Skip to content

Commit

Permalink
Rename resource to 'aws_apigatewayv2_route_response'.
Browse files Browse the repository at this point in the history
  • Loading branch information
ewbankkit committed Apr 15, 2020
1 parent 7ecef9c commit 1d45f80
Show file tree
Hide file tree
Showing 6 changed files with 236 additions and 187 deletions.
2 changes: 1 addition & 1 deletion aws/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ func Provider() terraform.ResourceProvider {
"aws_apigatewayv2_integration_response": resourceAwsApiGatewayV2IntegrationResponse(),
"aws_apigatewayv2_model": resourceAwsApiGatewayV2Model(),
"aws_apigatewayv2_route": resourceAwsApiGatewayV2Route(),
"aws_api_gateway_v2_route_response": resourceAwsApiGateway2RouteResponse(),
"aws_apigatewayv2_route_response": resourceAwsApiGatewayV2RouteResponse(),
"aws_app_cookie_stickiness_policy": resourceAwsAppCookieStickinessPolicy(),
"aws_appautoscaling_target": resourceAwsAppautoscalingTarget(),
"aws_appautoscaling_policy": resourceAwsAppautoscalingPolicy(),
Expand Down
163 changes: 0 additions & 163 deletions aws/resource_aws_api_gateway2_route_response_test.go

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
)

func resourceAwsApiGateway2RouteResponse() *schema.Resource {
func resourceAwsApiGatewayV2RouteResponse() *schema.Resource {
return &schema.Resource{
Create: resourceAwsApiGateway2RouteResponseCreate,
Read: resourceAwsApiGateway2RouteResponseRead,
Update: resourceAwsApiGateway2RouteResponseUpdate,
Delete: resourceAwsApiGateway2RouteResponseDelete,
Create: resourceAwsApiGatewayV2RouteResponseCreate,
Read: resourceAwsApiGatewayV2RouteResponseRead,
Update: resourceAwsApiGatewayV2RouteResponseUpdate,
Delete: resourceAwsApiGatewayV2RouteResponseDelete,
Importer: &schema.ResourceImporter{
State: resourceAwsApiGateway2RouteResponseImport,
State: resourceAwsApiGatewayV2RouteResponseImport,
},

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

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

req := &apigatewayv2.CreateRouteResponseInput{
Expand All @@ -71,10 +71,10 @@ func resourceAwsApiGateway2RouteResponseCreate(d *schema.ResourceData, meta inte

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

return resourceAwsApiGateway2RouteResponseRead(d, meta)
return resourceAwsApiGatewayV2RouteResponseRead(d, meta)
}

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

resp, err := conn.GetRouteResponse(&apigatewayv2.GetRouteResponseInput{
Expand All @@ -100,7 +100,7 @@ func resourceAwsApiGateway2RouteResponseRead(d *schema.ResourceData, meta interf
return nil
}

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

req := &apigatewayv2.UpdateRouteResponseInput{
Expand All @@ -124,10 +124,10 @@ func resourceAwsApiGateway2RouteResponseUpdate(d *schema.ResourceData, meta inte
return fmt.Errorf("error updating API Gateway v2 route response: %s", err)
}

return resourceAwsApiGateway2RouteResponseRead(d, meta)
return resourceAwsApiGatewayV2RouteResponseRead(d, meta)
}

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

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

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

0 comments on commit 1d45f80

Please sign in to comment.