Terraform: aws_lambda_function.vpc_config always detects a change when empty

Created on 22 Dec 2016  ยท  5Comments  ยท  Source: hashicorp/terraform

Terraform Version

0.8.2

Affected Resource(s)

aws_lambda_function

Terraform Configuration Files

# Only relevant parts shown

variable "subnet_ids" {
  default = []
}

variable "security_group_ids" {
  default = []
}

resource "aws_lambda_function" "lambda" {
  vpc_config {
    subnet_ids         = ["${var.subnet_ids}"]
    security_group_ids = ["${var.security_group_ids}"]
  }
}

Expected Behavior

Right after applying, terraform plan should not detect any change since there aren't any.

Actual Behavior

Right after applying, terraform plan detects a change in vpc_config. If you apply the change, terraform plan will still detect the same change over and over again.

Relevant part of the output:

-/+ module.auth.authorizer.authorizer_lambda.aws_lambda_function.lambda
    vpc_config.#:        "0" => "1" (forces new resource)
    vpc_config.0.vpc_id: "" => "<computed>"

Steps to Reproduce

  1. terraform plan
  2. terraform apply
  3. repeat

References

Seem to be related:

bug provideaws

Most helpful comment

This is still happening in 0.11.3. Any updates here?

All 5 comments

We've been seeing this behavior since 0.7.13.

Anything happening here?

This is still happening in 0.9.4.

This is still happening in 0.11.3. Any updates here?

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

shanmugakarna picture shanmugakarna  ยท  3Comments

rjinski picture rjinski  ยท  3Comments

larstobi picture larstobi  ยท  3Comments

ronnix picture ronnix  ยท  3Comments

sprokopiak picture sprokopiak  ยท  3Comments