Skip to content

Commit

Permalink
Rename resource to 'aws_apigatewayv2_api'.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ewbankkit committed Mar 12, 2020
1 parent 38f5b02 commit 46a3572
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion aws/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +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_gatewayv2_api": resourceAwsApiGatewayV2Api(),
"aws_apigatewayv2_api": resourceAwsApiGatewayV2Api(),
"aws_app_cookie_stickiness_policy": resourceAwsAppCookieStickinessPolicy(),
"aws_appautoscaling_target": resourceAwsAppautoscalingTarget(),
"aws_appautoscaling_policy": resourceAwsAppautoscalingPolicy(),
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import (
)

func init() {
resource.AddTestSweepers("aws_api_gatewayv2_api", &resource.Sweeper{
Name: "aws_api_gatewayv2_api",
resource.AddTestSweepers("aws_apigatewayv2_api", &resource.Sweeper{
Name: "aws_apigatewayv2_api",
F: testSweepAPIGatewayV2Apis,
})
}
Expand Down Expand Up @@ -67,7 +67,7 @@ func testSweepAPIGatewayV2Apis(region string) error {

func TestAccAWSAPIGatewayV2Api_basicWebSocket(t *testing.T) {
var v apigatewayv2.GetApiOutput
resourceName := "aws_api_gatewayv2_api.test"
resourceName := "aws_apigatewayv2_api.test"
rName := acctest.RandomWithPrefix("tf-acc-test")

resource.ParallelTest(t, resource.TestCase{
Expand Down Expand Up @@ -102,7 +102,7 @@ func TestAccAWSAPIGatewayV2Api_basicWebSocket(t *testing.T) {

func TestAccAWSAPIGatewayV2Api_basicHttp(t *testing.T) {
var v apigatewayv2.GetApiOutput
resourceName := "aws_api_gatewayv2_api.test"
resourceName := "aws_apigatewayv2_api.test"
rName := acctest.RandomWithPrefix("tf-acc-test")

resource.ParallelTest(t, resource.TestCase{
Expand Down Expand Up @@ -137,7 +137,7 @@ func TestAccAWSAPIGatewayV2Api_basicHttp(t *testing.T) {

func TestAccAWSAPIGatewayV2Api_disappears(t *testing.T) {
var v apigatewayv2.GetApiOutput
resourceName := "aws_api_gatewayv2_api.test"
resourceName := "aws_apigatewayv2_api.test"
rName := acctest.RandomWithPrefix("tf-acc-test")

resource.ParallelTest(t, resource.TestCase{
Expand All @@ -159,7 +159,7 @@ func TestAccAWSAPIGatewayV2Api_disappears(t *testing.T) {

func TestAccAWSAPIGatewayV2Api_AllAttributesWebSocket(t *testing.T) {
var v apigatewayv2.GetApiOutput
resourceName := "aws_api_gatewayv2_api.test"
resourceName := "aws_apigatewayv2_api.test"
rName1 := acctest.RandomWithPrefix("tf-acc-test")
rName2 := acctest.RandomWithPrefix("tf-acc-test")

Expand Down Expand Up @@ -232,7 +232,7 @@ func TestAccAWSAPIGatewayV2Api_AllAttributesWebSocket(t *testing.T) {

func TestAccAWSAPIGatewayV2Api_AllAttributesHttp(t *testing.T) {
var v apigatewayv2.GetApiOutput
resourceName := "aws_api_gatewayv2_api.test"
resourceName := "aws_apigatewayv2_api.test"
rName1 := acctest.RandomWithPrefix("tf-acc-test")
rName2 := acctest.RandomWithPrefix("tf-acc-test")

Expand Down Expand Up @@ -305,7 +305,7 @@ func TestAccAWSAPIGatewayV2Api_AllAttributesHttp(t *testing.T) {

func TestAccAWSAPIGatewayV2Api_Tags(t *testing.T) {
var v apigatewayv2.GetApiOutput
resourceName := "aws_api_gatewayv2_api.test"
resourceName := "aws_apigatewayv2_api.test"
rName := acctest.RandomWithPrefix("tf-acc-test")

resource.ParallelTest(t, resource.TestCase{
Expand Down Expand Up @@ -357,7 +357,7 @@ func testAccCheckAWSAPIGatewayV2ApiDestroy(s *terraform.State) error {
conn := testAccProvider.Meta().(*AWSClient).apigatewayv2conn

for _, rs := range s.RootModule().Resources {
if rs.Type != "aws_api_gatewayv2_api" {
if rs.Type != "aws_apigatewayv2_api" {
continue
}

Expand Down Expand Up @@ -417,7 +417,7 @@ func testAccCheckAWSAPIGatewayV2ApiExists(n string, v *apigatewayv2.GetApiOutput

func testAccAWSAPIGatewayV2ApiConfig_basicWebSocket(rName string) string {
return fmt.Sprintf(`
resource "aws_api_gatewayv2_api" "test" {
resource "aws_apigatewayv2_api" "test" {
name = %[1]q
protocol_type = "WEBSOCKET"
route_selection_expression = "$request.body.action"
Expand All @@ -427,7 +427,7 @@ resource "aws_api_gatewayv2_api" "test" {

func testAccAWSAPIGatewayV2ApiConfig_basicHttp(rName string) string {
return fmt.Sprintf(`
resource "aws_api_gatewayv2_api" "test" {
resource "aws_apigatewayv2_api" "test" {
name = %[1]q
protocol_type = "HTTP"
}
Expand All @@ -436,7 +436,7 @@ resource "aws_api_gatewayv2_api" "test" {

func testAccAWSAPIGatewayV2ApiConfig_allAttributesWebSocket(rName string) string {
return fmt.Sprintf(`
resource "aws_api_gatewayv2_api" "test" {
resource "aws_apigatewayv2_api" "test" {
api_key_selection_expression = "$context.authorizer.usageIdentifierKey"
description = "test description"
name = %[1]q
Expand All @@ -449,7 +449,7 @@ resource "aws_api_gatewayv2_api" "test" {

func testAccAWSAPIGatewayV2ApiConfig_allAttributesHttp(rName string) string {
return fmt.Sprintf(`
resource "aws_api_gatewayv2_api" "test" {
resource "aws_apigatewayv2_api" "test" {
description = "test description"
name = %[1]q
protocol_type = "HTTP"
Expand All @@ -460,7 +460,7 @@ resource "aws_api_gatewayv2_api" "test" {

func testAccAWSAPIGatewayV2ApiConfig_tags(rName string) string {
return fmt.Sprintf(`
resource "aws_api_gatewayv2_api" "test" {
resource "aws_apigatewayv2_api" "test" {
name = %[1]q
protocol_type = "WEBSOCKET"
route_selection_expression = "$request.body.action"
Expand Down
2 changes: 1 addition & 1 deletion website/aws.erb
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@
<a href="#">Resources</a>
<ul class="nav nav-auto-expand">
<li>
<a href="/docs/providers/aws/r/api_gatewayv2_api.html">aws_api_gatewayv2_api</a>
<a href="/docs/providers/aws/r/apigatewayv2_api.html">aws_apigatewayv2_api</a>
</li>
</ul>
</li>
Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/api_gateway_rest_api.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ description: |-

Provides an API Gateway REST API.

-> **Note:** Amazon API Gateway Version 1 resources are used for creating and deploying REST APIs. To create and deploy WebSocket and HTTP APIs, use Amazon API Gateway Version 2 [resources](https://www.terraform.io/docs/providers/aws/r/api_gatewayv2_api.html).
-> **Note:** Amazon API Gateway Version 1 resources are used for creating and deploying REST APIs. To create and deploy WebSocket and HTTP APIs, use Amazon API Gateway Version 2 [resources](https://www.terraform.io/docs/providers/aws/r/apigatewayv2_api.html).

## Example Usage

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
subcategory: "API Gateway (WebSocket and HTTP APIs)"
layout: "aws"
page_title: "AWS: aws_api_gatewayv2_api"
page_title: "AWS: aws_apigatewayv2_api"
description: |-
Manages an Amazon API Gateway Version 2 API.
---

# Resource: aws_api_gatewayv2_api
# Resource: aws_apigatewayv2_api

Manages an Amazon API Gateway Version 2 API.

Expand All @@ -17,7 +17,7 @@ Manages an Amazon API Gateway Version 2 API.
### Basic WebSocket API

```hcl
resource "aws_api_gatewayv2_api" "example" {
resource "aws_apigatewayv2_api" "example" {
name = "example-websocket-api"
protocol_type = "WEBSOCKET"
route_selection_expression = "$request.body.action"
Expand All @@ -27,7 +27,7 @@ resource "aws_api_gatewayv2_api" "example" {
### Basic HTTP API

```hcl
resource "aws_api_gatewayv2_api" "example" {
resource "aws_apigatewayv2_api" "example" {
name = "example-http-api"
protocol_type = "HTTP"
}
Expand Down Expand Up @@ -61,8 +61,8 @@ See the [Amazon API Gateway Developer Guide](https://docs.aws.amazon.com/apigate

## Import

`aws_api_gatewayv2_api` can be imported by using the API identifier, e.g.
`aws_apigatewayv2_api` can be imported by using the API identifier, e.g.

```
$ terraform import aws_api_gatewayv2_api.example aabbccddee
$ terraform import aws_apigatewayv2_api.example aabbccddee
```

0 comments on commit 46a3572

Please sign in to comment.