You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to set policies from CDK, and I'm getting an error, the same values using webconsole works fine.
import { Account, FeatureSet, Organization, OrganizationalUnit, Policy, PolicyType } from "@pepperize/cdk-organizations";
import { Stack } from "aws-cdk-lib";
export function createOrganization(stack: Stack) {
const organization = new Organization(stack, 'Organization', { featureSet: FeatureSet.ALL }
);
const ou_infrastructure = new OrganizationalUnit(stack, 'infrastructure', {
organizationalUnitName: 'infrastructure',
parent: organization.root,
})
const ou_infra_dev = new OrganizationalUnit(stack, 'infrastructure-dev', {
organizationalUnitName: 'infrastructure-dev',
parent: ou_infrastructure
})
const ou_infra_prod = new OrganizationalUnit(stack, 'infrastructure-prod', {
organizationalUnitName: 'infrastructure-prod',
parent: ou_infrastructure
})
new Account(stack, 'infrastructure-development', {
accountName: 'infrastructure-development',
email: '[email protected]',
parent: ou_infra_dev
})
new Account(stack, 'infrastructure-production', {
accountName: 'infrastructure-production',
email: '[email protected]',
parent: ou_infra_prod
})
organization.enablePolicyType(PolicyType.TAG_POLICY);
organization.enablePolicyType(PolicyType.SERVICE_CONTROL_POLICY);
const policy = new Policy(stack, "Policy", {
content: '{\n"Version":"2012-10-17","Statement":{\n"Effect":"Deny","Action":"s3:*"\n}\n}',
description: "Enables admins of attached accounts to delegate all S3 permissions",
policyName: "AllowAllS3Actions",
policyType: PolicyType.SERVICE_CONTROL_POLICY,
});
ou_infrastructure.attachPolicy(policy);
}
I get the error:
Received response status [FAILED] from custom resource. Message returned: The provided policy document does not meet the requirements of the specified pol
icy type. (RequestId: 3d1f559e-9123-4a99-95e1-a7778ebab168)
The text was updated successfully, but these errors were encountered:
I'm trying to set policies from CDK, and I'm getting an error, the same values using webconsole works fine.
I get the error:
The text was updated successfully, but these errors were encountered: