-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
resource/aws_organizations_account: Add tags argument #9202
Conversation
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 = {} } ```
…t_Tags test is included in TestAccAWSOrganizations
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍 👍
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! |
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! |
Community Note
Closes #8896
Release note for CHANGELOG:
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:
Planned:
Updated configuration:
Applied and state:
Updated configuration:
Applied and state:
Updated configuration:
Applied and state: