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

AWS Cloud Map resource tagging #13750

Merged
merged 4 commits into from Jun 15, 2020

Conversation

ewbankkit
Copy link
Contributor

@ewbankkit ewbankkit commented Jun 14, 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

Closes #13696.

Release note for CHANGELOG:

release/aws_service_discovery_http_namespace: Add `tags` argument
release/aws_service_discovery_private_dns_namespace: Add `tags` argument
release/aws_service_discovery_public_dns_namespace: Add `tags` argument
release/aws_service_discovery_service: Add `tags` argument

Output from acceptance testing:

$ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSServiceDiscoveryHttpNamespace_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -count 1 -parallel 20 -run=TestAccAWSServiceDiscoveryHttpNamespace_ -timeout 120m
=== RUN   TestAccAWSServiceDiscoveryHttpNamespace_basic
=== PAUSE TestAccAWSServiceDiscoveryHttpNamespace_basic
=== RUN   TestAccAWSServiceDiscoveryHttpNamespace_disappears
=== PAUSE TestAccAWSServiceDiscoveryHttpNamespace_disappears
=== RUN   TestAccAWSServiceDiscoveryHttpNamespace_Description
=== PAUSE TestAccAWSServiceDiscoveryHttpNamespace_Description
=== RUN   TestAccAWSServiceDiscoveryHttpNamespace_Tags
=== PAUSE TestAccAWSServiceDiscoveryHttpNamespace_Tags
=== CONT  TestAccAWSServiceDiscoveryHttpNamespace_basic
=== CONT  TestAccAWSServiceDiscoveryHttpNamespace_Tags
=== CONT  TestAccAWSServiceDiscoveryHttpNamespace_Description
=== CONT  TestAccAWSServiceDiscoveryHttpNamespace_disappears
--- PASS: TestAccAWSServiceDiscoveryHttpNamespace_disappears (91.23s)
--- PASS: TestAccAWSServiceDiscoveryHttpNamespace_Description (97.32s)
--- PASS: TestAccAWSServiceDiscoveryHttpNamespace_basic (97.73s)
--- PASS: TestAccAWSServiceDiscoveryHttpNamespace_Tags (129.24s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	129.305s
$ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSServiceDiscoveryPrivateDnsNamespace_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -count 1 -parallel 2 -run=TestAccAWSServiceDiscoveryPrivateDnsNamespace_ -timeout 120m
=== RUN   TestAccAWSServiceDiscoveryPrivateDnsNamespace_basic
=== PAUSE TestAccAWSServiceDiscoveryPrivateDnsNamespace_basic
=== RUN   TestAccAWSServiceDiscoveryPrivateDnsNamespace_disappears
=== PAUSE TestAccAWSServiceDiscoveryPrivateDnsNamespace_disappears
=== RUN   TestAccAWSServiceDiscoveryPrivateDnsNamespace_Description
=== PAUSE TestAccAWSServiceDiscoveryPrivateDnsNamespace_Description
=== RUN   TestAccAWSServiceDiscoveryPrivateDnsNamespace_error_Overlap
=== PAUSE TestAccAWSServiceDiscoveryPrivateDnsNamespace_error_Overlap
=== RUN   TestAccAWSServiceDiscoveryPrivateDnsNamespace_Tags
=== PAUSE TestAccAWSServiceDiscoveryPrivateDnsNamespace_Tags
=== CONT  TestAccAWSServiceDiscoveryPrivateDnsNamespace_basic
=== CONT  TestAccAWSServiceDiscoveryPrivateDnsNamespace_error_Overlap
--- PASS: TestAccAWSServiceDiscoveryPrivateDnsNamespace_basic (130.39s)
=== CONT  TestAccAWSServiceDiscoveryPrivateDnsNamespace_Description
--- PASS: TestAccAWSServiceDiscoveryPrivateDnsNamespace_error_Overlap (194.52s)
=== CONT  TestAccAWSServiceDiscoveryPrivateDnsNamespace_disappears
--- PASS: TestAccAWSServiceDiscoveryPrivateDnsNamespace_Description (127.27s)
=== CONT  TestAccAWSServiceDiscoveryPrivateDnsNamespace_Tags
--- PASS: TestAccAWSServiceDiscoveryPrivateDnsNamespace_disappears (125.96s)
--- PASS: TestAccAWSServiceDiscoveryPrivateDnsNamespace_Tags (175.52s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	433.239s
$ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSServiceDiscoveryPublicDnsNamespace_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -count 1 -parallel 2 -run=TestAccAWSServiceDiscoveryPublicDnsNamespace_ -timeout 120m
=== RUN   TestAccAWSServiceDiscoveryPublicDnsNamespace_basic
=== PAUSE TestAccAWSServiceDiscoveryPublicDnsNamespace_basic
=== RUN   TestAccAWSServiceDiscoveryPublicDnsNamespace_disappears
=== PAUSE TestAccAWSServiceDiscoveryPublicDnsNamespace_disappears
=== RUN   TestAccAWSServiceDiscoveryPublicDnsNamespace_Description
=== PAUSE TestAccAWSServiceDiscoveryPublicDnsNamespace_Description
=== RUN   TestAccAWSServiceDiscoveryPublicDnsNamespace_Tags
=== PAUSE TestAccAWSServiceDiscoveryPublicDnsNamespace_Tags
=== CONT  TestAccAWSServiceDiscoveryPublicDnsNamespace_Tags
=== CONT  TestAccAWSServiceDiscoveryPublicDnsNamespace_Description
--- PASS: TestAccAWSServiceDiscoveryPublicDnsNamespace_Description (114.29s)
=== CONT  TestAccAWSServiceDiscoveryPublicDnsNamespace_disappears
--- PASS: TestAccAWSServiceDiscoveryPublicDnsNamespace_Tags (148.95s)
=== CONT  TestAccAWSServiceDiscoveryPublicDnsNamespace_basic
--- PASS: TestAccAWSServiceDiscoveryPublicDnsNamespace_disappears (110.72s)
--- PASS: TestAccAWSServiceDiscoveryPublicDnsNamespace_basic (117.75s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	266.793s
$ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSServiceDiscoveryService_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -count 1 -parallel 20 -run=TestAccAWSServiceDiscoveryService_ -timeout 120m
=== RUN   TestAccAWSServiceDiscoveryService_private
=== PAUSE TestAccAWSServiceDiscoveryService_private
=== RUN   TestAccAWSServiceDiscoveryService_public
=== PAUSE TestAccAWSServiceDiscoveryService_public
=== RUN   TestAccAWSServiceDiscoveryService_http
=== PAUSE TestAccAWSServiceDiscoveryService_http
=== RUN   TestAccAWSServiceDiscoveryService_disappears
=== PAUSE TestAccAWSServiceDiscoveryService_disappears
=== RUN   TestAccAWSServiceDiscoveryService_Tags
=== PAUSE TestAccAWSServiceDiscoveryService_Tags
=== CONT  TestAccAWSServiceDiscoveryService_private
=== CONT  TestAccAWSServiceDiscoveryService_disappears
=== CONT  TestAccAWSServiceDiscoveryService_Tags
=== CONT  TestAccAWSServiceDiscoveryService_http
=== CONT  TestAccAWSServiceDiscoveryService_public
--- PASS: TestAccAWSServiceDiscoveryService_disappears (95.59s)
--- PASS: TestAccAWSServiceDiscoveryService_http (100.01s)
--- PASS: TestAccAWSServiceDiscoveryService_Tags (135.01s)
--- PASS: TestAccAWSServiceDiscoveryService_public (156.15s)
--- PASS: TestAccAWSServiceDiscoveryService_private (158.60s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	158.683s

@ewbankkit ewbankkit requested a review from a team June 14, 2020 21:03
@ghost ghost added size/M Managed by automation to categorize the size of a PR. service/servicediscovery Issues and PRs that pertain to the servicediscovery service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. documentation Introduces or discusses updates to documentation. labels Jun 14, 2020
@ghost ghost added size/XL Managed by automation to categorize the size of a PR. and removed size/M Managed by automation to categorize the size of a PR. labels Jun 14, 2020
@ewbankkit
Copy link
Contributor Author

Also added _disappears tests: #13527.

hcconfig := d.Get("health_check_config").([]interface{})
sc.HealthCheckConfig = expandServiceDiscoveryHealthCheckConfig(hcconfig[0].(map[string]interface{}))
}
if len(hcconfig) > 0 {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Handle deletion of health_check_config.

@ewbankkit ewbankkit changed the title [WIP] AWS Cloud Map resource tagging AWS Cloud Map resource tagging Jun 14, 2020
@bflad bflad added the enhancement Requests to existing resources that expand the functionality or scope. label Jun 15, 2020
@bflad
Copy link
Member

bflad commented Jun 15, 2020

@ewbankkit are you able to confirm the tags propagate to the Route 53 Hosted Zone for #7840? The Developer Guide seems to suggest otherwise. We may need to consider adding a separate resource similar to aws_ec2_tag to cover this instead once the generation is in place from #9061. I'm going to remove the linked issue from this for now.

@bflad bflad added this to the v2.67.0 milestone Jun 15, 2020
@bflad bflad self-assigned this Jun 15, 2020
Copy link
Member

@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.

Looks great 🚀

Output from acceptance testing:

--- PASS: TestAccAWSServiceDiscoveryHttpNamespace_basic (101.16s)
--- PASS: TestAccAWSServiceDiscoveryHttpNamespace_Description (101.11s)
--- PASS: TestAccAWSServiceDiscoveryHttpNamespace_disappears (96.92s)
--- PASS: TestAccAWSServiceDiscoveryHttpNamespace_Tags (112.88s)

--- PASS: TestAccAWSServiceDiscoveryPrivateDnsNamespace_basic (105.74s)
--- PASS: TestAccAWSServiceDiscoveryPrivateDnsNamespace_Description (103.22s)
--- PASS: TestAccAWSServiceDiscoveryPrivateDnsNamespace_disappears (92.73s)
--- PASS: TestAccAWSServiceDiscoveryPrivateDnsNamespace_error_Overlap (170.47s)
--- PASS: TestAccAWSServiceDiscoveryPrivateDnsNamespace_Tags (113.38s)

--- PASS: TestAccAWSServiceDiscoveryPublicDnsNamespace_basic (98.39s)
--- PASS: TestAccAWSServiceDiscoveryPublicDnsNamespace_Description (97.06s)
--- PASS: TestAccAWSServiceDiscoveryPublicDnsNamespace_disappears (97.56s)
--- PASS: TestAccAWSServiceDiscoveryPublicDnsNamespace_Tags (109.04s)

--- PASS: TestAccAWSServiceDiscoveryService_disappears (95.38s)
--- PASS: TestAccAWSServiceDiscoveryService_http (99.17s)
--- PASS: TestAccAWSServiceDiscoveryService_private (101.95s)
--- PASS: TestAccAWSServiceDiscoveryService_public (111.98s)
--- PASS: TestAccAWSServiceDiscoveryService_Tags (109.99s)

@bflad bflad merged commit 2183d75 into hashicorp:master Jun 15, 2020
bflad added a commit that referenced this pull request Jun 15, 2020
@ewbankkit ewbankkit deleted the f-servicediscovery-resource-tagging branch June 15, 2020 12:41
@ewbankkit
Copy link
Contributor Author

ewbankkit commented Jun 15, 2020

@bflad No, tags are not propagated from the ServiceDiscovery namespace to the Route 53 hosted zone:

$ aws --region us-west-2 route53 list-tags-for-resources --resource-type hostedzone --resource-ids Z02101932SP7LMVLGC71Q
{
    "ResourceTagSets": [
        {
            "ResourceType": "hostedzone",
            "ResourceId": "Z02101932SP7LMVLGC71Q",
            "Tags": []
        }
    ]
}

Yes, I think adding a route53_tag resource seems like a good idea - There are other services (API Gateway, off the top of my head) that implicitly create hosted zones.

@ghost
Copy link

ghost commented Jun 19, 2020

This has been released in version 2.67.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 Jul 15, 2020

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 and limited conversation to collaborators Jul 15, 2020
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. service/servicediscovery Issues and PRs that pertain to the servicediscovery service. size/XL 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.

AWS Cloud Map resource tagging
2 participants