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_organization feature_set change should not force new resource #15462

Closed
ryandeivert opened this issue Oct 2, 2020 · 6 comments · Fixed by #15473
Closed
Assignees
Labels
bug Addresses a defect in current functionality. service/organizations Issues and PRs that pertain to the organizations service.
Milestone

Comments

@ryandeivert
Copy link
Contributor

ryandeivert commented Oct 2, 2020

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 version: 0.13.1
AWS Provider version: 3.9.0

Affected Resource(s)

  • aws_organizations_organization

Terraform Configuration Files

When updating the following resource from the "before" to "after", terraform the following org resource from:

Before

resource "aws_organizations_organization" "org" {
  feature_set = "CONSOLIDATED_BILLING"
}

After

resource "aws_organizations_organization" "org" {
  aws_service_access_principals = [
    "cloudtrail.amazonaws.com",
  ]

  feature_set = "ALL"
}

Debug Output

-/+ aws_organizations_organization.org (new resource required)
      id:                                       "o-example" => <computed> (forces new resource)
      accounts.#:                               "2" => <computed>
      arn:                                      "arn:aws:organizations::123456789012:organization/o-example" => <computed>
      aws_service_access_principals.#:          "0" => "1"
      aws_service_access_principals.123456789: "" => "cloudtrail.amazonaws.com"
      feature_set:                              "CONSOLIDATED_BILLING" => "ALL" (forces new resource)
      master_account_arn:                       "arn:aws:organizations::123456789012:account/o-example/123456789012" => <computed>
      master_account_email:                     "email@foobar.com" => <computed>
      master_account_id:                        "123456789012" => <computed>
      non_master_accounts.#:                    "1" => <computed>
      roots.#:                                  "1" => <computed>

Panic Output

Expected Behavior

The change to feature_set does not force a new resource, which would generate a new Org ID. The feature set can be changed in Console without creating a new org ID, and I was informed by AWS that this should not need to generate a new org ID.

Actual Behavior

A new resource if forced when feature_set is changed from CONSOLIDATED_BILLING to ALL. This should only force a new resource if going from ALL to CONSOLIDATED_BILLING, according to this note on this page:

The migration from consolidated billing features to all features is one-way. You can't switch an organization with all features enabled back to consolidated billing features only.

Steps to Reproduce

  1. terraform apply using the config above

Important Factoids

References

N/A

@ghost ghost added the service/organizations Issues and PRs that pertain to the organizations service. label Oct 2, 2020
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Oct 2, 2020
@philnichol
Copy link
Contributor

Looks like it's possible to do this, although once you enable All Features it can't be reverted. I'd be interested in attempting to solve this if that's alright?

@ryandeivert
Copy link
Contributor Author

@philnichol yep I believe that is the case. I just put a PR up for the fix here if you'd like to comment: #15473

@philnichol
Copy link
Contributor

@ryandeivert your solution is 1000x more elegant than what I was thinking :) didn’t even know about ForceNewIfChange, nice one!

@anGie44 anGie44 added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Oct 6, 2020
@anGie44 anGie44 self-assigned this Nov 4, 2020
anGie44 added a commit that referenced this issue Nov 13, 2020
…zation-15462

adding fix for aws org feature_set update issue from #15462
@anGie44
Copy link
Contributor

anGie44 commented Nov 13, 2020

The proposed fix has been merged and will release with version 3.16.0 of the Terraform AWS Provider, expected out next Thursday.

@anGie44 anGie44 added this to the v3.16.0 milestone Nov 13, 2020
@ghost
Copy link

ghost commented Nov 18, 2020

This has been released in version 3.16.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 Dec 13, 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 as resolved and limited conversation to collaborators Dec 13, 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/organizations Issues and PRs that pertain to the organizations service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants