Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

AWSCC Provider

The awscc provider manages AWS resources through the AWS Cloud Control API.

Configuration

provider awscc {
  region = aws.Region.ap_northeast_1
}

Usage

Resources are defined using the awscc.<resource_type> syntax:

let vpc = awscc.ec2_vpc {
  name       = "my-vpc"
  cidr_block = "10.0.0.0/16"
  tags = {
    Environment = "production"
  }
}

Named resources (using let) can be referenced by other resources:

let subnet = awscc.ec2_subnet {
  name              = "my-subnet"
  vpc_id            = vpc.vpc_id
  cidr_block        = "10.0.1.0/24"
  availability_zone = "ap-northeast-1a"
}

Enum Values

Some attributes accept enum values. These can be specified in three formats:

  • Bare value: instance_tenancy = default
  • TypeName.value: instance_tenancy = InstanceTenancy.default
  • Full namespace: instance_tenancy = awscc.ec2_vpc.InstanceTenancy.default

Supported Resource Types

Resource TypeCloudFormation TypeDescription
ec2_vpcAWS::EC2::VPCVirtual Private Cloud
ec2_subnetAWS::EC2::SubnetVPC Subnet
ec2_internet_gatewayAWS::EC2::InternetGatewayInternet Gateway
ec2_vpc_gateway_attachmentAWS::EC2::VPCGatewayAttachmentVPC Gateway Attachment
ec2_route_tableAWS::EC2::RouteTableRoute Table
ec2_routeAWS::EC2::RouteRoute
ec2_subnet_route_table_associationAWS::EC2::SubnetRouteTableAssociationSubnet Route Table Association
ec2_eipAWS::EC2::EIPElastic IP Address
ec2_nat_gatewayAWS::EC2::NatGatewayNAT Gateway
ec2_security_groupAWS::EC2::SecurityGroupSecurity Group
ec2_security_group_ingressAWS::EC2::SecurityGroupIngressSecurity Group Ingress Rule
ec2_security_group_egressAWS::EC2::SecurityGroupEgressSecurity Group Egress Rule
ec2_vpc_endpointAWS::EC2::VPCEndpointVPC Endpoint
ec2_flow_logAWS::EC2::FlowLogVPC Flow Log