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

aws_placement_group is replaced although it is not modified #21446

Closed
shibataka000 opened this issue Oct 22, 2021 · 4 comments · Fixed by #21555
Closed

aws_placement_group is replaced although it is not modified #21446

shibataka000 opened this issue Oct 22, 2021 · 4 comments · Fixed by #21555
Labels
bug Addresses a defect in current functionality. service/ec2 Issues and PRs that pertain to the ec2 service.
Milestone

Comments

@shibataka000
Copy link
Contributor

shibataka000 commented Oct 22, 2021

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 other comments that do not add relevant new information or questions, 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 CLI and Terraform AWS Provider Version

$ terraform -v
Terraform v1.0.9
on linux_amd64
+ provider registry.terraform.io/hashicorp/aws v3.63.0

Affected Resource(s)

  • aws_placement_group

Terraform Configuration Files

Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.

provider "aws" {
  region = "us-west-2"
}

resource "aws_placement_group" "web" {
  name     = "hunky-dory-pg"
  strategy = "partition"
}

Debug Output

https://gist.github.com/shibataka000/3e666af6df5d0ab45dd0d67f4c6472b7

Panic Output

None

Expected Behavior

  1. When I run terraform apply at first, it create placement group resource.
  2. when I run terraform apply again, it doesn't do nothing because terraform configuration files isn't be modified.

Actual Behavior

  1. When I run terraform apply at first, it create placement group resource.
  2. when I run terraform apply again, it try to re-create placement group resource although terraform configuration files isn't be modified.
$ terraform apply
aws_placement_group.web: Refreshing state... [id=hunky-dory-pg]

Note: Objects have changed outside of Terraform

Terraform detected the following changes made outside of Terraform since the last "terraform apply":

  # aws_placement_group.web has been changed
  ~ resource "aws_placement_group" "web" {
        id                 = "hunky-dory-pg"
        name               = "hunky-dory-pg"
      + tags               = {}
        # (5 unchanged attributes hidden)
    }

Unless you have made equivalent changes to your configuration, or ignored the relevant attributes using ignore_changes, the following plan may include actions to undo or respond to these changes.

──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
-/+ destroy and then create replacement

Terraform will perform the following actions:

  # aws_placement_group.web must be replaced
-/+ resource "aws_placement_group" "web" {
      ~ arn                = "arn:aws:ec2:us-west-2:xxxxxxxxxxxx:placement-group/hunky-dory-pg" -> (known after apply)
      ~ id                 = "hunky-dory-pg" -> (known after apply)
        name               = "hunky-dory-pg"
      - partition_count    = 2 -> null # forces replacement
      ~ placement_group_id = "pg-0057f420f46db65a8" -> (known after apply)
      - tags               = {} -> null
      ~ tags_all           = {} -> (known after apply)
        # (1 unchanged attribute hidden)
    }

Plan: 1 to add, 0 to change, 1 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

aws_placement_group.web: Destroying... [id=hunky-dory-pg]
aws_placement_group.web: Destruction complete after 1s
aws_placement_group.web: Creating...
aws_placement_group.web: Creation complete after 1s [id=hunky-dory-pg]

Apply complete! Resources: 1 added, 0 changed, 1 destroyed.

Steps to Reproduce

Run terraform apply twice.

Important Factoids

None

References

None

@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. service/ec2 Issues and PRs that pertain to the ec2 service. labels Oct 22, 2021
@shibataka000
Copy link
Contributor Author

I guess this might be related to #15360 .

@ewbankkit ewbankkit added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Oct 22, 2021
@strngr
Copy link

strngr commented Nov 1, 2021

@shibataka000, indeed, it seems that the bug was introduced in version 3.63, because I was able to make a plan clean by setting version constraint to version = "~> 3.17, < 3.63"

@github-actions
Copy link

github-actions bot commented Nov 4, 2021

This functionality has been released in v3.64.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 May 31, 2022
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.
Projects
None yet
3 participants