UNPKG

advanced-cdk-constructs

Version:

[![codecov](https://codecov.io/gh/spensireli/advanced-cdk-constructs/graph/badge.svg?token=50IITI207T)](https://codecov.io/gh/spensireli/advanced-cdk-constructs)

57 lines (56 loc) 1.69 kB
import { Construct } from 'constructs'; /** * Properties for defining a Service Control Policy. */ export interface ServiceControlPolicyProps { /** * The list of target IDs (accounts or organizational units) to which the policy will be attached. */ readonly targetIds: string[]; /** * The name of the Service Control Policy. * @default - A name based on the construct ID will be used. */ readonly name?: string; /** * The policy statements to include in the Service Control Policy. */ readonly statements: any[]; /** * The description of the Service Control Policy. * @default - 'Service Control Policy from Advanced CDK Constructs' */ readonly description?: string; } /** * Defines an AWS Organizations Service Control Policy (SCP) and attaches it to the specified targets. * * Example: * ```ts * new ServiceControlPolicy(this, 'MySCP', { * targetIds: ['ou-xxxx-xxxxxxxx', '123456789012'], * name: 'DenyEC2', * statements: [ * { * Effect: 'Deny', * Action: 'ec2:*', * Resource: '*', * }, * ], * description: 'Denies all EC2 actions', * }); * ``` */ export declare class ServiceControlPolicy extends Construct { /** * The ARN of the created Service Control Policy. */ readonly serviceControlPolicyArn: string; /** * Creates a new Service Control Policy and attaches it to the specified targets. * @param scope The parent construct. * @param id The construct ID. * @param props The Service Control Policy properties. */ constructor(scope: Construct, id: string, props: ServiceControlPolicyProps); }