-
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
New resource: aws_ec2_managed_prefix_list #14068
Conversation
@roberth-k Thanks for the great contribution 👏.
Yes, I'm working towards support in the |
Thanks @ewbankkit.
The DescribeManagedPrefixLists API is a superset of DescribePrefixLists, even returning AWS's own prefix lists by default. A separate Existing uses of However, it is true that the two API-s are physically separate, so I'm happy to split it out if that's the preferred practice. In any case, I'll move these changes to a separate PR.
It's true that there's no separate API for it, and implementing the |
Do we have any idea when this will be merged and made available for use? |
Any ETA for the release ? |
Per #12690 (comment) it may be a while before this is picked up. In the meanwhile, I recommend using the |
863752c
to
cbddc42
Compare
cbddc42
to
354559c
Compare
The resources have been renamed to
|
Notification of Recent and Upcoming Changes to ContributionsThank you for this contribution! There have been a few recent development changes that affect this pull request. We apologize for the inconvenience, especially if there have been long review delays up until now. Please note that this is automated message from an unmonitored account. See the FAQ for additional information on the maintainer team and review prioritization. If you are unable to complete these updates, please leave a comment for the community and maintainers so someone can potentially continue the work. The maintainers will encourage other contributors to use the existing contribution as the base for additional changes as appropriate. Otherwise, contributions that do not receive updated code or comments from the original contributor may be closed in the future so the maintainers can focus on active items. For the most up to date information about Terraform AWS Provider development, see the Contributing Guide. Additional technical debt changes can be tracked with the As part of updating a pull request with these changes, the most current unit testing and linting will run. These may report issues that were not previously reported. Terraform 0.12 SyntaxReference: #8950 Version 3 and later of the Terraform AWS Provider, which all existing contributions would potentially be added, only supports Terraform 0.12 and later. Certain syntax elements of Terraform 0.11 and earlier show deprecation warnings during runs with Terraform 0.12. Documentation and test configurations, such as those including deprecated string interpolations ( Action Required: Terraform Plugin SDK Version 2Reference: #14551 The Terraform AWS Provider has been upgraded to the latest version of the Terraform Plugin SDK. Generally, most changes to contributions should only involve updating Go import paths in source code files. Please see the referenced issue for additional information. Removal of website/aws.erb FileReference: #14712 Any changes to the Upcoming Change of Git Branch NamingReference: #14292 Development environments will need their upstream Git branch updated from Upcoming Change of GitHub OrganizationReference: #14715 This repository will be migrating from https://github.com/terraform-providers/terraform-provider-aws to https://github.com/hashicorp/terraform-provider-aws. No practitioner or developer action is anticipated and most GitHub functionality will automatically redirect to the new location. Go import paths including |
Any updates on this? |
354559c
to
45eeaf4
Compare
5a29531
to
9a3c7e8
Compare
9a3c7e8
to
efc5819
Compare
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.
Hi @roberth-k 👋 Thank you for updating this pull request. I have provided some initial feedback here, with the biggest item to remove the aws_ec2_managed_prefix_list_entry
resource for now so we can focus on getting the aws_ec2_managed_prefix_list
resource merged in. Please reach out with any questions or let us know if you will not have time to make these updates. 👍
aws/provider.go
Outdated
@@ -599,6 +599,8 @@ func Provider() *schema.Provider { | |||
"aws_ec2_fleet": resourceAwsEc2Fleet(), | |||
"aws_ec2_local_gateway_route": resourceAwsEc2LocalGatewayRoute(), | |||
"aws_ec2_local_gateway_route_table_vpc_association": resourceAwsEc2LocalGatewayRouteTableVpcAssociation(), | |||
"aws_ec2_managed_prefix_list": resourceAwsEc2ManagedPrefixList(), | |||
"aws_ec2_managed_prefix_list_entry": resourceAwsEc2ManagedPrefixListEntry(), |
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.
Due to the complexity of the EC2 API using versioning on the parent resource and needing to handle the concurrency issues on the EC2 API which is ultimately eventually consistent, our preference would be to not introduce this separate resource at this time. That is not to say we would never introduce a new resource like this, however trying to work through all the concurrency issues in this PR seems counterproductive when we can introduce the standalone aws_ec2_managed_prefix_list
resource more immediately. 👍
"aws_ec2_managed_prefix_list_entry": resourceAwsEc2ManagedPrefixListEntry(), |
Type: schema.TypeSet, | ||
Optional: true, | ||
Computed: true, | ||
ConfigMode: schema.SchemaConfigModeAttr, |
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.
New resources should avoid declaring ConfigMode
for now. For more context, it exists on older resources where requiring dynamic
in configurations was a large barrier to upgrading to Terraform CLI 0.12.
ConfigMode: schema.SchemaConfigModeAttr, |
Computed: true, | ||
ConfigMode: schema.SchemaConfigModeAttr, | ||
Elem: prefixListEntrySchema(), | ||
Set: awsPrefixListEntrySetHashFunc, |
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.
We should be able to avoid this custom Set
function here:
Set: awsPrefixListEntrySetHashFunc, |
} | ||
} | ||
|
||
func prefixListEntrySchema() *schema.Resource { |
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.
Given that we will not be including the _entry
resource initially, let's move this inline above. 👍
|
||
output, err := conn.CreateManagedPrefixList(&input) | ||
if err != nil { | ||
return fmt.Errorf("failed to create managed prefix list: %v", err) |
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.
We have some pending linters to setup for this, but preferred to use %w
for returning AWS Go SDK errors:
return fmt.Errorf("failed to create managed prefix list: %v", err) | |
return fmt.Errorf("error creating EC2 Managed Prefix List: %w", err) |
|
||
const testAccAwsEc2ManagedPrefixListConfig_basic_create = ` | ||
resource "aws_ec2_managed_prefix_list" "test" { | ||
name = "tf-test-basic-create" |
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.
We should randomize the naming of these resources -- please see the Contributing Guide for information about this (or searching for rName
usage elsewhere).
|
||
const testAccAwsEc2ManagedPrefixListConfig_disappears = ` | ||
resource "aws_ec2_managed_prefix_list" "test" { | ||
name = "tf-test-disappears" |
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.
Similarly here, regarding naming randomization.
resourceName := "aws_ec2_managed_prefix_list.test" | ||
pl := ec2.ManagedPrefixList{} | ||
|
||
checkName := func(name string) resource.TestCheckFunc { |
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.
Similarly here, regarding using ImportStateVerify
instead.
resourceName := "aws_ec2_managed_prefix_list.test" | ||
pl := ec2.ManagedPrefixList{} | ||
|
||
checkTags := func(m map[string]string) resource.TestCheckFunc { |
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.
Similarly here, regarding using ImportStateVerify
instead.
~> **NOTE on Prefix Lists and Prefix List Entries:** Terraform currently | ||
provides both a standalone [Managed Prefix List Entry resource](ec2_managed_prefix_list_entry.html), | ||
and a Prefix List resource with an `entry` set defined in-line. At this time you | ||
cannot use a Prefix List with in-line rules in conjunction with any Prefix List Entry | ||
resources. Doing so will cause a conflict of rule settings and will unpredictably | ||
fail or overwrite rules. | ||
|
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.
Won't be needed:
~> **NOTE on Prefix Lists and Prefix List Entries:** Terraform currently | |
provides both a standalone [Managed Prefix List Entry resource](ec2_managed_prefix_list_entry.html), | |
and a Prefix List resource with an `entry` set defined in-line. At this time you | |
cannot use a Prefix List with in-line rules in conjunction with any Prefix List Entry | |
resources. Doing so will cause a conflict of rule settings and will unpredictably | |
fail or overwrite rules. |
Please note that I've updated the milestone for this pull request to version 3.22.0, which we expect to release on Thursday as our last release before the new year so its not lingering over the long break. If we do not see the updates prior to Wednesday, we will add commits on top of the existing ones to ensure this is tested and merged in time. 👍 |
@bflad I'll get the changes in now. |
1aa75e0
to
a78644e
Compare
Thank you for your work on this, @roberth-k, pulling in your commits now. 👍 |
This has been released in version 3.22.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
Community Note
Closes #13986
Release note for CHANGELOG:
Update to route tables expected with #14013.
Output from acceptance testing: