Skip to content
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

provider/aws: Add import support for API Gateway resources #558

Closed
hashibot opened this issue Jun 13, 2017 · 13 comments · Fixed by #28030
Closed

provider/aws: Add import support for API Gateway resources #558

hashibot opened this issue Jun 13, 2017 · 13 comments · Fixed by #28030
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/apigateway Issues and PRs that pertain to the apigateway service.
Milestone

Comments

@hashibot
Copy link

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.

@hashibot hashibot added the enhancement Requests to existing resources that expand the functionality or scope. label Jun 13, 2017
@radeksimko radeksimko added the service/apigateway Issues and PRs that pertain to the apigateway service. label Jan 25, 2018
@tdmalone
Copy link
Contributor

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

@bflad
Copy link
Contributor

bflad commented Aug 16, 2018

Pull requests submitted:

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

@bflad
Copy link
Contributor

bflad commented Aug 22, 2018

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.

@erikpaasonen
Copy link
Contributor

@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. :)

@kladiv
Copy link

kladiv commented Apr 12, 2019

+1 for "aws_api_gateway_deployment" import

@github-actions
Copy link

github-actions bot commented Apr 2, 2021

Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label.

If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you!

@github-actions github-actions bot added the stale Old or inactive issues managed by automation, if no further action taken these will get closed. label Apr 2, 2021
@vinischeidegger
Copy link

Please don't forget the aws_api_gateway_deployment import functionality.

@ghost ghost removed the stale Old or inactive issues managed by automation, if no further action taken these will get closed. label Apr 16, 2021
@natblundell
Copy link

+1 for "aws_api_gateway_deployment" import

@qingvincentyin
Copy link

qingvincentyin commented Mar 25, 2022

Re:

  • aws_api_gateway_deployment

Before that is implemented (eagerly waiting), I am hacking the terraform.tfstate file to copy-paste in a block like the following (in conjunction with terraform state pull/push). It seems to work.

  • Note: In the following JSON, the dependencies array will be particular to how your terraform source code is written.
    {
      "mode": "managed",
      "type": "aws_api_gateway_deployment",
      "name": "notification_time",
      "provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
      "instances": [
        {
          "schema_version": 0,
          "attributes": {
            "created_date": "2018-05-29T17:10:43Z",
            "description": "",
            "execution_arn": "arn:aws:execute-api:us-west-2:111122223333:******/******",
            "id": "******",
            "invoke_url": "https://******.execute-api.us-west-2.amazonaws.com/******",
            "rest_api_id": "******",
            "stage_description": null,
            "stage_name": "******",
            "triggers": null,
            "variables": null
          },
          "sensitive_attributes": [],
          "dependencies": [
            "aws_api_gateway_integration.notification_time",
            "aws_api_gateway_method.notification_time",
            "aws_api_gateway_resource.notification_time",
            "data.aws_api_gateway_resource.v1",
            "data.aws_api_gateway_rest_api.api_gateway"
          ]
        }
      ]
    },
$ terraform version
Terraform v1.1.4
on linux_amd64
+ provider registry.terraform.io/hashicorp/aws v3.75.1

@CSimpiFoN
Copy link

These would be very useful. +1 for the feature

@bluenick2k17
Copy link
Contributor

I've got a pull request open for the last ask left in this issue, the ability to import aws_api_gateway_deployment. If you are keeping an eye on this and are eagerly awaiting the enhancement, please consider giving the PR a 👍 to support prioritizing it. Thanks!

#28030 (comment)

@github-actions github-actions bot added this to the v4.44.0 milestone Nov 30, 2022
@github-actions
Copy link

This functionality has been released in v4.44.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. Thank you!

@github-actions
Copy link

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 31, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/apigateway Issues and PRs that pertain to the apigateway service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.