Terraform-provider-aws: provider/aws: Add import support for API Gateway resources

Created on 13 Jun 2017  路  5Comments  路  Source: hashicorp/terraform-provider-aws

_This issue was originally opened by @Vinnl as hashicorp/terraform#12250. It was migrated here as part of the provider split. The original body of the issue is below._


(I wasn't sure if I had to create separate issues for all of these - most of them are only useful together with some of the others. If you prefer separate issues, do let me know.)

Terraform Version

At least up to v0.8.7

Affected Resource(s)

The following resources are required to set up a proxy integration with an AWS Lambda function for API Gateway, and do not support importability yet:

  • aws_api_gateway_resource
  • aws_api_gateway_method
  • aws_api_gateway_integration
  • aws_lambda_permission
  • aws_api_gateway_method_response
  • aws_api_gateway_integration_response
  • aws_api_gateway_deployment

Expected Behavior

Running the import command for these resources should update the state.

Actual Behavior

Message resource <resource> doesn't support import.

enhancement servicapigateway

Most helpful comment

+1 for "aws_api_gateway_deployment" import

All 5 comments

A few more for the API Gateway import list - would love to see these! =]

  • aws_api_gateway_rest_api
  • aws_api_gateway_stage
  • aws_api_gateway_gateway_response
  • aws_api_gateway_domain_name

Pull requests submitted:

  • resource/aws_api_gateway_base_path_mapping: Support resource import #5566
  • resource/aws_api_gateway_gateway_response: Support resource import #5567
  • resource/aws_api_gateway_integration: Support resource import #5568
  • resource/aws_api_gateway_integration_response: Support resource import #5569
  • resource/aws_api_gateway_method_response: Support resource import #5570
  • resource/aws_api_gateway_method: Support resource import #5571
  • resource/aws_api_gateway_model: Support resource import #5572
  • resource/aws_api_gateway_request_validator: Support resource import #5573
  • resource/aws_api_gateway_resource: Support resource import #5574
  • resource/aws_api_gateway_rest_api: Support resource import #5564
  • resource/aws_api_gateway_stage: Support resource import #5575

aws_api_gateway_deployment looks like it will require some major refactoring to support import.

The above mentioned PRs have been merged and released in version 1.33.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

@bflad Could you please also add import support for aws_lambda_permission? @Vinnl mentioned it in the original list of resources, but it seems to have slipped through the cracks. Saves me from opening a brand-new issue. :)

+1 for "aws_api_gateway_deployment" import

Was this page helpful?
0 / 5 - 0 ratings