AWS VPC endpoints for DynamoDB provide secure and private connectivity between VPC resources and DynamoDB without traversing the public internet. For a VPC endpoint to function correctly, it must be associated with one or more route tables, either by setting route_table_ids directly on the aws_vpc_endpoint resource or via a standalone aws_vpc_endpoint_route_table_association resource whose vpc_endpoint_id names the endpoint. If this association is missing, instances within the VPC will not be able to route requests to DynamoDB over the VPC endpoint, potentially forcing traffic through the public internet or causing connectivity failures. This misconfiguration can expose sensitive data to unnecessary network risk and violates best practices for securing internal AWS service communications.
# Regression fixture: vpc_endpoint_id references an unrelated resource
# (aws_route_table) whose local name happens to collide with the real,
# unassociated aws_vpc_endpoint below. Without checking that the
# reference's own type segment is "aws_vpc_endpoint",
# standalone_association_endpoint_names incorrectly treats this as proof
# that "dynamodb-vpce-real" has a standalone association, suppressing
# the finding for the real, unassociated endpoint.
resource"aws_vpc""main12"{cidr_block="10.12.0.0/16"enable_dns_support=true}resource"aws_route_table""dynamodb-vpce-real"{vpc_id=aws_vpc.main12.id}resource"aws_vpc_endpoint""dynamodb-vpce-real"{vpc_id=aws_vpc.main12.idservice_name="com.amazonaws.us-east-1.dynamodb"}resource"aws_vpc_endpoint_route_table_association""fake"{vpc_endpoint_id=aws_route_table.dynamodb-vpce-real.idroute_table_id=aws_route_table.dynamodb-vpce-real.id}
# This endpoint has no route table association at all (no route_table_ids,
# no standalone aws_vpc_endpoint_route_table_association), so it must be
# flagged.
resource"aws_vpc""stack_a"{cidr_block="10.50.0.0/16"enable_dns_support=true}resource"aws_route_table""shared"{vpc_id=aws_vpc.stack_a.id}resource"aws_vpc_endpoint""dynamodb-vpce-stack-a"{vpc_id=aws_vpc.stack_a.idservice_name="com.amazonaws.us-east-1.dynamodb"}
1
2
rulesets:- Terraform / AWS # Rules to enforce / AWS.
Request a personalized demo
Get Started with Datadog
Ask AI
AI-generated responses may be inaccurate. Verify important info.