Carina
A strongly typed infrastructure management tool written in Rust.
Key Features
- Custom DSL for infrastructure definition (
.crnfiles) - Effects as Values - side effects are represented as data, inspectable before execution
- Strong Typing - resource attributes are validated at parse time
- Provider Architecture - pluggable providers (AWS, AWSCC)
- Modules - reusable infrastructure components
- State Management - S3 backend for remote state
- LSP Support - editor integration with completions and diagnostics
Quick Start
# Build from source
cargo build --release
# Validate a configuration
cargo run --bin carina -- validate example.crn
# Preview changes
aws-vault exec <profile> -- cargo run --bin carina -- plan example.crn
# Apply changes
aws-vault exec <profile> -- cargo run --bin carina -- apply example.crn
Providers
- AWSCC Provider - AWS Cloud Control API provider
For more details, see the README.
AWSCC Provider
The awscc provider manages AWS resources through the AWS Cloud Control API.
Configuration
provider awscc {
region = awscc.Region.ap_northeast_1
}
Usage
Resources are defined using the awscc.<service>.<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
awscc.ec2.egress_only_internet_gateway
CloudFormation Type: AWS::EC2::EgressOnlyInternetGateway
Resource Type definition for AWS::EC2::EgressOnlyInternetGateway
Example
let vpc = awscc.ec2.vpc {
cidr_block = "10.0.0.0/16"
}
awscc.ec2.egress_only_internet_gateway {
vpc_id = vpc.vpc_id
tags = {
Environment = "example"
}
}
Argument Reference
tags
- Type: Map
- Required: No
Any tags assigned to the egress only internet gateway.
vpc_id
- Type: VpcId
- Required: Yes
The ID of the VPC for which to create the egress-only internet gateway.
Attribute Reference
id
- Type: EgressOnlyInternetGatewayId
awscc.ec2.eip
CloudFormation Type: AWS::EC2::EIP
Specifies an Elastic IP (EIP) address and can, optionally, associate it with an Amazon EC2 instance. You can allocate an Elastic IP address from an address pool owned by AWS or from an address pool created from a public IPv4 address range that you have brought to AWS for use with your AWS resources using bring your own IP addresses (BYOIP). For more information, see Bring Your Own IP Addresses (BYOIP) in the Amazon EC2 User Guide. For more information, see Elastic IP Addresses in the Amazon EC2 User Guide.
Example
awscc.ec2.eip {
domain = "vpc"
tags = {
Environment = "example"
}
}
Argument Reference
address
- Type: Ipv4Address
- Required: No
domain
- Type: Enum (Domain)
- Required: No
The network (vpc). If you define an Elastic IP address and associate it with a VPC that is defined in the same template, you must declare a dependency on the VPC-gateway attachment by using the DependsOn Attribute on this resource.
instance_id
- Type: InstanceId
- Required: No
The ID of the instance. Updates to the InstanceId property may require some interruptions. Updates on an EIP reassociates the address on its associated resource.
ipam_pool_id
- Type: IpamPoolId
- Required: No
network_border_group
- Type: String
- Required: No
A unique set of Availability Zones, Local Zones, or Wavelength Zones from which AWS advertises IP addresses. Use this parameter to limit the IP address to this location. IP addresses cannot move between network border groups. Use DescribeAvailabilityZones to view the network border groups.
public_ipv4_pool
- Type: String
- Required: No
The ID of an address pool that you own. Use this parameter to let Amazon EC2 select an address from the address pool. Updates to the PublicIpv4Pool property may require some interruptions. Updates on an EIP reassociates the address on its associated resource.
tags
- Type: Map
- Required: No
Any tags assigned to the Elastic IP address. Updates to the Tags property may require some interruptions. Updates on an EIP reassociates the address on its associated resource.
transfer_address
- Type: Ipv4Address
- Required: No
The Elastic IP address you are accepting for transfer. You can only accept one transferred address. For more information on Elastic IP address transfers, see Transfer Elastic IP addresses in the Amazon Virtual Private Cloud User Guide.
Enum Values
domain (Domain)
| Value | DSL Identifier |
|---|---|
vpc | awscc.ec2.eip.Domain.vpc |
standard | awscc.ec2.eip.Domain.standard |
Shorthand formats: vpc or Domain.vpc
Attribute Reference
allocation_id
- Type: AllocationId
public_ip
- Type: Ipv4Address
awscc.ec2.flow_log
CloudFormation Type: AWS::EC2::FlowLog
Specifies a VPC flow log, which enables you to capture IP traffic for a specific network interface, subnet, or VPC.
Example
let vpc = awscc.ec2.vpc {
cidr_block = "10.0.0.0/16"
}
awscc.ec2.flow_log {
resource_id = vpc.vpc_id
resource_type = VPC
traffic_type = ALL
log_destination_type = s3
log_destination = "arn:aws:s3:::example-flow-logs-bucket"
tags = {
Environment = "example"
}
}
Argument Reference
deliver_cross_account_role
- Type: IamRoleArn
- Required: No
The ARN of the IAM role that allows Amazon EC2 to publish flow logs across accounts.
deliver_logs_permission_arn
- Type: IamRoleArn
- Required: No
The ARN for the IAM role that permits Amazon EC2 to publish flow logs to a CloudWatch Logs log group in your account. If you specify LogDestinationType as s3 or kinesis-data-firehose, do not specify DeliverLogsPermissionArn or LogGroupName.
destination_options
- Type: Struct(DestinationOptions)
- Required: No
log_destination
- Type: Arn
- Required: No
Specifies the destination to which the flow log data is to be published. Flow log data can be published to a CloudWatch Logs log group, an Amazon S3 bucket, or a Kinesis Firehose stream. The value specified for this parameter depends on the value specified for LogDestinationType.
log_destination_type
- Type: Enum (LogDestinationType)
- Required: No
Specifies the type of destination to which the flow log data is to be published. Flow log data can be published to CloudWatch Logs or Amazon S3.
log_format
- Type: String
- Required: No
The fields to include in the flow log record, in the order in which they should appear.
log_group_name
- Type: String
- Required: No
The name of a new or existing CloudWatch Logs log group where Amazon EC2 publishes your flow logs. If you specify LogDestinationType as s3 or kinesis-data-firehose, do not specify DeliverLogsPermissionArn or LogGroupName.
max_aggregation_interval
- Type: IntEnum([60, 600])
- Required: No
The maximum interval of time during which a flow of packets is captured and aggregated into a flow log record. You can specify 60 seconds (1 minute) or 600 seconds (10 minutes).
resource_id
- Type: String
- Required: Yes
The ID of the subnet, network interface, or VPC for which you want to create a flow log.
resource_type
- Type: Enum (ResourceType)
- Required: Yes
The type of resource for which to create the flow log. For example, if you specified a VPC ID for the ResourceId property, specify VPC for this property.
tags
- Type: Map
- Required: No
The tags to apply to the flow logs.
traffic_type
- Type: Enum (TrafficType)
- Required: No
The type of traffic to log. You can log traffic that the resource accepts or rejects, or all traffic.
Enum Values
file_format (FileFormat)
| Value | DSL Identifier |
|---|---|
plain-text | awscc.ec2.flow_log.FileFormat.plain_text |
parquet | awscc.ec2.flow_log.FileFormat.parquet |
Shorthand formats: plain_text or FileFormat.plain_text
log_destination_type (LogDestinationType)
| Value | DSL Identifier |
|---|---|
cloud-watch-logs | awscc.ec2.flow_log.LogDestinationType.cloud_watch_logs |
s3 | awscc.ec2.flow_log.LogDestinationType.s3 |
kinesis-data-firehose | awscc.ec2.flow_log.LogDestinationType.kinesis_data_firehose |
Shorthand formats: cloud_watch_logs or LogDestinationType.cloud_watch_logs
resource_type (ResourceType)
| Value | DSL Identifier |
|---|---|
NetworkInterface | awscc.ec2.flow_log.ResourceType.NetworkInterface |
Subnet | awscc.ec2.flow_log.ResourceType.Subnet |
VPC | awscc.ec2.flow_log.ResourceType.VPC |
TransitGateway | awscc.ec2.flow_log.ResourceType.TransitGateway |
TransitGatewayAttachment | awscc.ec2.flow_log.ResourceType.TransitGatewayAttachment |
RegionalNatGateway | awscc.ec2.flow_log.ResourceType.RegionalNatGateway |
Shorthand formats: NetworkInterface or ResourceType.NetworkInterface
traffic_type (TrafficType)
| Value | DSL Identifier |
|---|---|
ACCEPT | awscc.ec2.flow_log.TrafficType.ACCEPT |
ALL | awscc.ec2.flow_log.TrafficType.ALL |
REJECT | awscc.ec2.flow_log.TrafficType.REJECT |
Shorthand formats: ACCEPT or TrafficType.ACCEPT
Struct Definitions
DestinationOptions
| Field | Type | Required | Description |
|---|---|---|---|
file_format | Enum (FileFormat) | Yes | |
hive_compatible_partitions | Bool | Yes | |
per_hour_partition | Bool | Yes |
Attribute Reference
id
- Type: FlowLogId
awscc.ec2.internet_gateway
CloudFormation Type: AWS::EC2::InternetGateway
Allocates an internet gateway for use with a VPC. After creating the Internet gateway, you then attach it to a VPC.
Example
awscc.ec2.internet_gateway {
tags = {
Environment = "example"
}
}
Argument Reference
tags
- Type: Map
- Required: No
Any tags to assign to the internet gateway.
Attribute Reference
internet_gateway_id
- Type: InternetGatewayId
awscc.ec2.ipam_pool
CloudFormation Type: AWS::EC2::IPAMPool
Resource Schema of AWS::EC2::IPAMPool Type
Example
let ipam = awscc.ec2.ipam {
description = "Example IPAM"
tier = free
operating_region {
region_name = "ap-northeast-1"
}
}
awscc.ec2.ipam_pool {
ipam_scope_id = ipam.private_default_scope_id
address_family = "IPv4"
locale = "ap-northeast-1"
description = "Example IPv4 IPAM Pool"
provisioned_cidr {
cidr = "10.0.0.0/8"
}
tags = {
Environment = "example"
}
}
Argument Reference
address_family
- Type: Enum (AddressFamily)
- Required: Yes
The address family of the address space in this pool. Either IPv4 or IPv6.
allocation_default_netmask_length
- Type: Int
- Required: No
The default netmask length for allocations made from this pool. This value is used when the netmask length of an allocation isn’t specified.
allocation_max_netmask_length
- Type: Int
- Required: No
The maximum allowed netmask length for allocations made from this pool.
allocation_min_netmask_length
- Type: Int
- Required: No
The minimum allowed netmask length for allocations made from this pool.
allocation_resource_tags
- Type:
List<Map> - Required: No
When specified, an allocation will not be allowed unless a resource has a matching set of tags.
auto_import
- Type: Bool
- Required: No
Determines what to do if IPAM discovers resources that haven’t been assigned an allocation. If set to true, an allocation will be made automatically.
aws_service
- Type: Enum (AwsService)
- Required: No
Limits which service in Amazon Web Services that the pool can be used in.
description
- Type: String
- Required: No
ipam_scope_id
- Type: String
- Required: Yes
The Id of the scope this pool is a part of.
locale
- Type: Region
- Required: No
The region of this pool. If not set, this will default to “None” which will disable non-custom allocations. If the locale has been specified for the source pool, this value must match.
provisioned_cidrs
- Type: List<ProvisionedCidr>
- Required: No
A list of cidrs representing the address space available for allocation in this pool.
public_ip_source
- Type: Enum (PublicIpSource)
- Required: No
The IP address source for pools in the public scope. Only used for provisioning IP address CIDRs to pools in the public scope. Default is byoip.
publicly_advertisable
- Type: Bool
- Required: No
Determines whether or not address space from this pool is publicly advertised. Must be set if and only if the pool is IPv6.
source_ipam_pool_id
- Type: IpamPoolId
- Required: No
The Id of this pool’s source. If set, all space provisioned in this pool must be free space provisioned in the parent pool.
source_resource
- Type: Struct(SourceResource)
- Required: No
tags
- Type: Map
- Required: No
An array of key-value pairs to apply to this resource.
Enum Values
address_family (AddressFamily)
| Value | DSL Identifier |
|---|---|
IPv4 | awscc.ec2.ipam_pool.AddressFamily.IPv4 |
IPv6 | awscc.ec2.ipam_pool.AddressFamily.IPv6 |
Shorthand formats: IPv4 or AddressFamily.IPv4
aws_service (AwsService)
| Value | DSL Identifier |
|---|---|
ec2 | awscc.ec2.ipam_pool.AwsService.ec2 |
global-services | awscc.ec2.ipam_pool.AwsService.global_services |
Shorthand formats: ec2 or AwsService.ec2
ipam_scope_type (IpamScopeType)
| Value | DSL Identifier |
|---|---|
public | awscc.ec2.ipam_pool.IpamScopeType.public |
private | awscc.ec2.ipam_pool.IpamScopeType.private |
Shorthand formats: public or IpamScopeType.public
public_ip_source (PublicIpSource)
| Value | DSL Identifier |
|---|---|
byoip | awscc.ec2.ipam_pool.PublicIpSource.byoip |
amazon | awscc.ec2.ipam_pool.PublicIpSource.amazon |
Shorthand formats: byoip or PublicIpSource.byoip
state (State)
| Value | DSL Identifier |
|---|---|
create-in-progress | awscc.ec2.ipam_pool.State.create_in_progress |
create-complete | awscc.ec2.ipam_pool.State.create_complete |
modify-in-progress | awscc.ec2.ipam_pool.State.modify_in_progress |
modify-complete | awscc.ec2.ipam_pool.State.modify_complete |
delete-in-progress | awscc.ec2.ipam_pool.State.delete_in_progress |
delete-complete | awscc.ec2.ipam_pool.State.delete_complete |
Shorthand formats: create_in_progress or State.create_in_progress
Struct Definitions
ProvisionedCidr
| Field | Type | Required | Description |
|---|---|---|---|
cidr | Cidr | Yes |
SourceResource
| Field | Type | Required | Description |
|---|---|---|---|
resource_id | String | Yes | |
resource_owner | String | Yes | |
resource_region | Region | Yes | |
resource_type | String | Yes |
Attribute Reference
arn
- Type: Arn
ipam_arn
- Type: Arn
ipam_pool_id
- Type: IpamPoolId
ipam_scope_arn
- Type: Arn
ipam_scope_type
- Type: Enum (IpamScopeType)
pool_depth
- Type: Int
state
- Type: Enum (State)
state_message
- Type: String
awscc.ec2.ipam
CloudFormation Type: AWS::EC2::IPAM
Resource Schema of AWS::EC2::IPAM Type
Example
awscc.ec2.ipam {
description = "Example IPAM"
tier = free
operating_region {
region_name = "ap-northeast-1"
}
tags = {
Environment = "example"
}
}
Argument Reference
default_resource_discovery_organizational_unit_exclusions
- Type: List<IpamOrganizationalUnitExclusion>
- Required: No
A set of organizational unit (OU) exclusions for the default resource discovery, created with this IPAM.
description
- Type: String
- Required: No
enable_private_gua
- Type: Bool
- Required: No
Enable provisioning of GUA space in private pools.
metered_account
- Type: Enum (MeteredAccount)
- Required: No
A metered account is an account that is charged for active IP addresses managed in IPAM
operating_regions
- Type: List<IpamOperatingRegion>
- Required: No
The regions IPAM is enabled for. Allows pools to be created in these regions, as well as enabling monitoring
tags
- Type: Map
- Required: No
An array of key-value pairs to apply to this resource.
tier
- Type: Enum (Tier)
- Required: No
The tier of the IPAM.
Enum Values
metered_account (MeteredAccount)
| Value | DSL Identifier |
|---|---|
ipam-owner | awscc.ec2.ipam.MeteredAccount.ipam_owner |
resource-owner | awscc.ec2.ipam.MeteredAccount.resource_owner |
Shorthand formats: ipam_owner or MeteredAccount.ipam_owner
tier (Tier)
| Value | DSL Identifier |
|---|---|
free | awscc.ec2.ipam.Tier.free |
advanced | awscc.ec2.ipam.Tier.advanced |
Shorthand formats: free or Tier.free
Struct Definitions
IpamOperatingRegion
| Field | Type | Required | Description |
|---|---|---|---|
region_name | Region | Yes | The name of the region. |
IpamOrganizationalUnitExclusion
| Field | Type | Required | Description |
|---|---|---|---|
organizations_entity_path | String(len: 1..) | Yes | An AWS Organizations entity path. Build the path for the OU(s) using AWS Organizations IDs separated by a ‘/’. Include all child OUs by ending the path with ‘/*’. |
Attribute Reference
arn
- Type: Arn
default_resource_discovery_association_id
- Type: String
default_resource_discovery_id
- Type: String
ipam_id
- Type: IpamId
private_default_scope_id
- Type: String
public_default_scope_id
- Type: String(len: ..=255)
resource_discovery_association_count
- Type: Int
scope_count
- Type: Int
awscc.ec2.nat_gateway
CloudFormation Type: AWS::EC2::NatGateway
Specifies a network address translation (NAT) gateway in the specified subnet. You can create either a public NAT gateway or a private NAT gateway. The default is a public NAT gateway. If you create a public NAT gateway, you must specify an elastic IP address.
With a NAT gateway, instances in a private subnet can connect to the internet, other AWS services, or an on-premises network using the IP address of the NAT gateway. For more information, see NAT gateways in the Amazon VPC User Guide.
If you add a default route (AWS::EC2::Route resource) that points to a NAT gateway, specify the NAT gateway ID for the route’s NatGatewayId property.
When you associate an Elastic IP address or secondary Elastic IP address with a public NAT gateway, the network border group of the Elastic IP address must match the network border group of the Availability Zone (AZ) that the public NAT gateway is in. Otherwise, the NAT gateway fails to launch. You can see the network border group for the AZ by viewing the details of the subnet. Similarly, you can view the network border group for the Elastic IP address by viewing its details. For more information, see Allocate an Elastic IP address in the Amazon VPC User Guide.
Example
let vpc = awscc.ec2.vpc {
cidr_block = "10.0.0.0/16"
enable_dns_support = true
enable_dns_hostnames = true
}
let public_subnet = awscc.ec2.subnet {
vpc_id = vpc.vpc_id
cidr_block = "10.0.1.0/24"
availability_zone = "ap-northeast-1a"
map_public_ip_on_launch = true
}
let eip = awscc.ec2.eip {
domain = "vpc"
}
awscc.ec2.nat_gateway {
allocation_id = eip.allocation_id
subnet_id = public_subnet.subnet_id
tags = {
Environment = "example"
}
}
Argument Reference
allocation_id
- Type: AllocationId
- Required: No
[Public NAT gateway only] The allocation ID of the Elastic IP address that’s associated with the NAT gateway. This property is required for a public NAT gateway and cannot be specified with a private NAT gateway.
availability_mode
- Type: Enum (AvailabilityMode)
- Required: No
Indicates whether this is a zonal (single-AZ) or regional (multi-AZ) NAT gateway. A zonal NAT gateway is a NAT Gateway that provides redundancy and scalability within a single availability zone. A regional NAT gateway is a single NAT Gateway that works across multiple availability zones (AZs) in your VPC, providing redundancy, scalability and availability across all the AZs in a Region. For more information, see Regional NAT gateways for automatic multi-AZ expansion in the Amazon VPC User Guide.
availability_zone_addresses
- Type: List<AvailabilityZoneAddress>
- Required: No
For regional NAT gateways only: Specifies which Availability Zones you want the NAT gateway to support and the Elastic IP addresses (EIPs) to use in each AZ. The regional NAT gateway uses these EIPs to handle outbound NAT traffic from their respective AZs. If not specified, the NAT gateway will automatically expand to new AZs and associate EIPs upon detection of an elastic network interface. If you specify this parameter, auto-expansion is disabled and you must manually manage AZ coverage. A regional NAT gateway is a single NAT Gateway that works across multiple availability zones (AZs) in your VPC, providing redundancy, scalability and availability across all the AZs in a Region. For more information, see Regional NAT gateways for automatic multi-AZ expansion in the Amazon VPC User Guide.
connectivity_type
- Type: Enum (ConnectivityType)
- Required: No
Indicates whether the NAT gateway supports public or private connectivity. The default is public connectivity.
max_drain_duration_seconds
- Type: Int
- Required: No
The maximum amount of time to wait (in seconds) before forcibly releasing the IP addresses if connections are still in progress. Default value is 350 seconds.
private_ip_address
- Type: Ipv4Address
- Required: No
The private IPv4 address to assign to the NAT gateway. If you don’t provide an address, a private IPv4 address will be automatically assigned.
secondary_allocation_ids
- Type:
List<AllocationId> - Required: No
Secondary EIP allocation IDs. For more information, see Create a NAT gateway in the Amazon VPC User Guide.
secondary_private_ip_address_count
- Type: Int(1..)
- Required: No
[Private NAT gateway only] The number of secondary private IPv4 addresses you want to assign to the NAT gateway. For more information about secondary addresses, see Create a NAT gateway in the Amazon Virtual Private Cloud User Guide. SecondaryPrivateIpAddressCount and SecondaryPrivateIpAddresses cannot be set at the same time.
secondary_private_ip_addresses
- Type:
List<Ipv4Address> - Required: No
Secondary private IPv4 addresses. For more information about secondary addresses, see Create a NAT gateway in the Amazon Virtual Private Cloud User Guide. SecondaryPrivateIpAddressCount and SecondaryPrivateIpAddresses cannot be set at the same time.
subnet_id
- Type: SubnetId
- Required: No
The ID of the subnet in which the NAT gateway is located.
tags
- Type: Map
- Required: No
The tags for the NAT gateway.
vpc_id
- Type: VpcId
- Required: No
The ID of the VPC in which the NAT gateway is located.
Enum Values
availability_mode (AvailabilityMode)
| Value | DSL Identifier |
|---|---|
zonal | awscc.ec2.nat_gateway.AvailabilityMode.zonal |
regional | awscc.ec2.nat_gateway.AvailabilityMode.regional |
Shorthand formats: zonal or AvailabilityMode.zonal
connectivity_type (ConnectivityType)
| Value | DSL Identifier |
|---|---|
public | awscc.ec2.nat_gateway.ConnectivityType.public |
private | awscc.ec2.nat_gateway.ConnectivityType.private |
Shorthand formats: public or ConnectivityType.public
Struct Definitions
AvailabilityZoneAddress
| Field | Type | Required | Description |
|---|---|---|---|
allocation_ids | List<AllocationId> | Yes | The allocation IDs of the Elastic IP addresses (EIPs) to be used for handling outbound NAT traffic in this specific Availability Zone. |
availability_zone | AvailabilityZone | No | For regional NAT gateways only: The Availability Zone where this specific NAT gateway configuration will be active. Each AZ in a regional NAT gateway has its own configuration to handle outbound NAT traffic from that AZ. A regional NAT gateway is a single NAT Gateway that works across multiple availability zones (AZs) in your VPC, providing redundancy, scalability and availability across all the AZs in a Region. |
availability_zone_id | AvailabilityZoneId | No | For regional NAT gateways only: The ID of the Availability Zone where this specific NAT gateway configuration will be active. Each AZ in a regional NAT gateway has its own configuration to handle outbound NAT traffic from that AZ. Use this instead of AvailabilityZone for consistent identification of AZs across AWS Regions. A regional NAT gateway is a single NAT Gateway that works across multiple availability zones (AZs) in your VPC, providing redundancy, scalability and availability across all the AZs in a Region. |
Attribute Reference
auto_provision_zones
- Type: String
auto_scaling_ips
- Type: String
eni_id
- Type: NetworkInterfaceId
nat_gateway_id
- Type: NatGatewayId
route_table_id
- Type: RouteTableId
awscc.ec2.route_table
CloudFormation Type: AWS::EC2::RouteTable
Specifies a route table for the specified VPC. After you create a route table, you can add routes and associate the table with a subnet. For more information, see Route tables in the Amazon VPC User Guide.
Example
let vpc = awscc.ec2.vpc {
cidr_block = "10.0.0.0/16"
enable_dns_support = true
enable_dns_hostnames = true
}
awscc.ec2.route_table {
vpc_id = vpc.vpc_id
tags = {
Environment = "example"
}
}
Argument Reference
tags
- Type: Map
- Required: No
Any tags assigned to the route table.
vpc_id
- Type: VpcId
- Required: Yes
The ID of the VPC.
Attribute Reference
route_table_id
- Type: RouteTableId
awscc.ec2.route
CloudFormation Type: AWS::EC2::Route
Specifies a route in a route table. For more information, see Routes in the Amazon VPC User Guide.
You must specify either a destination CIDR block or prefix list ID. You must also specify exactly one of the resources as the target.
If you create a route that references a transit gateway in the same template where you create the transit gateway, you must declare a dependency on the transit gateway attachment. The route table cannot use the transit gateway until it has successfully attached to the VPC. Add a DependsOn Attribute in the AWS::EC2::Route resource to explicitly declare a dependency on the AWS::EC2::TransitGatewayAttachment resource.
Example
let vpc = awscc.ec2.vpc {
cidr_block = "10.0.0.0/16"
enable_dns_support = true
enable_dns_hostnames = true
}
let igw = awscc.ec2.internet_gateway {}
let igw_attachment = awscc.ec2.vpc_gateway_attachment {
vpc_id = vpc.vpc_id
internet_gateway_id = igw.internet_gateway_id
}
let rt = awscc.ec2.route_table {
vpc_id = vpc.vpc_id
}
awscc.ec2.route {
route_table_id = rt.route_table_id
destination_cidr_block = "0.0.0.0/0"
gateway_id = igw_attachment.internet_gateway_id
}
Argument Reference
carrier_gateway_id
- Type: CarrierGatewayId
- Required: No
The ID of the carrier gateway. You can only use this option when the VPC contains a subnet which is associated with a Wavelength Zone.
core_network_arn
- Type: Arn
- Required: No
The Amazon Resource Name (ARN) of the core network.
destination_cidr_block
- Type: Ipv4Cidr
- Required: No
The IPv4 CIDR address block used for the destination match. Routing decisions are based on the most specific match. We modify the specified CIDR block to its canonical form; for example, if you specify 100.68.0.18/18, we modify it to 100.68.0.0/18.
destination_ipv6_cidr_block
- Type: Ipv6Cidr
- Required: No
The IPv6 CIDR block used for the destination match. Routing decisions are based on the most specific match.
destination_prefix_list_id
- Type: PrefixListId
- Required: No
The ID of a prefix list used for the destination match.
egress_only_internet_gateway_id
- Type: EgressOnlyInternetGatewayId
- Required: No
[IPv6 traffic only] The ID of an egress-only internet gateway.
gateway_id
- Type: GatewayId
- Required: No
The ID of an internet gateway or virtual private gateway attached to your VPC.
instance_id
- Type: InstanceId
- Required: No
The ID of a NAT instance in your VPC. The operation fails if you specify an instance ID unless exactly one network interface is attached.
local_gateway_id
- Type: LocalGatewayId
- Required: No
The ID of the local gateway.
nat_gateway_id
- Type: NatGatewayId
- Required: No
[IPv4 traffic only] The ID of a NAT gateway.
network_interface_id
- Type: NetworkInterfaceId
- Required: No
The ID of a network interface.
route_table_id
- Type: RouteTableId
- Required: Yes
The ID of the route table for the route.
transit_gateway_id
- Type: TransitGatewayId
- Required: No
The ID of a transit gateway.
vpc_endpoint_id
- Type: VpcEndpointId
- Required: No
The ID of a VPC endpoint. Supported for Gateway Load Balancer endpoints only.
vpc_peering_connection_id
- Type: VpcPeeringConnectionId
- Required: No
The ID of a VPC peering connection.
Attribute Reference
cidr_block
- Type: Ipv4Cidr
awscc.ec2.security_group_egress
CloudFormation Type: AWS::EC2::SecurityGroupEgress
Adds the specified outbound (egress) rule to a security group. An outbound rule permits instances to send traffic to the specified IPv4 or IPv6 address range, the IP addresses that are specified by a prefix list, or the instances that are associated with a destination security group. For more information, see Security group rules. You must specify exactly one of the following destinations: an IPv4 address range, an IPv6 address range, a prefix list, or a security group. You must specify a protocol for each rule (for example, TCP). If the protocol is TCP or UDP, you must also specify a port or port range. If the protocol is ICMP or ICMPv6, you must also specify the ICMP/ICMPv6 type and code. To specify all types or all codes, use -1. Rule changes are propagated to instances associated with the security group as quickly as possible. However, a small delay might occur.
Example
let vpc = awscc.ec2.vpc {
cidr_block = "10.0.0.0/16"
}
let sg = awscc.ec2.security_group {
vpc_id = vpc.vpc_id
group_description = "Example security group"
}
awscc.ec2.security_group_egress {
group_id = sg.group_id
description = "Allow all outbound traffic"
ip_protocol = all
cidr_ip = "0.0.0.0/0"
}
Argument Reference
cidr_ip
- Type: Ipv4Cidr
- Required: No
The IPv4 address range, in CIDR format. You must specify exactly one of the following: CidrIp, CidrIpv6, DestinationPrefixListId, or DestinationSecurityGroupId. For examples of rules that you can add to security groups for specific access scenarios, see Security group rules for different use cases in the User Guide.
cidr_ipv6
- Type: Ipv6Cidr
- Required: No
The IPv6 address range, in CIDR format. You must specify exactly one of the following: CidrIp, CidrIpv6, DestinationPrefixListId, or DestinationSecurityGroupId. For examples of rules that you can add to security groups for specific access scenarios, see Security group rules for different use cases in the User Guide.
description
- Type: String
- Required: No
The description of an egress (outbound) security group rule. Constraints: Up to 255 characters in length. Allowed characters are a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$*
destination_prefix_list_id
- Type: PrefixListId
- Required: No
The prefix list IDs for an AWS service. This is the AWS service to access through a VPC endpoint from instances associated with the security group. You must specify exactly one of the following: CidrIp, CidrIpv6, DestinationPrefixListId, or DestinationSecurityGroupId.
destination_security_group_id
- Type: SecurityGroupId
- Required: No
The ID of the security group. You must specify exactly one of the following: CidrIp, CidrIpv6, DestinationPrefixListId, or DestinationSecurityGroupId.
from_port
- Type: Int(-1..=65535)
- Required: No
If the protocol is TCP or UDP, this is the start of the port range. If the protocol is ICMP or ICMPv6, this is the ICMP type or -1 (all ICMP types).
group_id
- Type: SecurityGroupId
- Required: Yes
The ID of the security group. You must specify either the security group ID or the security group name in the request. For security groups in a nondefault VPC, you must specify the security group ID.
ip_protocol
- Type: Enum (IpProtocol)
- Required: Yes
The IP protocol name (tcp, udp, icmp, icmpv6) or number (see Protocol Numbers). Use -1 to specify all protocols. When authorizing security group rules, specifying -1 or a protocol number other than tcp, udp, icmp, or icmpv6 allows traffic on all ports, regardless of any port range you specify. For tcp, udp, and icmp, you must specify a port range. For icmpv6, the port range is optional; if you omit the port range, traffic for all types and codes is allowed.
to_port
- Type: Int(-1..=65535)
- Required: No
If the protocol is TCP or UDP, this is the end of the port range. If the protocol is ICMP or ICMPv6, this is the ICMP code or -1 (all ICMP codes). If the start port is -1 (all ICMP types), then the end port must be -1 (all ICMP codes).
Enum Values
ip_protocol (IpProtocol)
| Value | DSL Identifier |
|---|---|
tcp | awscc.ec2.security_group_egress.IpProtocol.tcp |
udp | awscc.ec2.security_group_egress.IpProtocol.udp |
icmp | awscc.ec2.security_group_egress.IpProtocol.icmp |
icmpv6 | awscc.ec2.security_group_egress.IpProtocol.icmpv6 |
-1 | awscc.ec2.security_group_egress.IpProtocol.all |
Shorthand formats: tcp or IpProtocol.tcp
Attribute Reference
id
- Type: String
awscc.ec2.security_group_ingress
CloudFormation Type: AWS::EC2::SecurityGroupIngress
Resource Type definition for AWS::EC2::SecurityGroupIngress
Example
let vpc = awscc.ec2.vpc {
cidr_block = "10.0.0.0/16"
}
let sg = awscc.ec2.security_group {
vpc_id = vpc.vpc_id
group_description = "Example security group"
}
awscc.ec2.security_group_ingress {
group_id = sg.group_id
description = "Allow HTTPS from VPC"
ip_protocol = "tcp"
from_port = 443
to_port = 443
cidr_ip = "10.0.0.0/16"
}
Argument Reference
cidr_ip
- Type: Ipv4Cidr
- Required: No
The IPv4 ranges
cidr_ipv6
- Type: Ipv6Cidr
- Required: No
[VPC only] The IPv6 ranges
description
- Type: String
- Required: No
Updates the description of an ingress (inbound) security group rule. You can replace an existing description, or add a description to a rule that did not have one previously
from_port
- Type: Int(-1..=65535)
- Required: No
The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type number. A value of -1 indicates all ICMP/ICMPv6 types. If you specify all ICMP/ICMPv6 types, you must specify all codes. Use this for ICMP and any protocol that uses ports.
group_id
- Type: SecurityGroupId
- Required: No
The ID of the security group. You must specify either the security group ID or the security group name in the request. For security groups in a nondefault VPC, you must specify the security group ID. You must specify the GroupName property or the GroupId property. For security groups that are in a VPC, you must use the GroupId property.
group_name
- Type: String
- Required: No
The name of the security group.
ip_protocol
- Type: Enum (IpProtocol)
- Required: Yes
The IP protocol name (tcp, udp, icmp, icmpv6) or number (see Protocol Numbers). [VPC only] Use -1 to specify all protocols. When authorizing security group rules, specifying -1 or a protocol number other than tcp, udp, icmp, or icmpv6 allows traffic on all ports, regardless of any port range you specify. For tcp, udp, and icmp, you must specify a port range. For icmpv6, the port range is optional; if you omit the port range, traffic for all types and codes is allowed.
source_prefix_list_id
- Type: PrefixListId
- Required: No
[EC2-VPC only] The ID of a prefix list.
source_security_group_id
- Type: SecurityGroupId
- Required: No
The ID of the security group. You must specify either the security group ID or the security group name. For security groups in a nondefault VPC, you must specify the security group ID.
source_security_group_name
- Type: String
- Required: No
[EC2-Classic, default VPC] The name of the source security group. You must specify the GroupName property or the GroupId property. For security groups that are in a VPC, you must use the GroupId property.
source_security_group_owner_id
- Type: AwsAccountId
- Required: No
[nondefault VPC] The AWS account ID that owns the source security group. You can’t specify this property with an IP address range. If you specify SourceSecurityGroupName or SourceSecurityGroupId and that security group is owned by a different account than the account creating the stack, you must specify the SourceSecurityGroupOwnerId; otherwise, this property is optional.
to_port
- Type: Int(-1..=65535)
- Required: No
The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code. A value of -1 indicates all ICMP/ICMPv6 codes for the specified ICMP type. If you specify all ICMP/ICMPv6 types, you must specify all codes. Use this for ICMP and any protocol that uses ports.
Enum Values
ip_protocol (IpProtocol)
| Value | DSL Identifier |
|---|---|
tcp | awscc.ec2.security_group_ingress.IpProtocol.tcp |
udp | awscc.ec2.security_group_ingress.IpProtocol.udp |
icmp | awscc.ec2.security_group_ingress.IpProtocol.icmp |
icmpv6 | awscc.ec2.security_group_ingress.IpProtocol.icmpv6 |
-1 | awscc.ec2.security_group_ingress.IpProtocol.all |
Shorthand formats: tcp or IpProtocol.tcp
Attribute Reference
id
- Type: String
awscc.ec2.security_group
CloudFormation Type: AWS::EC2::SecurityGroup
Resource Type definition for AWS::EC2::SecurityGroup
Example
let vpc = awscc.ec2.vpc {
cidr_block = "10.0.0.0/16"
}
awscc.ec2.security_group {
vpc_id = vpc.vpc_id
group_description = "Example security group"
security_group_ingress {
ip_protocol = "tcp"
from_port = 80
to_port = 80
cidr_ip = "0.0.0.0/0"
}
security_group_ingress {
ip_protocol = "tcp"
from_port = 443
to_port = 443
cidr_ip = "0.0.0.0/0"
}
tags = {
Environment = "example"
}
}
Argument Reference
group_description
- Type: String
- Required: Yes
A description for the security group.
group_name
- Type: String
- Required: No
The name of the security group.
security_group_egress
- Type: List<Egress>
- Required: No
[VPC only] The outbound rules associated with the security group. There is a short interruption during which you cannot connect to the security group.
security_group_ingress
- Type: List<Ingress>
- Required: No
The inbound rules associated with the security group. There is a short interruption during which you cannot connect to the security group.
tags
- Type: Map
- Required: No
Any tags assigned to the security group.
vpc_id
- Type: VpcId
- Required: No
The ID of the VPC for the security group.
Enum Values
ip_protocol (IpProtocol)
| Value | DSL Identifier |
|---|---|
tcp | awscc.ec2.security_group.IpProtocol.tcp |
udp | awscc.ec2.security_group.IpProtocol.udp |
icmp | awscc.ec2.security_group.IpProtocol.icmp |
icmpv6 | awscc.ec2.security_group.IpProtocol.icmpv6 |
-1 | awscc.ec2.security_group.IpProtocol.all |
Shorthand formats: tcp or IpProtocol.tcp
Struct Definitions
Egress
| Field | Type | Required | Description |
|---|---|---|---|
cidr_ip | Ipv4Cidr | No | |
cidr_ipv6 | Ipv6Cidr | No | |
description | String | No | |
destination_prefix_list_id | PrefixListId | No | |
destination_security_group_id | SecurityGroupId | No | |
from_port | Int(-1..=65535) | No | |
ip_protocol | Enum (IpProtocol) | Yes | |
to_port | Int(-1..=65535) | No |
Ingress
| Field | Type | Required | Description |
|---|---|---|---|
cidr_ip | Ipv4Cidr | No | |
cidr_ipv6 | Ipv6Cidr | No | |
description | String | No | |
from_port | Int(-1..=65535) | No | |
ip_protocol | Enum (IpProtocol) | Yes | |
source_prefix_list_id | PrefixListId | No | |
source_security_group_id | SecurityGroupId | No | |
source_security_group_name | String | No | |
source_security_group_owner_id | AwsAccountId | No | |
to_port | Int(-1..=65535) | No |
Attribute Reference
group_id
- Type: SecurityGroupId
id
- Type: SecurityGroupId
awscc.ec2.subnet_route_table_association
CloudFormation Type: AWS::EC2::SubnetRouteTableAssociation
Associates a subnet with a route table. The subnet and route table must be in the same VPC. This association causes traffic originating from the subnet to be routed according to the routes in the route table. A route table can be associated with multiple subnets. To create a route table, see AWS::EC2::RouteTable.
Example
let vpc = awscc.ec2.vpc {
cidr_block = "10.0.0.0/16"
enable_dns_support = true
enable_dns_hostnames = true
}
let subnet = awscc.ec2.subnet {
vpc_id = vpc.vpc_id
cidr_block = "10.0.1.0/24"
availability_zone = "ap-northeast-1a"
}
let rt = awscc.ec2.route_table {
vpc_id = vpc.vpc_id
}
awscc.ec2.subnet_route_table_association {
subnet_id = subnet.subnet_id
route_table_id = rt.route_table_id
}
Argument Reference
route_table_id
- Type: RouteTableId
- Required: Yes
The ID of the route table. The physical ID changes when the route table ID is changed.
subnet_id
- Type: SubnetId
- Required: Yes
The ID of the subnet.
Attribute Reference
id
- Type: SubnetRouteTableAssociationId
awscc.ec2.subnet
CloudFormation Type: AWS::EC2::Subnet
Specifies a subnet for the specified VPC. For an IPv4 only subnet, specify an IPv4 CIDR block. If the VPC has an IPv6 CIDR block, you can create an IPv6 only subnet or a dual stack subnet instead. For an IPv6 only subnet, specify an IPv6 CIDR block. For a dual stack subnet, specify both an IPv4 CIDR block and an IPv6 CIDR block. For more information, see Subnets for your VPC in the Amazon VPC User Guide.
Example
let vpc = awscc.ec2.vpc {
cidr_block = "10.0.0.0/16"
enable_dns_support = true
enable_dns_hostnames = true
}
awscc.ec2.subnet {
vpc_id = vpc.vpc_id
cidr_block = "10.0.1.0/24"
availability_zone = "ap-northeast-1a"
map_public_ip_on_launch = true
tags = {
Environment = "example"
}
}
Argument Reference
assign_ipv6_address_on_creation
- Type: Bool
- Required: No
Indicates whether a network interface created in this subnet receives an IPv6 address. The default value is false. If you specify AssignIpv6AddressOnCreation, you must also specify an IPv6 CIDR block.
availability_zone
- Type: AvailabilityZone
- Required: No
The Availability Zone of the subnet. If you update this property, you must also update the CidrBlock property.
availability_zone_id
- Type: AvailabilityZoneId
- Required: No
The AZ ID of the subnet.
cidr_block
- Type: Ipv4Cidr
- Required: No
The IPv4 CIDR block assigned to the subnet. If you update this property, we create a new subnet, and then delete the existing one.
enable_dns64
- Type: Bool
- Required: No
Indicates whether DNS queries made to the Amazon-provided DNS Resolver in this subnet should return synthetic IPv6 addresses for IPv4-only destinations. You must first configure a NAT gateway in a public subnet (separate from the subnet containing the IPv6-only workloads). For example, the subnet containing the NAT gateway should have a 0.0.0.0/0 route pointing to the internet gateway. For more information, see Configure DNS64 and NAT64 in the User Guide.
enable_lni_at_device_index
- Type: Int
- Required: No
Indicates the device position for local network interfaces in this subnet. For example, 1 indicates local network interfaces in this subnet are the secondary network interface (eth1).
ipv4_ipam_pool_id
- Type: IpamPoolId
- Required: No
An IPv4 IPAM pool ID for the subnet.
ipv4_netmask_length
- Type: Int(0..=32)
- Required: No
An IPv4 netmask length for the subnet.
ipv6_cidr_block
- Type: Ipv6Cidr
- Required: No
The IPv6 CIDR block. If you specify AssignIpv6AddressOnCreation, you must also specify an IPv6 CIDR block.
ipv6_ipam_pool_id
- Type: IpamPoolId
- Required: No
An IPv6 IPAM pool ID for the subnet.
ipv6_native
- Type: Bool
- Required: No
Indicates whether this is an IPv6 only subnet. For more information, see Subnet basics in the User Guide.
ipv6_netmask_length
- Type: Int(0..=128)
- Required: No
An IPv6 netmask length for the subnet.
map_public_ip_on_launch
- Type: Bool
- Required: No
Indicates whether instances launched in this subnet receive a public IPv4 address. The default value is false. AWS charges for all public IPv4 addresses, including public IPv4 addresses associated with running instances and Elastic IP addresses. For more information, see the Public IPv4 Address tab on the VPC pricing page.
outpost_arn
- Type: Arn
- Required: No
The Amazon Resource Name (ARN) of the Outpost.
private_dns_name_options_on_launch
- Type: Struct(PrivateDnsNameOptionsOnLaunch)
- Required: No
The hostname type for EC2 instances launched into this subnet and how DNS A and AAAA record queries to the instances should be handled. For more information, see Amazon EC2 instance hostname types in the User Guide. Available options: + EnableResourceNameDnsAAAARecord (true | false) + EnableResourceNameDnsARecord (true | false) + HostnameType (ip-name | resource-name)
tags
- Type: Map
- Required: No
Any tags assigned to the subnet.
vpc_id
- Type: VpcId
- Required: Yes
The ID of the VPC the subnet is in. If you update this property, you must also update the CidrBlock property.
Enum Values
internet_gateway_block_mode (InternetGatewayBlockMode)
| Value | DSL Identifier |
|---|---|
off | awscc.ec2.subnet.InternetGatewayBlockMode.off |
block-bidirectional | awscc.ec2.subnet.InternetGatewayBlockMode.block_bidirectional |
block-ingress | awscc.ec2.subnet.InternetGatewayBlockMode.block_ingress |
Shorthand formats: off or InternetGatewayBlockMode.off
hostname_type (HostnameType)
| Value | DSL Identifier |
|---|---|
ip-name | awscc.ec2.subnet.HostnameType.ip_name |
resource-name | awscc.ec2.subnet.HostnameType.resource_name |
Shorthand formats: ip_name or HostnameType.ip_name
Struct Definitions
BlockPublicAccessStates
| Field | Type | Required | Description |
|---|---|---|---|
internet_gateway_block_mode | Enum (InternetGatewayBlockMode) | No | The mode of VPC BPA. Options here are off, block-bidirectional, block-ingress |
PrivateDnsNameOptionsOnLaunch
| Field | Type | Required | Description |
|---|---|---|---|
enable_resource_name_dns_aaaa_record | Bool | No | |
enable_resource_name_dns_a_record | Bool | No | |
hostname_type | Enum (HostnameType) | No |
Attribute Reference
block_public_access_states
ipv6_cidr_blocks
- Type:
List<Ipv6Cidr>
network_acl_association_id
- Type: String
subnet_id
- Type: SubnetId
awscc.ec2.transit_gateway_attachment
CloudFormation Type: AWS::EC2::TransitGatewayAttachment
Resource Type definition for AWS::EC2::TransitGatewayAttachment
Example
let vpc = awscc.ec2.vpc {
cidr_block = "10.0.0.0/16"
}
let subnet = awscc.ec2.subnet {
vpc_id = vpc.vpc_id
cidr_block = "10.0.1.0/24"
availability_zone = "ap-northeast-1a"
}
let tgw = awscc.ec2.transit_gateway {
description = "Example Transit Gateway"
}
awscc.ec2.transit_gateway_attachment {
transit_gateway_id = tgw.id
vpc_id = vpc.vpc_id
subnet_ids = [subnet.subnet_id]
tags = {
Environment = "example"
}
}
Argument Reference
options
- Type: Struct(Options)
- Required: No
The options for the transit gateway vpc attachment.
subnet_ids
- Type:
List<SubnetId> - Required: Yes
tags
- Type: Map
- Required: No
transit_gateway_id
- Type: TransitGatewayId
- Required: Yes
vpc_id
- Type: VpcId
- Required: Yes
Enum Values
appliance_mode_support (ApplianceModeSupport)
| Value | DSL Identifier |
|---|---|
enable | awscc.ec2.transit_gateway_attachment.ApplianceModeSupport.enable |
disable | awscc.ec2.transit_gateway_attachment.ApplianceModeSupport.disable |
Shorthand formats: enable or ApplianceModeSupport.enable
dns_support (DnsSupport)
| Value | DSL Identifier |
|---|---|
enable | awscc.ec2.transit_gateway_attachment.DnsSupport.enable |
disable | awscc.ec2.transit_gateway_attachment.DnsSupport.disable |
Shorthand formats: enable or DnsSupport.enable
ipv6_support (Ipv6Support)
| Value | DSL Identifier |
|---|---|
enable | awscc.ec2.transit_gateway_attachment.Ipv6Support.enable |
disable | awscc.ec2.transit_gateway_attachment.Ipv6Support.disable |
Shorthand formats: enable or Ipv6Support.enable
security_group_referencing_support (SecurityGroupReferencingSupport)
| Value | DSL Identifier |
|---|---|
enable | awscc.ec2.transit_gateway_attachment.SecurityGroupReferencingSupport.enable |
disable | awscc.ec2.transit_gateway_attachment.SecurityGroupReferencingSupport.disable |
Shorthand formats: enable or SecurityGroupReferencingSupport.enable
Struct Definitions
Options
| Field | Type | Required | Description |
|---|---|---|---|
appliance_mode_support | Enum (ApplianceModeSupport) | No | Indicates whether to enable Ipv6 Support for Vpc Attachment. Valid Values: enable |
dns_support | Enum (DnsSupport) | No | Indicates whether to enable DNS Support for Vpc Attachment. Valid Values: enable |
ipv6_support | Enum (Ipv6Support) | No | Indicates whether to enable Ipv6 Support for Vpc Attachment. Valid Values: enable |
security_group_referencing_support | Enum (SecurityGroupReferencingSupport) | No | Indicates whether to enable Security Group referencing support for Vpc Attachment. Valid Values: enable |
Attribute Reference
id
- Type: TransitGatewayAttachmentId
awscc.ec2.transit_gateway
CloudFormation Type: AWS::EC2::TransitGateway
Resource Type definition for AWS::EC2::TransitGateway
Example
awscc.ec2.transit_gateway {
description = "Example Transit Gateway"
tags = {
Environment = "example"
}
}
Argument Reference
amazon_side_asn
- Type: Int(1..=4294967294)
- Required: No
association_default_route_table_id
- Type: TgwRouteTableId
- Required: No
auto_accept_shared_attachments
- Type: Enum (AutoAcceptSharedAttachments)
- Required: No
default_route_table_association
- Type: Enum (DefaultRouteTableAssociation)
- Required: No
default_route_table_propagation
- Type: Enum (DefaultRouteTablePropagation)
- Required: No
description
- Type: String
- Required: No
dns_support
- Type: Enum (DnsSupport)
- Required: No
encryption_support
- Type: Enum (EncryptionSupport)
- Required: No
multicast_support
- Type: Enum (MulticastSupport)
- Required: No
propagation_default_route_table_id
- Type: TgwRouteTableId
- Required: No
security_group_referencing_support
- Type: Enum (SecurityGroupReferencingSupport)
- Required: No
tags
- Type: Map
- Required: No
transit_gateway_cidr_blocks
- Type:
List<Cidr> - Required: No
vpn_ecmp_support
- Type: Enum (VpnEcmpSupport)
- Required: No
Enum Values
auto_accept_shared_attachments (AutoAcceptSharedAttachments)
| Value | DSL Identifier |
|---|---|
enable | awscc.ec2.transit_gateway.AutoAcceptSharedAttachments.enable |
disable | awscc.ec2.transit_gateway.AutoAcceptSharedAttachments.disable |
Shorthand formats: enable or AutoAcceptSharedAttachments.enable
default_route_table_association (DefaultRouteTableAssociation)
| Value | DSL Identifier |
|---|---|
enable | awscc.ec2.transit_gateway.DefaultRouteTableAssociation.enable |
disable | awscc.ec2.transit_gateway.DefaultRouteTableAssociation.disable |
Shorthand formats: enable or DefaultRouteTableAssociation.enable
default_route_table_propagation (DefaultRouteTablePropagation)
| Value | DSL Identifier |
|---|---|
enable | awscc.ec2.transit_gateway.DefaultRouteTablePropagation.enable |
disable | awscc.ec2.transit_gateway.DefaultRouteTablePropagation.disable |
Shorthand formats: enable or DefaultRouteTablePropagation.enable
dns_support (DnsSupport)
| Value | DSL Identifier |
|---|---|
enable | awscc.ec2.transit_gateway.DnsSupport.enable |
disable | awscc.ec2.transit_gateway.DnsSupport.disable |
Shorthand formats: enable or DnsSupport.enable
encryption_support (EncryptionSupport)
| Value | DSL Identifier |
|---|---|
disable | awscc.ec2.transit_gateway.EncryptionSupport.disable |
enable | awscc.ec2.transit_gateway.EncryptionSupport.enable |
Shorthand formats: disable or EncryptionSupport.disable
encryption_support_state (EncryptionSupportState)
| Value | DSL Identifier |
|---|---|
disable | awscc.ec2.transit_gateway.EncryptionSupportState.disable |
enable | awscc.ec2.transit_gateway.EncryptionSupportState.enable |
Shorthand formats: disable or EncryptionSupportState.disable
multicast_support (MulticastSupport)
| Value | DSL Identifier |
|---|---|
enable | awscc.ec2.transit_gateway.MulticastSupport.enable |
disable | awscc.ec2.transit_gateway.MulticastSupport.disable |
Shorthand formats: enable or MulticastSupport.enable
security_group_referencing_support (SecurityGroupReferencingSupport)
| Value | DSL Identifier |
|---|---|
enable | awscc.ec2.transit_gateway.SecurityGroupReferencingSupport.enable |
disable | awscc.ec2.transit_gateway.SecurityGroupReferencingSupport.disable |
Shorthand formats: enable or SecurityGroupReferencingSupport.enable
vpn_ecmp_support (VpnEcmpSupport)
| Value | DSL Identifier |
|---|---|
enable | awscc.ec2.transit_gateway.VpnEcmpSupport.enable |
disable | awscc.ec2.transit_gateway.VpnEcmpSupport.disable |
Shorthand formats: enable or VpnEcmpSupport.enable
Attribute Reference
encryption_support_state
id
- Type: TransitGatewayId
transit_gateway_arn
- Type: Arn
awscc.ec2.vpc_endpoint
CloudFormation Type: AWS::EC2::VPCEndpoint
Specifies a VPC endpoint. A VPC endpoint provides a private connection between your VPC and an endpoint service. You can use an endpoint service provided by AWS, an MKT Partner, or another AWS accounts in your organization. For more information, see the User Guide.
An endpoint of type Interface establishes connections between the subnets in your VPC and an AWS-service, your own service, or a service hosted by another AWS-account. With an interface VPC endpoint, you specify the subnets in which to create the endpoint and the security groups to associate with the endpoint network interfaces.
An endpoint of type gateway serves as a target for a route in your route table for traffic destined for S3 or DDB. You can specify an endpoint policy for the endpoint, which controls access to the service from your VPC. You can also specify the VPC route tables that use the endpoint. For more information about connectivity to S3, see Why can’t I connect to an S3 bucket using a gateway VPC endpoint?
An endpoint of type GatewayLoadBalancer provides private connectivity between your VPC and virtual appliances from a service provider.
Example
let vpc = awscc.ec2.vpc {
cidr_block = "10.0.0.0/16"
enable_dns_support = true
enable_dns_hostnames = true
}
let subnet = awscc.ec2.subnet {
vpc_id = vpc.vpc_id
cidr_block = "10.0.100.0/24"
availability_zone = "ap-northeast-1a"
}
let sg = awscc.ec2.security_group {
vpc_id = vpc.vpc_id
group_description = "SG for VPC Endpoint"
}
awscc.ec2.security_group_ingress {
group_id = sg.group_id
description = "Allow HTTPS from VPC"
ip_protocol = "tcp"
from_port = 443
to_port = 443
cidr_ip = "10.0.0.0/16"
}
awscc.ec2.vpc_endpoint {
vpc_id = vpc.vpc_id
service_name = "com.amazonaws.ap-northeast-1.ecr.dkr"
vpc_endpoint_type = "Interface"
subnet_ids = [subnet.subnet_id]
security_group_ids = [sg.group_id]
private_dns_enabled = true
}
Argument Reference
dns_options
- Type: Struct(DnsOptionsSpecification)
- Required: No
Describes the DNS options for an endpoint.
ip_address_type
- Type: Enum (IpAddressType)
- Required: No
The supported IP address types.
policy_document
- Type: IamPolicyDocument
- Required: No
An endpoint policy, which controls access to the service from the VPC. The default endpoint policy allows full access to the service. Endpoint policies are supported only for gateway and interface endpoints. For CloudFormation templates in YAML, you can provide the policy in JSON or YAML format. For example, if you have a JSON policy, you can convert it to YAML before including it in the YAML template, and CFNlong converts the policy to JSON format before calling the API actions for privatelink. Alternatively, you can include the JSON directly in the YAML, as shown in the following Properties section: Properties: VpcEndpointType: 'Interface' ServiceName: !Sub 'com.amazonaws.${AWS::Region}.logs' PolicyDocument: '{ "Version":"2012-10-17", "Statement": [{ "Effect":"Allow", "Principal":"*", "Action":["logs:Describe*","logs:Get*","logs:List*","logs:FilterLogEvents"], "Resource":"*" }] }'
private_dns_enabled
- Type: Bool
- Required: No
Indicate whether to associate a private hosted zone with the specified VPC. The private hosted zone contains a record set for the default public DNS name for the service for the Region (for example, kinesis.us-east-1.amazonaws.com), which resolves to the private IP addresses of the endpoint network interfaces in the VPC. This enables you to make requests to the default public DNS name for the service instead of the public DNS names that are automatically generated by the VPC endpoint service. To use a private hosted zone, you must set the following VPC attributes to true: enableDnsHostnames and enableDnsSupport. This property is supported only for interface endpoints. Default: false
resource_configuration_arn
- Type: Arn
- Required: No
The Amazon Resource Name (ARN) of the resource configuration.
route_table_ids
- Type:
List<RouteTableId> - Required: No
The IDs of the route tables. Routing is supported only for gateway endpoints.
security_group_ids
- Type:
List<SecurityGroupId> - Required: No
The IDs of the security groups to associate with the endpoint network interfaces. If this parameter is not specified, we use the default security group for the VPC. Security groups are supported only for interface endpoints.
service_name
- Type: String
- Required: No
The name of the endpoint service.
service_network_arn
- Type: Arn
- Required: No
The Amazon Resource Name (ARN) of the service network.
service_region
- Type: Region
- Required: No
Describes a Region.
subnet_ids
- Type:
List<SubnetId> - Required: No
The IDs of the subnets in which to create endpoint network interfaces. You must specify this property for an interface endpoint or a Gateway Load Balancer endpoint. You can’t specify this property for a gateway endpoint. For a Gateway Load Balancer endpoint, you can specify only one subnet.
tags
- Type: Map
- Required: No
The tags to associate with the endpoint.
vpc_endpoint_type
- Type: Enum (VpcEndpointType)
- Required: No
The type of endpoint. Default: Gateway
vpc_id
- Type: VpcId
- Required: Yes
The ID of the VPC.
Enum Values
dns_record_ip_type (DnsRecordIpType)
| Value | DSL Identifier |
|---|---|
ipv4 | awscc.ec2.vpc_endpoint.DnsRecordIpType.ipv4 |
ipv6 | awscc.ec2.vpc_endpoint.DnsRecordIpType.ipv6 |
dualstack | awscc.ec2.vpc_endpoint.DnsRecordIpType.dualstack |
service-defined | awscc.ec2.vpc_endpoint.DnsRecordIpType.service_defined |
not-specified | awscc.ec2.vpc_endpoint.DnsRecordIpType.not_specified |
Shorthand formats: ipv4 or DnsRecordIpType.ipv4
private_dns_only_for_inbound_resolver_endpoint (PrivateDnsOnlyForInboundResolverEndpoint)
| Value | DSL Identifier |
|---|---|
OnlyInboundResolver | awscc.ec2.vpc_endpoint.PrivateDnsOnlyForInboundResolverEndpoint.OnlyInboundResolver |
AllResolvers | awscc.ec2.vpc_endpoint.PrivateDnsOnlyForInboundResolverEndpoint.AllResolvers |
NotSpecified | awscc.ec2.vpc_endpoint.PrivateDnsOnlyForInboundResolverEndpoint.NotSpecified |
Shorthand formats: OnlyInboundResolver or PrivateDnsOnlyForInboundResolverEndpoint.OnlyInboundResolver
private_dns_preference (PrivateDnsPreference)
| Value | DSL Identifier |
|---|---|
VERIFIED_DOMAINS_ONLY | awscc.ec2.vpc_endpoint.PrivateDnsPreference.VERIFIED_DOMAINS_ONLY |
ALL_DOMAINS | awscc.ec2.vpc_endpoint.PrivateDnsPreference.ALL_DOMAINS |
VERIFIED_DOMAINS_AND_SPECIFIED_DOMAINS | awscc.ec2.vpc_endpoint.PrivateDnsPreference.VERIFIED_DOMAINS_AND_SPECIFIED_DOMAINS |
SPECIFIED_DOMAINS_ONLY | awscc.ec2.vpc_endpoint.PrivateDnsPreference.SPECIFIED_DOMAINS_ONLY |
Shorthand formats: VERIFIED_DOMAINS_ONLY or PrivateDnsPreference.VERIFIED_DOMAINS_ONLY
ip_address_type (IpAddressType)
| Value | DSL Identifier |
|---|---|
ipv4 | awscc.ec2.vpc_endpoint.IpAddressType.ipv4 |
ipv6 | awscc.ec2.vpc_endpoint.IpAddressType.ipv6 |
dualstack | awscc.ec2.vpc_endpoint.IpAddressType.dualstack |
not-specified | awscc.ec2.vpc_endpoint.IpAddressType.not_specified |
Shorthand formats: ipv4 or IpAddressType.ipv4
vpc_endpoint_type (VpcEndpointType)
| Value | DSL Identifier |
|---|---|
Interface | awscc.ec2.vpc_endpoint.VpcEndpointType.Interface |
Gateway | awscc.ec2.vpc_endpoint.VpcEndpointType.Gateway |
GatewayLoadBalancer | awscc.ec2.vpc_endpoint.VpcEndpointType.GatewayLoadBalancer |
ServiceNetwork | awscc.ec2.vpc_endpoint.VpcEndpointType.ServiceNetwork |
Resource | awscc.ec2.vpc_endpoint.VpcEndpointType.Resource |
Shorthand formats: Interface or VpcEndpointType.Interface
Struct Definitions
DnsOptionsSpecification
| Field | Type | Required | Description |
|---|---|---|---|
dns_record_ip_type | Enum (DnsRecordIpType) | No | The DNS records created for the endpoint. |
private_dns_only_for_inbound_resolver_endpoint | Enum (PrivateDnsOnlyForInboundResolverEndpoint) | No | Indicates whether to enable private DNS only for inbound endpoints. This option is available only for services that support both gateway and interface endpoints. It routes traffic that originates from the VPC to the gateway endpoint and traffic that originates from on-premises to the interface endpoint. |
private_dns_preference | Enum (PrivateDnsPreference) | No | The preference for which private domains have a private hosted zone created for and associated with the specified VPC. Only supported when private DNS is enabled and when the VPC endpoint type is ServiceNetwork or Resource. |
private_dns_specified_domains | List<String> (items: 1..=10) | No | Indicates which of the private domains to create private hosted zones for and associate with the specified VPC. Only supported when private DNS is enabled and the private DNS preference is VERIFIED_DOMAINS_AND_SPECIFIED_DOMAINS or SPECIFIED_DOMAINS_ONLY. |
Attribute Reference
creation_timestamp
- Type: String
dns_entries
- Type:
List<String>
id
- Type: VpcEndpointId
network_interface_ids
- Type:
List<NetworkInterfaceId>
awscc.ec2.vpc_gateway_attachment
CloudFormation Type: AWS::EC2::VPCGatewayAttachment
Resource Type definition for AWS::EC2::VPCGatewayAttachment
Example
let vpc = awscc.ec2.vpc {
cidr_block = "10.0.0.0/16"
enable_dns_support = true
enable_dns_hostnames = true
}
let igw = awscc.ec2.internet_gateway {}
awscc.ec2.vpc_gateway_attachment {
vpc_id = vpc.vpc_id
internet_gateway_id = igw.internet_gateway_id
}
Argument Reference
internet_gateway_id
- Type: InternetGatewayId
- Required: No
The ID of the internet gateway. You must specify either InternetGatewayId or VpnGatewayId, but not both.
vpc_id
- Type: VpcId
- Required: Yes
The ID of the VPC.
vpn_gateway_id
- Type: VpnGatewayId
- Required: No
The ID of the virtual private gateway. You must specify either InternetGatewayId or VpnGatewayId, but not both.
Attribute Reference
attachment_type
- Type: String
awscc.ec2.vpc_peering_connection
CloudFormation Type: AWS::EC2::VPCPeeringConnection
Resource Type definition for AWS::EC2::VPCPeeringConnection
Example
let vpc1 = awscc.ec2.vpc {
cidr_block = "10.0.0.0/16"
}
let vpc2 = awscc.ec2.vpc {
cidr_block = "10.1.0.0/16"
}
awscc.ec2.vpc_peering_connection {
vpc_id = vpc1.vpc_id
peer_vpc_id = vpc2.vpc_id
tags = {
Environment = "example"
}
}
Argument Reference
assume_role_region
- Type: Region
- Required: No
The Region code to use when calling Security Token Service (STS) to assume the PeerRoleArn, if provided.
peer_owner_id
- Type: AwsAccountId
- Required: No
The AWS account ID of the owner of the accepter VPC.
peer_region
- Type: Region
- Required: No
The Region code for the accepter VPC, if the accepter VPC is located in a Region other than the Region in which you make the request.
peer_role_arn
- Type: IamRoleArn
- Required: No
The Amazon Resource Name (ARN) of the VPC peer role for the peering connection in another AWS account.
peer_vpc_id
- Type: VpcId
- Required: Yes
The ID of the VPC with which you are creating the VPC peering connection. You must specify this parameter in the request.
tags
- Type: Map
- Required: No
vpc_id
- Type: VpcId
- Required: Yes
The ID of the VPC.
Attribute Reference
id
- Type: VpcPeeringConnectionId
awscc.ec2.vpc
CloudFormation Type: AWS::EC2::VPC
Specifies a virtual private cloud (VPC). To add an IPv6 CIDR block to the VPC, see AWS::EC2::VPCCidrBlock. For more information, see Virtual private clouds (VPC) in the Amazon VPC User Guide.
Example
awscc.ec2.vpc {
cidr_block = "10.0.0.0/16"
enable_dns_support = true
enable_dns_hostnames = true
instance_tenancy = default
tags = {
Environment = "example"
}
}
Argument Reference
cidr_block
- Type: Ipv4Cidr
- Required: No
The IPv4 network range for the VPC, in CIDR notation. For example, 10.0.0.0/16. We modify the specified CIDR block to its canonical form; for example, if you specify 100.68.0.18/18, we modify it to 100.68.0.0/18. You must specify eitherCidrBlock or Ipv4IpamPoolId.
enable_dns_hostnames
- Type: Bool
- Required: No
Indicates whether the instances launched in the VPC get DNS hostnames. If enabled, instances in the VPC get DNS hostnames; otherwise, they do not. Disabled by default for nondefault VPCs. For more information, see DNS attributes in your VPC. You can only enable DNS hostnames if you’ve enabled DNS support.
enable_dns_support
- Type: Bool
- Required: No
Indicates whether the DNS resolution is supported for the VPC. If enabled, queries to the Amazon provided DNS server at the 169.254.169.253 IP address, or the reserved IP address at the base of the VPC network range “plus two” succeed. If disabled, the Amazon provided DNS service in the VPC that resolves public DNS hostnames to IP addresses is not enabled. Enabled by default. For more information, see DNS attributes in your VPC.
instance_tenancy
- Type: Enum (InstanceTenancy)
- Required: No
The allowed tenancy of instances launched into the VPC. + default: An instance launched into the VPC runs on shared hardware by default, unless you explicitly specify a different tenancy during instance launch. + dedicated: An instance launched into the VPC runs on dedicated hardware by default, unless you explicitly specify a tenancy of host during instance launch. You cannot specify a tenancy of default during instance launch. Updating InstanceTenancy requires no replacement only if you are updating its value from dedicated to default. Updating InstanceTenancy from default to dedicated requires replacement.
ipv4_ipam_pool_id
- Type: IpamPoolId
- Required: No
The ID of an IPv4 IPAM pool you want to use for allocating this VPC’s CIDR. For more information, see What is IPAM? in the Amazon VPC IPAM User Guide. You must specify eitherCidrBlock or Ipv4IpamPoolId.
ipv4_netmask_length
- Type: Int(0..=32)
- Required: No
The netmask length of the IPv4 CIDR you want to allocate to this VPC from an Amazon VPC IP Address Manager (IPAM) pool. For more information about IPAM, see What is IPAM? in the Amazon VPC IPAM User Guide.
tags
- Type: Map
- Required: No
The tags for the VPC.
Enum Values
instance_tenancy (InstanceTenancy)
| Value | DSL Identifier |
|---|---|
default | awscc.ec2.vpc.InstanceTenancy.default |
dedicated | awscc.ec2.vpc.InstanceTenancy.dedicated |
host | awscc.ec2.vpc.InstanceTenancy.host |
Shorthand formats: default or InstanceTenancy.default
Attribute Reference
cidr_block_associations
- Type:
List<VpcCidrBlockAssociationId>
default_network_acl
- Type: NetworkAclId
default_security_group
- Type: SecurityGroupId
ipv6_cidr_blocks
- Type:
List<Ipv6Cidr>
vpc_id
- Type: VpcId
awscc.ec2.vpn_gateway
CloudFormation Type: AWS::EC2::VPNGateway
Specifies a virtual private gateway. A virtual private gateway is the endpoint on the VPC side of your VPN connection. You can create a virtual private gateway before creating the VPC itself. For more information, see in the User Guide.
Example
awscc.ec2.vpn_gateway {
type = awscc.ec2.vpn_gateway.Type.ipsec.1
tags = {
Environment = "example"
}
}
Argument Reference
amazon_side_asn
- Type: Int(1..=4294967294)
- Required: No
The private Autonomous System Number (ASN) for the Amazon side of a BGP session.
tags
- Type: Map
- Required: No
Any tags assigned to the virtual private gateway.
type
- Type: String
- Required: Yes
The type of VPN connection the virtual private gateway supports.
Attribute Reference
vpn_gateway_id
- Type: VpnGatewayId
awscc.iam.role
CloudFormation Type: AWS::IAM::Role
Creates a new role for your AWS-account. For more information about roles, see IAM roles in the IAM User Guide. For information about quotas for role names and the number of roles you can create, see IAM and quotas in the IAM User Guide.
Example
awscc.iam.role {
role_name = "my-example-role"
assume_role_policy_document = {
version = "2012-10-17"
statement {
effect = "Allow"
principal = {
service = "lambda.amazonaws.com"
}
action = "sts:AssumeRole"
}
}
tags = {
Environment = "example"
}
}
Argument Reference
assume_role_policy_document
- Type: IamPolicyDocument
- Required: Yes
The trust policy that is associated with this role. Trust policies define which entities can assume the role. You can associate only one trust policy with a role. For an example of a policy that can be used to assume a role, see Template Examples. For more information about the elements that you can use in an IAM policy, see Policy Elements Reference in the User Guide.
description
- Type: String
- Required: No
A description of the role that you provide.
managed_policy_arns
- Type:
List<IamPolicyArn> - Required: No
A list of Amazon Resource Names (ARNs) of the IAM managed policies that you want to attach to the role. For more information about ARNs, see Amazon Resource Names (ARNs) and Service Namespaces in the General Reference.
max_session_duration
- Type: Int(3600..=43200)
- Required: No
The maximum session duration (in seconds) that you want to set for the specified role. If you do not specify a value for this setting, the default value of one hour is applied. This setting can have a value from 1 hour to 12 hours. Anyone who assumes the role from the CLI or API can use the DurationSeconds API parameter or the duration-secondsCLI parameter to request a longer session. The MaxSessionDuration setting determines the maximum duration that can be requested using the DurationSeconds parameter. If users don’t specify a value for the DurationSeconds parameter, their security credentials are valid for one hour by default. This applies when you use the AssumeRole* API operations or the assume-role*CLI operations but does not apply when you use those operations to create a console URL. For more information, see Using IAM roles in the IAM User Guide.
path
- Type: String
- Required: No
- Default:
"/"
The path to the role. For more information about paths, see IAM Identifiers in the IAM User Guide. This parameter is optional. If it is not included, it defaults to a slash (/). This parameter allows (through its regex pattern) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (\u0021) through the DEL character (\u007F), including most punctuation characters, digits, and upper and lowercased letters.
permissions_boundary
- Type: IamPolicyArn
- Required: No
The ARN of the policy used to set the permissions boundary for the role. For more information about permissions boundaries, see Permissions boundaries for IAM identities in the IAM User Guide.
policies
- Type: List<Policy>
- Required: No
Adds or updates an inline policy document that is embedded in the specified IAM role. When you embed an inline policy in a role, the inline policy is used as part of the role’s access (permissions) policy. The role’s trust policy is created at the same time as the role. You can update a role’s trust policy later. For more information about IAM roles, go to Using Roles to Delegate Permissions and Federate Identities. A role can also have an attached managed policy. For information about policies, see Managed Policies and Inline Policies in the User Guide. For information about limits on the number of inline policies that you can embed with a role, see Limitations on Entities in the User Guide. If an external policy (such as AWS::IAM::Policy or AWS::IAM::ManagedPolicy) has a Ref to a role and if a resource (such as AWS::ECS::Service) also has a Ref to the same role, add a DependsOn attribute to the resource to make the resource depend on the external policy. This dependency ensures that the role’s policy is available throughout the resource’s lifecycle. For example, when you delete a stack with an AWS::ECS::Service resource, the DependsOn attribute ensures that CFN deletes the AWS::ECS::Service resource before deleting its role’s policy.
role_name
- Type: String
- Required: No
A name for the IAM role, up to 64 characters in length. For valid values, see the RoleName parameter for the CreateRole action in the User Guide. This parameter allows (per its regex pattern) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-. The role name must be unique within the account. Role names are not distinguished by case. For example, you cannot create roles named both “Role1” and “role1”. If you don’t specify a name, CFN generates a unique physical ID and uses that ID for the role name. If you specify a name, you must specify the CAPABILITY_NAMED_IAM value to acknowledge your template’s capabilities. For more information, see Acknowledging Resources in Templates. Naming an IAM resource can cause an unrecoverable error if you reuse the same template in multiple Regions. To prevent this, we recommend using Fn::Join and AWS::Region to create a Region-specific name, as in the following example: {"Fn::Join": ["", [{"Ref": "AWS::Region"}, {"Ref": "MyResourceName"}]]}.
tags
- Type: Map
- Required: No
A list of tags that are attached to the role. For more information about tagging, see Tagging IAM resources in the IAM User Guide.
Struct Definitions
Policy
| Field | Type | Required | Description |
|---|---|---|---|
policy_document | IamPolicyDocument | Yes | The entire contents of the policy that defines permissions. For more information, see Overview of JSON policies. |
policy_name | String | Yes | The friendly name (not ARN) identifying the policy. |
Attribute Reference
arn
- Type: IamRoleArn
role_id
- Type: IamRoleId
awscc.logs.log_group
CloudFormation Type: AWS::Logs::LogGroup
The AWS::Logs::LogGroup resource specifies a log group. A log group defines common properties for log streams, such as their retention and access control rules. Each log stream must belong to one log group.
You can create up to 1,000,000 log groups per Region per account. You must use the following guidelines when naming a log group:
- Log group names must be unique within a Region for an AWS account.
- Log group names can be between 1 and 512 characters long.
- Log group names consist of the following characters: a-z, A-Z, 0-9, ‘_’ (underscore), ‘-’ (hyphen), ‘/’ (forward slash), and ‘.’ (period).
Example
awscc.logs.log_group {
log_group_name = "/example/my-app"
retention_in_days = 30
tags = {
Environment = "example"
}
}
Argument Reference
data_protection_policy
- Type: Map
- Required: No
Creates a data protection policy and assigns it to the log group. A data protection policy can help safeguard sensitive data that’s ingested by the log group by auditing and masking the sensitive log data. When a user who does not have permission to view masked data views a log event that includes masked data, the sensitive data is replaced by asterisks.
deletion_protection_enabled
- Type: Bool
- Required: No
- Default:
false
Indicates whether deletion protection is enabled for this log group. When enabled, deletion protection blocks all deletion operations until it is explicitly disabled.
field_index_policies
- Type:
List<String> - Required: No
Creates or updates a field index policy for the specified log group. Only log groups in the Standard log class support field index policies. For more information about log classes, see Log classes. You can use field index policies to create field indexes on fields found in log events in the log group. Creating field indexes lowers the costs for CWL Insights queries that reference those field indexes, because these queries attempt to skip the processing of log events that are known to not match the indexed field. Good fields to index are fields that you often need to query for and fields that have high cardinality of values Common examples of indexes include request ID, session ID, userID, and instance IDs. For more information, see Create field indexes to improve query performance and reduce costs. Currently, this array supports only one field index policy object.
kms_key_id
- Type: KmsKeyArn
- Required: No
The Amazon Resource Name (ARN) of the KMS key to use when encrypting log data. To associate an KMS key with the log group, specify the ARN of that KMS key here. If you do so, ingested data is encrypted using this key. This association is stored as long as the data encrypted with the KMS key is still within CWL. This enables CWL to decrypt this data whenever it is requested. If you attempt to associate a KMS key with the log group but the KMS key doesn’t exist or is deactivated, you will receive an InvalidParameterException error. Log group data is always encrypted in CWL. If you omit this key, the encryption does not use KMS. For more information, see Encrypt log data in using
log_group_class
- Type: Enum (LogGroupClass)
- Required: No
- Default:
"STANDARD"
Specifies the log group class for this log group. There are two classes: + The Standard log class supports all CWL features. + The Infrequent Access log class supports a subset of CWL features and incurs lower costs. For details about the features supported by each class, see Log classes
log_group_name
- Type: String(pattern, len: 1..=512)
- Required: No
The name of the log group. If you don’t specify a name, CFNlong generates a unique ID for the log group.
resource_policy_document
- Type: IamPolicyDocument
- Required: No
Creates or updates a resource policy for the specified log group that allows other services to put log events to this account. A LogGroup can have 1 resource policy.
retention_in_days
- Type: IntEnum([1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1096, 1827, 2192, 2557, 2922, 3288, 3653])
- Required: No
The number of days to retain the log events in the specified log group. Possible values are: 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1096, 1827, 2192, 2557, 2922, 3288, and 3653. To set a log group so that its log events do not expire, do not specify this property.
tags
- Type: Map
- Required: No
An array of key-value pairs to apply to the log group. For more information, see Tag.
Enum Values
log_group_class (LogGroupClass)
| Value | DSL Identifier |
|---|---|
STANDARD | awscc.logs.log_group.LogGroupClass.STANDARD |
INFREQUENT_ACCESS | awscc.logs.log_group.LogGroupClass.INFREQUENT_ACCESS |
DELIVERY | awscc.logs.log_group.LogGroupClass.DELIVERY |
Shorthand formats: STANDARD or LogGroupClass.STANDARD
Attribute Reference
arn
- Type: Arn
awscc.s3.bucket
CloudFormation Type: AWS::S3::Bucket
The AWS::S3::Bucket resource creates an Amazon S3 bucket in the same AWS Region where you create the AWS CloudFormation stack.
To control how AWS CloudFormation handles the bucket when the stack is deleted, you can set a deletion policy for your bucket. You can choose to retain the bucket or to delete the bucket. For more information, see DeletionPolicy Attribute.
You can only delete empty buckets. Deletion fails for buckets that have contents.
Example
awscc.s3.bucket {
bucket_name = "my-example-bucket"
versioning_configuration = {
status = Enabled
}
tags = {
Environment = "example"
}
}
Argument Reference
abac_status
- Type: Enum (AbacStatus)
- Required: No
The ABAC status of the general purpose bucket. When ABAC is enabled for the general purpose bucket, you can use tags to manage access to the general purpose buckets as well as for cost tracking purposes. When ABAC is disabled for the general purpose buckets, you can only use tags for cost tracking purposes. For more information, see Using tags with S3 general purpose buckets.
accelerate_configuration
- Type: Struct(AccelerateConfiguration)
- Required: No
Configures the transfer acceleration state for an Amazon S3 bucket. For more information, see Amazon S3 Transfer Acceleration in the Amazon S3 User Guide.
access_control
- Type: Enum (AccessControl)
- Required: No
This is a legacy property, and it is not recommended for most use cases. A majority of modern use cases in Amazon S3 no longer require the use of ACLs, and we recommend that you keep ACLs disabled. For more information, see Controlling object ownership in the Amazon S3 User Guide. A canned access control list (ACL) that grants predefined permissions to the bucket. For more information about canned ACLs, see Canned ACL in the Amazon S3 User Guide. S3 buckets are created with ACLs disabled by default. Therefore, unless you explicitly set the AWS::S3::OwnershipControls property to enable ACLs, your resource will fail to deploy with any value other than Private. Use cases requiring ACLs are uncommon. The majority of access control configurations can be successfully and more easily achieved with bucket policies. For more information, see AWS::S3::BucketPolicy. For examples of common policy configurations, including S3 Server Access Logs buckets and more, see Bucket policy examples in the Amazon S3 User Guide.
analytics_configurations
- Type: List<AnalyticsConfiguration>
- Required: No
Specifies the configuration and any analyses for the analytics filter of an Amazon S3 bucket.
bucket_encryption
- Type: Struct(BucketEncryption)
- Required: No
Specifies default encryption for a bucket using server-side encryption with Amazon S3-managed keys (SSE-S3), AWS KMS-managed keys (SSE-KMS), or dual-layer server-side encryption with KMS-managed keys (DSSE-KMS). For information about the Amazon S3 default encryption feature, see Amazon S3 Default Encryption for S3 Buckets in the Amazon S3 User Guide.
bucket_name
- Type: String
- Required: No
A name for the bucket. If you don’t specify a name, AWS CloudFormation generates a unique ID and uses that ID for the bucket name. The bucket name must contain only lowercase letters, numbers, periods (.), and dashes (-) and must follow Amazon S3 bucket restrictions and limitations. For more information, see Rules for naming Amazon S3 buckets in the Amazon S3 User Guide. If you specify a name, you can’t perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you need to replace the resource, specify a new name.
cors_configuration
- Type: Struct(CorsConfiguration)
- Required: No
Describes the cross-origin access configuration for objects in an Amazon S3 bucket. For more information, see Enabling Cross-Origin Resource Sharing in the Amazon S3 User Guide.
intelligent_tiering_configurations
- Type: List<IntelligentTieringConfiguration>
- Required: No
Defines how Amazon S3 handles Intelligent-Tiering storage.
inventory_configurations
- Type: List<InventoryConfiguration>
- Required: No
Specifies the S3 Inventory configuration for an Amazon S3 bucket. For more information, see GET Bucket inventory in the Amazon S3 API Reference.
lifecycle_configuration
- Type: Struct(LifecycleConfiguration)
- Required: No
Specifies the lifecycle configuration for objects in an Amazon S3 bucket. For more information, see Object Lifecycle Management in the Amazon S3 User Guide.
logging_configuration
- Type: Struct(LoggingConfiguration)
- Required: No
Settings that define where logs are stored.
metadata_configuration
- Type: Struct(MetadataConfiguration)
- Required: No
The S3 Metadata configuration for a general purpose bucket.
metadata_table_configuration
- Type: Struct(MetadataTableConfiguration)
- Required: No
The metadata table configuration of an S3 general purpose bucket.
metrics_configurations
- Type: List<MetricsConfiguration>
- Required: No
Specifies a metrics configuration for the CloudWatch request metrics (specified by the metrics configuration ID) from an Amazon S3 bucket. If you’re updating an existing metrics configuration, note that this is a full replacement of the existing metrics configuration. If you don’t include the elements you want to keep, they are erased. For more information, see PutBucketMetricsConfiguration.
notification_configuration
- Type: Struct(NotificationConfiguration)
- Required: No
Configuration that defines how Amazon S3 handles bucket notifications.
object_lock_configuration
- Type: Struct(ObjectLockConfiguration)
- Required: No
This operation is not supported for directory buckets. Places an Object Lock configuration on the specified bucket. The rule specified in the Object Lock configuration will be applied by default to every new object placed in the specified bucket. For more information, see Locking Objects. + The DefaultRetention settings require both a mode and a period. + The DefaultRetention period can be either Days or Years but you must select one. You cannot specify Days and Years at the same time. + You can enable Object Lock for new or existing buckets. For more information, see Configuring Object Lock. You must URL encode any signed header values that contain spaces. For example, if your header value is my file.txt, containing two spaces after my, you must URL encode this value to my%20%20file.txt.
object_lock_enabled
- Type: Bool
- Required: No
Indicates whether this bucket has an Object Lock configuration enabled. Enable ObjectLockEnabled when you apply ObjectLockConfiguration to a bucket.
ownership_controls
- Type: Struct(OwnershipControls)
- Required: No
Configuration that defines how Amazon S3 handles Object Ownership rules.
public_access_block_configuration
- Type: Struct(PublicAccessBlockConfiguration)
- Required: No
Configuration that defines how Amazon S3 handles public access.
replication_configuration
- Type: Struct(ReplicationConfiguration)
- Required: No
Configuration for replicating objects in an S3 bucket. To enable replication, you must also enable versioning by using the VersioningConfiguration property. Amazon S3 can store replicated objects in a single destination bucket or multiple destination buckets. The destination bucket or buckets must already exist.
tags
- Type: Map
- Required: No
An arbitrary set of tags (key-value pairs) for this S3 bucket.
versioning_configuration
- Type: Struct(VersioningConfiguration)
- Required: No
Enables multiple versions of all objects in this bucket. You might enable versioning to prevent objects from being deleted or overwritten by mistake or to archive objects so that you can retrieve previous versions of them. When you enable versioning on a bucket for the first time, it might take a short amount of time for the change to be fully propagated. We recommend that you wait for 15 minutes after enabling versioning before issuing write operations (PUT or DELETE) on objects in the bucket.
website_configuration
- Type: Struct(WebsiteConfiguration)
- Required: No
Information used to configure the bucket as a static website. For more information, see Hosting Websites on Amazon S3.
Enum Values
abac_status (AbacStatus)
| Value | DSL Identifier |
|---|---|
Enabled | awscc.s3.bucket.AbacStatus.Enabled |
Disabled | awscc.s3.bucket.AbacStatus.Disabled |
Shorthand formats: Enabled or AbacStatus.Enabled
acceleration_status (AccelerationStatus)
| Value | DSL Identifier |
|---|---|
Enabled | awscc.s3.bucket.AccelerationStatus.Enabled |
Suspended | awscc.s3.bucket.AccelerationStatus.Suspended |
Shorthand formats: Enabled or AccelerationStatus.Enabled
access_control (AccessControl)
| Value | DSL Identifier |
|---|---|
AuthenticatedRead | awscc.s3.bucket.AccessControl.AuthenticatedRead |
AwsExecRead | awscc.s3.bucket.AccessControl.AwsExecRead |
BucketOwnerFullControl | awscc.s3.bucket.AccessControl.BucketOwnerFullControl |
BucketOwnerRead | awscc.s3.bucket.AccessControl.BucketOwnerRead |
LogDeliveryWrite | awscc.s3.bucket.AccessControl.LogDeliveryWrite |
Private | awscc.s3.bucket.AccessControl.Private |
PublicRead | awscc.s3.bucket.AccessControl.PublicRead |
PublicReadWrite | awscc.s3.bucket.AccessControl.PublicReadWrite |
Shorthand formats: AuthenticatedRead or AccessControl.AuthenticatedRead
owner (Owner)
| Value | DSL Identifier |
|---|---|
Destination | awscc.s3.bucket.Owner.Destination |
Shorthand formats: Destination or Owner.Destination
encryption_type (EncryptionType)
| Value | DSL Identifier |
|---|---|
NONE | awscc.s3.bucket.EncryptionType.NONE |
SSE-C | awscc.s3.bucket.EncryptionType.SSE_C |
Shorthand formats: NONE or EncryptionType.NONE
allowed_methods (AllowedMethods)
| Value | DSL Identifier |
|---|---|
GET | awscc.s3.bucket.AllowedMethods.GET |
PUT | awscc.s3.bucket.AllowedMethods.PUT |
HEAD | awscc.s3.bucket.AllowedMethods.HEAD |
POST | awscc.s3.bucket.AllowedMethods.POST |
DELETE | awscc.s3.bucket.AllowedMethods.DELETE |
Shorthand formats: GET or AllowedMethods.GET
output_schema_version (OutputSchemaVersion)
| Value | DSL Identifier |
|---|---|
V_1 | awscc.s3.bucket.OutputSchemaVersion.V_1 |
Shorthand formats: V_1 or OutputSchemaVersion.V_1
mode (Mode)
| Value | DSL Identifier |
|---|---|
COMPLIANCE | awscc.s3.bucket.Mode.COMPLIANCE |
GOVERNANCE | awscc.s3.bucket.Mode.GOVERNANCE |
Shorthand formats: COMPLIANCE or Mode.COMPLIANCE
status (DeleteMarkerReplicationStatus)
| Value | DSL Identifier |
|---|---|
Disabled | awscc.s3.bucket.DeleteMarkerReplicationStatus.Disabled |
Enabled | awscc.s3.bucket.DeleteMarkerReplicationStatus.Enabled |
Shorthand formats: Disabled or DeleteMarkerReplicationStatus.Disabled
format (Format)
| Value | DSL Identifier |
|---|---|
CSV | awscc.s3.bucket.Format.CSV |
ORC | awscc.s3.bucket.Format.ORC |
Parquet | awscc.s3.bucket.Format.Parquet |
Shorthand formats: CSV or Format.CSV
status (IntelligentTieringConfigurationStatus)
| Value | DSL Identifier |
|---|---|
Disabled | awscc.s3.bucket.IntelligentTieringConfigurationStatus.Disabled |
Enabled | awscc.s3.bucket.IntelligentTieringConfigurationStatus.Enabled |
Shorthand formats: Disabled or IntelligentTieringConfigurationStatus.Disabled
included_object_versions (IncludedObjectVersions)
| Value | DSL Identifier |
|---|---|
All | awscc.s3.bucket.IncludedObjectVersions.All |
Current | awscc.s3.bucket.IncludedObjectVersions.Current |
Shorthand formats: All or IncludedObjectVersions.All
optional_fields (OptionalFields)
| Value | DSL Identifier |
|---|---|
Size | awscc.s3.bucket.OptionalFields.Size |
LastModifiedDate | awscc.s3.bucket.OptionalFields.LastModifiedDate |
StorageClass | awscc.s3.bucket.OptionalFields.StorageClass |
ETag | awscc.s3.bucket.OptionalFields.ETag |
IsMultipartUploaded | awscc.s3.bucket.OptionalFields.IsMultipartUploaded |
ReplicationStatus | awscc.s3.bucket.OptionalFields.ReplicationStatus |
EncryptionStatus | awscc.s3.bucket.OptionalFields.EncryptionStatus |
ObjectLockRetainUntilDate | awscc.s3.bucket.OptionalFields.ObjectLockRetainUntilDate |
ObjectLockMode | awscc.s3.bucket.OptionalFields.ObjectLockMode |
ObjectLockLegalHoldStatus | awscc.s3.bucket.OptionalFields.ObjectLockLegalHoldStatus |
IntelligentTieringAccessTier | awscc.s3.bucket.OptionalFields.IntelligentTieringAccessTier |
BucketKeyStatus | awscc.s3.bucket.OptionalFields.BucketKeyStatus |
ChecksumAlgorithm | awscc.s3.bucket.OptionalFields.ChecksumAlgorithm |
ObjectAccessControlList | awscc.s3.bucket.OptionalFields.ObjectAccessControlList |
ObjectOwner | awscc.s3.bucket.OptionalFields.ObjectOwner |
LifecycleExpirationDate | awscc.s3.bucket.OptionalFields.LifecycleExpirationDate |
Shorthand formats: Size or OptionalFields.Size
schedule_frequency (ScheduleFrequency)
| Value | DSL Identifier |
|---|---|
Daily | awscc.s3.bucket.ScheduleFrequency.Daily |
Weekly | awscc.s3.bucket.ScheduleFrequency.Weekly |
Shorthand formats: Daily or ScheduleFrequency.Daily
configuration_state (ConfigurationState)
| Value | DSL Identifier |
|---|---|
ENABLED | awscc.s3.bucket.ConfigurationState.ENABLED |
DISABLED | awscc.s3.bucket.ConfigurationState.DISABLED |
Shorthand formats: ENABLED or ConfigurationState.ENABLED
transition_default_minimum_object_size (TransitionDefaultMinimumObjectSize)
| Value | DSL Identifier |
|---|---|
varies_by_storage_class | awscc.s3.bucket.TransitionDefaultMinimumObjectSize.varies_by_storage_class |
all_storage_classes_128K | awscc.s3.bucket.TransitionDefaultMinimumObjectSize.all_storage_classes_128K |
Shorthand formats: varies_by_storage_class or TransitionDefaultMinimumObjectSize.varies_by_storage_class
table_bucket_type (TableBucketType)
| Value | DSL Identifier |
|---|---|
aws | awscc.s3.bucket.TableBucketType.aws |
customer | awscc.s3.bucket.TableBucketType.customer |
Shorthand formats: aws or TableBucketType.aws
sse_algorithm (MetadataTableEncryptionConfigurationSseAlgorithm)
| Value | DSL Identifier |
|---|---|
aws:kms | awscc.s3.bucket.MetadataTableEncryptionConfigurationSseAlgorithm.aws:kms |
AES256 | awscc.s3.bucket.MetadataTableEncryptionConfigurationSseAlgorithm.AES256 |
Shorthand formats: aws:kms or MetadataTableEncryptionConfigurationSseAlgorithm.aws:kms
status (MetricsStatus)
| Value | DSL Identifier |
|---|---|
Disabled | awscc.s3.bucket.MetricsStatus.Disabled |
Enabled | awscc.s3.bucket.MetricsStatus.Enabled |
Shorthand formats: Disabled or MetricsStatus.Disabled
storage_class (NoncurrentVersionTransitionStorageClass)
| Value | DSL Identifier |
|---|---|
DEEP_ARCHIVE | awscc.s3.bucket.NoncurrentVersionTransitionStorageClass.DEEP_ARCHIVE |
GLACIER | awscc.s3.bucket.NoncurrentVersionTransitionStorageClass.GLACIER |
GLACIER_IR | awscc.s3.bucket.NoncurrentVersionTransitionStorageClass.GLACIER_IR |
INTELLIGENT_TIERING | awscc.s3.bucket.NoncurrentVersionTransitionStorageClass.INTELLIGENT_TIERING |
ONEZONE_IA | awscc.s3.bucket.NoncurrentVersionTransitionStorageClass.ONEZONE_IA |
STANDARD_IA | awscc.s3.bucket.NoncurrentVersionTransitionStorageClass.STANDARD_IA |
Shorthand formats: DEEP_ARCHIVE or NoncurrentVersionTransitionStorageClass.DEEP_ARCHIVE
object_lock_enabled (ObjectLockEnabled)
| Value | DSL Identifier |
|---|---|
Enabled | awscc.s3.bucket.ObjectLockEnabled.Enabled |
Shorthand formats: Enabled or ObjectLockEnabled.Enabled
object_ownership (ObjectOwnership)
| Value | DSL Identifier |
|---|---|
ObjectWriter | awscc.s3.bucket.ObjectOwnership.ObjectWriter |
BucketOwnerPreferred | awscc.s3.bucket.ObjectOwnership.BucketOwnerPreferred |
BucketOwnerEnforced | awscc.s3.bucket.ObjectOwnership.BucketOwnerEnforced |
Shorthand formats: ObjectWriter or ObjectOwnership.ObjectWriter
partition_date_source (PartitionDateSource)
| Value | DSL Identifier |
|---|---|
EventTime | awscc.s3.bucket.PartitionDateSource.EventTime |
DeliveryTime | awscc.s3.bucket.PartitionDateSource.DeliveryTime |
Shorthand formats: EventTime or PartitionDateSource.EventTime
expiration (Expiration)
| Value | DSL Identifier |
|---|---|
ENABLED | awscc.s3.bucket.Expiration.ENABLED |
DISABLED | awscc.s3.bucket.Expiration.DISABLED |
Shorthand formats: ENABLED or Expiration.ENABLED
protocol (Protocol)
| Value | DSL Identifier |
|---|---|
http | awscc.s3.bucket.Protocol.http |
https | awscc.s3.bucket.Protocol.https |
Shorthand formats: http or Protocol.http
status (ReplicaModificationsStatus)
| Value | DSL Identifier |
|---|---|
Enabled | awscc.s3.bucket.ReplicaModificationsStatus.Enabled |
Disabled | awscc.s3.bucket.ReplicaModificationsStatus.Disabled |
Shorthand formats: Enabled or ReplicaModificationsStatus.Enabled
storage_class (ReplicationDestinationStorageClass)
| Value | DSL Identifier |
|---|---|
DEEP_ARCHIVE | awscc.s3.bucket.ReplicationDestinationStorageClass.DEEP_ARCHIVE |
GLACIER | awscc.s3.bucket.ReplicationDestinationStorageClass.GLACIER |
GLACIER_IR | awscc.s3.bucket.ReplicationDestinationStorageClass.GLACIER_IR |
INTELLIGENT_TIERING | awscc.s3.bucket.ReplicationDestinationStorageClass.INTELLIGENT_TIERING |
ONEZONE_IA | awscc.s3.bucket.ReplicationDestinationStorageClass.ONEZONE_IA |
REDUCED_REDUNDANCY | awscc.s3.bucket.ReplicationDestinationStorageClass.REDUCED_REDUNDANCY |
STANDARD | awscc.s3.bucket.ReplicationDestinationStorageClass.STANDARD |
STANDARD_IA | awscc.s3.bucket.ReplicationDestinationStorageClass.STANDARD_IA |
Shorthand formats: DEEP_ARCHIVE or ReplicationDestinationStorageClass.DEEP_ARCHIVE
status (ReplicationRuleStatus)
| Value | DSL Identifier |
|---|---|
Disabled | awscc.s3.bucket.ReplicationRuleStatus.Disabled |
Enabled | awscc.s3.bucket.ReplicationRuleStatus.Enabled |
Shorthand formats: Disabled or ReplicationRuleStatus.Disabled
status (ReplicationTimeStatus)
| Value | DSL Identifier |
|---|---|
Disabled | awscc.s3.bucket.ReplicationTimeStatus.Disabled |
Enabled | awscc.s3.bucket.ReplicationTimeStatus.Enabled |
Shorthand formats: Disabled or ReplicationTimeStatus.Disabled
status (RuleStatus)
| Value | DSL Identifier |
|---|---|
Enabled | awscc.s3.bucket.RuleStatus.Enabled |
Disabled | awscc.s3.bucket.RuleStatus.Disabled |
Shorthand formats: Enabled or RuleStatus.Enabled
sse_algorithm (ServerSideEncryptionByDefaultSseAlgorithm)
| Value | DSL Identifier |
|---|---|
aws:kms | awscc.s3.bucket.ServerSideEncryptionByDefaultSseAlgorithm.aws:kms |
AES256 | awscc.s3.bucket.ServerSideEncryptionByDefaultSseAlgorithm.AES256 |
aws:kms:dsse | awscc.s3.bucket.ServerSideEncryptionByDefaultSseAlgorithm.aws:kms:dsse |
Shorthand formats: aws:kms or ServerSideEncryptionByDefaultSseAlgorithm.aws:kms
status (SseKmsEncryptedObjectsStatus)
| Value | DSL Identifier |
|---|---|
Disabled | awscc.s3.bucket.SseKmsEncryptedObjectsStatus.Disabled |
Enabled | awscc.s3.bucket.SseKmsEncryptedObjectsStatus.Enabled |
Shorthand formats: Disabled or SseKmsEncryptedObjectsStatus.Disabled
access_tier (AccessTier)
| Value | DSL Identifier |
|---|---|
ARCHIVE_ACCESS | awscc.s3.bucket.AccessTier.ARCHIVE_ACCESS |
DEEP_ARCHIVE_ACCESS | awscc.s3.bucket.AccessTier.DEEP_ARCHIVE_ACCESS |
Shorthand formats: ARCHIVE_ACCESS or AccessTier.ARCHIVE_ACCESS
storage_class (TransitionStorageClass)
| Value | DSL Identifier |
|---|---|
DEEP_ARCHIVE | awscc.s3.bucket.TransitionStorageClass.DEEP_ARCHIVE |
GLACIER | awscc.s3.bucket.TransitionStorageClass.GLACIER |
GLACIER_IR | awscc.s3.bucket.TransitionStorageClass.GLACIER_IR |
INTELLIGENT_TIERING | awscc.s3.bucket.TransitionStorageClass.INTELLIGENT_TIERING |
ONEZONE_IA | awscc.s3.bucket.TransitionStorageClass.ONEZONE_IA |
STANDARD_IA | awscc.s3.bucket.TransitionStorageClass.STANDARD_IA |
Shorthand formats: DEEP_ARCHIVE or TransitionStorageClass.DEEP_ARCHIVE
status (VersioningConfigurationStatus)
| Value | DSL Identifier |
|---|---|
Enabled | awscc.s3.bucket.VersioningConfigurationStatus.Enabled |
Suspended | awscc.s3.bucket.VersioningConfigurationStatus.Suspended |
Shorthand formats: Enabled or VersioningConfigurationStatus.Enabled
Struct Definitions
AbortIncompleteMultipartUpload
| Field | Type | Required | Description |
|---|---|---|---|
days_after_initiation | Int(0..) | Yes | Specifies the number of days after which Amazon S3 stops an incomplete multipart upload. |
AccelerateConfiguration
| Field | Type | Required | Description |
|---|---|---|---|
acceleration_status | Enum (AccelerationStatus) | Yes | Specifies the transfer acceleration status of the bucket. |
AccessControlTranslation
| Field | Type | Required | Description |
|---|---|---|---|
owner | Enum (Owner) | Yes | Specifies the replica ownership. For default and valid values, see PUT bucket replication in the Amazon S3 API Reference. |
AnalyticsConfiguration
| Field | Type | Required | Description |
|---|---|---|---|
id | String | Yes | The ID that identifies the analytics configuration. |
prefix | String | No | The prefix that an object must have to be included in the analytics results. |
storage_class_analysis | Struct(StorageClassAnalysis) | Yes | Contains data related to access patterns to be collected and made available to analyze the tradeoffs between different storage classes. |
tag_filters | List<Map> | No | The tags to use when evaluating an analytics filter. The analytics only includes objects that meet the filter’s criteria. If no filter is specified, all of the contents of the bucket are included in the analysis. |
BlockedEncryptionTypes
| Field | Type | Required | Description |
|---|---|---|---|
encryption_type | Enum (EncryptionType) | No | The object encryption type that you want to block or unblock for an Amazon S3 general purpose bucket. Currently, this parameter only supports blocking or unblocking server side encryption with customer-provided keys (SSE-C). For more information about SSE-C, see Using server-side encryption with customer-provided keys (SSE-C). |
BucketEncryption
| Field | Type | Required | Description |
|---|---|---|---|
server_side_encryption_configuration | List<ServerSideEncryptionRule> | Yes | Specifies the default server-side-encryption configuration. |
CorsConfiguration
| Field | Type | Required | Description |
|---|---|---|---|
cors_rules | List<CorsRule> | Yes | A set of origins and methods (cross-origin access that you want to allow). You can add up to 100 rules to the configuration. |
CorsRule
| Field | Type | Required | Description |
|---|---|---|---|
allowed_headers | List<String> | No | Headers that are specified in the Access-Control-Request-Headers header. These headers are allowed in a preflight OPTIONS request. In response to any preflight OPTIONS request, Amazon S3 returns any requested headers that are allowed. |
allowed_methods | List<Enum (AllowedMethods)> | Yes | An HTTP method that you allow the origin to run. Allowed values: GET |
allowed_origins | List<String> | Yes | One or more origins you want customers to be able to access the bucket from. |
exposed_headers | List<String> | No | One or more headers in the response that you want customers to be able to access from their applications (for example, from a JavaScript XMLHttpRequest object). |
id | String(len: ..=255) | No | A unique identifier for this rule. The value must be no more than 255 characters. |
max_age | Int(0..) | No | The time in seconds that your browser is to cache the preflight response for the specified resource. |
DataExport
| Field | Type | Required | Description |
|---|---|---|---|
destination | Struct(Destination) | Yes | The place to store the data for an analysis. |
output_schema_version | Enum (OutputSchemaVersion) | Yes | The version of the output schema to use when exporting data. Must be V_1. |
DefaultRetention
| Field | Type | Required | Description |
|---|---|---|---|
days | Int | No | The number of days that you want to specify for the default retention period. If Object Lock is turned on, you must specify Mode and specify either Days or Years. |
mode | Enum (Mode) | No | The default Object Lock retention mode you want to apply to new objects placed in the specified bucket. If Object Lock is turned on, you must specify Mode and specify either Days or Years. |
years | Int | No | The number of years that you want to specify for the default retention period. If Object Lock is turned on, you must specify Mode and specify either Days or Years. |
DeleteMarkerReplication
| Field | Type | Required | Description |
|---|---|---|---|
status | Enum (DeleteMarkerReplicationStatus) | No | Indicates whether to replicate delete markers. |
Destination
| Field | Type | Required | Description |
|---|---|---|---|
bucket_account_id | AwsAccountId | No | The account ID that owns the destination S3 bucket. If no account ID is provided, the owner is not validated before exporting data. Although this value is optional, we strongly recommend that you set it to help prevent problems if the destination bucket ownership changes. |
bucket_arn | Arn | Yes | The Amazon Resource Name (ARN) of the bucket to which data is exported. |
format | Enum (Format) | Yes | Specifies the file format used when exporting data to Amazon S3. Allowed values: CSV |
prefix | String | No | The prefix to use when exporting data. The prefix is prepended to all results. |
EncryptionConfiguration
| Field | Type | Required | Description |
|---|---|---|---|
replica_kms_key_id | KmsKeyId | Yes | Specifies the ID (Key ARN or Alias ARN) of the customer managed AWS KMS key stored in AWS Key Management Service (KMS) for the destination bucket. Amazon S3 uses this key to encrypt replica objects. Amazon S3 only supports symmetric encryption KMS keys. For more information, see Asymmetric keys in KMS in the Key Management Service Developer Guide. |
EventBridgeConfiguration
| Field | Type | Required | Description |
|---|---|---|---|
event_bridge_enabled | Bool | Yes | Enables delivery of events to Amazon EventBridge. |
FilterRule
| Field | Type | Required | Description |
|---|---|---|---|
name | String(len: ..=1024) | Yes | The object key name prefix or suffix identifying one or more objects to which the filtering rule applies. The maximum length is 1,024 characters. Overlapping prefixes and suffixes are not supported. For more information, see Configuring Event Notifications in the Amazon S3 User Guide. |
value | String | Yes | The value that the filter searches for in object key names. |
IntelligentTieringConfiguration
| Field | Type | Required | Description |
|---|---|---|---|
id | String | Yes | The ID used to identify the S3 Intelligent-Tiering configuration. |
prefix | String | No | An object key name prefix that identifies the subset of objects to which the rule applies. |
status | Enum (IntelligentTieringConfigurationStatus) | Yes | Specifies the status of the configuration. |
tag_filters | List<Map> | No | A container for a key-value pair. |
tierings | List<Tiering> | Yes | Specifies a list of S3 Intelligent-Tiering storage class tiers in the configuration. At least one tier must be defined in the list. At most, you can specify two tiers in the list, one for each available AccessTier: ARCHIVE_ACCESS and DEEP_ARCHIVE_ACCESS. You only need Intelligent Tiering Configuration enabled on a bucket if you want to automatically move objects stored in the Intelligent-Tiering storage class to Archive Access or Deep Archive Access tiers. |
InventoryConfiguration
| Field | Type | Required | Description |
|---|---|---|---|
destination | Struct(Destination) | Yes | Contains information about where to publish the inventory results. |
enabled | Bool | Yes | Specifies whether the inventory is enabled or disabled. If set to True, an inventory list is generated. If set to False, no inventory list is generated. |
id | String | Yes | The ID used to identify the inventory configuration. |
included_object_versions | Enum (IncludedObjectVersions) | Yes | Object versions to include in the inventory list. If set to All, the list includes all the object versions, which adds the version-related fields VersionId, IsLatest, and DeleteMarker to the list. If set to Current, the list does not contain these version-related fields. |
optional_fields | List<Enum (OptionalFields)> | No | Contains the optional fields that are included in the inventory results. |
prefix | String | No | Specifies the inventory filter prefix. |
schedule_frequency | Enum (ScheduleFrequency) | Yes | Specifies the schedule for generating inventory results. |
InventoryTableConfiguration
| Field | Type | Required | Description |
|---|---|---|---|
configuration_state | Enum (ConfigurationState) | Yes | The configuration state of the inventory table, indicating whether the inventory table is enabled or disabled. |
encryption_configuration | Struct(MetadataTableEncryptionConfiguration) | No | The encryption configuration for the inventory table. |
table_arn | Arn | No | The Amazon Resource Name (ARN) for the inventory table. |
table_name | String | No | The name of the inventory table. |
JournalTableConfiguration
| Field | Type | Required | Description |
|---|---|---|---|
encryption_configuration | Struct(MetadataTableEncryptionConfiguration) | No | The encryption configuration for the journal table. |
record_expiration | Struct(RecordExpiration) | Yes | The journal table record expiration settings for the journal table. |
table_arn | Arn | No | The Amazon Resource Name (ARN) for the journal table. |
table_name | String | No | The name of the journal table. |
LambdaConfiguration
| Field | Type | Required | Description |
|---|---|---|---|
event | String | Yes | The Amazon S3 bucket event for which to invoke the LAMlong function. For more information, see Supported Event Types in the Amazon S3 User Guide. |
filter | Struct(NotificationFilter) | No | The filtering rules that determine which objects invoke the AWS Lambda function. For example, you can create a filter so that only image files with a .jpg extension invoke the function when they are added to the Amazon S3 bucket. |
function | Arn | Yes | The Amazon Resource Name (ARN) of the LAMlong function that Amazon S3 invokes when the specified event type occurs. |
LifecycleConfiguration
| Field | Type | Required | Description |
|---|---|---|---|
rules | List<Rule> | Yes | A lifecycle rule for individual objects in an Amazon S3 bucket. |
transition_default_minimum_object_size | Enum (TransitionDefaultMinimumObjectSize) | No | Indicates which default minimum object size behavior is applied to the lifecycle configuration. This parameter applies to general purpose buckets only. It isn’t supported for directory bucket lifecycle configurations. + all_storage_classes_128K - Objects smaller than 128 KB will not transition to any storage class by default. + varies_by_storage_class - Objects smaller than 128 KB will transition to Glacier Flexible Retrieval or Glacier Deep Archive storage classes. By default, all other storage classes will prevent transitions smaller than 128 KB. To customize the minimum object size for any transition you can add a filter that specifies a custom ObjectSizeGreaterThan or ObjectSizeLessThan in the body of your transition rule. Custom filters always take precedence over the default transition behavior. |
LoggingConfiguration
| Field | Type | Required | Description |
|---|---|---|---|
destination_bucket_name | String | No | The name of the bucket where Amazon S3 should store server access log files. You can store log files in any bucket that you own. By default, logs are stored in the bucket where the LoggingConfiguration property is defined. |
log_file_prefix | String | No | A prefix for all log object keys. If you store log files from multiple Amazon S3 buckets in a single bucket, you can use a prefix to distinguish which log files came from which bucket. |
target_object_key_format | Struct(TargetObjectKeyFormat) | No | Amazon S3 key format for log objects. Only one format, either PartitionedPrefix or SimplePrefix, is allowed. |
MetadataConfiguration
| Field | Type | Required | Description |
|---|---|---|---|
destination | Struct(MetadataDestination) | No | The destination information for the S3 Metadata configuration. |
inventory_table_configuration | Struct(InventoryTableConfiguration) | No | The inventory table configuration for a metadata configuration. |
journal_table_configuration | Struct(JournalTableConfiguration) | Yes | The journal table configuration for a metadata configuration. |
MetadataDestination
| Field | Type | Required | Description |
|---|---|---|---|
table_bucket_arn | Arn | No | The Amazon Resource Name (ARN) of the table bucket where the metadata configuration is stored. |
table_bucket_type | Enum (TableBucketType) | Yes | The type of the table bucket where the metadata configuration is stored. The aws value indicates an AWS managed table bucket, and the customer value indicates a customer-managed table bucket. V2 metadata configurations are stored in AWS managed table buckets, and V1 metadata configurations are stored in customer-managed table buckets. |
table_namespace | String | No | The namespace in the table bucket where the metadata tables for a metadata configuration are stored. |
MetadataTableConfiguration
| Field | Type | Required | Description |
|---|---|---|---|
s3_tables_destination | Struct(S3TablesDestination) | Yes | The destination information for the metadata table configuration. The destination table bucket must be in the same Region and AWS-account as the general purpose bucket. The specified metadata table name must be unique within the aws_s3_metadata namespace in the destination table bucket. |
MetadataTableEncryptionConfiguration
| Field | Type | Required | Description |
|---|---|---|---|
kms_key_arn | KmsKeyArn | No | If server-side encryption with KMSlong (KMS) keys (SSE-KMS) is specified, you must also specify the KMS key Amazon Resource Name (ARN). You must specify a customer-managed KMS key that’s located in the same Region as the general purpose bucket that corresponds to the metadata table configuration. |
sse_algorithm | Enum (MetadataTableEncryptionConfigurationSseAlgorithm) | Yes | The encryption type specified for a metadata table. To specify server-side encryption with KMSlong (KMS) keys (SSE-KMS), use the aws:kms value. To specify server-side encryption with Amazon S3 managed keys (SSE-S3), use the AES256 value. |
Metrics
| Field | Type | Required | Description |
|---|---|---|---|
event_threshold | Struct(ReplicationTimeValue) | No | A container specifying the time threshold for emitting the s3:Replication:OperationMissedThreshold event. |
status | Enum (MetricsStatus) | Yes | Specifies whether the replication metrics are enabled. |
MetricsConfiguration
| Field | Type | Required | Description |
|---|---|---|---|
access_point_arn | Arn | No | The access point that was used while performing operations on the object. The metrics configuration only includes objects that meet the filter’s criteria. |
id | String | Yes | The ID used to identify the metrics configuration. This can be any value you choose that helps you identify your metrics configuration. |
prefix | String | No | The prefix that an object must have to be included in the metrics results. |
tag_filters | List<Map> | No | Specifies a list of tag filters to use as a metrics configuration filter. The metrics configuration includes only objects that meet the filter’s criteria. |
NoncurrentVersionExpiration
| Field | Type | Required | Description |
|---|---|---|---|
newer_noncurrent_versions | Int | No | Specifies how many noncurrent versions S3 will retain. If there are this many more recent noncurrent versions, S3 will take the associated action. For more information about noncurrent versions, see Lifecycle configuration elements in the Amazon S3 User Guide. |
noncurrent_days | Int | Yes | Specifies the number of days an object is noncurrent before S3 can perform the associated action. For information about the noncurrent days calculations, see How Amazon S3 Calculates When an Object Became Noncurrent in the Amazon S3 User Guide. |
NoncurrentVersionTransition
| Field | Type | Required | Description |
|---|---|---|---|
newer_noncurrent_versions | Int | No | Specifies how many noncurrent versions S3 will retain. If there are this many more recent noncurrent versions, S3 will take the associated action. For more information about noncurrent versions, see Lifecycle configuration elements in the Amazon S3 User Guide. |
storage_class | Enum (NoncurrentVersionTransitionStorageClass) | Yes | The class of storage used to store the object. |
transition_in_days | Int | Yes | Specifies the number of days an object is noncurrent before Amazon S3 can perform the associated action. For information about the noncurrent days calculations, see How Amazon S3 Calculates How Long an Object Has Been Noncurrent in the Amazon S3 User Guide. |
NotificationConfiguration
| Field | Type | Required | Description |
|---|---|---|---|
event_bridge_configuration | Struct(EventBridgeConfiguration) | No | Enables delivery of events to Amazon EventBridge. |
lambda_configurations | List<LambdaConfiguration> | No | Describes the LAMlong functions to invoke and the events for which to invoke them. |
queue_configurations | List<QueueConfiguration> | No | The Amazon Simple Queue Service queues to publish messages to and the events for which to publish messages. |
topic_configurations | List<TopicConfiguration> | No | The topic to which notifications are sent and the events for which notifications are generated. |
NotificationFilter
| Field | Type | Required | Description |
|---|---|---|---|
s3_key | Struct(S3KeyFilter) | Yes | A container for object key name prefix and suffix filtering rules. |
ObjectLockConfiguration
| Field | Type | Required | Description |
|---|---|---|---|
object_lock_enabled | Enum (ObjectLockEnabled) | No | Indicates whether this bucket has an Object Lock configuration enabled. Enable ObjectLockEnabled when you apply ObjectLockConfiguration to a bucket. |
rule | Struct(ObjectLockRule) | No | Specifies the Object Lock rule for the specified object. Enable this rule when you apply ObjectLockConfiguration to a bucket. If Object Lock is turned on, bucket settings require both Mode and a period of either Days or Years. You cannot specify Days and Years at the same time. For more information, see ObjectLockRule and DefaultRetention. |
ObjectLockRule
| Field | Type | Required | Description |
|---|---|---|---|
default_retention | Struct(DefaultRetention) | No | The default Object Lock retention mode and period that you want to apply to new objects placed in the specified bucket. If Object Lock is turned on, bucket settings require both Mode and a period of either Days or Years. You cannot specify Days and Years at the same time. For more information about allowable values for mode and period, see DefaultRetention. |
OwnershipControls
| Field | Type | Required | Description |
|---|---|---|---|
rules | List<OwnershipControlsRule> | Yes | Specifies the container element for Object Ownership rules. |
OwnershipControlsRule
| Field | Type | Required | Description |
|---|---|---|---|
object_ownership | Enum (ObjectOwnership) | No | Specifies an object ownership rule. |
PartitionedPrefix
| Field | Type | Required | Description |
|---|---|---|---|
partition_date_source | Enum (PartitionDateSource) | No | Specifies the partition date source for the partitioned prefix. PartitionDateSource can be EventTime or DeliveryTime. For DeliveryTime, the time in the log file names corresponds to the delivery time for the log files. For EventTime, The logs delivered are for a specific day only. The year, month, and day correspond to the day on which the event occurred, and the hour, minutes and seconds are set to 00 in the key. |
PublicAccessBlockConfiguration
| Field | Type | Required | Description |
|---|---|---|---|
block_public_acls | Bool | No | Specifies whether Amazon S3 should block public access control lists (ACLs) for this bucket and objects in this bucket. Setting this element to TRUE causes the following behavior: + PUT Bucket ACL and PUT Object ACL calls fail if the specified ACL is public. + PUT Object calls fail if the request includes a public ACL. + PUT Bucket calls fail if the request includes a public ACL. Enabling this setting doesn’t affect existing policies or ACLs. |
block_public_policy | Bool | No | Specifies whether Amazon S3 should block public bucket policies for this bucket. Setting this element to TRUE causes Amazon S3 to reject calls to PUT Bucket policy if the specified bucket policy allows public access. Enabling this setting doesn’t affect existing bucket policies. |
ignore_public_acls | Bool | No | Specifies whether Amazon S3 should ignore public ACLs for this bucket and objects in this bucket. Setting this element to TRUE causes Amazon S3 to ignore all public ACLs on this bucket and objects in this bucket. Enabling this setting doesn’t affect the persistence of any existing ACLs and doesn’t prevent new public ACLs from being set. |
restrict_public_buckets | Bool | No | Specifies whether Amazon S3 should restrict public bucket policies for this bucket. Setting this element to TRUE restricts access to this bucket to only AWS-service principals and authorized users within this account if the bucket has a public policy. Enabling this setting doesn’t affect previously stored bucket policies, except that public and cross-account access within any public bucket policy, including non-public delegation to specific accounts, is blocked. |
QueueConfiguration
| Field | Type | Required | Description |
|---|---|---|---|
event | String | Yes | The Amazon S3 bucket event about which you want to publish messages to Amazon SQS. For more information, see Supported Event Types in the Amazon S3 User Guide. |
filter | Struct(NotificationFilter) | No | The filtering rules that determine which objects trigger notifications. For example, you can create a filter so that Amazon S3 sends notifications only when image files with a .jpg extension are added to the bucket. For more information, see Configuring event notifications using object key name filtering in the Amazon S3 User Guide. |
queue | Arn | Yes | The Amazon Resource Name (ARN) of the Amazon SQS queue to which Amazon S3 publishes a message when it detects events of the specified type. FIFO queues are not allowed when enabling an SQS queue as the event notification destination. |
RecordExpiration
| Field | Type | Required | Description |
|---|---|---|---|
days | Int | No | If you enable journal table record expiration, you can set the number of days to retain your journal table records. Journal table records must be retained for a minimum of 7 days. To set this value, specify any whole number from 7 to 2147483647. For example, to retain your journal table records for one year, set this value to 365. |
expiration | Enum (Expiration) | Yes | Specifies whether journal table record expiration is enabled or disabled. |
RedirectAllRequestsTo
| Field | Type | Required | Description |
|---|---|---|---|
host_name | String | Yes | Name of the host where requests are redirected. |
protocol | Enum (Protocol) | No | Protocol to use when redirecting requests. The default is the protocol that is used in the original request. |
RedirectRule
| Field | Type | Required | Description |
|---|---|---|---|
host_name | String | No | The host name to use in the redirect request. |
http_redirect_code | String | No | The HTTP redirect code to use on the response. Not required if one of the siblings is present. |
protocol | Enum (Protocol) | No | Protocol to use when redirecting requests. The default is the protocol that is used in the original request. |
replace_key_prefix_with | String | No | The object key prefix to use in the redirect request. For example, to redirect requests for all pages with prefix docs/ (objects in the docs/ folder) to documents/, you can set a condition block with KeyPrefixEquals set to docs/ and in the Redirect set ReplaceKeyPrefixWith to /documents. Not required if one of the siblings is present. Can be present only if ReplaceKeyWith is not provided. Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints. |
replace_key_with | String | No | The specific object key to use in the redirect request. For example, redirect request to error.html. Not required if one of the siblings is present. Can be present only if ReplaceKeyPrefixWith is not provided. Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints. |
ReplicaModifications
| Field | Type | Required | Description |
|---|---|---|---|
status | Enum (ReplicaModificationsStatus) | Yes | Specifies whether Amazon S3 replicates modifications on replicas. Allowed values: Enabled |
ReplicationConfiguration
| Field | Type | Required | Description |
|---|---|---|---|
role | IamRoleArn | Yes | The Amazon Resource Name (ARN) of the IAMlong (IAM) role that Amazon S3 assumes when replicating objects. For more information, see How to Set Up Replication in the Amazon S3 User Guide. |
rules | List<ReplicationRule> | Yes | A container for one or more replication rules. A replication configuration must have at least one rule and can contain a maximum of 1,000 rules. |
ReplicationDestination
| Field | Type | Required | Description |
|---|---|---|---|
access_control_translation | Struct(AccessControlTranslation) | No | Specify this only in a cross-account scenario (where source and destination bucket owners are not the same), and you want to change replica ownership to the AWS-account that owns the destination bucket. If this is not specified in the replication configuration, the replicas are owned by same AWS-account that owns the source object. |
account | AwsAccountId | No | Destination bucket owner account ID. In a cross-account scenario, if you direct Amazon S3 to change replica ownership to the AWS-account that owns the destination bucket by specifying the AccessControlTranslation property, this is the account ID of the destination bucket owner. For more information, see Cross-Region Replication Additional Configuration: Change Replica Owner in the Amazon S3 User Guide. If you specify the AccessControlTranslation property, the Account property is required. |
bucket | String | Yes | The Amazon Resource Name (ARN) of the bucket where you want Amazon S3 to store the results. |
encryption_configuration | Struct(EncryptionConfiguration) | No | Specifies encryption-related information. |
metrics | Struct(Metrics) | No | A container specifying replication metrics-related settings enabling replication metrics and events. |
replication_time | Struct(ReplicationTime) | No | A container specifying S3 Replication Time Control (S3 RTC), including whether S3 RTC is enabled and the time when all objects and operations on objects must be replicated. Must be specified together with a Metrics block. |
storage_class | Enum (ReplicationDestinationStorageClass) | No | The storage class to use when replicating objects, such as S3 Standard or reduced redundancy. By default, Amazon S3 uses the storage class of the source object to create the object replica. For valid values, see the StorageClass element of the PUT Bucket replication action in the Amazon S3 API Reference. FSX_OPENZFS is not an accepted value when replicating objects. |
ReplicationRule
| Field | Type | Required | Description |
|---|---|---|---|
delete_marker_replication | Struct(DeleteMarkerReplication) | No | Specifies whether Amazon S3 replicates delete markers. If you specify a Filter in your replication configuration, you must also include a DeleteMarkerReplication element. If your Filter includes a Tag element, the DeleteMarkerReplication````Status must be set to Disabled, because Amazon S3 does not support replicating delete markers for tag-based rules. For an example configuration, see Basic Rule Configuration. For more information about delete marker replication, see Basic Rule Configuration. If you are using an earlier version of the replication configuration, Amazon S3 handles replication of delete markers differently. For more information, see Backward Compatibility. |
destination | Struct(ReplicationDestination) | Yes | A container for information about the replication destination and its configurations including enabling the S3 Replication Time Control (S3 RTC). |
filter | Struct(ReplicationRuleFilter) | No | A filter that identifies the subset of objects to which the replication rule applies. A Filter must specify exactly one Prefix, TagFilter, or an And child element. The use of the filter field indicates that this is a V2 replication configuration. This field isn’t supported in a V1 replication configuration. V1 replication configuration only supports filtering by key prefix. To filter using a V1 replication configuration, add the Prefix directly as a child element of the Rule element. |
id | String(len: ..=255) | No | A unique identifier for the rule. The maximum value is 255 characters. If you don’t specify a value, AWS CloudFormation generates a random ID. When using a V2 replication configuration this property is capitalized as “ID”. |
prefix | String(len: ..=1024) | No | An object key name prefix that identifies the object or objects to which the rule applies. The maximum prefix length is 1,024 characters. To include all objects in a bucket, specify an empty string. To filter using a V1 replication configuration, add the Prefix directly as a child element of the Rule element. Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints. |
priority | Int | No | The priority indicates which rule has precedence whenever two or more replication rules conflict. Amazon S3 will attempt to replicate objects according to all replication rules. However, if there are two or more rules with the same destination bucket, then objects will be replicated according to the rule with the highest priority. The higher the number, the higher the priority. For more information, see Replication in the Amazon S3 User Guide. |
source_selection_criteria | Struct(SourceSelectionCriteria) | No | A container that describes additional filters for identifying the source objects that you want to replicate. You can choose to enable or disable the replication of these objects. |
status | Enum (ReplicationRuleStatus) | Yes | Specifies whether the rule is enabled. |
ReplicationRuleAndOperator
| Field | Type | Required | Description |
|---|---|---|---|
prefix | String | No | An object key name prefix that identifies the subset of objects to which the rule applies. |
tag_filters | List<Map> | No | An array of tags containing key and value pairs. |
ReplicationRuleFilter
| Field | Type | Required | Description |
|---|---|---|---|
and | Struct(ReplicationRuleAndOperator) | No | A container for specifying rule filters. The filters determine the subset of objects to which the rule applies. This element is required only if you specify more than one filter. For example: + If you specify both a Prefix and a TagFilter, wrap these filters in an And tag. + If you specify a filter based on multiple tags, wrap the TagFilter elements in an And tag. |
prefix | String | No | An object key name prefix that identifies the subset of objects to which the rule applies. Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints. |
tag_filter | Map | No | A container for specifying a tag key and value. The rule applies only to objects that have the tag in their tag set. |
ReplicationTime
| Field | Type | Required | Description |
|---|---|---|---|
status | Enum (ReplicationTimeStatus) | Yes | Specifies whether the replication time is enabled. |
time | Struct(ReplicationTimeValue) | Yes | A container specifying the time by which replication should be complete for all objects and operations on objects. |
ReplicationTimeValue
| Field | Type | Required | Description |
|---|---|---|---|
minutes | Int | Yes | Contains an integer specifying time in minutes. Valid value: 15 |
RoutingRule
| Field | Type | Required | Description |
|---|---|---|---|
redirect_rule | Struct(RedirectRule) | Yes | Container for redirect information. You can redirect requests to another host, to another page, or with another protocol. In the event of an error, you can specify a different error code to return. |
routing_rule_condition | Struct(RoutingRuleCondition) | No | A container for describing a condition that must be met for the specified redirect to apply. For example, 1. If request is for pages in the /docs folder, redirect to the /documents folder. 2. If request results in HTTP error 4xx, redirect request to another host where you might process the error. |
RoutingRuleCondition
| Field | Type | Required | Description |
|---|---|---|---|
http_error_code_returned_equals | String | No | The HTTP error code when the redirect is applied. In the event of an error, if the error code equals this value, then the specified redirect is applied. Required when parent element Condition is specified and sibling KeyPrefixEquals is not specified. If both are specified, then both must be true for the redirect to be applied. |
key_prefix_equals | String | No | The object key name prefix when the redirect is applied. For example, to redirect requests for ExamplePage.html, the key prefix will be ExamplePage.html. To redirect request for all pages with the prefix docs/, the key prefix will be docs/, which identifies all objects in the docs/ folder. Required when the parent element Condition is specified and sibling HttpErrorCodeReturnedEquals is not specified. If both conditions are specified, both must be true for the redirect to be applied. |
Rule
| Field | Type | Required | Description |
|---|---|---|---|
abort_incomplete_multipart_upload | Struct(AbortIncompleteMultipartUpload) | No | Specifies a lifecycle rule that stops incomplete multipart uploads to an Amazon S3 bucket. |
expiration_date | String | No | Indicates when objects are deleted from Amazon S3 and Amazon S3 Glacier. The date value must be in ISO 8601 format. The time is always midnight UTC. If you specify an expiration and transition time, you must use the same time unit for both properties (either in days or by date). The expiration time must also be later than the transition time. |
expiration_in_days | Int | No | Indicates the number of days after creation when objects are deleted from Amazon S3 and Amazon S3 Glacier. If you specify an expiration and transition time, you must use the same time unit for both properties (either in days or by date). The expiration time must also be later than the transition time. |
expired_object_delete_marker | Bool | No | Indicates whether Amazon S3 will remove a delete marker without any noncurrent versions. If set to true, the delete marker will be removed if there are no noncurrent versions. This cannot be specified with ExpirationInDays, ExpirationDate, or TagFilters. |
id | String(len: ..=255) | No | Unique identifier for the rule. The value can’t be longer than 255 characters. |
noncurrent_version_expiration | Struct(NoncurrentVersionExpiration) | No | Specifies when noncurrent object versions expire. Upon expiration, S3 permanently deletes the noncurrent object versions. You set this lifecycle configuration action on a bucket that has versioning enabled (or suspended) to request that S3 delete noncurrent object versions at a specific period in the object’s lifetime. |
noncurrent_version_expiration_in_days | Int | No | (Deprecated.) For buckets with versioning enabled (or suspended), specifies the time, in days, between when a new version of the object is uploaded to the bucket and when old versions of the object expire. When object versions expire, Amazon S3 permanently deletes them. If you specify a transition and expiration time, the expiration time must be later than the transition time. |
noncurrent_version_transition | Struct(NoncurrentVersionTransition) | No | (Deprecated.) For buckets with versioning enabled (or suspended), specifies when non-current objects transition to a specified storage class. If you specify a transition and expiration time, the expiration time must be later than the transition time. If you specify this property, don’t specify the NoncurrentVersionTransitions property. |
noncurrent_version_transitions | List<NoncurrentVersionTransition> | No | For buckets with versioning enabled (or suspended), one or more transition rules that specify when non-current objects transition to a specified storage class. If you specify a transition and expiration time, the expiration time must be later than the transition time. If you specify this property, don’t specify the NoncurrentVersionTransition property. |
object_size_greater_than | NumericString(len: ..=20) | No | Specifies the minimum object size in bytes for this rule to apply to. Objects must be larger than this value in bytes. For more information about size based rules, see Lifecycle configuration using size-based rules in the Amazon S3 User Guide. |
object_size_less_than | NumericString(len: ..=20) | No | Specifies the maximum object size in bytes for this rule to apply to. Objects must be smaller than this value in bytes. For more information about sized based rules, see Lifecycle configuration using size-based rules in the Amazon S3 User Guide. |
prefix | String | No | Object key prefix that identifies one or more objects to which this rule applies. Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints. |
status | Enum (RuleStatus) | Yes | If Enabled, the rule is currently being applied. If Disabled, the rule is not currently being applied. |
tag_filters | List<Map> | No | Tags to use to identify a subset of objects to which the lifecycle rule applies. |
transition | Struct(Transition) | No | (Deprecated.) Specifies when an object transitions to a specified storage class. If you specify an expiration and transition time, you must use the same time unit for both properties (either in days or by date). The expiration time must also be later than the transition time. If you specify this property, don’t specify the Transitions property. |
transitions | List<Transition> | No | One or more transition rules that specify when an object transitions to a specified storage class. If you specify an expiration and transition time, you must use the same time unit for both properties (either in days or by date). The expiration time must also be later than the transition time. If you specify this property, don’t specify the Transition property. |
S3KeyFilter
| Field | Type | Required | Description |
|---|---|---|---|
rules | List<FilterRule> | Yes | A list of containers for the key-value pair that defines the criteria for the filter rule. |
S3TablesDestination
| Field | Type | Required | Description |
|---|---|---|---|
table_arn | Arn | No | The Amazon Resource Name (ARN) for the metadata table in the metadata table configuration. The specified metadata table name must be unique within the aws_s3_metadata namespace in the destination table bucket. |
table_bucket_arn | Arn | Yes | The Amazon Resource Name (ARN) for the table bucket that’s specified as the destination in the metadata table configuration. The destination table bucket must be in the same Region and AWS-account as the general purpose bucket. |
table_name | String | Yes | The name for the metadata table in your metadata table configuration. The specified metadata table name must be unique within the aws_s3_metadata namespace in the destination table bucket. |
table_namespace | String | No | The table bucket namespace for the metadata table in your metadata table configuration. This value is always aws_s3_metadata. |
ServerSideEncryptionByDefault
| Field | Type | Required | Description |
|---|---|---|---|
kms_master_key_id | KmsKeyId | No | AWS Key Management Service (KMS) customer managed key ID to use for the default encryption. + General purpose buckets - This parameter is allowed if and only if SSEAlgorithm is set to aws:kms or aws:kms:dsse. + Directory buckets - This parameter is allowed if and only if SSEAlgorithm is set to aws:kms. You can specify the key ID, key alias, or the Amazon Resource Name (ARN) of the KMS key. + Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab + Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab + Key Alias: alias/alias-name If you are using encryption with cross-account or AWS service operations, you must use a fully qualified KMS key ARN. For more information, see Using encryption for cross-account operations. + General purpose buckets - If you’re specifying a customer managed KMS key, we recommend using a fully qualified KMS key ARN. If you use a KMS key alias instead, then KMS resolves the key within the requester?s account. This behavior can result in data that’s encrypted with a KMS key that belongs to the requester, and not the bucket owner. Also, if you use a key ID, you can run into a LogDestination undeliverable error when creating a VPC flow log. + Directory buckets - When you specify an customer managed key for encryption in your directory bucket, only use the key ID or key ARN. The key alias format of the KMS key isn’t supported. Amazon S3 only supports symmetric encryption KMS keys. For more information, see Asymmetric keys in KMS in the Key Management Service Developer Guide. |
sse_algorithm | Enum (ServerSideEncryptionByDefaultSseAlgorithm) | Yes | Server-side encryption algorithm to use for the default encryption. For directory buckets, there are only two supported values for server-side encryption: AES256 and aws:kms. |
ServerSideEncryptionRule
| Field | Type | Required | Description |
|---|---|---|---|
blocked_encryption_types | Struct(BlockedEncryptionTypes) | No | A bucket-level setting for Amazon S3 general purpose buckets used to prevent the upload of new objects encrypted with the specified server-side encryption type. For example, blocking an encryption type will block PutObject, CopyObject, PostObject, multipart upload, and replication requests to the bucket for objects with the specified encryption type. However, you can continue to read and list any pre-existing objects already encrypted with the specified encryption type. For more information, see Blocking or unblocking SSE-C for a general purpose bucket. Currently, this parameter only supports blocking or unblocking server-side encryption with customer-provided keys (SSE-C). For more information about SSE-C, see Using server-side encryption with customer-provided keys (SSE-C). |
bucket_key_enabled | Bool | No | Specifies whether Amazon S3 should use an S3 Bucket Key with server-side encryption using KMS (SSE-KMS) for new objects in the bucket. Existing objects are not affected. Setting the BucketKeyEnabled element to true causes Amazon S3 to use an S3 Bucket Key. By default, S3 Bucket Key is not enabled. For more information, see Amazon S3 Bucket Keys in the Amazon S3 User Guide. |
server_side_encryption_by_default | Struct(ServerSideEncryptionByDefault) | No | Specifies the default server-side encryption to apply to new objects in the bucket. If a PUT Object request doesn’t specify any server-side encryption, this default encryption will be applied. |
SourceSelectionCriteria
| Field | Type | Required | Description |
|---|---|---|---|
replica_modifications | Struct(ReplicaModifications) | No | A filter that you can specify for selection for modifications on replicas. |
sse_kms_encrypted_objects | Struct(SseKmsEncryptedObjects) | No | A container for filter information for the selection of Amazon S3 objects encrypted with AWS KMS. |
SseKmsEncryptedObjects
| Field | Type | Required | Description |
|---|---|---|---|
status | Enum (SseKmsEncryptedObjectsStatus) | Yes | Specifies whether Amazon S3 replicates objects created with server-side encryption using an AWS KMS key stored in AWS Key Management Service. |
StorageClassAnalysis
| Field | Type | Required | Description |
|---|---|---|---|
data_export | Struct(DataExport) | No | Specifies how data related to the storage class analysis for an Amazon S3 bucket should be exported. |
TargetObjectKeyFormat
| Field | Type | Required | Description |
|---|---|---|---|
partitioned_prefix | Struct(PartitionedPrefix) | No | |
simple_prefix | Map | No | This format defaults the prefix to the given log file prefix for delivering server access log file. |
Tiering
| Field | Type | Required | Description |
|---|---|---|---|
access_tier | Enum (AccessTier) | Yes | S3 Intelligent-Tiering access tier. See Storage class for automatically optimizing frequently and infrequently accessed objects for a list of access tiers in the S3 Intelligent-Tiering storage class. |
days | Int | Yes | The number of consecutive days of no access after which an object will be eligible to be transitioned to the corresponding tier. The minimum number of days specified for Archive Access tier must be at least 90 days and Deep Archive Access tier must be at least 180 days. The maximum can be up to 2 years (730 days). |
TopicConfiguration
| Field | Type | Required | Description |
|---|---|---|---|
event | String | Yes | The Amazon S3 bucket event about which to send notifications. For more information, see Supported Event Types in the Amazon S3 User Guide. |
filter | Struct(NotificationFilter) | No | The filtering rules that determine for which objects to send notifications. For example, you can create a filter so that Amazon S3 sends notifications only when image files with a .jpg extension are added to the bucket. |
topic | Arn | Yes | The Amazon Resource Name (ARN) of the Amazon SNS topic to which Amazon S3 publishes a message when it detects events of the specified type. |
Transition
| Field | Type | Required | Description |
|---|---|---|---|
storage_class | Enum (TransitionStorageClass) | Yes | The storage class to which you want the object to transition. |
transition_date | String | No | Indicates when objects are transitioned to the specified storage class. The date value must be in ISO 8601 format. The time is always midnight UTC. |
transition_in_days | Int | No | Indicates the number of days after creation when objects are transitioned to the specified storage class. If the specified storage class is INTELLIGENT_TIERING, GLACIER_IR, GLACIER, or DEEP_ARCHIVE, valid values are 0 or positive integers. If the specified storage class is STANDARD_IA or ONEZONE_IA, valid values are positive integers greater than 30. Be aware that some storage classes have a minimum storage duration and that you’re charged for transitioning objects before their minimum storage duration. For more information, see Constraints and considerations for transitions in the Amazon S3 User Guide. |
VersioningConfiguration
| Field | Type | Required | Description |
|---|---|---|---|
status | Enum (VersioningConfigurationStatus) | Yes | The versioning state of the bucket. |
WebsiteConfiguration
| Field | Type | Required | Description |
|---|---|---|---|
error_document | String | No | The name of the error document for the website. |
index_document | String | No | The name of the index document for the website. |
redirect_all_requests_to | Struct(RedirectAllRequestsTo) | No | The redirect behavior for every request to this bucket’s website endpoint. If you specify this property, you can’t specify any other property. |
routing_rules | List<RoutingRule> | No | Rules that define when a redirect is applied and the redirect behavior. |
Attribute Reference
arn
- Type: Arn
domain_name
- Type: String
dual_stack_domain_name
- Type: String
regional_domain_name
- Type: String
website_url
- Type: String(uri)
AWS Provider
The aws provider manages AWS resources through native AWS SDK APIs (EC2, S3).
Configuration
provider aws {
region = aws.Region.ap_northeast_1
}
Usage
Resources are defined using the aws.<resource_type> syntax:
let vpc = aws.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 = aws.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 = aws.ec2_vpc.InstanceTenancy.default
aws.ec2.internet_gateway
CloudFormation Type: AWS::EC2::InternetGateway
Describes an internet gateway.
Example
let vpc = aws.ec2.vpc {
cidr_block = "10.0.0.0/16"
tags = {
Environment = "example"
}
}
let igw = aws.ec2.internet_gateway {
vpc_id = vpc.vpc_id
tags = {
Environment = "example"
}
}
Argument Reference
tags
- Type: Map
- Required: No
The tags for the resource.
Attribute Reference
internet_gateway_id
- Type: internet_gateway_id
aws.ec2.route_table
CloudFormation Type: AWS::EC2::RouteTable
Describes a route table.
Example
let vpc = aws.ec2.vpc {
cidr_block = "10.0.0.0/16"
tags = {
Environment = "example"
}
}
let rt = aws.ec2.route_table {
vpc_id = vpc.vpc_id
tags = {
Environment = "example"
}
}
Argument Reference
vpc_id
- Type: VpcId
- Required: Yes
The ID of the VPC.
tags
- Type: Map
- Required: No
The tags for the resource.
Attribute Reference
route_table_id
- Type: route_table_id
aws.ec2.route
CloudFormation Type: AWS::EC2::Route
Describes a route in a route table.
Example
let vpc = aws.ec2.vpc {
cidr_block = "10.0.0.0/16"
tags = {
Environment = "example"
}
}
let igw = aws.ec2.internet_gateway {
vpc_id = vpc.vpc_id
tags = {
Environment = "example"
}
}
let rt = aws.ec2.route_table {
vpc_id = vpc.vpc_id
tags = {
Environment = "example"
}
}
let route = aws.ec2.route {
route_table_id = rt.route_table_id
destination_cidr_block = "0.0.0.0/0"
gateway_id = igw.internet_gateway_id
}
Argument Reference
destination_cidr_block
- Type: Ipv4Cidr
- Required: No
The IPv4 CIDR address block used for the destination match. Routing decisions are based on the most specific match. We modify the specified CIDR block to its canonical form; for example, if you specify 100.68.0.18/18, we modify it to 100.68.0.0/18.
gateway_id
- Type: GatewayId
- Required: No
The ID of an internet gateway or virtual private gateway attached to your VPC.
nat_gateway_id
- Type: nat_gateway_id
- Required: No
[IPv4 traffic only] The ID of a NAT gateway.
route_table_id
- Type: route_table_id
- Required: Yes
The ID of the route table for the route.
aws.ec2.security_group_egress
CloudFormation Type: AWS::EC2::SecurityGroupEgress
Describes a security group rule.
Example
let vpc = aws.ec2.vpc {
cidr_block = "10.0.0.0/16"
tags = {
Environment = "example"
}
}
let sg = aws.ec2.security_group {
group_name = "carina-example-sg-egress"
description = "SG for egress rule example"
vpc_id = vpc.vpc_id
tags = {
Environment = "example"
}
}
let egress = aws.ec2.security_group_egress {
group_id = sg.group_id
description = "Allow HTTPS outbound"
ip_protocol = tcp
from_port = 443
to_port = 443
cidr_ip = "0.0.0.0/0"
}
Argument Reference
cidr_ip
- Type: Ipv4Cidr
- Required: No
Not supported. Use IP permissions instead.
cidr_ipv6
- Type: Ipv6Cidr
- Required: No
The IPv6 CIDR range.
description
- Type: String
- Required: No
The security group rule description.
destination_prefix_list_id
- Type: PrefixListId
- Required: No
The ID of the destination prefix list.
from_port
- Type: Int(-1..=65535)
- Required: No
Not supported. Use IP permissions instead.
group_id
- Type: SecurityGroupId
- Required: Yes
The ID of the security group.
ip_protocol
- Type: Enum (IpProtocol)
- Required: Yes
Not supported. Use IP permissions instead.
source_security_group_name
- Type: String
- Required: No
Not supported. Use IP permissions instead.
source_security_group_owner_id
- Type: AwsAccountId
- Required: No
Not supported. Use IP permissions instead.
to_port
- Type: Int(-1..=65535)
- Required: No
Not supported. Use IP permissions instead.
destination_security_group_id
- Type: SecurityGroupId
- Required: No
The ID of the destination security group.
Enum Values
ip_protocol (IpProtocol)
| Value | DSL Identifier |
|---|---|
tcp | aws.ec2.security_group_egress.IpProtocol.tcp |
udp | aws.ec2.security_group_egress.IpProtocol.udp |
icmp | aws.ec2.security_group_egress.IpProtocol.icmp |
icmpv6 | aws.ec2.security_group_egress.IpProtocol.icmpv6 |
-1 | aws.ec2.security_group_egress.IpProtocol.all |
Shorthand formats: tcp or IpProtocol.tcp
Attribute Reference
security_group_rule_id
- Type: SecurityGroupRuleId
aws.ec2.security_group_ingress
CloudFormation Type: AWS::EC2::SecurityGroupIngress
Describes a security group rule.
Example
let vpc = aws.ec2.vpc {
cidr_block = "10.0.0.0/16"
tags = {
Environment = "example"
}
}
let sg = aws.ec2.security_group {
group_name = "carina-example-sg-ingress"
description = "SG for ingress rule example"
vpc_id = vpc.vpc_id
tags = {
Environment = "example"
}
}
let ingress = aws.ec2.security_group_ingress {
group_id = sg.group_id
description = "Allow HTTPS from VPC"
ip_protocol = tcp
from_port = 443
to_port = 443
cidr_ip = "10.0.0.0/16"
}
Argument Reference
cidr_ip
- Type: Ipv4Cidr
- Required: No
The IPv4 address range, in CIDR format. Amazon Web Services canonicalizes IPv4 and IPv6 CIDRs. For example, if you specify 100.68.0.18/18 for the CIDR block, Amazon Web Services canonicalizes the CIDR block to 100.68.0.0/18. Any subsequent DescribeSecurityGroups and DescribeSecurityGroupRules calls will return the canonicalized form of the CIDR block. Additionally, if you attempt to add another rule with the non-canonical form of the CIDR (such as 100.68.0.18/18) and there is already a rule for the canonicalized form of the CIDR block (such as 100.68.0.0/18), the API throws an duplicate rule error. To specify an IPv6 address range, use IP permissions instead. To specify multiple rules and descriptions for the rules, use IP permissions instead.
cidr_ipv6
- Type: Ipv6Cidr
- Required: No
The IPv6 CIDR range.
description
- Type: String
- Required: No
The security group rule description.
from_port
- Type: Int(-1..=65535)
- Required: No
If the protocol is TCP or UDP, this is the start of the port range. If the protocol is ICMP, this is the ICMP type or -1 (all ICMP types). To specify multiple rules and descriptions for the rules, use IP permissions instead.
group_id
- Type: SecurityGroupId
- Required: No
The ID of the security group.
group_name
- Type: String
- Required: No
[Default VPC] The name of the security group. For security groups for a default VPC you can specify either the ID or the name of the security group. For security groups for a nondefault VPC, you must specify the ID of the security group.
ip_protocol
- Type: Enum (IpProtocol)
- Required: Yes
The IP protocol name (tcp, udp, icmp) or number (see Protocol Numbers). To specify all protocols, use -1. To specify icmpv6, use IP permissions instead. If you specify a protocol other than one of the supported values, traffic is allowed on all ports, regardless of any ports that you specify. To specify multiple rules and descriptions for the rules, use IP permissions instead.
source_prefix_list_id
- Type: PrefixListId
- Required: No
The ID of the source prefix list.
source_security_group_name
- Type: String
- Required: No
[Default VPC] The name of the source security group. The rule grants full ICMP, UDP, and TCP access. To create a rule with a specific protocol and port range, specify a set of IP permissions instead.
source_security_group_owner_id
- Type: AwsAccountId
- Required: No
The Amazon Web Services account ID for the source security group, if the source security group is in a different account. The rule grants full ICMP, UDP, and TCP access. To create a rule with a specific protocol and port range, use IP permissions instead.
to_port
- Type: Int(-1..=65535)
- Required: No
If the protocol is TCP or UDP, this is the end of the port range. If the protocol is ICMP, this is the ICMP code or -1 (all ICMP codes). If the start port is -1 (all ICMP types), then the end port must be -1 (all ICMP codes). To specify multiple rules and descriptions for the rules, use IP permissions instead.
source_security_group_id
- Type: SecurityGroupId
- Required: No
The ID of the source security group.
Enum Values
ip_protocol (IpProtocol)
| Value | DSL Identifier |
|---|---|
tcp | aws.ec2.security_group_ingress.IpProtocol.tcp |
udp | aws.ec2.security_group_ingress.IpProtocol.udp |
icmp | aws.ec2.security_group_ingress.IpProtocol.icmp |
icmpv6 | aws.ec2.security_group_ingress.IpProtocol.icmpv6 |
-1 | aws.ec2.security_group_ingress.IpProtocol.all |
Shorthand formats: tcp or IpProtocol.tcp
Attribute Reference
security_group_rule_id
- Type: SecurityGroupRuleId
aws.ec2.security_group
CloudFormation Type: AWS::EC2::SecurityGroup
Describes a security group.
Example
let vpc = aws.ec2.vpc {
cidr_block = "10.0.0.0/16"
tags = {
Environment = "example"
}
}
let sg = aws.ec2.security_group {
group_name = "carina-example-sg"
description = "Example security group"
vpc_id = vpc.vpc_id
tags = {
Environment = "example"
}
}
Argument Reference
description
- Type: String
- Required: Yes
A description for the security group. Constraints: Up to 255 characters in length Valid characters: a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=&;{}!$*
group_name
- Type: String
- Required: Yes
The name of the security group. Names are case-insensitive and must be unique within the VPC. Constraints: Up to 255 characters in length. Can’t start with sg-. Valid characters: a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=&;{}!$*
vpc_id
- Type: VpcId
- Required: No
The ID of the VPC. Required for a nondefault VPC.
tags
- Type: Map
- Required: No
The tags for the resource.
Attribute Reference
group_id
- Type: SecurityGroupId
aws.ec2.subnet
CloudFormation Type: AWS::EC2::Subnet
Describes a subnet.
Example
let vpc = aws.ec2.vpc {
cidr_block = "10.0.0.0/16"
tags = {
Environment = "example"
}
}
let subnet = aws.ec2.subnet {
vpc_id = vpc.vpc_id
cidr_block = "10.0.1.0/24"
availability_zone = aws.AvailabilityZone.ap_northeast_1a
tags = {
Environment = "example"
}
}
Argument Reference
assign_ipv6_address_on_creation
- Type: Bool
- Required: No
Indicates whether a network interface created in this subnet (including a network interface created by RunInstances) receives an IPv6 address.
availability_zone
- Type: AvailabilityZone
- Required: No
The Availability Zone or Local Zone for the subnet. Default: Amazon Web Services selects one for you. If you create more than one subnet in your VPC, we do not necessarily select a different zone for each subnet. To create a subnet in a Local Zone, set this value to the Local Zone ID, for example us-west-2-lax-1a. For information about the Regions that support Local Zones, see Available Local Zones. To create a subnet in an Outpost, set this value to the Availability Zone for the Outpost and specify the Outpost ARN.
availability_zone_id
- Type: AvailabilityZoneId
- Required: No
The AZ ID or the Local Zone ID of the subnet.
cidr_block
- Type: Ipv4Cidr
- Required: No
The IPv4 network range for the subnet, in CIDR notation. For example, 10.0.0.0/24. We modify the specified CIDR block to its canonical form; for example, if you specify 100.68.0.18/18, we modify it to 100.68.0.0/18. This parameter is not supported for an IPv6 only subnet.
enable_dns64
- Type: Bool
- Required: No
Indicates whether DNS queries made to the Amazon-provided DNS Resolver in this subnet should return synthetic IPv6 addresses for IPv4-only destinations.
enable_lni_at_device_index
- Type: Int
- Required: No
Indicates the device position for local network interfaces in this subnet. For example, 1 indicates local network interfaces in this subnet are the secondary network interface (eth1).
ipv4_ipam_pool_id
- Type: IpamPoolId
- Required: No
An IPv4 IPAM pool ID for the subnet.
ipv4_netmask_length
- Type: Int(0..=32)
- Required: No
An IPv4 netmask length for the subnet.
ipv6_cidr_block
- Type: Ipv6Cidr
- Required: No
The IPv6 network range for the subnet, in CIDR notation. This parameter is required for an IPv6 only subnet.
ipv6_ipam_pool_id
- Type: IpamPoolId
- Required: No
An IPv6 IPAM pool ID for the subnet.
ipv6_native
- Type: Bool
- Required: No
Indicates whether to create an IPv6 only subnet.
ipv6_netmask_length
- Type: Int(0..=128)
- Required: No
An IPv6 netmask length for the subnet.
map_public_ip_on_launch
- Type: Bool
- Required: No
Indicates whether instances launched in this subnet receive a public IPv4 address. Amazon Web Services charges for all public IPv4 addresses, including public IPv4 addresses associated with running instances and Elastic IP addresses. For more information, see the Public IPv4 Address tab on the Amazon VPC pricing page.
outpost_arn
- Type: Arn
- Required: No
The Amazon Resource Name (ARN) of the Outpost. If you specify an Outpost ARN, you must also specify the Availability Zone of the Outpost subnet.
private_dns_name_options_on_launch
- Type: Struct(PrivateDnsNameOptionsOnLaunch)
- Required: No
The type of hostnames to assign to instances in the subnet at launch. An instance hostname is based on the IPv4 address or ID of the instance.
vpc_id
- Type: VpcId
- Required: Yes
The ID of the VPC.
tags
- Type: Map
- Required: No
The tags for the resource.
Struct Definitions
PrivateDnsNameOptionsOnLaunch
| Field | Type | Required | Description |
|---|---|---|---|
enable_resource_name_dns_aaaa_record | Bool | No | Indicates whether to respond to DNS queries for instance hostname with DNS AAAA records. |
enable_resource_name_dns_a_record | Bool | No | Indicates whether to respond to DNS queries for instance hostnames with DNS A records. |
hostname_type | Enum (HostnameType) | No | The type of hostname for EC2 instances. For IPv4 only subnets, an instance DNS name must be based on… |
Attribute Reference
subnet_id
- Type: SubnetId
aws.ec2.vpc
CloudFormation Type: AWS::EC2::VPC
Describes a VPC.
Example
let vpc = aws.ec2.vpc {
cidr_block = "10.0.0.0/16"
enable_dns_support = true
enable_dns_hostnames = true
instance_tenancy = aws.ec2.vpc.InstanceTenancy.default
tags = {
Environment = "example"
}
}
Argument Reference
cidr_block
- Type: Ipv4Cidr
- Required: No
The IPv4 network range for the VPC, in CIDR notation. For example, 10.0.0.0/16. We modify the specified CIDR block to its canonical form; for example, if you specify 100.68.0.18/18, we modify it to 100.68.0.0/18.
instance_tenancy
- Type: Enum (InstanceTenancy)
- Required: No
The tenancy options for instances launched into the VPC. For default, instances are launched with shared tenancy by default. You can launch instances with any tenancy into a shared tenancy VPC. For dedicated, instances are launched as dedicated tenancy instances by default. You can only launch instances with a tenancy of dedicated or host into a dedicated tenancy VPC. Important: The host value cannot be used with this parameter. Use the default or dedicated values only. Default: default
ipv4_ipam_pool_id
- Type: IpamPoolId
- Required: No
The ID of an IPv4 IPAM pool you want to use for allocating this VPC’s CIDR. For more information, see What is IPAM? in the Amazon VPC IPAM User Guide.
ipv4_netmask_length
- Type: Int(0..=32)
- Required: No
The netmask length of the IPv4 CIDR you want to allocate to this VPC from an Amazon VPC IP Address Manager (IPAM) pool. For more information about IPAM, see What is IPAM? in the Amazon VPC IPAM User Guide.
tags
- Type: Map
- Required: No
The tags for the resource.
Enum Values
instance_tenancy (InstanceTenancy)
| Value | DSL Identifier |
|---|---|
dedicated | aws.ec2.vpc.InstanceTenancy.dedicated |
default | aws.ec2.vpc.InstanceTenancy.default |
host | aws.ec2.vpc.InstanceTenancy.host |
Shorthand formats: dedicated or InstanceTenancy.dedicated
Attribute Reference
vpc_id
- Type: VpcId
aws.s3.bucket
CloudFormation Type: AWS::S3::Bucket
Example
let bucket = aws.s3.bucket {
bucket = "carina-example-s3-bucket"
versioning_status = aws.s3.bucket.VersioningStatus.Enabled
tags = {
Environment = "example"
}
}
Argument Reference
acl
- Type: Enum (ACL)
- Required: No
The canned ACL to apply to the bucket. This functionality is not supported for directory buckets.
bucket
- Type: String
- Required: Yes
The name of the bucket to create. General purpose buckets - For information about bucket naming restrictions, see Bucket naming rules in the Amazon S3 User Guide. Directory buckets - When you use this operation with a directory bucket, you must use path-style requests in the format https://s3express-control.region-code.amazonaws.com/bucket-name . Virtual-hosted-style requests aren’t supported. Directory bucket names must be unique in the chosen Zone (Availability Zone or Local Zone). Bucket names must also follow the format bucket-base-name–zone-id–x-s3 (for example, DOC-EXAMPLE-BUCKET–usw2-az1–x-s3). For information about bucket naming restrictions, see Directory bucket naming rules in the Amazon S3 User Guide
bucket_namespace
- Type: Enum (BucketNamespace)
- Required: No
Specifies the namespace where you want to create your general purpose bucket. When you create a general purpose bucket, you can choose to create a bucket in the shared global namespace or you can choose to create a bucket in your account regional namespace. Your account regional namespace is a subdivision of the global namespace that only your account can create buckets in. For more information on bucket namespaces, see Namespaces for general purpose buckets. General purpose buckets in your account regional namespace must follow a specific naming convention. These buckets consist of a bucket name prefix that you create, and a suffix that contains your 12-digit Amazon Web Services Account ID, the Amazon Web Services Region code, and ends with -an. Bucket names must follow the format bucket-name-prefix-accountId-region-an (for example, amzn-s3-demo-bucket-111122223333-us-west-2-an). For information about bucket naming restrictions, see Account regional namespace naming rules in the Amazon S3 User Guide. This functionality is not supported for directory buckets.
grant_full_control
- Type: String
- Required: No
Allows grantee the read, write, read ACP, and write ACP permissions on the bucket. This functionality is not supported for directory buckets.
grant_read
- Type: String
- Required: No
Allows grantee to list the objects in the bucket. This functionality is not supported for directory buckets.
grant_read_acp
- Type: String
- Required: No
Allows grantee to read the bucket ACL. This functionality is not supported for directory buckets.
grant_write
- Type: String
- Required: No
Allows grantee to create new objects in the bucket. For the bucket and object owners of existing objects, also allows deletions and overwrites of those objects. This functionality is not supported for directory buckets.
grant_write_acp
- Type: String
- Required: No
Allows grantee to write the ACL for the applicable bucket. This functionality is not supported for directory buckets.
object_lock_enabled_for_bucket
- Type: Bool
- Required: No
Specifies whether you want S3 Object Lock to be enabled for the new bucket. This functionality is not supported for directory buckets.
object_ownership
- Type: Enum (ObjectOwnership)
- Required: No
versioning_status
- Type: Enum (VersioningStatus)
- Required: No
The versioning state of the bucket.
tags
- Type: Map
- Required: No
The tags for the resource.
Enum Values
acl (ACL)
| Value | DSL Identifier |
|---|---|
authenticated-read | aws.s3.bucket.ACL.authenticated_read |
private | aws.s3.bucket.ACL.private |
public-read | aws.s3.bucket.ACL.public_read |
public-read-write | aws.s3.bucket.ACL.public_read_write |
Shorthand formats: authenticated_read or ACL.authenticated_read
bucket_namespace (BucketNamespace)
| Value | DSL Identifier |
|---|---|
account-regional | aws.s3.bucket.BucketNamespace.account_regional |
global | aws.s3.bucket.BucketNamespace.global |
Shorthand formats: account_regional or BucketNamespace.account_regional
object_ownership (ObjectOwnership)
| Value | DSL Identifier |
|---|---|
BucketOwnerEnforced | aws.s3.bucket.ObjectOwnership.BucketOwnerEnforced |
BucketOwnerPreferred | aws.s3.bucket.ObjectOwnership.BucketOwnerPreferred |
ObjectWriter | aws.s3.bucket.ObjectOwnership.ObjectWriter |
Shorthand formats: BucketOwnerEnforced or ObjectOwnership.BucketOwnerEnforced
versioning_status (VersioningStatus)
| Value | DSL Identifier |
|---|---|
Enabled | aws.s3.bucket.VersioningStatus.Enabled |
Suspended | aws.s3.bucket.VersioningStatus.Suspended |
Shorthand formats: Enabled or VersioningStatus.Enabled
aws.sts.caller_identity
CloudFormation Type: AWS::STS::CallerIdentity
Attribute Reference
account_id
- Type: AwsAccountId
arn
- Type: Arn
user_id
- Type: String