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 to API Gateway Usage Plan Resource #10566

Merged

Conversation

DrFaust92
Copy link
Collaborator

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" comments, they generate extra noise for pull request followers and do not help prioritize the request

Relates #8744

Release note for CHANGELOG:

- resource/resource_aws_api_gateway_usage_plan: Add `tags` argument.

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccAWSAPIGatewayUsagePlan_'

=== RUN   TestAccAWSAPIGatewayUsagePlan_importBasic
=== PAUSE TestAccAWSAPIGatewayUsagePlan_importBasic
=== CONT  TestAccAWSAPIGatewayUsagePlan_importBasic
--- PASS: TestAccAWSAPIGatewayUsagePlan_importBasic (83.05s)
=== RUN   TestAccAWSAPIGatewayUsagePlan_basic
=== PAUSE TestAccAWSAPIGatewayUsagePlan_basic
=== CONT  TestAccAWSAPIGatewayUsagePlan_basic
--- PASS: TestAccAWSAPIGatewayUsagePlan_basic (172.62s)
=== RUN   TestAccAWSAPIGatewayUsagePlan_tags
=== PAUSE TestAccAWSAPIGatewayUsagePlan_tags
=== CONT  TestAccAWSAPIGatewayUsagePlan_tags
--- PASS: TestAccAWSAPIGatewayUsagePlan_tags (126.41s)
=== RUN   TestAccAWSAPIGatewayUsagePlan_description
=== PAUSE TestAccAWSAPIGatewayUsagePlan_description
=== CONT  TestAccAWSAPIGatewayUsagePlan_description
--- PASS: TestAccAWSAPIGatewayUsagePlan_description (250.04s)
=== RUN   TestAccAWSAPIGatewayUsagePlan_productCode
=== PAUSE TestAccAWSAPIGatewayUsagePlan_productCode
=== CONT  TestAccAWSAPIGatewayUsagePlan_productCode
--- PASS: TestAccAWSAPIGatewayUsagePlan_productCode (235.84s)
=== RUN   TestAccAWSAPIGatewayUsagePlan_throttling
=== PAUSE TestAccAWSAPIGatewayUsagePlan_throttling
=== CONT  TestAccAWSAPIGatewayUsagePlan_throttling
--- PASS: TestAccAWSAPIGatewayUsagePlan_throttling (222.17s)
=== RUN   TestAccAWSAPIGatewayUsagePlan_throttlingInitialRateLimit
=== PAUSE TestAccAWSAPIGatewayUsagePlan_throttlingInitialRateLimit
=== CONT  TestAccAWSAPIGatewayUsagePlan_throttlingInitialRateLimit
--- PASS: TestAccAWSAPIGatewayUsagePlan_throttlingInitialRateLimit (58.00s)
=== RUN   TestAccAWSAPIGatewayUsagePlan_quota
=== PAUSE TestAccAWSAPIGatewayUsagePlan_quota
=== CONT  TestAccAWSAPIGatewayUsagePlan_quota
--- PASS: TestAccAWSAPIGatewayUsagePlan_quota (186.17s)
=== RUN   TestAccAWSAPIGatewayUsagePlan_apiStages
=== PAUSE TestAccAWSAPIGatewayUsagePlan_apiStages
=== CONT  TestAccAWSAPIGatewayUsagePlan_apiStages
--- PASS: TestAccAWSAPIGatewayUsagePlan_apiStages (249.36s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	454.103s

...

@DrFaust92 DrFaust92 requested a review from a team October 20, 2019 14:46
@ghost ghost added size/L Managed by automation to categorize the size of a PR. documentation Introduces or discusses updates to documentation. service/apigateway Issues and PRs that pertain to the apigateway service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Oct 20, 2019
@bflad bflad added the enhancement Requests to existing resources that expand the functionality or scope. label Nov 8, 2019
@bflad bflad added this to the v2.36.0 milestone Nov 8, 2019
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.

Looks good, thanks @DrFaust92 🚀

Output from acceptance testing:

--- PASS: TestAccAWSAPIGatewayUsagePlan_throttlingInitialRateLimit (42.37s)
--- PASS: TestAccAWSAPIGatewayUsagePlan_basic (129.58s)
--- PASS: TestAccAWSAPIGatewayUsagePlan_productCode (307.70s)
--- PASS: TestAccAWSAPIGatewayUsagePlan_apiStages (342.27s)
--- PASS: TestAccAWSAPIGatewayUsagePlan_description (371.72s)
--- PASS: TestAccAWSAPIGatewayUsagePlan_throttling (400.19s)
--- PASS: TestAccAWSAPIGatewayUsagePlan_quota (500.22s)

@bflad bflad merged commit 50d66de into hashicorp:master Nov 8, 2019
bflad added a commit that referenced this pull request Nov 8, 2019
@DrFaust92 DrFaust92 deleted the api-gateway-usage-plan-tag-support branch November 9, 2019 12:41
@ghost
Copy link

ghost commented Nov 14, 2019

This has been released in version 2.36.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!

@zihaoyu
Copy link

zihaoyu commented Dec 4, 2019

@DrFaust92 @bflad For some reason I'm not able to create a usage plan with tags.

resource "aws_api_gateway_usage_plan" "throttle" {
  name         = "${var.usage_plan_name}"

  ......

  tags = {
    environment = "${var.environment}"
    region      = "${var.region}"
  }
}

Getting the following error in terratest:

TestCreateUsagePlan 2019-12-04T16:55:06-05:00 command.go:158: Error: Unsupported argument
TestCreateUsagePlan 2019-12-04T16:55:06-05:00 command.go:158:
TestCreateUsagePlan 2019-12-04T16:55:06-05:00 command.go:158:   on main.tf line 19, in resource "aws_api_gateway_usage_plan" "throttle":
TestCreateUsagePlan 2019-12-04T16:55:06-05:00 command.go:158:   19:   tags = {
TestCreateUsagePlan 2019-12-04T16:55:06-05:00 command.go:158:
TestCreateUsagePlan 2019-12-04T16:55:06-05:00 command.go:158: An argument named "tags" is not expected here.

It's using aws provider 2.41:

TestCreateUsagePlan 2019-12-04T16:55:03-05:00 command.go:158: * provider.aws: version = "~> 2.41"

Also it looks like the documentation page does not show the tags arg as well. Are we sure this is released?

@zihaoyu
Copy link

zihaoyu commented Dec 4, 2019

Opened #11146

@DrFaust92 DrFaust92 restored the api-gateway-usage-plan-tag-support branch December 5, 2019 14:47
bflad added a commit that referenced this pull request Dec 6, 2019
@ghost
Copy link

ghost commented Dec 9, 2019

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 Dec 9, 2019
@DrFaust92 DrFaust92 deleted the api-gateway-usage-plan-tag-support branch March 27, 2020 18:36
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/apigateway Issues and PRs that pertain to the apigateway 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.

3 participants