-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Organizations: Add Mechanism to enable Service control policies on the root #4545
Comments
I stumbled with this same problem. The work-arround is to manually launch policy enabler. |
…ument Reference: #4545 The `aws_organizations_policy_attachment` acceptance testing was previously written to assume that the account running it was already in an Organization, manually had enabled Service Control Policies in the Root, and did not check Root or Organizational Unit policy attachments as the appropriate attributes/resources did not exist. The updates to those tests now verify the SCP attachment workflow end-to-end with creating a new Organization, enabling SCPs, and SCP attachments to an account, Root, and OU. Previous output from acceptance testing (before `enabled_policy_types` implementation): ``` --- FAIL: TestAccAWSOrganizations/PolicyAttachment (37.12s) --- FAIL: TestAccAWSOrganizations/PolicyAttachment/Account (14.00s) testing.go:568: Step 0 error: errors during apply: Error: error creating Organizations Policy Attachment: PolicyTypeNotEnabledException: This operation can be performed only for enabled policy types. status code: 400, request id: 381509e0-7225-11e9-b974-09edfb312bea on /var/folders/v0/_d108fkx1pbbg4_sh864_7740000gn/T/tf-test737240811/main.tf line 11: (source code not available) --- FAIL: TestAccAWSOrganizations/PolicyAttachment/OrganizationalUnit (10.85s) testing.go:568: Step 0 error: errors during apply: Error: error creating Organizations Policy Attachment: PolicyTypeNotEnabledException: This operation can be performed only for enabled policy types. status code: 400, request id: 3f587964-7225-11e9-96c5-1d623fb91cbf on /var/folders/v0/_d108fkx1pbbg4_sh864_7740000gn/T/tf-test570985045/main.tf line 16: (source code not available) --- FAIL: TestAccAWSOrganizations/PolicyAttachment/Root (12.27s) testing.go:568: Step 0 error: errors during apply: Error: error creating Organizations Policy Attachment: PolicyTypeNotEnabledException: This operation can be performed only for enabled policy types. status code: 400, request id: 46589efd-7225-11e9-b974-09edfb312bea on /var/folders/v0/_d108fkx1pbbg4_sh864_7740000gn/T/tf-test865604943/main.tf line 11: (source code not available) ``` Output from acceptance testing: ``` --- PASS: TestAccAWSOrganizations/Organization (79.29s) --- PASS: TestAccAWSOrganizations/Organization/basic (13.66s) --- PASS: TestAccAWSOrganizations/Organization/AwsServiceAccessPrincipals (24.59s) --- PASS: TestAccAWSOrganizations/Organization/EnabledPolicyTypes (30.29s) --- PASS: TestAccAWSOrganizations/Organization/FeatureSet (10.75s) --- PASS: TestAccAWSOrganizations/PolicyAttachment (58.58s) --- PASS: TestAccAWSOrganizations/PolicyAttachment/Account (21.28s) --- PASS: TestAccAWSOrganizations/PolicyAttachment/OrganizationalUnit (20.48s) --- PASS: TestAccAWSOrganizations/PolicyAttachment/Root (16.82s) ```
Pull request submitted: #8588 |
Support for this has been merged via a new |
This has been released in version 2.10.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. |
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
Description
Need a mechanism to enable Service control policies on the root. It looks like this needs to be done manually before you can successfully apply policies with Organizations (Organizations, Organize accounts, click the Root on the left pane, click Enable under ENABLE/DISABLE POLICY TYPES, Service control policies.
Attempting to add policies without toggling this setting results in this:
References
https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies.html#enable_policies_on_root
The text was updated successfully, but these errors were encountered: