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 tag support for aws_codestarconnections_connection resource #16835

Merged
merged 4 commits into from
Feb 11, 2021

Conversation

shuheiktgw
Copy link
Collaborator

@shuheiktgw shuheiktgw commented Dec 18, 2020

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 #15453

Release note for CHANGELOG:

resource/aws_codestarconnections_connection: Add tag support

Output from acceptance testing:

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

Thank you for your review! 👍

@shuheiktgw shuheiktgw requested a review from a team as a code owner December 18, 2020 07:58
@ghost ghost added size/L Managed by automation to categorize the size of a PR. documentation Introduces or discusses updates to documentation. provider Pertains to the provider itself, rather than any interaction with AWS. service/codestarconnections Issues and PRs that pertain to the codestarconnections service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Dec 18, 2020
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Dec 18, 2020
Base automatically changed from master to main January 23, 2021 01:00
@bflad bflad self-assigned this Feb 11, 2021
@bflad bflad 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 Feb 11, 2021
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this is on the right track, just a few additional things and we will get this in. Thank you, @shuheiktgw 😄

"tags": {
Type: schema.TypeMap,
Optional: true,
ForceNew: true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updating resource tags should not require resource recreation -- we can add an Update function that only handles tags. 👍

CheckDestroy: testAccCheckAWSCodeStarConnectionsConnectionDestroy,
Steps: []resource.TestStep{
{
Config: testAccAWSCodeStarConnectionsConnectionConfigTags(rName),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Will parameterize this to match the Contributing Guide so it is easier to add the update step.

@@ -68,6 +68,7 @@ The following arguments are supported:

* `name` - (Required) The name of the connection to be created. The name must be unique in the calling AWS account. Changing `name` will create a new resource.
* `provider_type` - (Required) The name of the external provider where your third-party code repository is configured. Valid values are `Bitbucket`, `GitHub`, or `GitHubEnterpriseServer`. Changing `provider_type` will create a new resource.
* `tags` - (Optional) An array of key:value pairs to associate with the resource.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Terraform the type is map

Suggested change
* `tags` - (Optional) An array of key:value pairs to associate with the resource.
* `tags` - (Optional) Map of key-value resource tags to associate with the resource.

Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @shuheiktgw 🚀

After adding tag update support:

Output from acceptance testing in AWS Commercial:

--- PASS: TestAccAWSCodeStarConnectionsConnection_disappears (10.57s)
--- PASS: TestAccAWSCodeStarConnectionsConnection_Basic (14.06s)
--- PASS: TestAccAWSCodeStarConnectionsConnection_Tags (30.15s)

Output from acceptance testing in AWS GovCloud (US):

--- SKIP: TestAccAWSCodeStarConnectionsConnection_Basic (1.27s)
--- SKIP: TestAccAWSCodeStarConnectionsConnection_disappears (1.27s)
--- SKIP: TestAccAWSCodeStarConnectionsConnection_Tags (1.27s)

@bflad bflad merged commit 9169fa2 into hashicorp:main Feb 11, 2021
@github-actions github-actions bot added this to the v3.28.0 milestone Feb 11, 2021
@ghost
Copy link

ghost commented Feb 12, 2021

This has been released in version 3.28.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 14, 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 14, 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. provider Pertains to the provider itself, rather than any interaction with AWS. service/codestarconnections Issues and PRs that pertain to the codestarconnections service. size/L 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.

2 participants