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 Organizations account tagging #8896

Closed
ewbankkit opened this issue Jun 6, 2019 · 5 comments · Fixed by #9202
Closed

AWS Organizations account tagging #8896

ewbankkit opened this issue Jun 6, 2019 · 5 comments · Fixed by #9202
Assignees
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/organizations Issues and PRs that pertain to the organizations service.
Milestone

Comments

@ewbankkit
Copy link
Contributor

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

Description

As of AWS SDK v1.19.45 AWS Organization accounts can be tagged:

You can tag and untag accounts in your organization and view tags on an account in your organization.

Requires:

@ewbankkit ewbankkit added the enhancement Requests to existing resources that expand the functionality or scope. label Jun 6, 2019
@ewbankkit
Copy link
Contributor Author

Affected resources:

@bflad bflad added the service/organizations Issues and PRs that pertain to the organizations service. label Jun 7, 2019
@bflad bflad self-assigned this Jul 2, 2019
bflad added a commit that referenced this issue Jul 2, 2019
Reference: #8896

AWS Organizations Account testing is manual due to the lack of an automated deletion APIs. Manually verified with locally updated Terraform AWS Provider binary.

Starting configuration:

```hcl
resource "aws_organizations_account" "bflad-dev2" {
  name  = "bflad-dev2"
  email = "--OMITTED--"
}
```

Planned:

```console
$ terraform plan
...
No changes. Infrastructure is up-to-date.
```

Updated configuration:

```hcl
resource "aws_organizations_account" "bflad-dev2" {
  name  = "bflad-dev2"
  email = "--OMITTED--"

  tags = {
    key1 = "value1"
  }
}
```

Applied and state:

```console
$ terraform apply
...
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # aws_organizations_account.bflad-dev2 will be updated in-place
  ~ resource "aws_organizations_account" "bflad-dev2" {
        arn           = "arn:aws:organizations::--OMITTED--:account/o-p687o6l073/--OMITTED--"
        email         = "--OMITTED--"
        id            = "--OMITTED--"
        joined_method = "INVITED"
        name          = "bflad-dev2"
        parent_id     = "r-cg2b"
        status        = "ACTIVE"
      ~ tags          = {
          + "key1" = "value1"
        }
    }

Plan: 0 to add, 1 to change, 0 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_organizations_account.bflad-dev2: Modifying... [id=--OMITTED--]
aws_organizations_account.bflad-dev2: Modifications complete after 0s [id=--OMITTED--]

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

$ terraform state show aws_organizations_account.bflad-dev2
resource "aws_organizations_account" "bflad-dev2" {
    arn           = "arn:aws:organizations::--OMITTED--:account/o-p687o6l073/--OMITTED--"
    email         = "--OMITTED--"
    id            = "--OMITTED--"
    joined_method = "INVITED"
    name          = "bflad-dev2"
    parent_id     = "r-cg2b"
    status        = "ACTIVE"
    tags          = {
        "key1" = "value1"
    }
}
```

Updated configuration:

```hcl
resource "aws_organizations_account" "bflad-dev2" {
  name  = "bflad-dev2"
  email = "--OMITTED--"

  tags = {
    key1 = "value1updated"
    key2 = "value2"
  }
}
```

Applied and state:

```console
$ terraform apply
...
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # aws_organizations_account.bflad-dev2 will be updated in-place
  ~ resource "aws_organizations_account" "bflad-dev2" {
        arn           = "arn:aws:organizations::--OMITTED--:account/o-p687o6l073/--OMITTED--"
        email         = "--OMITTED--"
        id            = "--OMITTED--"
        joined_method = "INVITED"
        name          = "bflad-dev2"
        parent_id     = "r-cg2b"
        status        = "ACTIVE"
      ~ tags          = {
          ~ "key1" = "value1" -> "value1updated"
          + "key2" = "value2"
        }
    }

Plan: 0 to add, 1 to change, 0 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_organizations_account.bflad-dev2: Modifying... [id=--OMITTED--]
aws_organizations_account.bflad-dev2: Modifications complete after 1s [id=--OMITTED--]

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

$ terraform state show aws_organizations_account.bflad-dev2
resource "aws_organizations_account" "bflad-dev2" {
    arn           = "arn:aws:organizations::--OMITTED--:account/o-p687o6l073/--OMITTED--"
    email         = "--OMITTED--"
    id            = "--OMITTED--"
    joined_method = "INVITED"
    name          = "bflad-dev2"
    parent_id     = "r-cg2b"
    status        = "ACTIVE"
    tags          = {
        "key1" = "value1updated"
        "key2" = "value2"
    }
}
```

Updated configuration:

```hcl
resource "aws_organizations_account" "bflad-dev2" {
  name  = "bflad-dev2"
  email = "--OMITTED--"
}
```

Applied and state:

```console
$ terraform apply
...
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # aws_organizations_account.bflad-dev2 will be updated in-place
  ~ resource "aws_organizations_account" "bflad-dev2" {
        arn           = "arn:aws:organizations::--OMITTED--:account/o-p687o6l073/--OMITTED--"
        email         = "--OMITTED--"
        id            = "--OMITTED--"
        joined_method = "INVITED"
        name          = "bflad-dev2"
        parent_id     = "r-cg2b"
        status        = "ACTIVE"
      ~ tags          = {
          - "key1" = "value1updated" -> null
          - "key2" = "value2" -> null
        }
    }

Plan: 0 to add, 1 to change, 0 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_organizations_account.bflad-dev2: Modifying... [id=--OMITTED--]
aws_organizations_account.bflad-dev2: Modifications complete after 0s [id=--OMITTED--]

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

$ terraform state show aws_organizations_account.bflad-dev2
resource "aws_organizations_account" "bflad-dev2" {
    arn           = "arn:aws:organizations::--OMITTED--:account/o-p687o6l073/--OMITTED--"
    email         = "--OMITTED--"
    id            = "--OMITTED--"
    joined_method = "INVITED"
    name          = "bflad-dev2"
    parent_id     = "r-cg2b"
    status        = "ACTIVE"
    tags          = {}
}
```
@bflad
Copy link
Contributor

bflad commented Jul 2, 2019

Pull request submitted: #9202

@bflad bflad added this to the v2.19.0 milestone Jul 8, 2019
@bflad
Copy link
Contributor

bflad commented Jul 8, 2019

Support for tagging with the aws_organizations_account resource has been merged and will release with version 2.19.0 of the Terraform AWS Provider, likely later this week. 👍

@bflad
Copy link
Contributor

bflad commented Jul 11, 2019

This has been released in version 2.19.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 for triage. Thanks!

@ghost
Copy link

ghost commented Nov 2, 2019

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 Nov 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/organizations Issues and PRs that pertain to the organizations service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants