Skip to content

EC2 transit gateways should have auto accept shared attachments disabled

Ensure transit gateways have auto accept shared attachments feature disabled. If this setting is disabled, then any VPC that attempts to attach to a transit gateway will need to request authorization, and the account that owns the transit gateway will need to accept the authorization.

How to fix

Attribute auto_accept_shared_attachments of aws_ec2_transit_gateway must be "disable".

Implementation options

Choose the option that matches how you manage Terraform. All options satisfy this control.

Option 1: Terraform AWS provider resources

If you manage resources directly, configure the relevant Terraform AWS provider resources to meet this control. See docs for the resources involved: aws_ec2_transit_gateway.

resource "aws_ec2_transit_gateway" "this" {
  auto_accept_shared_attachments = "disable"
}
Which option should I choose?
  • Compliance.tf module (recommended): controls enforced by default and mapped to frameworks.
  • Open source module (terraform-aws-modules): compatible by design with compliance.tf. Same variable names for an easy, low-change migration path when you are ready.
  • Terraform AWS provider resources: manage Terraform resources directly.

Tool mappings

Use these identifiers to cross-reference this control across tools, reports, and evidence.

  • Compliance.tf (CTF) Control: ec2_transit_gateway_auto_cross_account_attachment_disabled

  • AWS Config Managed Rule: EC2_TRANSIT_GATEWAY_AUTO_VPC_ATTACH_DISABLED

  • Checkov Check: CKV_AWS_331

  • Powerpipe Control: aws_compliance.control.ec2_transit_gateway_auto_cross_account_attachment_disabled