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

adding fix for aws org feature_set update issue from #15462 #15473

Merged
merged 5 commits into from
Nov 13, 2020
Merged

adding fix for aws org feature_set update issue from #15462 #15473

merged 5 commits into from
Nov 13, 2020

Conversation

ryandeivert
Copy link
Contributor

@ryandeivert ryandeivert commented Oct 4, 2020

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment 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 pull request followers and do not help prioritize the request

Closes #15462

Release note for CHANGELOG:

NONE

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccAWSOrganizations_serial/Organization/FeatureSet'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSOrganizations_serial/Organization/FeatureSet -timeout 120m
=== RUN   TestAccAWSOrganizations_serial
=== RUN   TestAccAWSOrganizations_serial/OrganizationalUnits
=== RUN   TestAccAWSOrganizations_serial/Organization
=== RUN   TestAccAWSOrganizations_serial/Organization/FeatureSet_Basic
=== RUN   TestAccAWSOrganizations_serial/Organization/FeatureSet_Update
    resource_aws_organizations_organization_test.go:413: [INFO] Got non-empty plan, as expected
    resource_aws_organizations_organization_test.go:413: [INFO] Got non-empty plan, as expected
=== RUN   TestAccAWSOrganizations_serial/Organization/FeatureSet_ForcesNew
=== RUN   TestAccAWSOrganizations_serial/OrganizationalUnit
--- PASS: TestAccAWSOrganizations_serial (141.11s)
    --- PASS: TestAccAWSOrganizations_serial/OrganizationalUnits (0.00s)
    --- PASS: TestAccAWSOrganizations_serial/Organization (141.11s)
        --- PASS: TestAccAWSOrganizations_serial/Organization/FeatureSet_Basic (27.37s)
        --- PASS: TestAccAWSOrganizations_serial/Organization/FeatureSet_Update (52.12s)
        --- PASS: TestAccAWSOrganizations_serial/Organization/FeatureSet_ForcesNew (61.62s)
    --- PASS: TestAccAWSOrganizations_serial/OrganizationalUnit (0.00s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	142.790s

@ryandeivert ryandeivert requested a review from a team October 4, 2020 05:15
@ghost ghost added size/M Managed by automation to categorize the size of a PR. service/organizations Issues and PRs that pertain to the organizations service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Oct 4, 2020
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Oct 4, 2020
Copy link
Contributor

@philnichol philnichol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ryandeivert I'm not a maintainer so feel free to ignore, but looks like feature_set changes aren't yet implemented in the Read/Update functions, so this doesn't change the infra in AWS. Might need something like (I'm quite new to TF and Go so apologies if the below examples are garbage):

// somewhere within the Read function
if err := d.Set("feature_set", org.Organization.FeatureSet); err != nil {
	return fmt.Errorf("error setting feature_set: %s", err)
}
// somewhere within the Update function
if d.HasChange("feature_set") {
	o, n := d.GetChange("feature_set")
	input := &organizations.EnableAllFeaturesInput{}
	if _, err := conn.EnableAllFeatures(input); err != nil {
		return fmt.Errorf("error changing feature_set from (%s) to (%s): %s", o, n, err)
	}
}

Also may be worth updating docs, since when you enable "All" you still have to manually go into the AWS console and click "Finalize" once all accounts have accepted the change. Until you Finalize it's left in a state where you can still revert things.

@ghost ghost added the documentation Introduces or discusses updates to documentation. label Oct 4, 2020
@ryandeivert
Copy link
Contributor Author

good catch @philnichol - I added some updates and fixed a different bug in the current tests. docs are also updated now

@philnichol
Copy link
Contributor

@ryandeivert great stuff!

@ryandeivert
Copy link
Contributor Author

hi @anGie44 I noticed you updated the issue associated with this. is there any chance you can provide an update here?

@anGie44 anGie44 self-assigned this Nov 4, 2020
@anGie44 anGie44 added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Nov 4, 2020
Copy link
Contributor

@anGie44 anGie44 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @ryandeivert , thank you for this PR and your patience! Overall changes look great just some small changes needed.

aws/resource_aws_organizations_organization.go Outdated Show resolved Hide resolved
aws/resource_aws_organizations_organization_test.go Outdated Show resolved Hide resolved
aws/resource_aws_organizations_organization_test.go Outdated Show resolved Hide resolved
aws/resource_aws_organizations_organization_test.go Outdated Show resolved Hide resolved
aws/resource_aws_organizations_organization_test.go Outdated Show resolved Hide resolved
@anGie44 anGie44 added the waiting-response Maintainers are waiting on response from community or contributor. label Nov 12, 2020
@ryandeivert ryandeivert requested a review from a team as a code owner November 12, 2020 22:20
@ryandeivert
Copy link
Contributor Author

hi @anGie44 - thank you for the review! I believe I have addressed all of your feedback now

@ghost ghost removed the waiting-response Maintainers are waiting on response from community or contributor. label Nov 12, 2020
@anGie44 anGie44 added this to the v3.16.0 milestone Nov 13, 2020
Copy link
Contributor

@anGie44 anGie44 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes LGTM 🚀 Thanks again @ryandeivert @philnichol !

Output of acceptance tests:

--- PASS: TestFlattenOrganizationsRoots (0.00s)
--- PASS: TestAccAWSOrganizations_serial (1103.64s)
    --- PASS: TestAccAWSOrganizations_serial/Organization (217.24s)
        --- PASS: TestAccAWSOrganizations_serial/Organization/FeatureSet_ForcesNew (26.15s)
        --- PASS: TestAccAWSOrganizations_serial/Organization/DataSource (25.22s)
        --- PASS: TestAccAWSOrganizations_serial/Organization/basic (12.52s)
        --- PASS: TestAccAWSOrganizations_serial/Organization/AwsServiceAccessPrincipals (30.70s)
        --- PASS: TestAccAWSOrganizations_serial/Organization/EnabledPolicyTypes (90.92s)
        --- PASS: TestAccAWSOrganizations_serial/Organization/FeatureSet_Basic (11.43s)
        --- PASS: TestAccAWSOrganizations_serial/Organization/FeatureSet_Update (20.30s)
    --- PASS: TestAccAWSOrganizations_serial/Account (0.00s)
        --- SKIP: TestAccAWSOrganizations_serial/Account/basic (0.00s)
        --- SKIP: TestAccAWSOrganizations_serial/Account/ParentId (0.00s)
        --- SKIP: TestAccAWSOrganizations_serial/Account/Tags (0.00s)
    --- PASS: TestAccAWSOrganizations_serial/OrganizationalUnit (38.24s)
        --- PASS: TestAccAWSOrganizations_serial/OrganizationalUnit/basic (14.78s)
        --- PASS: TestAccAWSOrganizations_serial/OrganizationalUnit/Name (23.45s)
    --- PASS: TestAccAWSOrganizations_serial/OrganizationalUnits (0.00s)
        --- PASS: TestAccAWSOrganizations_serial/OrganizationalUnits/DataSource (13.49s)
    --- PASS: TestAccAWSOrganizations_serial/Policy (764.26s)
        --- PASS: TestAccAWSOrganizations_serial/Policy/Description (24.70s)
        --- PASS: TestAccAWSOrganizations_serial/Policy/Tags (321.10s)
        --- PASS: TestAccAWSOrganizations_serial/Policy/Type_SCP (296.24s)
        --- PASS: TestAccAWSOrganizations_serial/Policy/Type_Tag (13.83s)
        --- PASS: TestAccAWSOrganizations_serial/Policy/basic (25.28s)
        --- PASS: TestAccAWSOrganizations_serial/Policy/concurrent (25.83s)
        --- PASS: TestAccAWSOrganizations_serial/Policy/disappears (13.14s)
        --- PASS: TestAccAWSOrganizations_serial/Policy/Type_AI_OPT_OUT (15.99s)
        --- PASS: TestAccAWSOrganizations_serial/Policy/Type_Backup (13.66s)
        --- PASS: TestAccAWSOrganizations_serial/Policy/ImportAwsManagedPolicy (14.49s)
    --- PASS: TestAccAWSOrganizations_serial/PolicyAttachment (70.41s)
        --- PASS: TestAccAWSOrganizations_serial/PolicyAttachment/OrganizationalUnit (19.30s)
        --- PASS: TestAccAWSOrganizations_serial/PolicyAttachment/Root (18.89s)
        --- PASS: TestAccAWSOrganizations_serial/PolicyAttachment/Account (32.22s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	1106.033s

@anGie44 anGie44 merged commit 405133c into hashicorp:master Nov 13, 2020
anGie44 added a commit that referenced this pull request 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!

@ryandeivert ryandeivert deleted the b-aws_organizations_organization-15462 branch December 3, 2020 00:02
@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. documentation Introduces or discusses updates to documentation. service/organizations Issues and PRs that pertain to the organizations service. size/M Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

aws_organizations_organization feature_set change should not force new resource
3 participants