Loading...
Loading...
If I change the name of a lambda function terraform correctly creates a plan about resources to create/destroy/update, but it won't do anything after running the apply command on the created plan. ### Terraform Version <!--- Run `terraform -v` to show the version, and paste the result between the ``` marks below. If you are not running the latest version of Terraform, please try upgrading because your issue may have already been fixed. --> ``` Terraform v0.11.14 ``` ### Terraform Configuration Files ```hcl resource "aws_api_gateway_rest_api" "TestApi" { name = "TestApi" } resource "aws_api_gateway_resource" "TestApiGWResource" { rest_api_id = "${aws_api_gateway_rest_api.TestApi.id}" parent_id = "${aws_api_gateway_rest_api.TestApi.root_resource_id}" path_part = "{proxy+}" } resource "aws_api_gateway_method" "TestApiGWMethod" { rest_api_id = "${aws_api_gateway_rest_api.TestApi.id}" resource_id = "${aws_api_gateway_resource.TestApiGWResource.id}" http_method = "ANY" authorization = "NONE" } resource "aws_lambda_function" "TestFunction" { function_name = "Test-${terraform.workspace}" filename = "./lambda_payload.zip" source_code_hash = "${base64sha256(file("./lambda_payload.zip"))}" handler = "index.server" runtime = "nodejs10.x" role = "${aws_iam_role.lambda_execute.arn}" } resource "aws_api_gateway_integration" "TestApiGWIntegration" { rest_api_id = "${aws_api_gateway_rest_api.TestApi.id}" resource_id = "${aws_api_gateway_method.TestApiGWMethod.resource_id}" http_method = "${aws_api_gateway_method.TestApiGWMethod.http_method}" integration_http_method = "POST" type = "AWS_PROXY" uri = "${aws_lambda_function.TestFunction.invoke_arn}" } resource "aws_api_gateway_deployment" "TestApiGWDeployment" { depends_on = [ "aws_api_gateway_integration.TestApiGWIntegration"] rest_api_id = "${aws_api_gateway_rest_api.TestApi.id}" stage_name = "${terraform.workspace}" } ``` ### Expected Behavior After changing function name and creating the plan the apply should apply those changes ### Actual Behavior `terraform plan` : Plan: 1 to add, 1 to change, 1 to destroy. `terraform apply out.plan` : Apply complete! Resources: 0 added, 0 changed, 0 destroyed. ### Steps to Reproduce After created all the resources change the value of `function_name` in "aws_lambda_function.TestFunction" `terraform plan -target="aws_api_gateway_deployment.TestApiGWDeployment" -out out.plan` `terraform apply out.plan` or `terraform apply -target="aws_api_gateway_deployment.TestApiGWDeployment" out.plan` ### Additional Context It works if I omit the -target, but I pass target as I want to target a specific deployment:( Trace log: [trace log of apply](https://gist.github.com/steveetm/75ac6481f371126a9340a0df92f3643f) ### References - #20576 (but I don't use count)
Click on a version to see all relevant bugs
Terraform Integration
Learn more about where this data comes from
Bug Scrub Advisor
Streamline upgrades with automated vendor bug scrubs
BugZero Enterprise
Wish you caught this bug sooner? Get proactive today.