AWS Amazon EC2 Transit Gateway Route Table Propagation

This page shows how to write Terraform and CloudFormation for Amazon EC2 Transit Gateway Route Table Propagation and write them securely.

aws_ec2_transit_gateway_route_table_propagation_table_propagation (Terraform)

The Transit Gateway Route Table Propagation in Amazon EC2 can be configured in Terraform with the resource name aws_ec2_transit_gateway_route_table_propagation_table_propagation. The following sections describe how to use the resource and its parameters.

Example Usage from GitHub

An example could not be found in GitHub.

Review your Terraform file for AWS best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

The following arguments are supported:

  • transit_gateway_attachment_id - (Required) Identifier of EC2 Transit Gateway Attachment.
  • transit_gateway_route_table_id - (Required) Identifier of EC2 Transit Gateway Route Table.

In addition to all arguments above, the following attributes are exported:

  • id - EC2 Transit Gateway Route Table identifier combined with EC2 Transit Gateway Attachment identifier
  • resource_id - Identifier of the resource
  • resource_type - Type of the resource

Explanation in Terraform Registry

Manages an EC2 Transit Gateway Route Table propagation.

Tips: Best Practices for The Other AWS Amazon EC2 Resources

In addition to the aws_default_vpc, AWS Amazon EC2 has the other resources that should be configured for security reasons. Please check some examples of those resources and precautions.

risk-label

aws_default_vpc

Ensure to avoid using default VPC

It is better to define the own VPC and use it.

risk-label

aws_network_acl_rule

Ensure your network ACL rule blocks unwanted inbound traffic

It is better to block unwanted inbound traffic.

risk-label

aws_ebs_volume

Ensure to use a customer-managed key for EBS volume encryption

It is better to use a customer-managed key for EBS volume encryption. It can be gain more control over the encryption by using customer-managed keys (CMK).

risk-label

aws_instance

Ensure to avoid storing AWS access keys in user data

It is better to avoid storing AWS access keys in user data. `aws_iam_instance_profile` could be used instead.

risk-label

aws_security_group

Ensure your security group blocks unwanted inbound traffic

It is better to block unwanted inbound traffic.

Review your AWS Amazon EC2 settings

In addition to the above, there are other security points you should be aware of making sure that your .tf files are protected in Shisho Cloud.

AWS::EC2::TransitGatewayRouteTablePropagation (CloudFormation)

The TransitGatewayRouteTablePropagation in EC2 can be configured in CloudFormation with the resource name AWS::EC2::TransitGatewayRouteTablePropagation. The following sections describe 10 examples of how to use the resource and its parameters.

Example Usage from GitHub

1.OCTANK_TGW.yml#L76
    Type: "AWS::EC2::TransitGatewayRouteTablePropagation"
    Properties:
      TransitGatewayAttachmentId: !Ref AttachAOCTANK
      TransitGatewayRouteTableId: !Ref RTRed

  PropagateAOCTANKGreen:
transit-attach-tenant.yml#L66
    Type: AWS::EC2::TransitGatewayRouteTablePropagation
    Properties:
      TransitGatewayAttachmentId: !Ref pTgwAttachId
      TransitGatewayRouteTableId: !Ref pManagementServicesRtId
  rTenantVpcPropagationToInspectionRt:
    Condition: cEnableVpcFirewall
transit-gateway-route-tables-inspection.yml#L55
    Type: AWS::EC2::TransitGatewayRouteTablePropagation
    Properties:
      TransitGatewayAttachmentId: !Ref pDmzVpcTgwAttachIdId
      TransitGatewayRouteTableId: !Ref pInspectionRtId
  rInspectionRtPropagationManagementServicesVpc:
    Type: AWS::EC2::TransitGatewayRouteTablePropagation
network.yml#L30
    Type: AWS::EC2::TransitGatewayRouteTablePropagation
    Properties:
      TransitGatewayAttachmentId: !Ref NewAttachmentID
      TransitGatewayRouteTableId: !ImportValue SharedServicesTGWRTID
  # "Propagate" the CIDRblock on the AppIsolated Prod route table
  AppIsolatedProdTGWRouteTableRoutePropagation:
shared-services.yml#L30
    Type: AWS::EC2::TransitGatewayRouteTablePropagation
    Properties:
      TransitGatewayAttachmentId: !Ref NewAttachmentID
      TransitGatewayRouteTableId: !ImportValue NetworkTGWRTID
  # "Propagate" the CIDRblock on the Shared Service route table
  SharedServicesTGWRouteTableRoutePropagation:
EC2TransitGatewayRouteTablePropagationSpecification.json#L3
    "AWS::EC2::TransitGatewayRouteTablePropagation": {
      "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-transitgatewayroutetablepropagation.html",
      "Properties": {
        "TransitGatewayRouteTableId": {
          "Required": true,
          "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-transitgatewayroutetablepropagation.html#cfn-ec2-transitgatewayroutetablepropagation-transitgatewayroutetableid",
EC2TransitGatewayRouteTablePropagationSpecification.json#L3
    "AWS::EC2::TransitGatewayRouteTablePropagation": {
      "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-transitgatewayroutetablepropagation.html",
      "Properties": {
        "TransitGatewayRouteTableId": {
          "Required": true,
          "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-transitgatewayroutetablepropagation.html#cfn-ec2-transitgatewayroutetablepropagation-transitgatewayroutetableid",
EC2TransitGatewayRouteTablePropagationSpecification.json#L3
    "AWS::EC2::TransitGatewayRouteTablePropagation": {
      "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-transitgatewayroutetablepropagation.html",
      "Properties": {
        "TransitGatewayRouteTableId": {
          "Required": true,
          "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-transitgatewayroutetablepropagation.html#cfn-ec2-transitgatewayroutetablepropagation-transitgatewayroutetableid",
EC2TransitGatewayRouteTablePropagationSpecification.json#L3
    "AWS::EC2::TransitGatewayRouteTablePropagation": {
      "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-transitgatewayroutetablepropagation.html",
      "Properties": {
        "TransitGatewayRouteTableId": {
          "Required": true,
          "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-transitgatewayroutetablepropagation.html#cfn-ec2-transitgatewayroutetablepropagation-transitgatewayroutetableid",
EC2TransitGatewayRouteTablePropagationSpecification.json#L3
    "AWS::EC2::TransitGatewayRouteTablePropagation": {
      "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-transitgatewayroutetablepropagation.html",
      "Properties": {
        "TransitGatewayRouteTableId": {
          "Required": true,
          "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-transitgatewayroutetablepropagation.html#cfn-ec2-transitgatewayroutetablepropagation-transitgatewayroutetableid",

Parameters

Explanation in CloudFormation Registry

Enables the specified attachment to propagate routes to the specified propagation route table.

For more information about enabling transit gateway route propagation, see EnableTransitGatewayRouteTablePropagation in the Amazon EC2 API Reference.

Frequently asked questions

What is AWS Amazon EC2 Transit Gateway Route Table Propagation?

AWS Amazon EC2 Transit Gateway Route Table Propagation is a resource for Amazon EC2 of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.

Where can I find the example code for the AWS Amazon EC2 Transit Gateway Route Table Propagation?

For CloudFormation, the whchoi98/TGW_CF, awslabs/compliant-framework-for-federal-and-dod-workloads-in-aws-govcloud-us and awslabs/compliant-framework-for-federal-and-dod-workloads-in-aws-govcloud-us source code examples are useful. See the CloudFormation Example section for further details.