Skip to content

Commit

Permalink
'aws_api_gateway2_route' -> 'aws_apigatewayv2_route'.
Browse files Browse the repository at this point in the history
Acceptance test output:

$ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSAPIGatewayV2Route_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -count 1 -parallel 20 -run=TestAccAWSAPIGatewayV2Route_ -timeout 120m
=== RUN   TestAccAWSAPIGatewayV2Route_basic
=== PAUSE TestAccAWSAPIGatewayV2Route_basic
=== RUN   TestAccAWSAPIGatewayV2Route_disappears
=== PAUSE TestAccAWSAPIGatewayV2Route_disappears
=== RUN   TestAccAWSAPIGatewayV2Route_Model
=== PAUSE TestAccAWSAPIGatewayV2Route_Model
=== RUN   TestAccAWSAPIGatewayV2Route_SimpleAttributes
=== PAUSE TestAccAWSAPIGatewayV2Route_SimpleAttributes
=== RUN   TestAccAWSAPIGatewayV2Route_Target
=== PAUSE TestAccAWSAPIGatewayV2Route_Target
=== CONT  TestAccAWSAPIGatewayV2Route_basic
=== CONT  TestAccAWSAPIGatewayV2Route_SimpleAttributes
=== CONT  TestAccAWSAPIGatewayV2Route_Model
=== CONT  TestAccAWSAPIGatewayV2Route_Target
=== CONT  TestAccAWSAPIGatewayV2Route_disappears
--- PASS: TestAccAWSAPIGatewayV2Route_disappears (23.60s)
--- PASS: TestAccAWSAPIGatewayV2Route_basic (26.45s)
--- PASS: TestAccAWSAPIGatewayV2Route_Target (28.53s)
--- PASS: TestAccAWSAPIGatewayV2Route_Model (29.18s)
--- PASS: TestAccAWSAPIGatewayV2Route_SimpleAttributes (58.48s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	58.539s
  • Loading branch information
ewbankkit committed Apr 9, 2020
1 parent e6e5b77 commit 0231daa
Show file tree
Hide file tree
Showing 5 changed files with 163 additions and 111 deletions.
2 changes: 1 addition & 1 deletion aws/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ func Provider() terraform.ResourceProvider {
"aws_apigatewayv2_authorizer": resourceAwsApiGatewayV2Authorizer(),
"aws_apigatewayv2_integration": resourceAwsApiGatewayV2Integration(),
"aws_apigatewayv2_model": resourceAwsApiGatewayV2Model(),
"aws_api_gateway_v2_route": resourceAwsApiGateway2Route(),
"aws_apigatewayv2_route": resourceAwsApiGatewayV2Route(),
"aws_app_cookie_stickiness_policy": resourceAwsAppCookieStickinessPolicy(),
"aws_appautoscaling_target": resourceAwsAppautoscalingTarget(),
"aws_appautoscaling_policy": resourceAwsAppautoscalingPolicy(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/helper/validation"
)

func resourceAwsApiGateway2Route() *schema.Resource {
func resourceAwsApiGatewayV2Route() *schema.Resource {
return &schema.Resource{
Create: resourceAwsApiGateway2RouteCreate,
Read: resourceAwsApiGateway2RouteRead,
Update: resourceAwsApiGateway2RouteUpdate,
Delete: resourceAwsApiGateway2RouteDelete,
Create: resourceAwsApiGatewayV2RouteCreate,
Read: resourceAwsApiGatewayV2RouteRead,
Update: resourceAwsApiGatewayV2RouteUpdate,
Delete: resourceAwsApiGatewayV2RouteDelete,
Importer: &schema.ResourceImporter{
State: resourceAwsApiGateway2RouteImport,
State: resourceAwsApiGatewayV2RouteImport,
},

Schema: map[string]*schema.Schema{
Expand Down Expand Up @@ -77,7 +77,7 @@ func resourceAwsApiGateway2Route() *schema.Resource {
}
}

func resourceAwsApiGateway2RouteCreate(d *schema.ResourceData, meta interface{}) error {
func resourceAwsApiGatewayV2RouteCreate(d *schema.ResourceData, meta interface{}) error {
conn := meta.(*AWSClient).apigatewayv2conn

req := &apigatewayv2.CreateRouteInput{
Expand Down Expand Up @@ -113,10 +113,10 @@ func resourceAwsApiGateway2RouteCreate(d *schema.ResourceData, meta interface{})

d.SetId(aws.StringValue(resp.RouteId))

return resourceAwsApiGateway2RouteRead(d, meta)
return resourceAwsApiGatewayV2RouteRead(d, meta)
}

func resourceAwsApiGateway2RouteRead(d *schema.ResourceData, meta interface{}) error {
func resourceAwsApiGatewayV2RouteRead(d *schema.ResourceData, meta interface{}) error {
conn := meta.(*AWSClient).apigatewayv2conn

resp, err := conn.GetRoute(&apigatewayv2.GetRouteInput{
Expand Down Expand Up @@ -147,7 +147,7 @@ func resourceAwsApiGateway2RouteRead(d *schema.ResourceData, meta interface{}) e
return nil
}

func resourceAwsApiGateway2RouteUpdate(d *schema.ResourceData, meta interface{}) error {
func resourceAwsApiGatewayV2RouteUpdate(d *schema.ResourceData, meta interface{}) error {
conn := meta.(*AWSClient).apigatewayv2conn

req := &apigatewayv2.UpdateRouteInput{
Expand Down Expand Up @@ -185,10 +185,10 @@ func resourceAwsApiGateway2RouteUpdate(d *schema.ResourceData, meta interface{})
return fmt.Errorf("error updating API Gateway v2 route: %s", err)
}

return resourceAwsApiGateway2RouteRead(d, meta)
return resourceAwsApiGatewayV2RouteRead(d, meta)
}

func resourceAwsApiGateway2RouteDelete(d *schema.ResourceData, meta interface{}) error {
func resourceAwsApiGatewayV2RouteDelete(d *schema.ResourceData, meta interface{}) error {
conn := meta.(*AWSClient).apigatewayv2conn

log.Printf("[DEBUG] Deleting API Gateway v2 route (%s)", d.Id())
Expand All @@ -206,7 +206,7 @@ func resourceAwsApiGateway2RouteDelete(d *schema.ResourceData, meta interface{})
return nil
}

func resourceAwsApiGateway2RouteImport(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) {
func resourceAwsApiGatewayV2RouteImport(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) {
parts := strings.Split(d.Id(), "/")
if len(parts) != 2 {
return []*schema.ResourceData{}, fmt.Errorf("Wrong format of resource: %s. Please follow 'api-id/route-id'", d.Id())
Expand Down
Loading

0 comments on commit 0231daa

Please sign in to comment.