awscc_ec2_vpc_gateway_attachment (Resource)

Resource Type definition for AWS::EC2::VPCGatewayAttachment

Example Usage

Internet Gateway

Attach a internet gateway to a VPC.

resource "awscc_ec2_vpc_gateway_attachment" "igw" {
  internet_gateway_id = awscc_ec2_internet_gateway.igw.id
  vpc_id              = awscc_ec2_vpc.vpc.id
}

resource "awscc_ec2_internet_gateway" "igw" {
  tags = [{
    key   = "Managed By"
    value = "AWSCC"
  }]
}

resource "awscc_ec2_vpc" "vpc" {
  cidr_block = "10.0.0.0/16"
  tags = [{
    key   = "Managed By"
    value = "AWSCC"
  }]
}

Virtual Private Gateway

Attach a virtual private gateway to a VPC.

resource "awscc_ec2_vpc_gateway_attachment" "vpn" {
  vpn_gateway_id = awscc_ec2_vpn_gateway.vpn.id
  vpc_id         = awscc_ec2_vpc.vpc.id
}

resource "awscc_ec2_vpn_gateway" "vpn" {
  type = "ipsec.1"
  tags = [
    {
      key   = "Modified By"
      value = "AWSCC"
    }
  ]
}

resource "awscc_ec2_vpc" "vpc" {
  cidr_block = "10.0.0.0/16"
  tags = [{
    key   = "Managed By"
    value = "AWSCC"
  }]
}

Schema

Required

Optional

Read-Only

Import

Import is supported using the following syntax:

$ terraform import awscc_ec2_vpc_gateway_attachment.example <resource ID>