aws_ip_ranges

    0

    0

    lucycodes42

    Terraform snippets

    Shortcut: tf_aws_ip_ranges

    data "aws_ip_ranges" "${european_ec2}" {
       regions = [ "eu-west-1", "eu-central-1" ]
       services = [ "ec2" ]
    }
    
    resource "aws_security_group" "from_europe" {
       name = "from_europe"
    
       ingress {
           from_port = "443"
           to_port = "443"
           protocol = "tcp"
           cidr_blocks = [ "\${data.aws_ip_ranges.${european_ec2}.cidr_blocks}" ]
       }
    
       tags {
           CreateDate = "\${data.aws_ip_ranges.${european_ec2}.create_date}"
           SyncToken = "\${data.aws_ip_ranges.${european_ec2}.sync_token}"
       }
    
    }
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    Legal
    • Security
    • Privacy Policy
    • Code Privacy
    • Terms of Service
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.