-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
New resource: aws_apigatewayv2_api #8842
Conversation
Re-ran acceptance tests: $ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSAPIGateway2Api_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -parallel 20 -run=TestAccAWSAPIGateway2Api_ -timeout 120m
=== RUN TestAccAWSAPIGateway2Api_basic
=== PAUSE TestAccAWSAPIGateway2Api_basic
=== RUN TestAccAWSAPIGateway2Api_update
=== PAUSE TestAccAWSAPIGateway2Api_update
=== CONT TestAccAWSAPIGateway2Api_basic
=== CONT TestAccAWSAPIGateway2Api_update
--- PASS: TestAccAWSAPIGateway2Api_basic (23.43s)
--- PASS: TestAccAWSAPIGateway2Api_update (66.44s)
PASS
ok github.com/terraform-providers/terraform-provider-aws/aws 66.506s |
Rebased to add support for resource tags enabled via #9153. |
Test sweeper: $ SWEEP=us-west-2 SWEEPARGS=-sweep-run=aws_api_gateway_v2_api make sweep
WARNING: This will destroy infrastructure. Use only in development accounts.
go test ./... -v -sweep=us-west-2 -sweep-run=aws_api_gateway_v2_api
? github.com/terraform-providers/terraform-provider-aws [no test files]
2019/07/12 15:43:02 [DEBUG] Running Sweepers for region (us-west-2):
2019/07/12 15:43:02 [INFO] Building AWS auth structure
2019/07/12 15:43:02 [INFO] Setting AWS metadata API timeout to 100ms
2019/07/12 15:43:03 [INFO] Ignoring AWS metadata API endpoint at default location as it doesn't return any instance-id
2019/07/12 15:43:03 [INFO] AWS Auth provider used: "EnvProvider"
2019/07/12 15:43:03 [DEBUG] Trying to get account information via sts:GetCallerIdentity
2019/07/12 15:43:03 [DEBUG] Trying to get account information via sts:GetCallerIdentity
2019/07/12 15:43:04 [INFO] Deleting API Gateway v2 API: 0xdnxeagx4
2019/07/12 15:43:06 [INFO] Deleting API Gateway v2 API: 1euwhap7li
2019/07/12 15:43:06 [INFO] Deleting API Gateway v2 API: 46tnfzqtjg
2019/07/12 15:43:07 [INFO] Deleting API Gateway v2 API: 5qrmhx3ls8
2019/07/12 15:43:08 [INFO] Deleting API Gateway v2 API: 6um3maylxc
2019/07/12 15:43:09 [INFO] Deleting API Gateway v2 API: 7lrwzvg1l5
2019/07/12 15:43:10 [INFO] Deleting API Gateway v2 API: a944fj0y4c
2019/07/12 15:43:11 [INFO] Deleting API Gateway v2 API: dz58flf4f4
2019/07/12 15:43:12 Sweeper Tests ran:
- aws_api_gateway_v2_api
ok github.com/terraform-providers/terraform-provider-aws/aws 9.739s |
Rebased to fix merge conflict. |
Re-ran acceptance tests: $ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSAPIGateway2Api_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -parallel 20 -run=TestAccAWSAPIGateway2Api_ -timeout 120m
=== RUN TestAccAWSAPIGateway2Api_basic
=== PAUSE TestAccAWSAPIGateway2Api_basic
=== RUN TestAccAWSAPIGateway2Api_AllAttributes
=== PAUSE TestAccAWSAPIGateway2Api_AllAttributes
=== RUN TestAccAWSAPIGateway2Api_Tags
=== PAUSE TestAccAWSAPIGateway2Api_Tags
=== CONT TestAccAWSAPIGateway2Api_basic
=== CONT TestAccAWSAPIGateway2Api_Tags
=== CONT TestAccAWSAPIGateway2Api_AllAttributes
--- PASS: TestAccAWSAPIGateway2Api_basic (19.53s)
--- PASS: TestAccAWSAPIGateway2Api_Tags (30.86s)
--- PASS: TestAccAWSAPIGateway2Api_AllAttributes (52.58s)
PASS
ok github.com/terraform-providers/terraform-provider-aws/aws 52.611s |
Rebased and did the Terraform Plugin SDK migration for the new resources. $ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSAPIGateway2Api_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -count 1 -parallel 20 -run=TestAccAWSAPIGateway2Api_ -timeout 120m
go: finding github.com/terraform-providers/terraform-provider-tls v2.1.1+incompatible
go: finding github.com/terraform-providers/terraform-provider-tls v2.1.1+incompatible
=== RUN TestAccAWSAPIGateway2Api_basic
=== PAUSE TestAccAWSAPIGateway2Api_basic
=== RUN TestAccAWSAPIGateway2Api_AllAttributes
=== PAUSE TestAccAWSAPIGateway2Api_AllAttributes
=== RUN TestAccAWSAPIGateway2Api_Tags
=== PAUSE TestAccAWSAPIGateway2Api_Tags
=== CONT TestAccAWSAPIGateway2Api_basic
=== CONT TestAccAWSAPIGateway2Api_Tags
=== CONT TestAccAWSAPIGateway2Api_AllAttributes
--- PASS: TestAccAWSAPIGateway2Api_basic (30.13s)
--- PASS: TestAccAWSAPIGateway2Api_Tags (30.68s)
--- PASS: TestAccAWSAPIGateway2Api_AllAttributes (51.21s)
PASS
ok github.com/terraform-providers/terraform-provider-aws/aws 51.230s |
…atchResourceAttrRegionalARNNoAccount'.
Rebased to remove merge conflicts. |
Cleaned up function names similar to #12299 (@kreempuff was correct). $ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSAPIGatewayV2Api_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -count 1 -parallel 20 -run=TestAccAWSAPIGatewayV2Api_ -timeout 120m
=== RUN TestAccAWSAPIGatewayV2Api_basic
=== PAUSE TestAccAWSAPIGatewayV2Api_basic
=== RUN TestAccAWSAPIGatewayV2Api_disappears
=== PAUSE TestAccAWSAPIGatewayV2Api_disappears
=== RUN TestAccAWSAPIGatewayV2Api_AllAttributes
=== PAUSE TestAccAWSAPIGatewayV2Api_AllAttributes
=== RUN TestAccAWSAPIGatewayV2Api_Tags
=== PAUSE TestAccAWSAPIGatewayV2Api_Tags
=== CONT TestAccAWSAPIGatewayV2Api_basic
=== CONT TestAccAWSAPIGatewayV2Api_Tags
=== CONT TestAccAWSAPIGatewayV2Api_AllAttributes
=== CONT TestAccAWSAPIGatewayV2Api_disappears
--- PASS: TestAccAWSAPIGatewayV2Api_disappears (18.93s)
--- PASS: TestAccAWSAPIGatewayV2Api_basic (25.30s)
--- PASS: TestAccAWSAPIGatewayV2Api_Tags (41.03s)
--- PASS: TestAccAWSAPIGatewayV2Api_AllAttributes (84.80s)
PASS
ok github.com/terraform-providers/terraform-provider-aws/aws 84.865s |
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.
Thanks for this and the other API Gateway v2 resources, @ewbankkit! I've added a few changes to make before we merge this.
aws/resource_aws_api_gateway2_api.go
Outdated
"github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" | ||
) | ||
|
||
func resourceAwsApiGateway2Api() *schema.Resource { |
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.
The HSM naming was incorrect 😄 We'd like to use the V2
naming suggested here. Also for the CRUD functions.
aws/provider.go
Outdated
@@ -354,6 +354,7 @@ func Provider() terraform.ResourceProvider { | |||
"aws_api_gateway_usage_plan": resourceAwsApiGatewayUsagePlan(), | |||
"aws_api_gateway_usage_plan_key": resourceAwsApiGatewayUsagePlanKey(), | |||
"aws_api_gateway_vpc_link": resourceAwsApiGatewayVpcLink(), | |||
"aws_api_gateway_v2_api": resourceAwsApiGatewayV2Api(), |
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.
Based on our naming standards at https://github.com/terraform-providers/terraform-provider-aws/blob/master/.github/CONTRIBUTING.md#new-service, the service name should beapigatewayv2
, and therefore the resource should be aws_apigatewayv2_api
.
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.
Sure. For completeness I'll rename the files to resource_aws_api_gatewayv2_api.go
, resource_aws_api_gatewayv2_api_test.go
and api_gatewayv2_api.html.markdown
.
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.
Done.
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.
One more tweak, please: can you change it to aws_apigatewayv2_api
, without the underscore in apigateway
? We know it's not consistent with v1, but we're trying to standardize on our service naming.
Other than that, we're good to go!
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.
Too close to the issue to see the additional _
😄.
I have renamed the resource to aws_apigatewayv2_api
.
Re-ran acceptance tests:
$ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSAPIGatewayV2Api_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -count 1 -parallel 20 -run=TestAccAWSAPIGatewayV2Api_ -timeout 120m
=== RUN TestAccAWSAPIGatewayV2Api_basicWebSocket
=== PAUSE TestAccAWSAPIGatewayV2Api_basicWebSocket
=== RUN TestAccAWSAPIGatewayV2Api_basicHttp
=== PAUSE TestAccAWSAPIGatewayV2Api_basicHttp
=== RUN TestAccAWSAPIGatewayV2Api_disappears
=== PAUSE TestAccAWSAPIGatewayV2Api_disappears
=== RUN TestAccAWSAPIGatewayV2Api_AllAttributesWebSocket
=== PAUSE TestAccAWSAPIGatewayV2Api_AllAttributesWebSocket
=== RUN TestAccAWSAPIGatewayV2Api_AllAttributesHttp
=== PAUSE TestAccAWSAPIGatewayV2Api_AllAttributesHttp
=== RUN TestAccAWSAPIGatewayV2Api_Tags
=== PAUSE TestAccAWSAPIGatewayV2Api_Tags
=== CONT TestAccAWSAPIGatewayV2Api_basicWebSocket
=== CONT TestAccAWSAPIGatewayV2Api_AllAttributesHttp
=== CONT TestAccAWSAPIGatewayV2Api_Tags
=== CONT TestAccAWSAPIGatewayV2Api_disappears
=== CONT TestAccAWSAPIGatewayV2Api_AllAttributesWebSocket
=== CONT TestAccAWSAPIGatewayV2Api_basicHttp
--- PASS: TestAccAWSAPIGatewayV2Api_disappears (21.75s)
--- PASS: TestAccAWSAPIGatewayV2Api_basicWebSocket (26.20s)
--- PASS: TestAccAWSAPIGatewayV2Api_basicHttp (38.05s)
--- PASS: TestAccAWSAPIGatewayV2Api_Tags (44.29s)
--- PASS: TestAccAWSAPIGatewayV2Api_AllAttributesHttp (74.49s)
--- PASS: TestAccAWSAPIGatewayV2Api_AllAttributesWebSocket (75.41s)
PASS
ok github.com/terraform-providers/terraform-provider-aws/aws 75.468s
Acceptance test output: $ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSAPIGatewayV2Api_' ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws/ -v -count 1 -parallel 20 -run=TestAccAWSAPIGatewayV2Api_ -timeout 120m === RUN TestAccAWSAPIGatewayV2Api_basic === PAUSE TestAccAWSAPIGatewayV2Api_basic === RUN TestAccAWSAPIGatewayV2Api_disappears === PAUSE TestAccAWSAPIGatewayV2Api_disappears === RUN TestAccAWSAPIGatewayV2Api_AllAttributes === PAUSE TestAccAWSAPIGatewayV2Api_AllAttributes === RUN TestAccAWSAPIGatewayV2Api_Tags === PAUSE TestAccAWSAPIGatewayV2Api_Tags === CONT TestAccAWSAPIGatewayV2Api_basic === CONT TestAccAWSAPIGatewayV2Api_Tags === CONT TestAccAWSAPIGatewayV2Api_AllAttributes === CONT TestAccAWSAPIGatewayV2Api_disappears --- PASS: TestAccAWSAPIGatewayV2Api_disappears (19.00s) --- PASS: TestAccAWSAPIGatewayV2Api_basic (25.16s) --- PASS: TestAccAWSAPIGatewayV2Api_Tags (39.97s) --- PASS: TestAccAWSAPIGatewayV2Api_AllAttributes (72.42s) PASS ok github.com/terraform-providers/terraform-provider-aws/aws 72.472s
…re all errors. Acceptance test output: $ SWEEP=us-west-2 SWEEPARGS=-sweep-run=aws_api_gatewayv2_api make sweep WARNING: This will destroy infrastructure. Use only in development accounts. go test ./aws -v -sweep=us-west-2 -sweep-run=aws_api_gatewayv2_api -timeout 60m 2020/03/10 17:48:09 [DEBUG] Running Sweepers for region (us-west-2): 2020/03/10 17:48:09 [DEBUG] Running Sweeper (aws_api_gatewayv2_api) in region (us-west-2) 2020/03/10 17:48:09 [INFO] Building AWS auth structure 2020/03/10 17:48:09 [INFO] Setting AWS metadata API timeout to 100ms 2020/03/10 17:48:10 [INFO] Ignoring AWS metadata API endpoint at default location as it doesn't return any instance-id 2020/03/10 17:48:10 [INFO] AWS Auth provider used: "EnvProvider" 2020/03/10 17:48:10 [DEBUG] Trying to get account information via sts:GetCallerIdentity 2020/03/10 17:48:10 [DEBUG] Trying to get account information via sts:GetCallerIdentity 2020/03/10 17:48:12 Sweeper Tests ran successfully: - aws_api_gatewayv2_api ok github.com/terraform-providers/terraform-provider-aws/aws 2.687s
Acceptance test output: $ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSAPIGatewayV2Api_' ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws/ -v -count 1 -parallel 20 -run=TestAccAWSAPIGatewayV2Api_ -timeout 120m === RUN TestAccAWSAPIGatewayV2Api_basicWebSocket === PAUSE TestAccAWSAPIGatewayV2Api_basicWebSocket === RUN TestAccAWSAPIGatewayV2Api_basicHttp === PAUSE TestAccAWSAPIGatewayV2Api_basicHttp === RUN TestAccAWSAPIGatewayV2Api_disappears === PAUSE TestAccAWSAPIGatewayV2Api_disappears === RUN TestAccAWSAPIGatewayV2Api_AllAttributesWebSocket === PAUSE TestAccAWSAPIGatewayV2Api_AllAttributesWebSocket === RUN TestAccAWSAPIGatewayV2Api_AllAttributesHttp === PAUSE TestAccAWSAPIGatewayV2Api_AllAttributesHttp === RUN TestAccAWSAPIGatewayV2Api_Tags === PAUSE TestAccAWSAPIGatewayV2Api_Tags === CONT TestAccAWSAPIGatewayV2Api_basicWebSocket === CONT TestAccAWSAPIGatewayV2Api_AllAttributesWebSocket === CONT TestAccAWSAPIGatewayV2Api_Tags === CONT TestAccAWSAPIGatewayV2Api_AllAttributesHttp === CONT TestAccAWSAPIGatewayV2Api_disappears === CONT TestAccAWSAPIGatewayV2Api_basicHttp --- PASS: TestAccAWSAPIGatewayV2Api_disappears (19.24s) --- PASS: TestAccAWSAPIGatewayV2Api_basicWebSocket (24.78s) --- PASS: TestAccAWSAPIGatewayV2Api_basicHttp (25.00s) --- PASS: TestAccAWSAPIGatewayV2Api_Tags (42.31s) --- PASS: TestAccAWSAPIGatewayV2Api_AllAttributesWebSocket (70.75s) --- PASS: TestAccAWSAPIGatewayV2Api_AllAttributesHttp (70.95s) PASS ok github.com/terraform-providers/terraform-provider-aws/aws 71.014s
@gdavison I made all the suggested changes. Re-ran acceptance tests: $ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSAPIGatewayV2Api_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -count 1 -parallel 20 -run=TestAccAWSAPIGatewayV2Api_ -timeout 120m
=== RUN TestAccAWSAPIGatewayV2Api_basicWebSocket
=== PAUSE TestAccAWSAPIGatewayV2Api_basicWebSocket
=== RUN TestAccAWSAPIGatewayV2Api_basicHttp
=== PAUSE TestAccAWSAPIGatewayV2Api_basicHttp
=== RUN TestAccAWSAPIGatewayV2Api_disappears
=== PAUSE TestAccAWSAPIGatewayV2Api_disappears
=== RUN TestAccAWSAPIGatewayV2Api_AllAttributesWebSocket
=== PAUSE TestAccAWSAPIGatewayV2Api_AllAttributesWebSocket
=== RUN TestAccAWSAPIGatewayV2Api_AllAttributesHttp
=== PAUSE TestAccAWSAPIGatewayV2Api_AllAttributesHttp
=== RUN TestAccAWSAPIGatewayV2Api_Tags
=== PAUSE TestAccAWSAPIGatewayV2Api_Tags
=== CONT TestAccAWSAPIGatewayV2Api_basicWebSocket
=== CONT TestAccAWSAPIGatewayV2Api_AllAttributesWebSocket
=== CONT TestAccAWSAPIGatewayV2Api_Tags
=== CONT TestAccAWSAPIGatewayV2Api_AllAttributesHttp
=== CONT TestAccAWSAPIGatewayV2Api_disappears
=== CONT TestAccAWSAPIGatewayV2Api_basicHttp
--- PASS: TestAccAWSAPIGatewayV2Api_disappears (19.24s)
--- PASS: TestAccAWSAPIGatewayV2Api_basicWebSocket (24.78s)
--- PASS: TestAccAWSAPIGatewayV2Api_basicHttp (25.00s)
--- PASS: TestAccAWSAPIGatewayV2Api_Tags (42.31s)
--- PASS: TestAccAWSAPIGatewayV2Api_AllAttributesWebSocket (70.75s)
--- PASS: TestAccAWSAPIGatewayV2Api_AllAttributesHttp (70.95s)
PASS
ok github.com/terraform-providers/terraform-provider-aws/aws 71.014s |
Acceptance test output: $ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSAPIGatewayV2Api_' ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws/ -v -count 1 -parallel 20 -run=TestAccAWSAPIGatewayV2Api_ -timeout 120m === RUN TestAccAWSAPIGatewayV2Api_basicWebSocket === PAUSE TestAccAWSAPIGatewayV2Api_basicWebSocket === RUN TestAccAWSAPIGatewayV2Api_basicHttp === PAUSE TestAccAWSAPIGatewayV2Api_basicHttp === RUN TestAccAWSAPIGatewayV2Api_disappears === PAUSE TestAccAWSAPIGatewayV2Api_disappears === RUN TestAccAWSAPIGatewayV2Api_AllAttributesWebSocket === PAUSE TestAccAWSAPIGatewayV2Api_AllAttributesWebSocket === RUN TestAccAWSAPIGatewayV2Api_AllAttributesHttp === PAUSE TestAccAWSAPIGatewayV2Api_AllAttributesHttp === RUN TestAccAWSAPIGatewayV2Api_Tags === PAUSE TestAccAWSAPIGatewayV2Api_Tags === CONT TestAccAWSAPIGatewayV2Api_basicWebSocket === CONT TestAccAWSAPIGatewayV2Api_AllAttributesHttp === CONT TestAccAWSAPIGatewayV2Api_Tags === CONT TestAccAWSAPIGatewayV2Api_disappears === CONT TestAccAWSAPIGatewayV2Api_AllAttributesWebSocket === CONT TestAccAWSAPIGatewayV2Api_basicHttp --- PASS: TestAccAWSAPIGatewayV2Api_disappears (21.75s) --- PASS: TestAccAWSAPIGatewayV2Api_basicWebSocket (26.20s) --- PASS: TestAccAWSAPIGatewayV2Api_basicHttp (38.05s) --- PASS: TestAccAWSAPIGatewayV2Api_Tags (44.29s) --- PASS: TestAccAWSAPIGatewayV2Api_AllAttributesHttp (74.49s) --- PASS: TestAccAWSAPIGatewayV2Api_AllAttributesWebSocket (75.41s) PASS ok github.com/terraform-providers/terraform-provider-aws/aws 75.468s
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.
LGTM 🚀
--- PASS: TestAccAWSAPIGatewayV2Api_disappears (7.48s)
--- PASS: TestAccAWSAPIGatewayV2Api_Tags (15.21s)
--- PASS: TestAccAWSAPIGatewayV2Api_basicWebSocket (20.47s)
--- PASS: TestAccAWSAPIGatewayV2Api_basicHttp (21.63s)
--- PASS: TestAccAWSAPIGatewayV2Api_AllAttributesWebSocket (25.13s)
--- PASS: TestAccAWSAPIGatewayV2Api_AllAttributesHttp (26.07s)
This has been released in version 2.53.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 #7004.
I included the commits from @mbonig - https://github.com/mbonig/terraform-provider-aws/tree/f-gatewayv2, removed the
aws_api_gateway_v2_route
resource to add in a subsequent PR, added documentation, tidied up the code and got acceptance tests to pass.Release note for CHANGELOG:
Output from acceptance testing: