FEATURES OPEN SOURCE ABOUT DOCS LOGIN REGISTER

aws_ip_ranges

Use this data source to get the IP ranges of various AWS products and services.

Example Usage

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}"
  }

}

Argument Reference

~> NOTE: If the specified combination of regions and services does not yield any CIDR blocks, Terraform will fail.

Attributes Reference


See the source of this document at Terraform.io