-
Notifications
You must be signed in to change notification settings - Fork 9.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
r/aws_(default)_route_table: 'destination_prefix_list_id' attribute can be specified for managed prefix list destinations #17319
Merged
YakDriver
merged 25 commits into
hashicorp:main
from
ewbankkit:f-r/aws_route_table-managed_prefix_list-destination
Mar 29, 2021
Merged
Changes from 23 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
8638d27
r/aws_default_route_table: AWS Wavelength support.
ewbankkit 052f75d
Revert "r/aws_default_route_table: AWS Wavelength support."
ewbankkit 7df1469
r/aws_default_route_table: Add 'arn' attribute.
ewbankkit 621c838
r/aws_route_table: 'destination_prefix_list_id' attribute can be spec…
ewbankkit 985bb3c
Rename CHANGELOG entry file.
ewbankkit ce09aed
Add acceptance test pre-check.
ewbankkit d30ceb5
r/aws_default_route_table: 'destination_prefix_list_id' attribute can…
ewbankkit d8d5437
r/aws_(default)_route_table: Add 'ErrorCheck' to new acceptance tests.
ewbankkit 5c59677
Fix issue when creating default route table that has a route propagation
gpiper14 9be0522
r/aws_default_route_table: Add 'TestAccAWSDefaultRouteTable_RevokeExi…
ewbankkit 6c2cc1f
route_table: fail creation if later read does not find resource
staebler 2fef042
r/aws_route_table: Add 'd.IsNewResource()' check to resource read (#1…
ewbankkit 65d1d7a
r/route_table: Code consistency
YakDriver 1961ca1
r/route_table: Code consistency
YakDriver 3407ddf
r/route_table: Add waiter and status for route table
YakDriver 90b0c97
r/route_table_association: Use waiter for route table status
YakDriver 6c7be9d
r/route_table: Switch to waiter
YakDriver 491cbfd
r/vpn_gateway_route_propagation: Use waiter for route table status
YakDriver 56c538d
r/vpn_gateway_route_propagation: Use correct ID for waiter
YakDriver 43181cd
r/route_table: Avoid changing API errors
YakDriver 960b0d7
r/route_table: Rework waiters and VPN gateway route test
YakDriver 7665057
r/route_table_associations: Check that route table exists
YakDriver ac11d76
r/route_table: Switch to using tfresource Not Found
YakDriver 87fa5bf
r/route_table: Remove unnecessary check
YakDriver f36fc0a
route_table: Add changelog items
YakDriver File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
```release-notes:enhancement | ||
resource/aws_default_route_table: Add `destination_prefix_list_id` attribute | ||
``` | ||
|
||
```release-notes:enhancement | ||
resource/aws_route_table: Add `destination_prefix_list_id` attribute | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ import ( | |
"github.com/hashicorp/aws-sdk-go-base/tfawserr" | ||
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" | ||
tfec2 "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/ec2" | ||
"github.com/terraform-providers/terraform-provider-aws/aws/internal/tfresource" | ||
) | ||
|
||
const ( | ||
|
@@ -257,6 +258,53 @@ const ( | |
NetworkAclEntryPropagationTimeout = 5 * time.Minute | ||
) | ||
|
||
const ( | ||
RouteTableReadyTimeout = 10 * time.Minute | ||
RouteTableDeletedTimeout = 5 * time.Minute | ||
RouteTableUpdateTimeout = 5 * time.Minute | ||
|
||
RouteTableNotFoundChecks = 40 | ||
) | ||
|
||
func RouteTableReady(conn *ec2.EC2, id string) (*ec2.RouteTable, error) { | ||
stateConf := &resource.StateChangeConf{ | ||
Pending: []string{}, | ||
Target: []string{RouteTableStatusReady}, | ||
Refresh: RouteTableStatus(conn, id), | ||
Timeout: RouteTableReadyTimeout, | ||
NotFoundChecks: RouteTableNotFoundChecks, | ||
} | ||
|
||
outputRaw, err := stateConf.WaitForState() | ||
|
||
if output, ok := outputRaw.(*ec2.RouteTable); ok { | ||
return output, err | ||
} | ||
|
||
return nil, err | ||
} | ||
|
||
func RouteTableDeleted(conn *ec2.EC2, id string) (*ec2.RouteTable, error) { | ||
stateConf := &resource.StateChangeConf{ | ||
Pending: []string{RouteTableStatusReady}, | ||
Target: []string{}, | ||
Refresh: RouteTableStatus(conn, id), | ||
Timeout: RouteTableDeletedTimeout, | ||
} | ||
|
||
outputRaw, err := stateConf.WaitForState() | ||
|
||
if tfresource.NotFound(err) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This can go since the status eats |
||
return nil, nil | ||
} | ||
|
||
if output, ok := outputRaw.(*ec2.RouteTable); ok { | ||
return output, err | ||
} | ||
|
||
return nil, err | ||
} | ||
|
||
func SecurityGroupCreated(conn *ec2.EC2, id string, timeout time.Duration) (*ec2.SecurityGroup, error) { | ||
stateConf := &resource.StateChangeConf{ | ||
Pending: []string{SecurityGroupStatusNotFound}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can remove this as it is should not be referenced below.