Skip to content

Commit a9e3b62

Browse files
committed
Update docs
1 parent 7e139da commit a9e3b62

File tree

2 files changed

+72
-0
lines changed

2 files changed

+72
-0
lines changed

website/docs/r/ec2_transit_gateway_route_table_association.html.markdown

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,42 @@ resource "aws_ec2_transit_gateway_route_table_association" "example" {
1919
}
2020
```
2121

22+
### Direct Connect Gateway Association
23+
24+
When associating a Direct Connect Gateway attachment, reference the `transit_gateway_attachment_id` attribute directly from the `aws_dx_gateway_association` resource (available in v6.5.0+):
25+
26+
```terraform
27+
resource "aws_dx_gateway" "example" {
28+
name = "example"
29+
amazon_side_asn = 64512
30+
}
31+
32+
resource "aws_ec2_transit_gateway" "example" {
33+
description = "example"
34+
}
35+
36+
resource "aws_dx_gateway_association" "example" {
37+
dx_gateway_id = aws_dx_gateway.example.id
38+
associated_gateway_id = aws_ec2_transit_gateway.example.id
39+
40+
allowed_prefixes = [
41+
"10.0.0.0/16",
42+
]
43+
}
44+
45+
resource "aws_ec2_transit_gateway_route_table" "example" {
46+
transit_gateway_id = aws_ec2_transit_gateway.example.id
47+
}
48+
49+
# Correct: Reference the attachment ID directly from the association resource
50+
resource "aws_ec2_transit_gateway_route_table_association" "example" {
51+
transit_gateway_attachment_id = aws_dx_gateway_association.example.transit_gateway_attachment_id
52+
transit_gateway_route_table_id = aws_ec2_transit_gateway_route_table.example.id
53+
}
54+
```
55+
56+
~> **NOTE:** Avoid using the `aws_ec2_transit_gateway_dx_gateway_attachment` data source to retrieve the attachment ID, as this can cause unnecessary resource recreation when unrelated attributes of the Direct Connect Gateway association change (such as `allowed_prefixes`). Always reference the `transit_gateway_attachment_id` attribute directly from the `aws_dx_gateway_association` resource when available.
57+
2258
## Argument Reference
2359

2460
This resource supports the following arguments:

website/docs/r/ec2_transit_gateway_route_table_propagation.html.markdown

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,42 @@ resource "aws_ec2_transit_gateway_route_table_propagation" "example" {
1919
}
2020
```
2121

22+
### Direct Connect Gateway Propagation
23+
24+
When propagating routes from a Direct Connect Gateway attachment, reference the `transit_gateway_attachment_id` attribute directly from the `aws_dx_gateway_association` resource (available in v6.5.0+):
25+
26+
```terraform
27+
resource "aws_dx_gateway" "example" {
28+
name = "example"
29+
amazon_side_asn = 64512
30+
}
31+
32+
resource "aws_ec2_transit_gateway" "example" {
33+
description = "example"
34+
}
35+
36+
resource "aws_dx_gateway_association" "example" {
37+
dx_gateway_id = aws_dx_gateway.example.id
38+
associated_gateway_id = aws_ec2_transit_gateway.example.id
39+
40+
allowed_prefixes = [
41+
"10.0.0.0/16",
42+
]
43+
}
44+
45+
resource "aws_ec2_transit_gateway_route_table" "example" {
46+
transit_gateway_id = aws_ec2_transit_gateway.example.id
47+
}
48+
49+
# Correct: Reference the attachment ID directly from the association resource
50+
resource "aws_ec2_transit_gateway_route_table_propagation" "example" {
51+
transit_gateway_attachment_id = aws_dx_gateway_association.example.transit_gateway_attachment_id
52+
transit_gateway_route_table_id = aws_ec2_transit_gateway_route_table.example.id
53+
}
54+
```
55+
56+
~> **NOTE:** Avoid using the `aws_ec2_transit_gateway_dx_gateway_attachment` data source to retrieve the attachment ID, as this can cause unnecessary resource recreation when unrelated attributes of the Direct Connect Gateway association change (such as `allowed_prefixes`). Always reference the `transit_gateway_attachment_id` attribute directly from the `aws_dx_gateway_association` resource when available.
57+
2258
## Argument Reference
2359

2460
This resource supports the following arguments:

0 commit comments

Comments
 (0)