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

Modify group aws with module #787

Closed
hashibot opened this issue Jun 13, 2017 · 2 comments
Closed

Modify group aws with module #787

hashibot opened this issue Jun 13, 2017 · 2 comments
Labels
bug Addresses a defect in current functionality. service/iam Issues and PRs that pertain to the iam service.

Comments

@hashibot
Copy link

This issue was originally opened by @inceptor as hashicorp/terraform#14692. It was migrated here as part of the provider split. The original body of the issue is below.


Hello,

This is my first post, so, if I do some mistake (naming, leak of informations, etc) claim it!

I trying to create groups iam (on aws) by a TF module.
This module take a var list with names of groups in param (ex: names=["dev", "ops"]).
The module will create these groups (with the count).

The groups creation work. But, when I try to change a name of one group in the var list (ex: names=["develop", "ops"]), the modification work but the TF state is... Not updated.

Terraform Version

v9.4

Affected Resource(s)

  • module
  • aws_iam_group

Terraform Configuration Files

main.tf

module "group" {
  source = "../../../../../modules/iam/group"

  groups_names = "${var.names}"
}

output "names" {
  value = ["${module.group.names}"]
}

module group

resource "aws_iam_group" "groups" {
  count = "${length(var.groups_names)}"

  name  = "${element(var.groups_names, count.index)}"
  path  = "/"

  lifecycle {
    create_before_destroy = false
  }
}

output "names" {
  value = ["${aws_iam_group.groups.*.name}"]
}

Example of tfvars

Original :
names = ["dev", "tester", "ops"]

Modification :
names = ["develop", "test", "ops"]

Debug Output

Before modification :

After modification :

If I do terraform show, there is no trace of team-fem or groups.2

Panic Output

If I redo an apply :

Expected Behavior

Just a group renaming without error

Actual Behavior

Error, the group "EntityAlreadyExists".
In AWS, the group is well renamed.
But the TF state is not update or no trace of the ressource ?

Steps to Reproduce

  1. Put group names in the var list "names"
  2. terraform apply
  3. The groups are created. Change the name of one or more groups and do : terraform apply
  4. The group(s) is renamed but if you redo terraform applythere is an error "EntityAlreadyExists"

Important Factoids

None.

Thank you for your help !

@hashibot hashibot added the bug Addresses a defect in current functionality. label Jun 13, 2017
@radeksimko radeksimko added the service/iam Issues and PRs that pertain to the iam service. label Jan 27, 2018
@bflad
Copy link
Contributor

bflad commented May 3, 2018

Closing this issue to focus discussion and efforts in the earlier duplicate: #620

@bflad bflad closed this as completed May 3, 2018
@ghost
Copy link

ghost commented Apr 6, 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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Apr 6, 2020
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/iam Issues and PRs that pertain to the iam service.
Projects
None yet
Development

No branches or pull requests

3 participants