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

Public IP4 not assigned by default #8425

Closed
mutt13y opened this issue Apr 24, 2019 · 3 comments
Closed

Public IP4 not assigned by default #8425

mutt13y opened this issue Apr 24, 2019 · 3 comments
Labels
bug Addresses a defect in current functionality. service/ec2 Issues and PRs that pertain to the ec2 service. stale Old or inactive issues managed by automation, if no further action taken these will get closed.

Comments

@mutt13y
Copy link

mutt13y commented Apr 24, 2019

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

Terraform v0.12.0-beta2

  • provider.aws v2.7.0

Affected Resource(s)

  • aws_instance
  • aws_subnet

Terraform Configuration Files

resource "aws_instance" "bastion" {
  instance_type               = local.instance["bastion"]["instance_type"]
  ami                         = data.aws_ami.amazonix.id
  subnet_id                   = aws_subnet.public[0].id
  key_name                    = var.key_name
  vpc_security_group_ids      = [aws_security_group.public.id]
  #associate_public_ip_address = true
}

resource "aws_vpc" "corp" {
  cidr_block           = var.vpc_cidr
  enable_dns_hostnames = true
}

# Define the public subnets
resource "aws_subnet" "public" {
  vpc_id                  = aws_vpc.corp.id
  count                   = length(local.aws_az)
  cidr_block              = var.public_subnet_cidr[count.index]
  availability_zone       = local.aws_az[count.index]
  map_public_ip_on_launch = true
}

Debug Output

Panic Output

Expected Behavior

With the line commented as above the instance should be assigned a public IP because this is the default for the subnet.
This was the behaviour on V0.12-beta-1 / terraform-provider-aws_1.60.0-dev20190216H00-dev

Actual Behavior

Public IP is not assigned unless the indicated line is uncommented

Steps to Reproduce

  1. terraform apply

Important Factoids

Using workspaces with S3 backend

References

Possibly related to
#227

  • #0000
@aeschright aeschright added the needs-triage Waiting for first response or review from a maintainer. label Jun 19, 2019
@aeschright aeschright added the service/ec2 Issues and PRs that pertain to the ec2 service. label Jul 3, 2019
@aeschright aeschright added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Dec 14, 2019
@rick-masters
Copy link
Contributor

I was able to reproduce this with the 0.12 beta2 and provider 2.7.0.
However, just upgrading the provider to 2.60 with that older terraform and the problem is no longer reproducible.
Nor is the problem reproducible with terraform 0.14.5.

If you are stuck on 0.12 for some reason, you can specify a provider versions like so:
terraform {
required_providers {
aws = "2.60.0"
}
}

I believe this bug can be closed.

@github-actions
Copy link

github-actions bot commented Feb 9, 2023

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 Feb 9, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 12, 2023
@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 Apr 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/ec2 Issues and PRs that pertain to the ec2 service. stale Old or inactive issues managed by automation, if no further action taken these will get closed.
Projects
None yet
Development

No branches or pull requests

3 participants