Skip to content
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

Merged
merged 8 commits into from
Feb 24, 2021
Merged

Conversation

snowsky
Copy link
Contributor

@snowsky snowsky commented Jan 19, 2021

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Relates OR Closes #17092

Release note for CHANGELOG:


Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccAWSDmsCertificate_basic'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSDmsCertificate_basic -timeout 120m
=== RUN   TestAccAWSDmsCertificate_basic
=== PAUSE TestAccAWSDmsCertificate_basic
=== CONT  TestAccAWSDmsCertificate_basic
--- PASS: TestAccAWSDmsCertificate_basic (28.89s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	36.841s

...

@snowsky snowsky requested a review from a team as a code owner January 19, 2021 01:40
@ghost ghost added size/XS Managed by automation to categorize the size of a PR. service/databasemigrationservice tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Jan 19, 2021
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Jan 19, 2021
Copy link

@github-actions github-actions bot left a 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! 😃

@anGie44 anGie44 added enhancement Requests to existing resources that expand the functionality or scope. and removed needs-triage Waiting for first response or review from a maintainer. labels Jan 20, 2021
Copy link
Contributor

@anGie44 anGie44 left a 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:

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 :)

aws/resource_aws_dms_certificate.go Outdated Show resolved Hide resolved
aws/resource_aws_dms_certificate.go Show resolved Hide resolved
aws/resource_aws_dms_certificate_test.go Outdated Show resolved Hide resolved
aws/resource_aws_dms_certificate_test.go Outdated Show resolved Hide resolved
@anGie44 anGie44 added the waiting-response Maintainers are waiting on response from community or contributor. label Jan 20, 2021
Base automatically changed from master to main January 23, 2021 01:00
@anGie44 anGie44 self-assigned this Jan 24, 2021
@ghost ghost added size/M Managed by automation to categorize the size of a PR. and removed size/XS Managed by automation to categorize the size of a PR. labels Jan 24, 2021
@snowsky snowsky requested a review from anGie44 January 25, 2021 18:14
@snowsky
Copy link
Contributor Author

snowsky commented Feb 19, 2021

@anGie44, could you please take another look? Thanks.

@ghost ghost removed the waiting-response Maintainers are waiting on response from community or contributor. label Feb 19, 2021
@ghost ghost removed waiting-response Maintainers are waiting on response from community or contributor. labels Feb 19, 2021
@anGie44
Copy link
Contributor

anGie44 commented Feb 24, 2021

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 tags test and adjust some of the error formatting used in the return statements (%s -> %w)

Output of acceptance test:

--- PASS: TestAccAWSDmsCertificate_tags (32.93s)

@ghost ghost added the documentation Introduces or discusses updates to documentation. label Feb 24, 2021
@anGie44 anGie44 added this to the v3.30.0 milestone Feb 24, 2021
@anGie44 anGie44 merged commit e9c3b76 into hashicorp:main Feb 24, 2021
@snowsky
Copy link
Contributor Author

snowsky commented Feb 24, 2021

Thanks @anGie44, learned from your commit :)

@ghost
Copy link

ghost commented Feb 26, 2021

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!

@ghost
Copy link

ghost commented Mar 26, 2021

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!

@ghost ghost locked as resolved and limited conversation to collaborators Mar 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. enhancement Requests to existing resources that expand the functionality or scope. size/M Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add tagging support to the aws_dms_certificate resource
2 participants