mirror of
https://github.com/floci-io/floci.git
synced 2026-11-25 14:57:54 -05:00
CreateOrganization (and EnableAllFeatures) seeded the root with SERVICE_CONTROL_POLICY already ENABLED, so the first EnablePolicyType a caller issues was rejected with PolicyTypeAlreadyEnabledException. That is exactly what Terraform's aws_organizations_organization does with enabled_policy_types right after CreateOrganization, so the common "create the org and turn on SCPs" configuration failed at its first resource. On AWS a new root has an empty PolicyTypes list: the provider's acceptance test for a plain organization asserts roots.0.policy_types is empty, and its enabled_policy_types test enables SCPs on a fresh organization successfully. DescribeOrganization's AvailablePolicyTypes used to read the root's list, which is what the seed was standing in for. It is now reported separately and, as AWS documents for the deprecated field, lists only SERVICE_CONTROL_POLICY for an ALL organization. Tests that relied on the seed now call EnablePolicyType first, as a real caller must. The CloudFormation test creates the stack without its SCP, enables the type, then adds the SCP by UpdateStack, because no CloudFormation resource enables a policy type.