-
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
Add Tags for resource aws_dms_certificate #17163
Conversation
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.
Welcome @snowsky 👋
It looks like this is your first Pull Request submission to the Terraform AWS Provider! If you haven’t already done so please make sure you have checked out our CONTRIBUTING guide and FAQ to make sure your contribution is adhering to best practice and has all the necessary elements in place for a successful approval.
Also take a look at our FAQ which details how we prioritize Pull Requests for inclusion.
Thanks again, and welcome to the community! 😃
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 @snowsky, thank you for this PR! It's off to a great start, please find my initial comments for review.
In addition to implementing tags
in the Create
function, we'll also want to implement them in the Read
and Update
functions as well. Please refer to our docs page for more info/examples: https://github.com/hashicorp/terraform-provider-aws/blob/master/docs/contributing/contribution-checklists.md#resource-tagging-code-implementation. A good example of tests to go along with the updated implementation can be found in this resource's tests _Tags
func to validate the update and multiple tags:
terraform-provider-aws/aws/resource_aws_ec2_managed_prefix_list_test.go
Lines 190 to 234 in 6e1126c
func TestAccAwsEc2ManagedPrefixList_Tags(t *testing.T) { | |
resourceName := "aws_ec2_managed_prefix_list.test" | |
rName := acctest.RandomWithPrefix("tf-acc-test") | |
resource.ParallelTest(t, resource.TestCase{ | |
PreCheck: func() { testAccPreCheck(t) }, | |
Providers: testAccProviders, | |
CheckDestroy: testAccCheckAwsEc2ManagedPrefixListDestroy, | |
Steps: []resource.TestStep{ | |
{ | |
Config: testAccAwsEc2ManagedPrefixListConfig_Tags1(rName, "key1", "value1"), | |
Check: resource.ComposeAggregateTestCheckFunc( | |
testAccAwsEc2ManagedPrefixListExists(resourceName), | |
resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), | |
resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), | |
resource.TestCheckResourceAttr(resourceName, "version", "1"), | |
), | |
}, | |
{ | |
ResourceName: resourceName, | |
ImportState: true, | |
ImportStateVerify: true, | |
}, | |
{ | |
Config: testAccAwsEc2ManagedPrefixListConfig_Tags2(rName, "key1", "value1updated", "key2", "value2"), | |
Check: resource.ComposeAggregateTestCheckFunc( | |
testAccAwsEc2ManagedPrefixListExists(resourceName), | |
resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), | |
resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), | |
resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), | |
resource.TestCheckResourceAttr(resourceName, "version", "1"), | |
), | |
}, | |
{ | |
Config: testAccAwsEc2ManagedPrefixListConfig_Tags1(rName, "key2", "value2"), | |
Check: resource.ComposeAggregateTestCheckFunc( | |
testAccAwsEc2ManagedPrefixListExists(resourceName), | |
resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), | |
resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), | |
resource.TestCheckResourceAttr(resourceName, "version", "1"), | |
), | |
}, | |
}, | |
}) | |
} |
If you have any additional implementation/testing questions, lmk :)
@anGie44, could you please take another look? Thanks. |
thanks again @snowsky and apologies for the delay! the changes overall look good, to get this into an upcoming release i'm going to add to the Output of acceptance test:
|
Thanks @anGie44, learned from your commit :) |
This has been released in version 3.30.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
Relates OR Closes #17092
Release note for CHANGELOG:
Output from acceptance testing: