Create a new AWS Account.
import { Account } from '@jttc/aws-organizations'
new Account(scope: Construct, id: string, props: AccountProps)
Name | Type | Description |
---|---|---|
scope |
constructs.Construct |
No description. |
id |
string |
No description. |
props |
AccountProps |
No description. |
- Type: constructs.Construct
- Type: string
- Type: AccountProps
Name | Description |
---|---|
toString |
Returns a string representation of this construct. |
applyRemovalPolicy |
Apply the given removal policy to this resource. |
public toString(): string
Returns a string representation of this construct.
public applyRemovalPolicy(policy: RemovalPolicy): void
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.
The resource can be deleted (RemovalPolicy.DESTROY
), or left in your AWS
account for data recovery and cleanup later (RemovalPolicy.RETAIN
).
- Type: aws-cdk-lib.RemovalPolicy
Name | Description |
---|---|
isConstruct |
Checks if x is a construct. |
isOwnedResource |
Returns true if the construct was created by CDK, and false otherwise. |
isResource |
Check whether the given construct is a Resource. |
fromAccountAttributes |
Import a Organization. |
import { Account } from '@jttc/aws-organizations'
Account.isConstruct(x: any)
Checks if x
is a construct.
Use this method instead of instanceof
to properly detect Construct
instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the constructs
library on
disk are seen as independent, completely different libraries. As a
consequence, the class Construct
in each copy of the constructs
library
is seen as a different class, and an instance of one class will not test as
instanceof
the other class. npm install
will not create installations
like this, but users may manually symlink construct libraries together or
use a monorepo tool: in those cases, multiple copies of the constructs
library can be accidentally installed, and instanceof
will behave
unpredictably. It is safest to avoid using instanceof
, and using
this type-testing method instead.
- Type: any
Any object.
import { Account } from '@jttc/aws-organizations'
Account.isOwnedResource(construct: IConstruct)
Returns true if the construct was created by CDK, and false otherwise.
- Type: constructs.IConstruct
import { Account } from '@jttc/aws-organizations'
Account.isResource(construct: IConstruct)
Check whether the given construct is a Resource.
- Type: constructs.IConstruct
import { Account } from '@jttc/aws-organizations'
Account.fromAccountAttributes(scope: Construct, id: string, attributes: AccountAttributes)
Import a Organization.
Example
Organization.fromOrganizationAttributes(this, 'Organization', {
organizationId: 'o-xxxx',
organizationRootId: 'r-xxxx',
managementAccountId: 'xxxx',
});
- Type: constructs.Construct
- Type: string
- Type: AccountAttributes
Name | Type | Description |
---|---|---|
node |
constructs.Node |
The tree node. |
env |
aws-cdk-lib.ResourceEnvironment |
The environment this resource belongs to. |
stack |
aws-cdk-lib.Stack |
The stack in which this resource is defined. |
accountArn |
string |
The Arn of the created account. |
accountId |
string |
The account id created. |
roleName |
string |
The name of an IAM role that AWS Organizations automatically preconfigures in the new member account. |
public readonly node: Node;
- Type: constructs.Node
The tree node.
public readonly env: ResourceEnvironment;
- Type: aws-cdk-lib.ResourceEnvironment
The environment this resource belongs to.
For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.
public readonly stack: Stack;
- Type: aws-cdk-lib.Stack
The stack in which this resource is defined.
public readonly accountArn: string;
- Type: string
The Arn of the created account.
public readonly accountId: string;
- Type: string
The account id created.
public readonly roleName: string;
- Type: string
The name of an IAM role that AWS Organizations automatically preconfigures in the new member account.
- Implements: IAccount
import { AccountBase } from '@jttc/aws-organizations'
new AccountBase(scope: Construct, id: string, props?: ResourceProps)
Name | Type | Description |
---|---|---|
scope |
constructs.Construct |
No description. |
id |
string |
No description. |
props |
aws-cdk-lib.ResourceProps |
No description. |
- Type: constructs.Construct
- Type: string
- Type: aws-cdk-lib.ResourceProps
Name | Description |
---|---|
toString |
Returns a string representation of this construct. |
applyRemovalPolicy |
Apply the given removal policy to this resource. |
public toString(): string
Returns a string representation of this construct.
public applyRemovalPolicy(policy: RemovalPolicy): void
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.
The resource can be deleted (RemovalPolicy.DESTROY
), or left in your AWS
account for data recovery and cleanup later (RemovalPolicy.RETAIN
).
- Type: aws-cdk-lib.RemovalPolicy
Name | Description |
---|---|
isConstruct |
Checks if x is a construct. |
isOwnedResource |
Returns true if the construct was created by CDK, and false otherwise. |
isResource |
Check whether the given construct is a Resource. |
import { AccountBase } from '@jttc/aws-organizations'
AccountBase.isConstruct(x: any)
Checks if x
is a construct.
Use this method instead of instanceof
to properly detect Construct
instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the constructs
library on
disk are seen as independent, completely different libraries. As a
consequence, the class Construct
in each copy of the constructs
library
is seen as a different class, and an instance of one class will not test as
instanceof
the other class. npm install
will not create installations
like this, but users may manually symlink construct libraries together or
use a monorepo tool: in those cases, multiple copies of the constructs
library can be accidentally installed, and instanceof
will behave
unpredictably. It is safest to avoid using instanceof
, and using
this type-testing method instead.
- Type: any
Any object.
import { AccountBase } from '@jttc/aws-organizations'
AccountBase.isOwnedResource(construct: IConstruct)
Returns true if the construct was created by CDK, and false otherwise.
- Type: constructs.IConstruct
import { AccountBase } from '@jttc/aws-organizations'
AccountBase.isResource(construct: IConstruct)
Check whether the given construct is a Resource.
- Type: constructs.IConstruct
Name | Type | Description |
---|---|---|
node |
constructs.Node |
The tree node. |
env |
aws-cdk-lib.ResourceEnvironment |
The environment this resource belongs to. |
stack |
aws-cdk-lib.Stack |
The stack in which this resource is defined. |
accountArn |
string |
The Arn of the created account. |
accountId |
string |
The account id created. |
roleName |
string |
The name of an IAM role that AWS Organizations automatically preconfigures in the new member account. |
public readonly node: Node;
- Type: constructs.Node
The tree node.
public readonly env: ResourceEnvironment;
- Type: aws-cdk-lib.ResourceEnvironment
The environment this resource belongs to.
For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.
public readonly stack: Stack;
- Type: aws-cdk-lib.Stack
The stack in which this resource is defined.
public readonly accountArn: string;
- Type: string
The Arn of the created account.
public readonly accountId: string;
- Type: string
The account id created.
public readonly roleName: string;
- Type: string
The name of an IAM role that AWS Organizations automatically preconfigures in the new member account.
Create a new organization.
Example
new Organization(this, 'Organization');
import { Organization } from '@jttc/aws-organizations'
new Organization(scope: Construct, id: string, props?: OrganizationProps)
Name | Type | Description |
---|---|---|
scope |
constructs.Construct |
No description. |
id |
string |
No description. |
props |
OrganizationProps |
No description. |
- Type: constructs.Construct
- Type: string
- Type: OrganizationProps
Name | Description |
---|---|
toString |
Returns a string representation of this construct. |
applyRemovalPolicy |
Apply the given removal policy to this resource. |
public toString(): string
Returns a string representation of this construct.
public applyRemovalPolicy(policy: RemovalPolicy): void
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.
The resource can be deleted (RemovalPolicy.DESTROY
), or left in your AWS
account for data recovery and cleanup later (RemovalPolicy.RETAIN
).
- Type: aws-cdk-lib.RemovalPolicy
Name | Description |
---|---|
isConstruct |
Checks if x is a construct. |
isOwnedResource |
Returns true if the construct was created by CDK, and false otherwise. |
isResource |
Check whether the given construct is a Resource. |
fromOrganizationArn |
Import a Organization from arn. |
fromOrganizationAttributes |
Import a Organization from attributes. |
import { Organization } from '@jttc/aws-organizations'
Organization.isConstruct(x: any)
Checks if x
is a construct.
Use this method instead of instanceof
to properly detect Construct
instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the constructs
library on
disk are seen as independent, completely different libraries. As a
consequence, the class Construct
in each copy of the constructs
library
is seen as a different class, and an instance of one class will not test as
instanceof
the other class. npm install
will not create installations
like this, but users may manually symlink construct libraries together or
use a monorepo tool: in those cases, multiple copies of the constructs
library can be accidentally installed, and instanceof
will behave
unpredictably. It is safest to avoid using instanceof
, and using
this type-testing method instead.
- Type: any
Any object.
import { Organization } from '@jttc/aws-organizations'
Organization.isOwnedResource(construct: IConstruct)
Returns true if the construct was created by CDK, and false otherwise.
- Type: constructs.IConstruct
import { Organization } from '@jttc/aws-organizations'
Organization.isResource(construct: IConstruct)
Check whether the given construct is a Resource.
- Type: constructs.IConstruct
import { Organization } from '@jttc/aws-organizations'
Organization.fromOrganizationArn(scope: Construct, id: string, organizationArn: string)
Import a Organization from arn.
Example
Organization.fromOrganizationArn(this, 'Organization', 'arn:aws:organizations::123456789012:root/o-agnj84t7qk/r-m7g5');
- Type: constructs.Construct
- Type: string
- Type: string
import { Organization } from '@jttc/aws-organizations'
Organization.fromOrganizationAttributes(scope: Construct, id: string, attributes: OrganizationAttributes)
Import a Organization from attributes.
Example
Organization.fromOrganizationAttributes(this, 'Organization', {
organizationId: 'o-xxxx',
organizationRootId: 'r-xxxx',
managementAccountId: 'xxxx',
});
- Type: constructs.Construct
- Type: string
- Type: OrganizationAttributes
Name | Type | Description |
---|---|---|
node |
constructs.Node |
The tree node. |
env |
aws-cdk-lib.ResourceEnvironment |
The environment this resource belongs to. |
stack |
aws-cdk-lib.Stack |
The stack in which this resource is defined. |
managementAccountId |
string |
The unique identifier (ID) of the management account of an organization. |
organizationArn |
string |
The Amazon Resource Name (ARN) of the organization. |
organizationId |
string |
The unique identifier (ID) of the organization. |
organizationRootId |
string |
The unique identifier (ID) of the organization root. |
public readonly node: Node;
- Type: constructs.Node
The tree node.
public readonly env: ResourceEnvironment;
- Type: aws-cdk-lib.ResourceEnvironment
The environment this resource belongs to.
For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.
public readonly stack: Stack;
- Type: aws-cdk-lib.Stack
The stack in which this resource is defined.
public readonly managementAccountId: string;
- Type: string
The unique identifier (ID) of the management account of an organization.
public readonly organizationArn: string;
- Type: string
The Amazon Resource Name (ARN) of the organization.
public readonly organizationId: string;
- Type: string
The unique identifier (ID) of the organization.
public readonly organizationRootId: string;
- Type: string
The unique identifier (ID) of the organization root.
- Implements: IOrganization
import { OrganizationBase } from '@jttc/aws-organizations'
new OrganizationBase(scope: Construct, id: string, props?: ResourceProps)
Name | Type | Description |
---|---|---|
scope |
constructs.Construct |
No description. |
id |
string |
No description. |
props |
aws-cdk-lib.ResourceProps |
No description. |
- Type: constructs.Construct
- Type: string
- Type: aws-cdk-lib.ResourceProps
Name | Description |
---|---|
toString |
Returns a string representation of this construct. |
applyRemovalPolicy |
Apply the given removal policy to this resource. |
public toString(): string
Returns a string representation of this construct.
public applyRemovalPolicy(policy: RemovalPolicy): void
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.
The resource can be deleted (RemovalPolicy.DESTROY
), or left in your AWS
account for data recovery and cleanup later (RemovalPolicy.RETAIN
).
- Type: aws-cdk-lib.RemovalPolicy
Name | Description |
---|---|
isConstruct |
Checks if x is a construct. |
isOwnedResource |
Returns true if the construct was created by CDK, and false otherwise. |
isResource |
Check whether the given construct is a Resource. |
import { OrganizationBase } from '@jttc/aws-organizations'
OrganizationBase.isConstruct(x: any)
Checks if x
is a construct.
Use this method instead of instanceof
to properly detect Construct
instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the constructs
library on
disk are seen as independent, completely different libraries. As a
consequence, the class Construct
in each copy of the constructs
library
is seen as a different class, and an instance of one class will not test as
instanceof
the other class. npm install
will not create installations
like this, but users may manually symlink construct libraries together or
use a monorepo tool: in those cases, multiple copies of the constructs
library can be accidentally installed, and instanceof
will behave
unpredictably. It is safest to avoid using instanceof
, and using
this type-testing method instead.
- Type: any
Any object.
import { OrganizationBase } from '@jttc/aws-organizations'
OrganizationBase.isOwnedResource(construct: IConstruct)
Returns true if the construct was created by CDK, and false otherwise.
- Type: constructs.IConstruct
import { OrganizationBase } from '@jttc/aws-organizations'
OrganizationBase.isResource(construct: IConstruct)
Check whether the given construct is a Resource.
- Type: constructs.IConstruct
Name | Type | Description |
---|---|---|
node |
constructs.Node |
The tree node. |
env |
aws-cdk-lib.ResourceEnvironment |
The environment this resource belongs to. |
stack |
aws-cdk-lib.Stack |
The stack in which this resource is defined. |
managementAccountId |
string |
The unique identifier (ID) of the management account of an organization. |
organizationArn |
string |
The Amazon Resource Name (ARN) of the organization. |
organizationId |
string |
The unique identifier (ID) of the organization. |
organizationRootId |
string |
The unique identifier (ID) of the organization root. |
public readonly node: Node;
- Type: constructs.Node
The tree node.
public readonly env: ResourceEnvironment;
- Type: aws-cdk-lib.ResourceEnvironment
The environment this resource belongs to.
For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.
public readonly stack: Stack;
- Type: aws-cdk-lib.Stack
The stack in which this resource is defined.
public readonly managementAccountId: string;
- Type: string
The unique identifier (ID) of the management account of an organization.
public readonly organizationArn: string;
- Type: string
The Amazon Resource Name (ARN) of the organization.
public readonly organizationId: string;
- Type: string
The unique identifier (ID) of the organization.
public readonly organizationRootId: string;
- Type: string
The unique identifier (ID) of the organization root.
Create a new Organization Unit.
Example
new OrganizationUnit(this, 'OU', {
organizationUnitName: 'OU',
parent: 'r-123456789',
});
import { OrganizationUnit } from '@jttc/aws-organizations'
new OrganizationUnit(scope: Construct, id: string, props: IOrganizationUnitProps)
Name | Type | Description |
---|---|---|
scope |
constructs.Construct |
No description. |
id |
string |
No description. |
props |
IOrganizationUnitProps |
No description. |
- Type: constructs.Construct
- Type: string
- Type: IOrganizationUnitProps
Name | Description |
---|---|
toString |
Returns a string representation of this construct. |
applyRemovalPolicy |
Apply the given removal policy to this resource. |
public toString(): string
Returns a string representation of this construct.
public applyRemovalPolicy(policy: RemovalPolicy): void
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.
The resource can be deleted (RemovalPolicy.DESTROY
), or left in your AWS
account for data recovery and cleanup later (RemovalPolicy.RETAIN
).
- Type: aws-cdk-lib.RemovalPolicy
Name | Description |
---|---|
isConstruct |
Checks if x is a construct. |
isOwnedResource |
Returns true if the construct was created by CDK, and false otherwise. |
isResource |
Check whether the given construct is a Resource. |
fromOrganizationUnitAttributes |
No description. |
import { OrganizationUnit } from '@jttc/aws-organizations'
OrganizationUnit.isConstruct(x: any)
Checks if x
is a construct.
Use this method instead of instanceof
to properly detect Construct
instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the constructs
library on
disk are seen as independent, completely different libraries. As a
consequence, the class Construct
in each copy of the constructs
library
is seen as a different class, and an instance of one class will not test as
instanceof
the other class. npm install
will not create installations
like this, but users may manually symlink construct libraries together or
use a monorepo tool: in those cases, multiple copies of the constructs
library can be accidentally installed, and instanceof
will behave
unpredictably. It is safest to avoid using instanceof
, and using
this type-testing method instead.
- Type: any
Any object.
import { OrganizationUnit } from '@jttc/aws-organizations'
OrganizationUnit.isOwnedResource(construct: IConstruct)
Returns true if the construct was created by CDK, and false otherwise.
- Type: constructs.IConstruct
import { OrganizationUnit } from '@jttc/aws-organizations'
OrganizationUnit.isResource(construct: IConstruct)
Check whether the given construct is a Resource.
- Type: constructs.IConstruct
import { OrganizationUnit } from '@jttc/aws-organizations'
OrganizationUnit.fromOrganizationUnitAttributes(scope: Construct, id: string, attrs: OrganizationUnitAttributes)
- Type: constructs.Construct
- Type: string
Name | Type | Description |
---|---|---|
node |
constructs.Node |
The tree node. |
env |
aws-cdk-lib.ResourceEnvironment |
The environment this resource belongs to. |
stack |
aws-cdk-lib.Stack |
The stack in which this resource is defined. |
organizationUnitArn |
string |
The ARN of the OU. |
organizationUnitId |
string |
The ID of the OU. |
organizationUnitName |
string |
The Organization Unit name. |
public readonly node: Node;
- Type: constructs.Node
The tree node.
public readonly env: ResourceEnvironment;
- Type: aws-cdk-lib.ResourceEnvironment
The environment this resource belongs to.
For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.
public readonly stack: Stack;
- Type: aws-cdk-lib.Stack
The stack in which this resource is defined.
public readonly organizationUnitArn: string;
- Type: string
The ARN of the OU.
public readonly organizationUnitId: string;
- Type: string
The ID of the OU.
public readonly organizationUnitName: string;
- Type: string
The Organization Unit name.
- Implements: IOrganizationUnits
import { OrganizationUnitBase } from '@jttc/aws-organizations'
new OrganizationUnitBase(scope: Construct, id: string, props?: ResourceProps)
Name | Type | Description |
---|---|---|
scope |
constructs.Construct |
No description. |
id |
string |
No description. |
props |
aws-cdk-lib.ResourceProps |
No description. |
- Type: constructs.Construct
- Type: string
- Type: aws-cdk-lib.ResourceProps
Name | Description |
---|---|
toString |
Returns a string representation of this construct. |
applyRemovalPolicy |
Apply the given removal policy to this resource. |
public toString(): string
Returns a string representation of this construct.
public applyRemovalPolicy(policy: RemovalPolicy): void
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.
The resource can be deleted (RemovalPolicy.DESTROY
), or left in your AWS
account for data recovery and cleanup later (RemovalPolicy.RETAIN
).
- Type: aws-cdk-lib.RemovalPolicy
Name | Description |
---|---|
isConstruct |
Checks if x is a construct. |
isOwnedResource |
Returns true if the construct was created by CDK, and false otherwise. |
isResource |
Check whether the given construct is a Resource. |
import { OrganizationUnitBase } from '@jttc/aws-organizations'
OrganizationUnitBase.isConstruct(x: any)
Checks if x
is a construct.
Use this method instead of instanceof
to properly detect Construct
instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the constructs
library on
disk are seen as independent, completely different libraries. As a
consequence, the class Construct
in each copy of the constructs
library
is seen as a different class, and an instance of one class will not test as
instanceof
the other class. npm install
will not create installations
like this, but users may manually symlink construct libraries together or
use a monorepo tool: in those cases, multiple copies of the constructs
library can be accidentally installed, and instanceof
will behave
unpredictably. It is safest to avoid using instanceof
, and using
this type-testing method instead.
- Type: any
Any object.
import { OrganizationUnitBase } from '@jttc/aws-organizations'
OrganizationUnitBase.isOwnedResource(construct: IConstruct)
Returns true if the construct was created by CDK, and false otherwise.
- Type: constructs.IConstruct
import { OrganizationUnitBase } from '@jttc/aws-organizations'
OrganizationUnitBase.isResource(construct: IConstruct)
Check whether the given construct is a Resource.
- Type: constructs.IConstruct
Name | Type | Description |
---|---|---|
node |
constructs.Node |
The tree node. |
env |
aws-cdk-lib.ResourceEnvironment |
The environment this resource belongs to. |
stack |
aws-cdk-lib.Stack |
The stack in which this resource is defined. |
organizationUnitArn |
string |
The Amazon Resource Name (ARN) of this OU. |
organizationUnitId |
string |
The unique identifier (ID) associated with this OU. |
organizationUnitName |
string |
The name of the OU. |
public readonly node: Node;
- Type: constructs.Node
The tree node.
public readonly env: ResourceEnvironment;
- Type: aws-cdk-lib.ResourceEnvironment
The environment this resource belongs to.
For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.
public readonly stack: Stack;
- Type: aws-cdk-lib.Stack
The stack in which this resource is defined.
public readonly organizationUnitArn: string;
- Type: string
The Amazon Resource Name (ARN) of this OU.
public readonly organizationUnitId: string;
- Type: string
The unique identifier (ID) associated with this OU.
public readonly organizationUnitName: string;
- Type: string
The name of the OU.
- Implements: IOrganizationPolicy
import { OrganzationPolicyBase } from '@jttc/aws-organizations'
new OrganzationPolicyBase(scope: Construct, id: string, props?: ResourceProps)
Name | Type | Description |
---|---|---|
scope |
constructs.Construct |
No description. |
id |
string |
No description. |
props |
aws-cdk-lib.ResourceProps |
No description. |
- Type: constructs.Construct
- Type: string
- Type: aws-cdk-lib.ResourceProps
Name | Description |
---|---|
toString |
Returns a string representation of this construct. |
applyRemovalPolicy |
Apply the given removal policy to this resource. |
public toString(): string
Returns a string representation of this construct.
public applyRemovalPolicy(policy: RemovalPolicy): void
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.
The resource can be deleted (RemovalPolicy.DESTROY
), or left in your AWS
account for data recovery and cleanup later (RemovalPolicy.RETAIN
).
- Type: aws-cdk-lib.RemovalPolicy
Name | Description |
---|---|
isConstruct |
Checks if x is a construct. |
isOwnedResource |
Returns true if the construct was created by CDK, and false otherwise. |
isResource |
Check whether the given construct is a Resource. |
import { OrganzationPolicyBase } from '@jttc/aws-organizations'
OrganzationPolicyBase.isConstruct(x: any)
Checks if x
is a construct.
Use this method instead of instanceof
to properly detect Construct
instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the constructs
library on
disk are seen as independent, completely different libraries. As a
consequence, the class Construct
in each copy of the constructs
library
is seen as a different class, and an instance of one class will not test as
instanceof
the other class. npm install
will not create installations
like this, but users may manually symlink construct libraries together or
use a monorepo tool: in those cases, multiple copies of the constructs
library can be accidentally installed, and instanceof
will behave
unpredictably. It is safest to avoid using instanceof
, and using
this type-testing method instead.
- Type: any
Any object.
import { OrganzationPolicyBase } from '@jttc/aws-organizations'
OrganzationPolicyBase.isOwnedResource(construct: IConstruct)
Returns true if the construct was created by CDK, and false otherwise.
- Type: constructs.IConstruct
import { OrganzationPolicyBase } from '@jttc/aws-organizations'
OrganzationPolicyBase.isResource(construct: IConstruct)
Check whether the given construct is a Resource.
- Type: constructs.IConstruct
Name | Type | Description |
---|---|---|
node |
constructs.Node |
The tree node. |
env |
aws-cdk-lib.ResourceEnvironment |
The environment this resource belongs to. |
stack |
aws-cdk-lib.Stack |
The stack in which this resource is defined. |
organizationPolicyArn |
string |
Returns the Amazon Resource Name (ARN) of the policy. |
organizationPolicyId |
string |
Returns the unique identifier (ID) of the policy. |
targetIds |
string[] |
List of unique identifiers (IDs) of the root, OU, or account that you want to attach the policy to. |
public readonly node: Node;
- Type: constructs.Node
The tree node.
public readonly env: ResourceEnvironment;
- Type: aws-cdk-lib.ResourceEnvironment
The environment this resource belongs to.
For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.
public readonly stack: Stack;
- Type: aws-cdk-lib.Stack
The stack in which this resource is defined.
public readonly organizationPolicyArn: string;
- Type: string
Returns the Amazon Resource Name (ARN) of the policy.
public readonly organizationPolicyId: string;
- Type: string
Returns the unique identifier (ID) of the policy.
public readonly targetIds: string[];
- Type: string[]
List of unique identifiers (IDs) of the root, OU, or account that you want to attach the policy to.
Creates a policy of a specified type that you can attach to a root, an organizational unit (OU), or an individual AWS account.
Example
import { ServiceControlPolicy } from '@jttc/aws-organizations';
const serviceControlPolicy = new ServiceControlPolicy(this, 'ServiceControlPolicy', {
name: 'ServiceControlPolicy',
description: 'Service Control Policy',
statements: [
new PolicyStatement({
actions: ['s3:*'],
resources: ['*'],
}),
],
targetIds: ['o-12345678'],
});
import { ServiceControlPolicy } from '@jttc/aws-organizations'
new ServiceControlPolicy(scope: Construct, id: string, props: ServiceControlPolicyProps)
Name | Type | Description |
---|---|---|
scope |
constructs.Construct |
No description. |
id |
string |
No description. |
props |
ServiceControlPolicyProps |
No description. |
- Type: constructs.Construct
- Type: string
Name | Description |
---|---|
toString |
Returns a string representation of this construct. |
applyRemovalPolicy |
Apply the given removal policy to this resource. |
addTarget |
Add a target which will be applied this Policy. |
public toString(): string
Returns a string representation of this construct.
public applyRemovalPolicy(policy: RemovalPolicy): void
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.
The resource can be deleted (RemovalPolicy.DESTROY
), or left in your AWS
account for data recovery and cleanup later (RemovalPolicy.RETAIN
).
- Type: aws-cdk-lib.RemovalPolicy
public addTarget(target: string): void
Add a target which will be applied this Policy.
It must be a unique identifiers (IDs) of the root, OU, or account that you want to attach the policy to.
- Type: string
Name | Description |
---|---|
isConstruct |
Checks if x is a construct. |
isOwnedResource |
Returns true if the construct was created by CDK, and false otherwise. |
isResource |
Check whether the given construct is a Resource. |
import { ServiceControlPolicy } from '@jttc/aws-organizations'
ServiceControlPolicy.isConstruct(x: any)
Checks if x
is a construct.
Use this method instead of instanceof
to properly detect Construct
instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the constructs
library on
disk are seen as independent, completely different libraries. As a
consequence, the class Construct
in each copy of the constructs
library
is seen as a different class, and an instance of one class will not test as
instanceof
the other class. npm install
will not create installations
like this, but users may manually symlink construct libraries together or
use a monorepo tool: in those cases, multiple copies of the constructs
library can be accidentally installed, and instanceof
will behave
unpredictably. It is safest to avoid using instanceof
, and using
this type-testing method instead.
- Type: any
Any object.
import { ServiceControlPolicy } from '@jttc/aws-organizations'
ServiceControlPolicy.isOwnedResource(construct: IConstruct)
Returns true if the construct was created by CDK, and false otherwise.
- Type: constructs.IConstruct
import { ServiceControlPolicy } from '@jttc/aws-organizations'
ServiceControlPolicy.isResource(construct: IConstruct)
Check whether the given construct is a Resource.
- Type: constructs.IConstruct
Name | Type | Description |
---|---|---|
node |
constructs.Node |
The tree node. |
env |
aws-cdk-lib.ResourceEnvironment |
The environment this resource belongs to. |
stack |
aws-cdk-lib.Stack |
The stack in which this resource is defined. |
organizationPolicyArn |
string |
Returns the Amazon Resource Name (ARN) of the policy. |
organizationPolicyId |
string |
Returns the unique identifier (ID) of the policy. |
targetIds |
string[] |
List of unique identifiers (IDs) of the root, OU, or account that you want to attach the policy to. |
public readonly node: Node;
- Type: constructs.Node
The tree node.
public readonly env: ResourceEnvironment;
- Type: aws-cdk-lib.ResourceEnvironment
The environment this resource belongs to.
For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.
public readonly stack: Stack;
- Type: aws-cdk-lib.Stack
The stack in which this resource is defined.
public readonly organizationPolicyArn: string;
- Type: string
Returns the Amazon Resource Name (ARN) of the policy.
public readonly organizationPolicyId: string;
- Type: string
Returns the unique identifier (ID) of the policy.
public readonly targetIds: string[];
- Type: string[]
List of unique identifiers (IDs) of the root, OU, or account that you want to attach the policy to.
import { AccountAttributes } from '@jttc/aws-organizations'
const accountAttributes: AccountAttributes = { ... }
Name | Type | Description |
---|---|---|
accountId |
string |
The account id created. |
organizationUnitId |
string |
The Organization Unit Id ou-xxxxxx. |
roleName |
string |
The name of an IAM role that AWS Organizations automatically preconfigures in the new member account. |
public readonly accountId: string;
- Type: string
The account id created.
public readonly organizationUnitId: string;
- Type: string
The Organization Unit Id ou-xxxxxx.
public readonly roleName: string;
- Type: string
The name of an IAM role that AWS Organizations automatically preconfigures in the new member account.
import { AccountProps } from '@jttc/aws-organizations'
const accountProps: AccountProps = { ... }
Name | Type | Description |
---|---|---|
accountName |
string |
The account name given to the account when it was created. |
email |
string |
The email address associated with the AWS account. |
parent |
string | OrganizationUnit |
The unique identifier (ID) of the root or organizational unit (OU) that you want to create the new account in. |
roleName |
string |
The name of an IAM role that AWS Organizations automatically preconfigures in the new member account. |
tags |
aws-cdk-lib.Tag[] |
A list of tags that you want to attach to the newly created account. |
public readonly accountName: string;
- Type: string
The account name given to the account when it was created.
public readonly email: string;
- Type: string
The email address associated with the AWS account.
public readonly parent: string | OrganizationUnit;
- Type: string | OrganizationUnit
The unique identifier (ID) of the root or organizational unit (OU) that you want to create the new account in.
If you don't specify this parameter, the ParentId defaults to the root ID.
public readonly roleName: string;
- Type: string
The name of an IAM role that AWS Organizations automatically preconfigures in the new member account.
This role trusts the management account, allowing users in the management account to assume the role, as permitted by the management account administrator.
The role has administrator permissions in the new member account.
If you don't specify this parameter, the role name defaults to OrganizationAccountAccessRole.
For more information about how to use this role to access the member account, see the following links:
- Creating the OrganizationAccountAccessRole in an invited member account in the AWS Organizations User Guide
https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_cross-account-with-roles.html
public readonly tags: Tag[];
- Type: aws-cdk-lib.Tag[]
A list of tags that you want to attach to the newly created account.
For each tag in the list, you must specify both a tag key and a value. You can set the value to an empty string, but you can't set it to null
import { OrganizationAttributes } from '@jttc/aws-organizations'
const organizationAttributes: OrganizationAttributes = { ... }
Name | Type | Description |
---|---|---|
managementAccountId |
string |
The unique identifier (ID) of the management account of an organization. |
organizationId |
string |
The unique identifier (ID) of the organization. |
organizationRootId |
string |
The unique identifier (ID) of the organization root. |
public readonly managementAccountId: string;
- Type: string
The unique identifier (ID) of the management account of an organization.
public readonly organizationId: string;
- Type: string
The unique identifier (ID) of the organization.
public readonly organizationRootId: string;
- Type: string
The unique identifier (ID) of the organization root.
import { OrganizationProps } from '@jttc/aws-organizations'
const organizationProps: OrganizationProps = { ... }
Name | Type | Description |
---|---|---|
featureSet |
OrganizationFeatureSet |
Specifies the feature set supported by the new organization. |
public readonly featureSet: OrganizationFeatureSet;
- Type: OrganizationFeatureSet
- Default: OrganizationFeatureSet.ALL
Specifies the feature set supported by the new organization.
import { OrganizationUnitAttributes } from '@jttc/aws-organizations'
const organizationUnitAttributes: OrganizationUnitAttributes = { ... }
Name | Type | Description |
---|---|---|
organizationUnitArn |
string |
The Amazon Resource Name (ARN) of this OU. |
organizationUnitId |
string |
The unique identifier (ID) associated with this OU. |
organizationUnitName |
string |
The name of the OU. |
public readonly organizationUnitArn: string;
- Type: string
The Amazon Resource Name (ARN) of this OU.
public readonly organizationUnitId: string;
- Type: string
The unique identifier (ID) associated with this OU.
public readonly organizationUnitName: string;
- Type: string
The name of the OU.
import { ServiceControlPolicyProps } from '@jttc/aws-organizations'
const serviceControlPolicyProps: ServiceControlPolicyProps = { ... }
Name | Type | Description |
---|---|---|
description |
string |
The description of the policy. |
name |
string |
The name of the policy. |
statements |
aws-cdk-lib.aws_iam.PolicyStatement[] |
Represents a statement in an IAM policy document. |
removalPolicy |
aws-cdk-lib.RemovalPolicy |
The policy to apply when the policy is removed from the organization. |
tags |
aws-cdk-lib.CfnTag[] |
A list of tags that you want to attach to the newly created policy. |
targetIds |
string[] |
List of unique identifiers (IDs) of the root, OU, or account that you want to attach the policy to. |
public readonly description: string;
- Type: string
The description of the policy.
public readonly name: string;
- Type: string
The name of the policy.
public readonly statements: PolicyStatement[];
- Type: aws-cdk-lib.aws_iam.PolicyStatement[]
Represents a statement in an IAM policy document.
public readonly removalPolicy: RemovalPolicy;
- Type: aws-cdk-lib.RemovalPolicy
- Default: RemovalPolicy.RETAIN
The policy to apply when the policy is removed from the organization.
public readonly tags: CfnTag[];
- Type: aws-cdk-lib.CfnTag[]
A list of tags that you want to attach to the newly created policy.
public readonly targetIds: string[];
- Type: string[]
List of unique identifiers (IDs) of the root, OU, or account that you want to attach the policy to.
-
Extends: aws-cdk-lib.IResource
-
Implemented By: Account, AccountBase, IAccount
Name | Type | Description |
---|---|---|
node |
constructs.Node |
The tree node. |
env |
aws-cdk-lib.ResourceEnvironment |
The environment this resource belongs to. |
stack |
aws-cdk-lib.Stack |
The stack in which this resource is defined. |
accountArn |
string |
The Arn of the created account. |
accountId |
string |
The account id created. |
roleName |
string |
The name of an IAM role that AWS Organizations automatically preconfigures in the new member account. |
public readonly node: Node;
- Type: constructs.Node
The tree node.
public readonly env: ResourceEnvironment;
- Type: aws-cdk-lib.ResourceEnvironment
The environment this resource belongs to.
For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.
public readonly stack: Stack;
- Type: aws-cdk-lib.Stack
The stack in which this resource is defined.
public readonly accountArn: string;
- Type: string
The Arn of the created account.
public readonly accountId: string;
- Type: string
The account id created.
public readonly roleName: string;
- Type: string
The name of an IAM role that AWS Organizations automatically preconfigures in the new member account.
-
Extends: aws-cdk-lib.IResource
-
Implemented By: Organization, OrganizationBase, IOrganization
Name | Type | Description |
---|---|---|
node |
constructs.Node |
The tree node. |
env |
aws-cdk-lib.ResourceEnvironment |
The environment this resource belongs to. |
stack |
aws-cdk-lib.Stack |
The stack in which this resource is defined. |
managementAccountId |
string |
The unique identifier (ID) of the management account of an organization. |
organizationArn |
string |
The Amazon Resource Name (ARN) of the organization. |
organizationId |
string |
The unique identifier (ID) of the organization. |
organizationRootId |
string |
The unique identifier (ID) of the organization root. |
public readonly node: Node;
- Type: constructs.Node
The tree node.
public readonly env: ResourceEnvironment;
- Type: aws-cdk-lib.ResourceEnvironment
The environment this resource belongs to.
For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.
public readonly stack: Stack;
- Type: aws-cdk-lib.Stack
The stack in which this resource is defined.
public readonly managementAccountId: string;
- Type: string
The unique identifier (ID) of the management account of an organization.
public readonly organizationArn: string;
- Type: string
The Amazon Resource Name (ARN) of the organization.
public readonly organizationId: string;
- Type: string
The unique identifier (ID) of the organization.
public readonly organizationRootId: string;
- Type: string
The unique identifier (ID) of the organization root.
-
Extends: aws-cdk-lib.IResource
-
Implemented By: OrganzationPolicyBase, ServiceControlPolicy, IOrganizationPolicy
Name | Type | Description |
---|---|---|
node |
constructs.Node |
The tree node. |
env |
aws-cdk-lib.ResourceEnvironment |
The environment this resource belongs to. |
stack |
aws-cdk-lib.Stack |
The stack in which this resource is defined. |
organizationPolicyArn |
string |
Returns the Amazon Resource Name (ARN) of the policy. |
organizationPolicyId |
string |
Returns the unique identifier (ID) of the policy. |
targetIds |
string[] |
List of unique identifiers (IDs) of the root, OU, or account that you want to attach the policy to. |
public readonly node: Node;
- Type: constructs.Node
The tree node.
public readonly env: ResourceEnvironment;
- Type: aws-cdk-lib.ResourceEnvironment
The environment this resource belongs to.
For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.
public readonly stack: Stack;
- Type: aws-cdk-lib.Stack
The stack in which this resource is defined.
public readonly organizationPolicyArn: string;
- Type: string
Returns the Amazon Resource Name (ARN) of the policy.
public readonly organizationPolicyId: string;
- Type: string
Returns the unique identifier (ID) of the policy.
public readonly targetIds: string[];
- Type: string[]
List of unique identifiers (IDs) of the root, OU, or account that you want to attach the policy to.
- Implemented By: IOrganizationUnitProps
Organization Unit Properties.
Name | Type | Description |
---|---|---|
organizationUnitName |
string |
The name of the OU. |
parent |
string | IOrganization | OrganizationUnit |
The unique identifier (ID) of the parent root or OU that you want to create the new OU in. |
public readonly organizationUnitName: string;
- Type: string
The name of the OU.
public readonly parent: string | IOrganization | OrganizationUnit;
- Type: string | IOrganization | OrganizationUnit
The unique identifier (ID) of the parent root or OU that you want to create the new OU in.
-
Extends: aws-cdk-lib.IResource
-
Implemented By: OrganizationUnit, OrganizationUnitBase, IOrganizationUnits
Name | Type | Description |
---|---|---|
node |
constructs.Node |
The tree node. |
env |
aws-cdk-lib.ResourceEnvironment |
The environment this resource belongs to. |
stack |
aws-cdk-lib.Stack |
The stack in which this resource is defined. |
organizationUnitArn |
string |
The Amazon Resource Name (ARN) of this OU. |
organizationUnitId |
string |
The unique identifier (ID) associated with this OU. |
organizationUnitName |
string |
The name of the OU. |
public readonly node: Node;
- Type: constructs.Node
The tree node.
public readonly env: ResourceEnvironment;
- Type: aws-cdk-lib.ResourceEnvironment
The environment this resource belongs to.
For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.
public readonly stack: Stack;
- Type: aws-cdk-lib.Stack
The stack in which this resource is defined.
public readonly organizationUnitArn: string;
- Type: string
The Amazon Resource Name (ARN) of this OU.
public readonly organizationUnitId: string;
- Type: string
The unique identifier (ID) associated with this OU.
public readonly organizationUnitName: string;
- Type: string
The name of the OU.
Specifies the feature set supported by the new organization.
Each feature set supports different levels of functionality.
Name | Description |
---|---|
ALL |
In addition to all the features supported by the consolidated billing feature set, the management account gains access to advanced features that give you more control over accounts in your organization. |
CONSOLIDATED_BILLING |
All member accounts have their bills consolidated to and paid by the management account. |
In addition to all the features supported by the consolidated billing feature set, the management account gains access to advanced features that give you more control over accounts in your organization.
By default or if you set the FeatureSet property to ALL, the new organization is created with all features enabled and service control policies automatically enabled in the root.
All member accounts have their bills consolidated to and paid by the management account.
The type of policy to create.
Name | Description |
---|---|
SERVICE_CONTROL_POLICY |
Service control policies (SCPs) enable central administration over the maximum permissions that identities (users and roles) within accounts in your organization can have. |
BACKUP_POLICY |
Backup policies enable you to deploy organization-wide backup plans to help ensure compliance across your organization's accounts. |
TAG_POLICY |
Tag policies help you standardize tags on all tagged resources across your organization. |
AISERVICES_OPT_OUT_POLICY |
Artificial Intelligence (AI) services opt-out policies enable you to control whether AWS AI services can store and use your content. |
Service control policies (SCPs) enable central administration over the maximum permissions that identities (users and roles) within accounts in your organization can have.
This helps ensure that your identities stay within your organization’s access control guidelines
Backup policies enable you to deploy organization-wide backup plans to help ensure compliance across your organization's accounts.
Using policies helps ensure consistency in how you implement your backup plans.
Tag policies help you standardize tags on all tagged resources across your organization.
You can use tag policies to define tag keys (including how they should be capitalized) and their allowed values
https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies.html
Artificial Intelligence (AI) services opt-out policies enable you to control whether AWS AI services can store and use your content.