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: ALB gets recreated when no SG is defined #8264

Closed
radeksimko opened this issue Aug 17, 2016 · 2 comments · Fixed by #8269
Closed

provider/aws: ALB gets recreated when no SG is defined #8264

radeksimko opened this issue Aug 17, 2016 · 2 comments · Fixed by #8269

Comments

@radeksimko
Copy link
Member

Terraform Version

Terraform v0.7.1-dev (dd2740d4fec9d1846026301e0b527a55246ccf52)

Affected Resource(s)

  • aws_alb

Terraform Configuration Files

resource "aws_vpc" "main" {
  cidr_block = "10.10.0.0/16"
}

resource "aws_subnet" "first" {
  cidr_block = "10.10.1.0/24"
  vpc_id = "${aws_vpc.main.id}"
}

resource "aws_subnet" "second" {
  cidr_block = "10.10.2.0/24"
  vpc_id = "${aws_vpc.main.id}"
}

resource "aws_alb" "main" {
  name            = "test-alb-tf"
  subnets         = ["${aws_subnet.first.id}", "${aws_subnet.second.id}"]
}

Expected Behavior

$ terraform plan

No diff.

Actual Behavior

$ terraform plan
-/+ aws_alb.main
    dns_name:                   "test-alb-tf-319967521.us-west-2.elb.amazonaws.com" => "<computed>"
    enable_deletion_protection: "false" => "false"
    idle_timeout:               "60" => "60"
    internal:                   "false" => "<computed>"
    name:                       "test-alb-tf" => "test-alb-tf"
    security_groups.#:          "1" => "0" (forces new resource)
    security_groups.289196067:  "sg-81cbcae4" => ""
    subnets.#:                  "2" => "2"
    subnets.6620723:            "subnet-f9297b8d" => "subnet-f9297b8d"
    subnets.704553415:          "subnet-f5c3a873" => "subnet-f5c3a873"
    vpc_id:                     "vpc-fd351998" => "<computed>"
    zone_id:                    "Z1H1FL5HABSF5" => "<computed>"

Steps to Reproduce

  1. terraform apply
  2. terraform plan
@radeksimko radeksimko changed the title provider/aws: ALB security group gets recreated when no SG is defined provider/aws: ALB gets recreated when no SG is defined Aug 17, 2016
@jen20
Copy link
Contributor

jen20 commented Aug 17, 2016

Looks like they assign a default security group - this will need marking as Computed. I'll follow up soon. Tagging #8137 for tracking purposes.

jen20 added a commit that referenced this issue Aug 17, 2016
This commit fixes #8264 by making the security_groups attribute on
aws_alb resources computed, allowing the default security group assigned
by AWS to not generate perpetual plans forcing new resources.
jen20 added a commit that referenced this issue Aug 18, 2016
This commit fixes #8264 by making the security_groups attribute on
aws_alb resources computed, allowing the default security group assigned
by AWS to not generate perpetual plans forcing new resources.
radeksimko pushed a commit that referenced this issue Aug 18, 2016
This commit fixes #8264 by making the security_groups attribute on
aws_alb resources computed, allowing the default security group assigned
by AWS to not generate perpetual plans forcing new resources.
kwilczynski pushed a commit to kwilczynski/terraform that referenced this issue Aug 18, 2016
This commit fixes hashicorp#8264 by making the security_groups attribute on
aws_alb resources computed, allowing the default security group assigned
by AWS to not generate perpetual plans forcing new resources.
@ghost
Copy link

ghost commented Apr 23, 2020

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.

@ghost ghost locked and limited conversation to collaborators Apr 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants