@aws-cdk/core
- Version 1.204.0
- Published
- 5.69 MB
- 8 dependencies
- Apache-2.0 license
Install
npm i @aws-cdk/core
yarn add @aws-cdk/core
pnpm add @aws-cdk/core
Overview
AWS Cloud Development Kit Core Library
Index
Variables
Functions
- attachCustomSynthesis()
- canInspect()
- captureStackTrace()
- cfnTagToCloudFormation()
- dateToCloudFormation()
- hashMapper()
- hashValidator()
- isResolvableObject()
- listMapper()
- listValidator()
- propertyValidator()
- requiredValidator()
- requireProperty()
- rootPathTo()
- unionMapper()
- unionValidator()
- validateBoolean()
- validateCfnTag()
- validateDate()
- validateNumber()
- validateObject()
- validateString()
- withResolved()
Classes
DefaultStackSynthesizer
- addDockerImageAsset()
- addFileAsset()
- bind()
- cloudFormationExecutionRoleArn
- DEFAULT_BOOTSTRAP_STACK_VERSION_SSM_PARAMETER
- DEFAULT_CLOUDFORMATION_ROLE_ARN
- DEFAULT_DEPLOY_ROLE_ARN
- DEFAULT_DOCKER_ASSET_PREFIX
- DEFAULT_FILE_ASSET_KEY_ARN_EXPORT_NAME
- DEFAULT_FILE_ASSET_PREFIX
- DEFAULT_FILE_ASSET_PUBLISHING_ROLE_ARN
- DEFAULT_FILE_ASSETS_BUCKET_NAME
- DEFAULT_IMAGE_ASSET_PUBLISHING_ROLE_ARN
- DEFAULT_IMAGE_ASSETS_REPOSITORY_NAME
- DEFAULT_LOOKUP_ROLE_ARN
- DEFAULT_QUALIFIER
- deployRoleArn
- stack
- synthesize()
- synthesizeStackTemplate()
Stack
- account
- addDependency()
- addDockerImageAsset()
- addFileAsset()
- addTransform()
- allocateLogicalId()
- artifactId
- availabilityZones
- bundlingRequired
- dependencies
- environment
- exportValue()
- formatArn()
- getLogicalId()
- isStack()
- nested
- nestedStackParent
- nestedStackResource
- notificationArns
- of()
- parentStack
- parseArn()
- partition
- prepareCrossReference()
- region
- regionalFact()
- renameLogicalId()
- reportMissingContext()
- reportMissingContextKey()
- resolve()
- splitArn()
- stackId
- stackName
- synthesizer
- tags
- templateFile
- templateOptions
- terminationProtection
- toJsonString()
- urlSuffix
Interfaces
DefaultStackSynthesizerProps
- bootstrapStackVersionSsmParameter
- bucketPrefix
- cloudFormationExecutionRole
- deployRoleArn
- deployRoleExternalId
- dockerTagPrefix
- fileAssetKeyArnExportName
- fileAssetPublishingExternalId
- fileAssetPublishingRoleArn
- fileAssetsBucketName
- generateBootstrapVersionRule
- imageAssetPublishingExternalId
- imageAssetPublishingRoleArn
- imageAssetsRepositoryName
- lookupRoleArn
- lookupRoleExternalId
- qualifier
- useLookupRoleForStackOperations
Enums
Type Aliases
Namespaces
Variables
variable booleanToCloudFormation
const booleanToCloudFormation: Mapper;
variable BOOTSTRAP_QUALIFIER_CONTEXT
const BOOTSTRAP_QUALIFIER_CONTEXT: string;
variable numberToCloudFormation
const numberToCloudFormation: Mapper;
variable objectToCloudFormation
const objectToCloudFormation: Mapper;
variable STACK_RESOURCE_LIMIT_CONTEXT
const STACK_RESOURCE_LIMIT_CONTEXT: string;
variable stringToCloudFormation
const stringToCloudFormation: Mapper;
variable VALIDATION_SUCCESS
const VALIDATION_SUCCESS: ValidationResult;
Functions
function attachCustomSynthesis
attachCustomSynthesis: ( construct: Construct, synthesis: ICustomSynthesis) => void;
Add a custom synthesis for the given construct
When the construct is being synthesized, this allows it to add additional items into the Cloud Assembly output.
This feature is intended for use by official AWS CDK libraries only; 3rd party library authors and CDK users should not use this function. That's why it's not exposed via jsii.
function canInspect
canInspect: (x: any) => boolean;
Return whether this object can be validated at all
True unless it's undefined or a CloudFormation intrinsic
function captureStackTrace
captureStackTrace: (below?: Function, limit?: number) => string[];
Captures the current process' stack trace.
Stack traces are often invaluable tools to help diagnose problems, however their capture is a rather expensive operation, and the stack traces can be large. Consequently, users are stronly advised to condition capturing stack traces to specific user opt-in.
Stack traces will only be captured if the
CDK_DEBUG
environment variable is set to'true'
or1
.Parameter below
an optional function starting from which stack frames will be ignored. Defaults to the
captureStackTrace
function itself.Parameter limit
and optional upper bound to the number of stack frames to be captured. If not provided, this defaults to
Number.MAX_SAFE_INTEGER
, effectively meaning "no limit".Returns
the captured stack trace, as an array of stack frames.
function cfnTagToCloudFormation
cfnTagToCloudFormation: (x: any) => any;
Turn a tag object into the proper CloudFormation representation
function dateToCloudFormation
dateToCloudFormation: (x?: Date) => any;
The date needs to be formatted as an ISO date in UTC
Some usage sites require a date, some require a timestamp. We'll always output a timestamp and hope the parser on the other end is smart enough to ignore the time part... (?)
function hashMapper
hashMapper: (elementMapper: Mapper) => Mapper;
function hashValidator
hashValidator: (elementValidator: Validator) => Validator;
Return a hash validator based on the given element validator
function isResolvableObject
isResolvableObject: (x: any) => x is IResolvable;
function listMapper
listMapper: (elementMapper: Mapper) => Mapper;
function listValidator
listValidator: (elementValidator: Validator) => Validator;
Return a list validator based on the given element validator
function propertyValidator
propertyValidator: (propName: string, validator: Validator) => Validator;
Decorate a validator with a message clarifying the property the failure is for.
function requiredValidator
requiredValidator: (x: any) => ValidationResult;
Return a validator that will fail if the passed property is not present
Does not distinguish between the property actually not being present, vs being present but 'null' or 'undefined' (courtesy of JavaScript), which is generally the behavior that we want.
Empty strings are considered "present"--don't know if this agrees with how CloudFormation looks at the world.
function requireProperty
requireProperty: ( props: { [name: string]: any }, name: string, context: Construct) => any;
Require a property from a property bag.
Parameter props
the property bag from which a property is required.
Parameter name
the name of the required property.
Parameter typeName
the name of the construct type that requires the property
Returns
the value of ``props[name]``
Throws
if the property ``name`` is not present in ``props``.
function rootPathTo
rootPathTo: (construct: IConstruct, ancestor?: IConstruct) => IConstruct[];
Return the construct root path of the given construct relative to the given ancestor
If no ancestor is given or the ancestor is not found, return the entire root path.
function unionMapper
unionMapper: (validators: Validator[], mappers: Mapper[]) => Mapper;
Return a union mapper
Takes a list of validators and a list of mappers, which should correspond pairwise.
The mapper of the first successful validator will be called.
function unionValidator
unionValidator: (...validators: Validator[]) => Validator;
Validates if any of the given validators matches
We add either/or words to the front of the error mesages so that they read more nicely. Example:
Properties not correct for 'FunctionProps' codeUri: not one of the possible types either: properties not correct for 'S3LocationProperty' bucket: required but missing key: required but missing version: required but missing or: '3' should be a 'string'
function validateBoolean
validateBoolean: (x: any) => ValidationResult;
function validateCfnTag
validateCfnTag: (x: any) => ValidationResult;
function validateDate
validateDate: (x: any) => ValidationResult;
function validateNumber
validateNumber: (x: any) => ValidationResult;
function validateObject
validateObject: (x: any) => ValidationResult;
function validateString
validateString: (x: any) => ValidationResult;
function withResolved
withResolved: { <A>(a: A, fn: (a: A) => void): void; <A, B>(a: A, b: B, fn: (a: A, b: B) => void): void; <A, B, C>(a: A, b: B, c: C, fn: (a: A, b: B, c: C) => void): void;};
Call the given function only if all given values are resolved
Exported as a function since it will be used by TypeScript modules, but can't be exposed via JSII because of the generics.
Classes
class Annotations
class Annotations {}
Includes API for attaching annotations such as warning messages to constructs.
method addDeprecation
addDeprecation: (api: string, message: string) => void;
Adds a deprecation warning for a specific API.
Deprecations will be added only once per construct as a warning and will be deduplicated based on the
api
.If the environment variable
CDK_BLOCK_DEPRECATIONS
is set, this method will throw an error instead with the deprecation message.Parameter api
The API being deprecated in the format
module.Class.property
(e.g.@aws-cdk/core.Construct.node
).Parameter message
The deprecation message to display, with information about alternatives.
method addError
addError: (message: string) => void;
Adds an { "error": } metadata entry to this construct. The toolkit will fail deployment of any stack that has errors reported against it.
Parameter message
The error message.
method addInfo
addInfo: (message: string) => void;
Adds an info metadata entry to this construct.
The CLI will display the info message when apps are synthesized.
Parameter message
The info message.
method addWarning
addWarning: (message: string) => void;
Adds a warning metadata entry to this construct.
The CLI will display the warning when an app is synthesized, or fail if run in --strict mode.
Parameter message
The warning message.
method of
static of: (scope: IConstruct) => Annotations;
Returns the annotations API for a construct scope.
Parameter scope
The scope
class App
class App extends Stage {}
A construct which represents an entire CDK app. This construct is normally the root of the construct tree.
You would normally define an
App
instance in your program's entrypoint, then define constructs where the app is used as the parent scope.After all the child constructs are defined within the app, you should call
app.synth()
which will emit a "cloud assembly" from this app into the directory specified byoutdir
. Cloud assemblies includes artifacts such as CloudFormation templates and assets that are needed to deploy this app into the AWS cloud.See Also
https://docs.aws.amazon.com/cdk/latest/guide/apps.html
constructor
constructor(props?: AppProps);
Initializes a CDK application.
Parameter props
initialization properties
method isApp
static isApp: (obj: any) => obj is App;
Checks if an object is an instance of the
App
class.Parameter obj
The object to evaluate
Returns
true
ifobj
is anApp
.
class Arn
class Arn {}
method extractResourceName
static extractResourceName: (arn: string, resourceType: string) => string;
Extract the full resource name from an ARN
Necessary for resource names (paths) that may contain the separator, like
arn:aws:iam::111111111111:role/path/to/role/name
.Only works if we statically know the expected
resourceType
beforehand, since we're going to use that to split the string on ':/' (and take the right-hand side).We can't extract the 'resourceType' from the ARN at hand, because CloudFormation Expressions only allow literals in the 'separator' argument to
{ Fn::Split }
, and so it can't be{ Fn::Select: [5, { Fn::Split: [':', ARN] }}
.Only necessary for ARN formats for which the type-name separator is
/
.
method format
static format: (components: ArnComponents, stack?: Stack) => string;
Creates an ARN from components.
If
partition
,region
oraccount
are not specified, the stack's partition, region and account will be used.If any component is the empty string, an empty string will be inserted into the generated ARN at the location that component corresponds to.
The ARN will be formatted as follows:
arn:{partition}:{service}:{region}:{account}:{resource}{sep}{resource-name}
The required ARN pieces that are omitted will be taken from the stack that the 'scope' is attached to. If all ARN pieces are supplied, the supplied scope can be 'undefined'.
method parse
static parse: ( arn: string, sepIfToken?: string, hasName?: boolean) => ArnComponents;
Given an ARN, parses it and returns components.
IF THE ARN IS A CONCRETE STRING...
...it will be parsed and validated. The separator (
sep
) will be set to '/' if the 6th component includes a '/', in which case,resource
will be set to the value before the '/' andresourceName
will be the rest. In case there is no '/',resource
will be set to the 6th components andresourceName
will be set to the rest of the string.IF THE ARN IS A TOKEN...
...it cannot be validated, since we don't have the actual value yet at the time of this function call. You will have to supply
sepIfToken
and whether or not ARNs of the expected format usually have resource names in order to parse it properly. The resultingArnComponents
object will contain tokens for the subexpressions of the ARN, not string literals.If the resource name could possibly contain the separator char, the actual resource name cannot be properly parsed. This only occurs if the separator char is '/', and happens for example for S3 object ARNs, IAM Role ARNs, IAM OIDC Provider ARNs, etc. To properly extract the resource name from a Tokenized ARN, you must know the resource type and call
Arn.extractResourceName
.Parameter arn
The ARN to parse
Parameter sepIfToken
The separator used to separate resource from resourceName
Parameter hasName
Whether there is a name component in the ARN at all. For example, SNS Topics ARNs have the 'resource' component contain the topic name, and no 'resourceName' component.
Returns
an ArnComponents object which allows access to the various components of the ARN.
Deprecated
use split instead
method split
static split: (arn: string, arnFormat: ArnFormat) => ArnComponents;
Splits the provided ARN into its components. Works both if 'arn' is a string like 'arn:aws:s3:::bucket', and a Token representing a dynamic CloudFormation expression (in which case the returned components will also be dynamic CloudFormation expressions, encoded as Tokens).
Parameter arn
the ARN to split into its components
Parameter arnFormat
the expected format of 'arn' - depends on what format the service 'arn' represents uses
class Aspects
class Aspects {}
Aspects can be applied to CDK tree scopes and can operate on the tree before synthesis.
property aspects
readonly aspects: IAspect[];
The list of aspects which were directly applied on this scope.
method add
add: (aspect: IAspect) => void;
Adds an aspect to apply this scope before synthesis.
Parameter aspect
The aspect to add.
method of
static of: (scope: IConstruct) => Aspects;
Returns the
Aspects
object associated with a construct scope.Parameter scope
The scope for which these aspects will apply.
class AssetStaging
class AssetStaging extends CoreConstruct {}
Stages a file or directory from a location on the file system into a staging directory.
This is controlled by the context key 'aws:cdk:asset-staging' and enabled by the CLI by default in order to ensure that when the CDK app exists, all assets are available for deployment. Otherwise, if an app references assets in temporary locations, those will not be available when it exists (see https://github.com/aws/aws-cdk/issues/1716).
The
stagedPath
property is a stringified token that represents the location of the file or directory after staging. It will be resolved only during the "prepare" stage and may be either the original path or the staged path depending on the context setting.The file/directory are staged based on their content hash (fingerprint). This means that only if content was changed, copy will happen.
constructor
constructor(scope: Construct, id: string, props: AssetStagingProps);
property absoluteStagedPath
readonly absoluteStagedPath: string;
Absolute path to the asset data.
If asset staging is disabled, this will just be the source path or a temporary directory used for bundling.
If asset staging is enabled it will be the staged path.
IMPORTANT: If you are going to call
addFileAsset()
, userelativeStagedPath()
instead.
property assetHash
readonly assetHash: string;
A cryptographic hash of the asset.
property BUNDLING_INPUT_DIR
static readonly BUNDLING_INPUT_DIR: string;
The directory inside the bundling container into which the asset sources will be mounted.
property BUNDLING_OUTPUT_DIR
static readonly BUNDLING_OUTPUT_DIR: string;
The directory inside the bundling container into which the bundled output should be written.
property isArchive
readonly isArchive: boolean;
Whether this asset is an archive (zip or jar).
property packaging
readonly packaging: FileAssetPackaging;
How this asset should be packaged.
property sourceHash
readonly sourceHash: string;
A cryptographic hash of the asset.
Deprecated
see
assetHash
.
property sourcePath
readonly sourcePath: string;
The absolute path of the asset as it was referenced by the user.
property stagedPath
readonly stagedPath: string;
Absolute path to the asset data.
If asset staging is disabled, this will just be the source path or a temporary directory used for bundling.
If asset staging is enabled it will be the staged path.
IMPORTANT: If you are going to call
addFileAsset()
, userelativeStagedPath()
instead.Deprecated
- Use
absoluteStagedPath
instead.
method clearAssetHashCache
static clearAssetHashCache: () => void;
Clears the asset hash cache
method relativeStagedPath
relativeStagedPath: (stack: Stack) => string;
Return the path to the staged asset, relative to the Cloud Assembly (manifest) directory of the given stack
Only returns a relative path if the asset was staged, returns an absolute path if it was not staged.
A bundled asset might end up in the outDir and still not count as "staged"; if asset staging is disabled we're technically expected to reference source directories, but we don't have a source directory for the bundled outputs (as the bundle output is written to a temporary directory). Nevertheless, we will still return an absolute path.
A non-obvious directory layout may look like this:
CLOUD ASSEMBLY ROOT+-- asset.12345abcdef/+-- assembly-Stage+-- MyStack.template.json+-- MyStack.assets.json <- will contain { "path": "../asset.12345abcdef" }
class Aws
class Aws {}
Accessor for pseudo parameters
Since pseudo parameters need to be anchored to a stack somewhere in the construct tree, this class takes an scope parameter; the pseudo parameter values can be obtained as properties from an scoped object.
property ACCOUNT_ID
static readonly ACCOUNT_ID: string;
property NO_VALUE
static readonly NO_VALUE: string;
property NOTIFICATION_ARNS
static readonly NOTIFICATION_ARNS: string[];
property PARTITION
static readonly PARTITION: string;
property REGION
static readonly REGION: string;
property STACK_ID
static readonly STACK_ID: string;
property STACK_NAME
static readonly STACK_NAME: string;
property URL_SUFFIX
static readonly URL_SUFFIX: string;
class BootstraplessSynthesizer
class BootstraplessSynthesizer extends DefaultStackSynthesizer {}
Synthesizer that reuses bootstrap roles from a different region
A special synthesizer that behaves similarly to
DefaultStackSynthesizer
, but doesn't require bootstrapping the environment it operates in. Instead, it will re-use the Roles that were created for a different region (which is possible because IAM is a global service).However, it will not assume asset buckets or repositories have been created, and therefore does not support assets.
Used by the CodePipeline construct for the support stacks needed for cross-region replication S3 buckets. App builders do not need to use this synthesizer directly.
constructor
constructor(props: BootstraplessSynthesizerProps);
method addDockerImageAsset
addDockerImageAsset: ( _asset: DockerImageAssetSource) => DockerImageAssetLocation;
method addFileAsset
addFileAsset: (_asset: FileAssetSource) => FileAssetLocation;
method synthesize
synthesize: (session: ISynthesisSession) => void;
class BundlingDockerImage
class BundlingDockerImage {}
A Docker image used for asset bundling
Deprecated
use DockerImage
constructor
protected constructor(image: string, _imageHash?: string);
Parameter image
The Docker image
property image
readonly image: string;
method cp
cp: (imagePath: string, outputPath?: string) => string;
Copies a file or directory out of the Docker image to the local filesystem.
If
outputPath
is omitted the destination path is a temporary directory.Parameter imagePath
the path in the Docker image
Parameter outputPath
the destination path for the copy operation
Returns
the destination path
method fromAsset
static fromAsset: ( path: string, options?: DockerBuildOptions) => BundlingDockerImage;
Reference an image that's built directly from sources on disk.
Parameter path
The path to the directory containing the Docker file
Parameter options
Docker build options
Deprecated
use DockerImage.fromBuild()
method fromRegistry
static fromRegistry: (image: string) => DockerImage;
Reference an image on DockerHub or another online registry.
Parameter image
the image name
method run
run: (options?: DockerRunOptions) => void;
Runs a Docker image
method toJSON
toJSON: () => string;
Provides a stable representation of this image for JSON serialization.
The overridden image name if set or image hash name in that order
class CfnCodeDeployBlueGreenHook
class CfnCodeDeployBlueGreenHook extends CfnHook {}
A CloudFormation Hook for CodeDeploy blue-green ECS deployments.
See Also
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/blue-green.html#blue-green-template-reference
constructor
constructor( scope: Construct, id: string, props: CfnCodeDeployBlueGreenHookProps);
Creates a new CodeDeploy blue-green ECS Hook.
Parameter scope
the scope to create the hook in (usually the containing Stack object)
Parameter id
the identifier of the construct - will be used to generate the logical ID of the Hook
Parameter props
the properties of the Hook
property additionalOptions
additionalOptions: CfnCodeDeployBlueGreenAdditionalOptions;
Additional options for the blue/green deployment.
- no additional options
property applications
applications: CfnCodeDeployBlueGreenApplication[];
Properties of the Amazon ECS applications being deployed.
property lifecycleEventHooks
lifecycleEventHooks: CfnCodeDeployBlueGreenLifecycleEventHooks;
Use lifecycle event hooks to specify a Lambda function that CodeDeploy can call to validate a deployment. You can use the same function or a different one for deployment lifecycle events. Following completion of the validation tests, the Lambda CfnCodeDeployBlueGreenLifecycleEventHooks.afterAllowTraffic function calls back CodeDeploy and delivers a result of 'Succeeded' or 'Failed'.
- no lifecycle event hooks
property serviceRole
serviceRole: string;
The IAM Role for CloudFormation to use to perform blue-green deployments.
property trafficRoutingConfig
trafficRoutingConfig: CfnTrafficRoutingConfig;
Traffic routing configuration settings.
- time-based canary traffic shifting, with a 15% step percentage and a five minute bake time
method renderProperties
protected renderProperties: (_props?: { [p: string]: any }) => { [p: string]: any;};
class CfnCondition
class CfnCondition extends CfnElement implements ICfnConditionExpression, IResolvable {}
Represents a CloudFormation condition, for resources which must be conditionally created and the determination must be made at deploy time.
constructor
constructor(scope: Construct, id: string, props?: CfnConditionProps);
Build a new condition. The condition must be constructed with a condition token, that the condition is based on.
property expression
expression?: ICfnConditionExpression;
The condition statement.
method resolve
resolve: (_context: IResolveContext) => any;
Synthesizes the condition.
class CfnCustomResource
class CfnCustomResource extends cdk.CfnResource implements cdk.IInspectable {}
A CloudFormation
AWS::CloudFormation::CustomResource
In a CloudFormation template, you use the
AWS::CloudFormation::CustomResource
orCustom:: *String*
resource type to specify custom resources.Custom resources provide a way for you to write custom provisioning logic in CloudFormation template and have CloudFormation run it during a stack operation, such as when you create, update or delete a stack. For more information, see [Custom resources](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-custom-resources.html) .
> If you use the [VPC endpoints](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-endpoints.html) feature, custom resources in the VPC must have access to CloudFormation -specific Amazon Simple Storage Service ( Amazon S3 ) buckets. Custom resources must send responses to a presigned Amazon S3 URL. If they can't send responses to Amazon S3 , CloudFormation won't receive a response and the stack operation fails. For more information, see [Setting up VPC endpoints for AWS CloudFormation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-vpce-bucketnames.html) .
AWS::CloudFormation::CustomResource external
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cfn-customresource.html
constructor
constructor(scope: cdk.Construct, id: string, props: cdk.CfnCustomResourceProps);
Create a new
AWS::CloudFormation::CustomResource
.Parameter scope
scope in which this resource is defined
Parameter id
scoped id of the resource
Parameter props
resource properties
property CFN_RESOURCE_TYPE_NAME
static readonly CFN_RESOURCE_TYPE_NAME: string;
The CloudFormation resource type name for this resource class.
property cfnProperties
readonly cfnProperties: { [key: string]: any };
property serviceToken
serviceToken: string;
> Only one property is defined by AWS for a custom resource:
ServiceToken
. All other properties are defined by the service provider.The service token that was given to the template developer by the service provider to access the service, such as an Amazon SNS topic ARN or Lambda function ARN. The service token must be from the same Region in which you are creating the stack.
Updates aren't supported.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cfn-customresource.html#cfn-customresource-servicetoken
method inspect
inspect: (inspector: cdk.TreeInspector) => void;
Examines the CloudFormation resource and discloses attributes.
Parameter inspector
tree inspector to collect and process attributes
method renderProperties
protected renderProperties: (props: { [key: string]: any }) => { [key: string]: any;};
class CfnDynamicReference
class CfnDynamicReference extends Intrinsic {}
References a dynamically retrieved value
This is a Construct so that subclasses will (eventually) be able to attach metadata to themselves without having to change call signatures.
See Also
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/dynamic-references.html
constructor
constructor(service: CfnDynamicReferenceService, key: string);
class CfnElement
abstract class CfnElement extends CoreConstruct {}
An element of a CloudFormation stack.
constructor
constructor(scope: Construct, id: string);
Creates an entity and binds it to a tree. Note that the root of the tree must be a Stack object (not just any Root).
Parameter scope
The parent construct
Parameter props
Construct properties
property creationStack
readonly creationStack: string[];
Returns
the stack trace of the point where this Resource was created from, sourced from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most node +internal+ entries filtered.
property logicalId
readonly logicalId: string;
The logical ID for this CloudFormation stack element. The logical ID of the element is calculated from the path of the resource node in the construct tree.
To override this value, use
overrideLogicalId(newLogicalId)
.Returns
the logical ID as a stringified token. This value will only get resolved during synthesis.
property stack
readonly stack: Stack;
The stack in which this element is defined. CfnElements must be defined within a stack scope (directly or indirectly).
method isCfnElement
static isCfnElement: (x: any) => x is CfnElement;
Returns
true
if a construct is a stack element (i.e. part of the synthesized cloudformation template).Uses duck-typing instead of
instanceof
to allow stack elements from different versions of this library to be included in the same stack.Returns
The construct as a stack element or undefined if it is not a stack element.
method overrideLogicalId
overrideLogicalId: (newLogicalId: string) => void;
Overrides the auto-generated logical ID with a specific ID.
Parameter newLogicalId
The new logical ID to use for this stack element.
class CfnHook
class CfnHook extends CfnElement {}
Represents a CloudFormation resource.
constructor
constructor(scope: Construct, id: string, props: CfnHookProps);
Creates a new Hook object.
property type
readonly type: string;
The type of the hook (for example, "AWS::CodeDeploy::BlueGreen").
method renderProperties
protected renderProperties: (props?: { [key: string]: any }) => { [key: string]: any;};
class CfnHookDefaultVersion
class CfnHookDefaultVersion extends cdk.CfnResource implements cdk.IInspectable {}
A CloudFormation
AWS::CloudFormation::HookDefaultVersion
The
HookDefaultVersion
resource specifies the default version of the hook. The default version of the hook is used in CloudFormation operations for this AWS account and AWS Region .AWS::CloudFormation::HookDefaultVersion external
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-hookdefaultversion.html
constructor
constructor( scope: cdk.Construct, id: string, props?: cdk.CfnHookDefaultVersionProps);
Create a new
AWS::CloudFormation::HookDefaultVersion
.Parameter scope
scope in which this resource is defined
Parameter id
scoped id of the resource
Parameter props
resource properties
property attrArn
readonly attrArn: string;
The Amazon Resource Number (ARN) of the activated extension, in this account and Region. Arn
property CFN_RESOURCE_TYPE_NAME
static readonly CFN_RESOURCE_TYPE_NAME: string;
The CloudFormation resource type name for this resource class.
property cfnProperties
readonly cfnProperties: { [key: string]: any };
property typeName
typeName: string;
The name of the hook.
You must specify either
TypeVersionArn
, orTypeName
andVersionId
.http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-hookdefaultversion.html#cfn-cloudformation-hookdefaultversion-typename
property typeVersionArn
typeVersionArn: string;
The version ID of the type configuration.
You must specify either
TypeVersionArn
, orTypeName
andVersionId
.http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-hookdefaultversion.html#cfn-cloudformation-hookdefaultversion-typeversionarn
property versionId
versionId: string;
The version ID of the type specified.
You must specify either
TypeVersionArn
, orTypeName
andVersionId
.http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-hookdefaultversion.html#cfn-cloudformation-hookdefaultversion-versionid
method inspect
inspect: (inspector: cdk.TreeInspector) => void;
Examines the CloudFormation resource and discloses attributes.
Parameter inspector
tree inspector to collect and process attributes
method renderProperties
protected renderProperties: (props: { [key: string]: any }) => { [key: string]: any;};
class CfnHookTypeConfig
class CfnHookTypeConfig extends cdk.CfnResource implements cdk.IInspectable {}
A CloudFormation
AWS::CloudFormation::HookTypeConfig
The
HookTypeConfig
resource specifies the configuration of a hook.AWS::CloudFormation::HookTypeConfig external
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-hooktypeconfig.html
constructor
constructor(scope: cdk.Construct, id: string, props: cdk.CfnHookTypeConfigProps);
Create a new
AWS::CloudFormation::HookTypeConfig
.Parameter scope
scope in which this resource is defined
Parameter id
scoped id of the resource
Parameter props
resource properties
property attrConfigurationArn
readonly attrConfigurationArn: string;
The Amazon Resource Number (ARN) of the activated hook type configuration, in this account and Region. ConfigurationArn
property CFN_RESOURCE_TYPE_NAME
static readonly CFN_RESOURCE_TYPE_NAME: string;
The CloudFormation resource type name for this resource class.
property cfnProperties
readonly cfnProperties: { [key: string]: any };
property configuration
configuration: string;
Specifies the activated hook type configuration, in this AWS account and AWS Region .
You must specify either
TypeName
andConfiguration
orTypeARN
andConfiguration
.http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-hooktypeconfig.html#cfn-cloudformation-hooktypeconfig-configuration
property configurationAlias
configurationAlias: string;
Specifies the activated hook type configuration, in this AWS account and AWS Region .
Defaults to
default
alias. Hook types currently support default configuration alias.http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-hooktypeconfig.html#cfn-cloudformation-hooktypeconfig-configurationalias
property typeArn
typeArn: string;
The Amazon Resource Number (ARN) for the hook to set
Configuration
for.You must specify either
TypeName
andConfiguration
orTypeARN
andConfiguration
.http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-hooktypeconfig.html#cfn-cloudformation-hooktypeconfig-typearn
property typeName
typeName: string;
The unique name for your hook. Specifies a three-part namespace for your hook, with a recommended pattern of
Organization::Service::Hook
.You must specify either
TypeName
andConfiguration
orTypeARN
andConfiguration
.http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-hooktypeconfig.html#cfn-cloudformation-hooktypeconfig-typename
method inspect
inspect: (inspector: cdk.TreeInspector) => void;
Examines the CloudFormation resource and discloses attributes.
Parameter inspector
tree inspector to collect and process attributes
method renderProperties
protected renderProperties: (props: { [key: string]: any }) => { [key: string]: any;};
class CfnHookVersion
class CfnHookVersion extends cdk.CfnResource implements cdk.IInspectable {}
A CloudFormation
AWS::CloudFormation::HookVersion
The
HookVersion
resource publishes new or first hook version to the AWS CloudFormation registry.AWS::CloudFormation::HookVersion external
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-hookversion.html
constructor
constructor(scope: cdk.Construct, id: string, props: cdk.CfnHookVersionProps);
Create a new
AWS::CloudFormation::HookVersion
.Parameter scope
scope in which this resource is defined
Parameter id
scoped id of the resource
Parameter props
resource properties
property attrArn
readonly attrArn: string;
The Amazon Resource Name (ARN) of the hook. Arn
property attrIsDefaultVersion
readonly attrIsDefaultVersion: cdk.IResolvable;
Whether the specified hook version is set as the default version. IsDefaultVersion
property attrTypeArn
readonly attrTypeArn: string;
The Amazon Resource Number (ARN) assigned to this version of the hook. TypeArn
property attrVersionId
readonly attrVersionId: string;
The ID of this version of the hook. VersionId
property attrVisibility
readonly attrVisibility: string;
The scope at which the resource is visible and usable in CloudFormation operations.
Valid values include:
-
PRIVATE
: The resource is only visible and usable within the account in which it's registered. CloudFormation marks any resources you register asPRIVATE
. -PUBLIC
: The resource is publicly visible and usable within any Amazon account. Visibility
property CFN_RESOURCE_TYPE_NAME
static readonly CFN_RESOURCE_TYPE_NAME: string;
The CloudFormation resource type name for this resource class.
property cfnProperties
readonly cfnProperties: { [key: string]: any };
property executionRoleArn
executionRoleArn: string;
The Amazon Resource Name (ARN) of the task execution role that grants the hook permission.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-hookversion.html#cfn-cloudformation-hookversion-executionrolearn
property loggingConfig
loggingConfig: cdk.IResolvable | cdk.CfnHookVersion.LoggingConfigProperty;
Contains logging configuration information for an extension.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-hookversion.html#cfn-cloudformation-hookversion-loggingconfig
property schemaHandlerPackage
schemaHandlerPackage: string;
A URL to the Amazon S3 bucket containing the hook project package that contains the necessary files for the hook you want to register.
For information on generating a schema handler package for the resource you want to register, see [submit](https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-cli-submit.html) in the *CloudFormation CLI User Guide for Extension Development* .
> The user registering the resource must be able to access the package in the S3 bucket. That's, the user must have [GetObject](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html) permissions for the schema handler package. For more information, see [Actions, Resources, and Condition Keys for Amazon S3](https://docs.aws.amazon.com/IAM/latest/UserGuide/list_amazons3.html) in the *AWS Identity and Access Management User Guide* .
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-hookversion.html#cfn-cloudformation-hookversion-schemahandlerpackage
property typeName
typeName: string;
The unique name for your hook. Specifies a three-part namespace for your hook, with a recommended pattern of
Organization::Service::Hook
.> The following organization namespaces are reserved and can't be used in your hook type names: > > -
Alexa
> -AMZN
> -Amazon
> -ASK
> -AWS
> -Custom
> -Dev
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-hookversion.html#cfn-cloudformation-hookversion-typename
method inspect
inspect: (inspector: cdk.TreeInspector) => void;
Examines the CloudFormation resource and discloses attributes.
Parameter inspector
tree inspector to collect and process attributes
method renderProperties
protected renderProperties: (props: { [key: string]: any }) => { [key: string]: any;};
class CfnInclude
class CfnInclude extends CfnElement {}
Includes a CloudFormation template into a stack. All elements of the template will be merged into the current stack, together with any elements created programmatically.
Deprecated
use the CfnInclude class from the cloudformation-include module instead
constructor
constructor(scope: Construct, id: string, props: CfnIncludeProps);
Creates an adopted template construct. The template will be incorporated into the stack as-is with no changes at all. This means that logical IDs of entities within this template may conflict with logical IDs of entities that are part of the stack.
Parameter scope
The parent construct of this template
Parameter id
The ID of this construct
Parameter props
Initialization properties.
property template
readonly template: {};
The included template.
class CfnJson
class CfnJson extends CoreConstruct implements IResolvable {}
Captures a synthesis-time JSON object a CloudFormation reference which resolves during deployment to the resolved values of the JSON object.
The main use case for this is to overcome a limitation in CloudFormation that does not allow using intrinsic functions as dictionary keys (because dictionary keys in JSON must be strings). Specifically this is common in IAM conditions such as
StringEquals: { lhs: "rhs" }
where you want "lhs" to be a reference.This object is resolvable, so it can be used as a value.
This construct is backed by a custom resource.
constructor
constructor(scope: Construct, id: string, props: CfnJsonProps);
property creationStack
readonly creationStack: string[];
property value
readonly value: Reference;
An Fn::GetAtt to the JSON object passed through
value
and resolved during synthesis.Normally there is no need to use this property since
CfnJson
is an IResolvable, so it can be simply used as a value.
method resolve
resolve: (_: IResolveContext) => any;
method toJSON
toJSON: () => string;
This is required in case someone JSON.stringifys an object which refrences this object. Otherwise, we'll get a cyclic JSON reference.
class CfnMacro
class CfnMacro extends cdk.CfnResource implements cdk.IInspectable {}
A CloudFormation
AWS::CloudFormation::Macro
The
AWS::CloudFormation::Macro
resource is a CloudFormation resource type that creates a CloudFormation macro to perform custom processing on CloudFormation templates. For more information, see [Using AWS CloudFormation macros to perform custom processing on templates](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-macros.html) .AWS::CloudFormation::Macro external
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-macro.html
constructor
constructor(scope: cdk.Construct, id: string, props: cdk.CfnMacroProps);
Create a new
AWS::CloudFormation::Macro
.Parameter scope
scope in which this resource is defined
Parameter id
scoped id of the resource
Parameter props
resource properties
property CFN_RESOURCE_TYPE_NAME
static readonly CFN_RESOURCE_TYPE_NAME: string;
The CloudFormation resource type name for this resource class.
property cfnProperties
readonly cfnProperties: { [key: string]: any };
property description
description: string;
A description of the macro.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-macro.html#cfn-cloudformation-macro-description
property functionName
functionName: string;
The Amazon Resource Name (ARN) of the underlying AWS Lambda function that you want AWS CloudFormation to invoke when the macro is run.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-macro.html#cfn-cloudformation-macro-functionname
property logGroupName
logGroupName: string;
The CloudWatch Logs group to which AWS CloudFormation sends error logging information when invoking the macro's underlying AWS Lambda function.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-macro.html#cfn-cloudformation-macro-loggroupname
property logRoleArn
logRoleArn: string;
The ARN of the role AWS CloudFormation should assume when sending log entries to CloudWatch Logs .
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-macro.html#cfn-cloudformation-macro-logrolearn
property name
name: string;
The name of the macro. The name of the macro must be unique across all macros in the account.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-macro.html#cfn-cloudformation-macro-name
method inspect
inspect: (inspector: cdk.TreeInspector) => void;
Examines the CloudFormation resource and discloses attributes.
Parameter inspector
tree inspector to collect and process attributes
method renderProperties
protected renderProperties: (props: { [key: string]: any }) => { [key: string]: any;};
class CfnMapping
class CfnMapping extends CfnRefElement {}
Represents a CloudFormation mapping.
constructor
constructor(scope: Construct, id: string, props?: CfnMappingProps);
method findInMap
findInMap: (key1: string, key2: string) => string;
Returns
A reference to a value in the map based on the two keys.
method setValue
setValue: (key1: string, key2: string, value: any) => void;
Sets a value in the map based on the two keys.
class CfnModuleDefaultVersion
class CfnModuleDefaultVersion extends cdk.CfnResource implements cdk.IInspectable {}
A CloudFormation
AWS::CloudFormation::ModuleDefaultVersion
Specifies the default version of a module. The default version of the module will be used in CloudFormation operations for this account and Region.
To register a module version, use the
[AWS::CloudFormation::ModuleVersion](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-moduleversion.html)
resource.For more information using modules, see [Using modules to encapsulate and reuse resource configurations](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/modules.html) and [Registering extensions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/registry.html#registry-register) in the *AWS CloudFormation User Guide* . For information on developing modules, see [Developing modules](https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/modules.html) in the *AWS CloudFormation CLI User Guide* .
AWS::CloudFormation::ModuleDefaultVersion external
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-moduledefaultversion.html
constructor
constructor( scope: cdk.Construct, id: string, props?: cdk.CfnModuleDefaultVersionProps);
Create a new
AWS::CloudFormation::ModuleDefaultVersion
.Parameter scope
scope in which this resource is defined
Parameter id
scoped id of the resource
Parameter props
resource properties
property arn
arn: string;
The Amazon Resource Name (ARN) of the module version to set as the default version.
Conditional: You must specify either
Arn
, orModuleName
andVersionId
.http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-moduledefaultversion.html#cfn-cloudformation-moduledefaultversion-arn
property CFN_RESOURCE_TYPE_NAME
static readonly CFN_RESOURCE_TYPE_NAME: string;
The CloudFormation resource type name for this resource class.
property cfnProperties
readonly cfnProperties: { [key: string]: any };
property moduleName
moduleName: string;
The name of the module.
Conditional: You must specify either
Arn
, orModuleName
andVersionId
.http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-moduledefaultversion.html#cfn-cloudformation-moduledefaultversion-modulename
property versionId
versionId: string;
The ID for the specific version of the module.
Conditional: You must specify either
Arn
, orModuleName
andVersionId
.http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-moduledefaultversion.html#cfn-cloudformation-moduledefaultversion-versionid
method inspect
inspect: (inspector: cdk.TreeInspector) => void;
Examines the CloudFormation resource and discloses attributes.
Parameter inspector
tree inspector to collect and process attributes
method renderProperties
protected renderProperties: (props: { [key: string]: any }) => { [key: string]: any;};
class CfnModuleVersion
class CfnModuleVersion extends cdk.CfnResource implements cdk.IInspectable {}
A CloudFormation
AWS::CloudFormation::ModuleVersion
Registers the specified version of the module with the CloudFormation service. Registering a module makes it available for use in CloudFormation templates in your AWS account and Region.
To specify a module version as the default version, use the
[AWS::CloudFormation::ModuleDefaultVersion](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-moduledefaultversion.html)
resource.For more information using modules, see [Using modules to encapsulate and reuse resource configurations](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/modules.html) and [Registering extensions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/registry.html#registry-register) in the *CloudFormation User Guide* . For information on developing modules, see [Developing modules](https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/modules.html) in the *CloudFormation CLI User Guide* .
AWS::CloudFormation::ModuleVersion external
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-moduleversion.html
constructor
constructor(scope: cdk.Construct, id: string, props: cdk.CfnModuleVersionProps);
Create a new
AWS::CloudFormation::ModuleVersion
.Parameter scope
scope in which this resource is defined
Parameter id
scoped id of the resource
Parameter props
resource properties
property attrArn
readonly attrArn: string;
The Amazon Resource Name (ARN) of the module. Arn
property attrDescription
readonly attrDescription: string;
The description of the module. Description
property attrDocumentationUrl
readonly attrDocumentationUrl: string;
The URL of a page providing detailed documentation for this module. DocumentationUrl
property attrIsDefaultVersion
readonly attrIsDefaultVersion: cdk.IResolvable;
Whether the specified module version is set as the default version. IsDefaultVersion
property attrSchema
readonly attrSchema: string;
The schema that defines the module. Schema
property attrTimeCreated
readonly attrTimeCreated: string;
When the specified module version was registered. TimeCreated
property attrVersionId
readonly attrVersionId: string;
The ID of this version of the module. VersionId
property attrVisibility
readonly attrVisibility: string;
The scope at which the module is visible and usable in CloudFormation operations.
Valid values include:
-
PRIVATE
: The module is only visible and usable within the account in which it's registered. -PUBLIC
: The module is publicly visible and usable within any Amazon account. Visibility
property CFN_RESOURCE_TYPE_NAME
static readonly CFN_RESOURCE_TYPE_NAME: string;
The CloudFormation resource type name for this resource class.
property cfnProperties
readonly cfnProperties: { [key: string]: any };
property moduleName
moduleName: string;
The name of the module being registered.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-moduleversion.html#cfn-cloudformation-moduleversion-modulename
property modulePackage
modulePackage: string;
A URL to the S3 bucket containing the package that contains the template fragment and schema files for the module version to register.
> The user registering the module version must be able to access the module package in the S3 bucket. That's, the user needs to have [GetObject](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html) permissions for the package. For more information, see [Actions, Resources, and Condition Keys for Amazon S3](https://docs.aws.amazon.com/IAM/latest/UserGuide/list_amazons3.html) in the *AWS Identity and Access Management User Guide* .
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-moduleversion.html#cfn-cloudformation-moduleversion-modulepackage
method inspect
inspect: (inspector: cdk.TreeInspector) => void;
Examines the CloudFormation resource and discloses attributes.
Parameter inspector
tree inspector to collect and process attributes
method renderProperties
protected renderProperties: (props: { [key: string]: any }) => { [key: string]: any;};
class CfnOutput
class CfnOutput extends CfnElement {}
constructor
constructor(scope: Construct, id: string, props: CfnOutputProps);
Creates an CfnOutput value for this stack.
Parameter scope
The parent construct.
Parameter props
CfnOutput properties.
property condition
condition: CfnCondition;
A condition to associate with this output value. If the condition evaluates to
false
, this output value will not be included in the stack.- No condition is associated with the output.
property description
description: string;
A String type that describes the output value. The description can be a maximum of 4 K in length.
- No description.
property exportName
exportName: string;
The name used to export the value of this output across stacks.
To use the value in another stack, pass the value of
output.importValue
to it.- the output is not exported
property importValue
readonly importValue: string;
Return the
Fn.importValue
expression to import this value into another stackThe returned value should not be used in the same stack, but in a different one. It must be deployed to the same environment, as CloudFormation exports can only be imported in the same Region and account.
The is no automatic registration of dependencies between stacks when using this mechanism, so you should make sure to deploy them in the right order yourself.
You can use this mechanism to share values across Stacks in different Stages. If you intend to share the value to another Stack inside the same Stage, the automatic cross-stack referencing mechanism is more convenient.
property value
value: any;
The value of the property returned by the aws cloudformation describe-stacks command. The value of an output can include literals, parameter references, pseudo-parameters, a mapping value, or intrinsic functions.
method validate
protected validate: () => string[];
class CfnParameter
class CfnParameter extends CfnElement {}
A CloudFormation parameter.
Use the optional Parameters section to customize your templates. Parameters enable you to input custom values to your template each time you create or update a stack.
constructor
constructor(scope: Construct, id: string, props?: CfnParameterProps);
Creates a parameter construct. Note that the name (logical ID) of the parameter will derive from it's
coname
and location within the stack. Therefore, it is recommended that parameters are defined at the stack level.Parameter scope
The parent construct.
Parameter props
The parameter properties.
property allowedPattern
allowedPattern: string;
A regular expression that represents the patterns to allow for String types.
- No constraints on patterns allowed for parameter.
property allowedValues
allowedValues: string[];
An array containing the list of values allowed for the parameter.
- No constraints on values allowed for parameter.
property constraintDescription
constraintDescription: string;
A string that explains a constraint when the constraint is violated. For example, without a constraint description, a parameter that has an allowed pattern of [A-Za-z0-9]+ displays the following error message when the user specifies an invalid value:
- No description with customized error message when user specifies invalid values.
property default
default: any;
A value of the appropriate type for the template to use if no value is specified when a stack is created. If you define constraints for the parameter, you must specify a value that adheres to those constraints.
- No default value for parameter.
property description
description: string;
A string of up to 4000 characters that describes the parameter.
- No description for the parameter.
property maxLength
maxLength: number;
An integer value that determines the largest number of characters you want to allow for String types.
- None.
property maxValue
maxValue: number;
A numeric value that determines the largest numeric value you want to allow for Number types.
- None.
property minLength
minLength: number;
An integer value that determines the smallest number of characters you want to allow for String types.
- None.
property minValue
minValue: number;
A numeric value that determines the smallest numeric value you want to allow for Number types.
- None.
property noEcho
noEcho: boolean;
Indicates if this parameter is configured with "NoEcho" enabled.
property type
type: string;
The data type for the parameter (DataType).
String
property value
readonly value: IResolvable;
The parameter value as a Token
property valueAsList
readonly valueAsList: string[];
The parameter value, if it represents a string list.
property valueAsNumber
readonly valueAsNumber: number;
The parameter value, if it represents a number.
property valueAsString
readonly valueAsString: string;
The parameter value, if it represents a string.
method resolve
resolve: (_context: IResolveContext) => any;
class CfnPublicTypeVersion
class CfnPublicTypeVersion extends cdk.CfnResource implements cdk.IInspectable {}
A CloudFormation
AWS::CloudFormation::PublicTypeVersion
Tests and publishes a registered extension as a public, third-party extension.
CloudFormation first tests the extension to make sure it meets all necessary requirements for being published in the CloudFormation registry. If it does, CloudFormation then publishes it to the registry as a public third-party extension in this Region. Public extensions are available for use by all CloudFormation users.
- For resource types, testing includes passing all contracts tests defined for the type. - For modules, testing includes determining if the module's model meets all necessary requirements.
For more information, see [Testing your public extension prior to publishing](https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/publish-extension.html#publish-extension-testing) in the *CloudFormation CLI User Guide* .
If you don't specify a version, CloudFormation uses the default version of the extension in your account and Region for testing.
To perform testing, CloudFormation assumes the execution role specified when the type was registered.
An extension must have a test status of
PASSED
before it can be published. For more information, see [Publishing extensions to make them available for public use](https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-publish.html) in the *CloudFormation CLI User Guide* .AWS::CloudFormation::PublicTypeVersion external
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-publictypeversion.html
constructor
constructor( scope: cdk.Construct, id: string, props?: cdk.CfnPublicTypeVersionProps);
Create a new
AWS::CloudFormation::PublicTypeVersion
.Parameter scope
scope in which this resource is defined
Parameter id
scoped id of the resource
Parameter props
resource properties
property arn
arn: string;
The Amazon Resource Number (ARN) of the extension.
Conditional: You must specify
Arn
, orTypeName
andType
.http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-publictypeversion.html#cfn-cloudformation-publictypeversion-arn
property attrPublicTypeArn
readonly attrPublicTypeArn: string;
The Amazon Resource Number (ARN) assigned to the public extension upon publication. PublicTypeArn
property attrPublisherId
readonly attrPublisherId: string;
The publisher ID of the extension publisher. PublisherId
property attrTypeVersionArn
readonly attrTypeVersionArn: string;
The Amazon Resource Number (ARN) assigned to this version of the extension. TypeVersionArn
property CFN_RESOURCE_TYPE_NAME
static readonly CFN_RESOURCE_TYPE_NAME: string;
The CloudFormation resource type name for this resource class.
property cfnProperties
readonly cfnProperties: { [key: string]: any };
property logDeliveryBucket
logDeliveryBucket: string;
The S3 bucket to which CloudFormation delivers the contract test execution logs.
CloudFormation delivers the logs by the time contract testing has completed and the extension has been assigned a test type status of
PASSED
orFAILED
.The user initiating the stack operation must be able to access items in the specified S3 bucket. Specifically, the user needs the following permissions:
- GetObject - PutObject
For more information, see [Actions, Resources, and Condition Keys for Amazon S3](https://docs.aws.amazon.com/service-authorization/latest/reference/list_amazons3.html) in the *AWS Identity and Access Management User Guide* .
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-publictypeversion.html#cfn-cloudformation-publictypeversion-logdeliverybucket
property publicVersionNumber
publicVersionNumber: string;
The version number to assign to this version of the extension.
Use the following format, and adhere to semantic versioning when assigning a version number to your extension:
MAJOR.MINOR.PATCH
For more information, see [Semantic Versioning 2.0.0](https://docs.aws.amazon.com/https://semver.org/) .
If you don't specify a version number, CloudFormation increments the version number by one minor version release.
You cannot specify a version number the first time you publish a type. AWS CloudFormation automatically sets the first version number to be
1.0.0
.http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-publictypeversion.html#cfn-cloudformation-publictypeversion-publicversionnumber
property type
type: string;
The type of the extension to test.
Conditional: You must specify
Arn
, orTypeName
andType
.http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-publictypeversion.html#cfn-cloudformation-publictypeversion-type
property typeName
typeName: string;
The name of the extension to test.
Conditional: You must specify
Arn
, orTypeName
andType
.http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-publictypeversion.html#cfn-cloudformation-publictypeversion-typename
method inspect
inspect: (inspector: cdk.TreeInspector) => void;
Examines the CloudFormation resource and discloses attributes.
Parameter inspector
tree inspector to collect and process attributes
method renderProperties
protected renderProperties: (props: { [key: string]: any }) => { [key: string]: any;};
class CfnPublisher
class CfnPublisher extends cdk.CfnResource implements cdk.IInspectable {}
A CloudFormation
AWS::CloudFormation::Publisher
Registers your account as a publisher of public extensions in the CloudFormation registry. Public extensions are available for use by all CloudFormation users.
For information on requirements for registering as a public extension publisher, see [Registering your account to publish CloudFormation extensions](https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/publish-extension.html#publish-extension-prereqs) in the *CloudFormation CLI User Guide* .
AWS::CloudFormation::Publisher external
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-publisher.html
constructor
constructor(scope: cdk.Construct, id: string, props: cdk.CfnPublisherProps);
Create a new
AWS::CloudFormation::Publisher
.Parameter scope
scope in which this resource is defined
Parameter id
scoped id of the resource
Parameter props
resource properties
property acceptTermsAndConditions
acceptTermsAndConditions: boolean | cdk.IResolvable;
Whether you accept the [Terms and Conditions](https://docs.aws.amazon.com/https://cloudformation-registry-documents.s3.amazonaws.com/Terms_and_Conditions_for_AWS_CloudFormation_Registry_Publishers.pdf) for publishing extensions in the CloudFormation registry. You must accept the terms and conditions in order to register to publish public extensions to the CloudFormation registry.
The default is
false
.http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-publisher.html#cfn-cloudformation-publisher-accepttermsandconditions
property attrIdentityProvider
readonly attrIdentityProvider: string;
The type of account used as the identity provider when registering this publisher with CloudFormation .
Values include:
AWS_Marketplace
|Bitbucket
|GitHub
. IdentityProvider
property attrPublisherId
readonly attrPublisherId: string;
The ID of the extension publisher. This publisher ID applies to your account in all AWS Regions . PublisherId
property attrPublisherProfile
readonly attrPublisherProfile: string;
The URL to the publisher's profile with the identity provider. PublisherProfile
property attrPublisherStatus
readonly attrPublisherStatus: string;
Whether the publisher is verified. PublisherStatus
property CFN_RESOURCE_TYPE_NAME
static readonly CFN_RESOURCE_TYPE_NAME: string;
The CloudFormation resource type name for this resource class.
property cfnProperties
readonly cfnProperties: { [key: string]: any };
property connectionArn
connectionArn: string;
If you are using a Bitbucket or GitHub account for identity verification, the Amazon Resource Name (ARN) for your connection to that account.
For more information, see [Registering your account to publish CloudFormation extensions](https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/publish-extension.html#publish-extension-prereqs) in the *CloudFormation CLI User Guide* .
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-publisher.html#cfn-cloudformation-publisher-connectionarn
method inspect
inspect: (inspector: cdk.TreeInspector) => void;
Examines the CloudFormation resource and discloses attributes.
Parameter inspector
tree inspector to collect and process attributes
method renderProperties
protected renderProperties: (props: { [key: string]: any }) => { [key: string]: any;};
class CfnRefElement
abstract class CfnRefElement extends CfnElement {}
Base class for referenceable CloudFormation constructs which are not Resources
These constructs are things like Conditions and Parameters, can be referenced by taking the
.ref
attribute.Resource constructs do not inherit from CfnRefElement because they have their own, more specific types returned from the .ref attribute. Also, some resources aren't referenceable at all (such as BucketPolicies or GatewayAttachments).
property ref
readonly ref: string;
Return a string that will be resolved to a CloudFormation
{ Ref }
for this element.If, by any chance, the intrinsic reference of a resource is not a string, you could coerce it to an IResolvable through
Lazy.any({ produce: resource.ref })
.
class CfnResource
class CfnResource extends CfnRefElement {}
Represents a CloudFormation resource.
constructor
constructor(scope: Construct, id: string, props: CfnResourceProps);
Creates a resource construct.
Parameter cfnResourceType
The CloudFormation type of this resource (e.g. AWS::DynamoDB::Table)
property cfnOptions
readonly cfnOptions: ICfnResourceOptions;
Options for this resource, such as condition, update policy etc.
property cfnProperties
readonly cfnProperties: { [key: string]: any };
property cfnResourceType
readonly cfnResourceType: string;
AWS resource type.
property updatedProperites
readonly updatedProperites: { [key: string]: any };
Return properties modified after initiation
Resources that expose mutable properties should override this function to collect and return the properties object for this resource.
method addDeletionOverride
addDeletionOverride: (path: string) => void;
Syntactic sugar for
addOverride(path, undefined)
.Parameter path
The path of the value to delete
method addDependsOn
addDependsOn: (target: CfnResource) => void;
Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
This can be used for resources across stacks (or nested stack) boundaries and the dependency will automatically be transferred to the relevant scope.
method addMetadata
addMetadata: (key: string, value: any) => void;
Add a value to the CloudFormation Resource Metadata
See Also
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.
method addOverride
addOverride: (path: string, value: any) => void;
Adds an override to the synthesized CloudFormation resource. To add a property override, either use
addPropertyOverride
or prefixpath
with "Properties." (i.e.Properties.TopicName
).If the override is nested, separate each nested level using a dot (.) in the path parameter. If there is an array as part of the nesting, specify the index in the path.
To include a literal
.
in the property name, prefix with a\
. In most programming languages you will need to write this as"\\."
because the\
itself will need to be escaped.For example,
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');would add the overrides
"Properties": {"GlobalSecondaryIndexes": [{"Projection": {"NonKeyAttributes": [ "myattribute" ]...}...},{"ProjectionType": "INCLUDE"...},]...}The
value
argument toaddOverride
will not be processed or translated in any way. Pass raw JSON values in here with the correct capitalization for CloudFormation. If you pass CDK classes or structs, they will be rendered with lowercased key names, and CloudFormation will reject the template.Parameter path
The path of the property, you can use dot notation to override values in complex types. Any intermdediate keys will be created as needed.
Parameter value
The value. Could be primitive or complex.
method addPropertyDeletionOverride
addPropertyDeletionOverride: (propertyPath: string) => void;
Adds an override that deletes the value of a property from the resource definition.
Parameter propertyPath
The path to the property.
method addPropertyOverride
addPropertyOverride: (propertyPath: string, value: any) => void;
Adds an override to a resource property.
Syntactic sugar for
addOverride("Properties.<...>", value)
.Parameter propertyPath
The path of the property
Parameter value
The value
method applyRemovalPolicy
applyRemovalPolicy: ( policy: RemovalPolicy | undefined, options?: RemovalPolicyOptions) => void;
Sets the deletion policy of the resource based on the removal policy specified.
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
).
method getAtt
getAtt: (attributeName: string) => Reference;
Returns a token for an runtime attribute of this resource. Ideally, use generated attribute accessors (e.g.
resource.arn
), but this can be used for future compatibility in case there is no generated attribute.Parameter attributeName
The name of the attribute.
method getMetadata
getMetadata: (key: string) => any;
Retrieve a value value from the CloudFormation Resource Metadata
See Also
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.
method isCfnResource
static isCfnResource: (construct: IConstruct) => construct is CfnResource;
Check whether the given construct is a CfnResource
method renderProperties
protected renderProperties: (props: { [key: string]: any }) => { [key: string]: any;};
method shouldSynthesize
protected shouldSynthesize: () => boolean;
Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template.
Returns
true
if the resource should be included orfalse
is the resource should be omitted.
method toString
toString: () => string;
Returns
a string representation of this resource
method validateProperties
protected validateProperties: (_properties: any) => void;
class CfnResourceDefaultVersion
class CfnResourceDefaultVersion extends cdk.CfnResource implements cdk.IInspectable {}
A CloudFormation
AWS::CloudFormation::ResourceDefaultVersion
Specifies the default version of a resource. The default version of a resource will be used in CloudFormation operations.
AWS::CloudFormation::ResourceDefaultVersion external
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-resourcedefaultversion.html
constructor
constructor( scope: cdk.Construct, id: string, props?: cdk.CfnResourceDefaultVersionProps);
Create a new
AWS::CloudFormation::ResourceDefaultVersion
.Parameter scope
scope in which this resource is defined
Parameter id
scoped id of the resource
Parameter props
resource properties
property attrArn
readonly attrArn: string;
The Amazon Resource Name (ARN) of the resource. Arn
property CFN_RESOURCE_TYPE_NAME
static readonly CFN_RESOURCE_TYPE_NAME: string;
The CloudFormation resource type name for this resource class.
property cfnProperties
readonly cfnProperties: { [key: string]: any };
property typeName
typeName: string;
The name of the resource.
Conditional: You must specify either
TypeVersionArn
, orTypeName
andVersionId
.http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-resourcedefaultversion.html#cfn-cloudformation-resourcedefaultversion-typename
property typeVersionArn
typeVersionArn: string;
The Amazon Resource Name (ARN) of the resource version.
Conditional: You must specify either
TypeVersionArn
, orTypeName
andVersionId
.http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-resourcedefaultversion.html#cfn-cloudformation-resourcedefaultversion-typeversionarn
property versionId
versionId: string;
The ID of a specific version of the resource. The version ID is the value at the end of the Amazon Resource Name (ARN) assigned to the resource version when it's registered.
Conditional: You must specify either
TypeVersionArn
, orTypeName
andVersionId
.http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-resourcedefaultversion.html#cfn-cloudformation-resourcedefaultversion-versionid
method inspect
inspect: (inspector: cdk.TreeInspector) => void;
Examines the CloudFormation resource and discloses attributes.
Parameter inspector
tree inspector to collect and process attributes
method renderProperties
protected renderProperties: (props: { [key: string]: any }) => { [key: string]: any;};
class CfnResourceVersion
class CfnResourceVersion extends cdk.CfnResource implements cdk.IInspectable {}
A CloudFormation
AWS::CloudFormation::ResourceVersion
Registers a resource version with the CloudFormation service. Registering a resource version makes it available for use in CloudFormation templates in your AWS account , and includes:
- Validating the resource schema. - Determining which handlers, if any, have been specified for the resource. - Making the resource available for use in your account.
For more information on how to develop resources and ready them for registration, see [Creating Resource Providers](https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-types.html) in the *CloudFormation CLI User Guide* .
You can have a maximum of 50 resource versions registered at a time. This maximum is per account and per Region.
AWS::CloudFormation::ResourceVersion external
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-resourceversion.html
constructor
constructor( scope: cdk.Construct, id: string, props: cdk.CfnResourceVersionProps);
Create a new
AWS::CloudFormation::ResourceVersion
.Parameter scope
scope in which this resource is defined
Parameter id
scoped id of the resource
Parameter props
resource properties
property attrArn
readonly attrArn: string;
The Amazon Resource Name (ARN) of the resource version. Arn
property attrIsDefaultVersion
readonly attrIsDefaultVersion: cdk.IResolvable;
Whether the resource version is set as the default version. IsDefaultVersion
property attrProvisioningType
readonly attrProvisioningType: string;
The provisioning behavior of the resource type. CloudFormation determines the provisioning type during registration, based on the types of handlers in the schema handler package submitted.
Valid values include:
-
FULLY_MUTABLE
: The resource type includes an update handler to process updates to the type during stack update operations. -IMMUTABLE
: The resource type doesn't include an update handler, so the type can't be updated and must instead be replaced during stack update operations. -NON_PROVISIONABLE
: The resource type doesn't include all the following handlers, and therefore can't actually be provisioned.- create - read - delete ProvisioningType
property attrTypeArn
readonly attrTypeArn: string;
The Amazon Resource Name (ARN) of the resource. TypeArn
property attrVersionId
readonly attrVersionId: string;
The ID of a specific version of the resource. The version ID is the value at the end of the Amazon Resource Name (ARN) assigned to the resource version when it is registered. VersionId
property attrVisibility
readonly attrVisibility: string;
The scope at which the resource is visible and usable in CloudFormation operations.
Valid values include:
-
PRIVATE
: The resource is only visible and usable within the account in which it's registered. CloudFormation marks any resources you register asPRIVATE
. -PUBLIC
: The resource is publicly visible and usable within any Amazon account. Visibility
property CFN_RESOURCE_TYPE_NAME
static readonly CFN_RESOURCE_TYPE_NAME: string;
The CloudFormation resource type name for this resource class.
property cfnProperties
readonly cfnProperties: { [key: string]: any };
property executionRoleArn
executionRoleArn: string;
The Amazon Resource Name (ARN) of the IAM role for CloudFormation to assume when invoking the resource. If your resource calls AWS APIs in any of its handlers, you must create an *[IAM execution role](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html)* that includes the necessary permissions to call those AWS APIs, and provision that execution role in your account. When CloudFormation needs to invoke the resource type handler, CloudFormation assumes this execution role to create a temporary session token, which it then passes to the resource type handler, thereby supplying your resource type with the appropriate credentials.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-resourceversion.html#cfn-cloudformation-resourceversion-executionrolearn
property loggingConfig
loggingConfig: cdk.IResolvable | cdk.CfnResourceVersion.LoggingConfigProperty;
Logging configuration information for a resource.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-resourceversion.html#cfn-cloudformation-resourceversion-loggingconfig
property schemaHandlerPackage
schemaHandlerPackage: string;
A URL to the S3 bucket containing the resource project package that contains the necessary files for the resource you want to register.
For information on generating a schema handler package for the resource you want to register, see [submit](https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-cli-submit.html) in the *CloudFormation CLI User Guide* .
> The user registering the resource must be able to access the package in the S3 bucket. That is, the user needs to have [GetObject](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html) permissions for the schema handler package. For more information, see [Actions, Resources, and Condition Keys for Amazon S3](https://docs.aws.amazon.com/IAM/latest/UserGuide/list_amazons3.html) in the *AWS Identity and Access Management User Guide* .
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-resourceversion.html#cfn-cloudformation-resourceversion-schemahandlerpackage
property typeName
typeName: string;
The name of the resource being registered.
We recommend that resource names adhere to the following pattern: *company_or_organization* :: *service* :: *type* .
> The following organization namespaces are reserved and can't be used in your resource names: > > -
Alexa
> -AMZN
> -Amazon
> -AWS
> -Custom
> -Dev
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-resourceversion.html#cfn-cloudformation-resourceversion-typename
method inspect
inspect: (inspector: cdk.TreeInspector) => void;
Examines the CloudFormation resource and discloses attributes.
Parameter inspector
tree inspector to collect and process attributes
method renderProperties
protected renderProperties: (props: { [key: string]: any }) => { [key: string]: any;};
class CfnRule
class CfnRule extends CfnRefElement {}
The Rules that define template constraints in an AWS Service Catalog portfolio describe when end users can use the template and which values they can specify for parameters that are declared in the AWS CloudFormation template used to create the product they are attempting to use. Rules are useful for preventing end users from inadvertently specifying an incorrect value. For example, you can add a rule to verify whether end users specified a valid subnet in a given VPC or used m1.small instance types for test environments. AWS CloudFormation uses rules to validate parameter values before it creates the resources for the product.
A rule can include a RuleCondition property and must include an Assertions property. For each rule, you can define only one rule condition; you can define one or more asserts within the Assertions property. You define a rule condition and assertions by using rule-specific intrinsic functions.
https://docs.aws.amazon.com/servicecatalog/latest/adminguide/reference-template_constraint_rules.html
constructor
constructor(scope: Construct, id: string, props?: CfnRuleProps);
Creates and adds a rule.
Parameter scope
The parent construct.
Parameter props
The rule props.
method addAssertion
addAssertion: (condition: ICfnConditionExpression, description: string) => void;
Adds an assertion to the rule.
Parameter condition
The expression to evaluation.
Parameter description
The description of the assertion.
class CfnStack
class CfnStack extends cdk.CfnResource implements cdk.IInspectable {}
A CloudFormation
AWS::CloudFormation::Stack
The
AWS::CloudFormation::Stack
resource nests a stack as a resource in a top-level template.You can add output values from a nested stack within the containing template. You use the [GetAtt](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-getatt.html) function with the nested stack's logical name and the name of the output value in the nested stack in the format
Outputs. *NestedStackOutputName*
.> We strongly recommend that updates to nested stacks are run from the parent stack.
When you apply template changes to update a top-level stack, CloudFormation updates the top-level stack and initiates an update to its nested stacks. CloudFormation updates the resources of modified nested stacks, but doesn't update the resources of unmodified nested stacks. For more information, see [CloudFormation stack updates](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks.html) .
> You must acknowledge IAM capabilities for nested stacks that contain IAM resources. Also, verify that you have cancel update stack permissions, which is required if an update rolls back. For more information about IAM and CloudFormation , see [Controlling access with AWS Identity and Access Management](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html) .
AWS::CloudFormation::Stack external
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-stack.html
constructor
constructor(scope: cdk.Construct, id: string, props: cdk.CfnStackProps);
Create a new
AWS::CloudFormation::Stack
.Parameter scope
scope in which this resource is defined
Parameter id
scoped id of the resource
Parameter props
resource properties
property CFN_RESOURCE_TYPE_NAME
static readonly CFN_RESOURCE_TYPE_NAME: string;
The CloudFormation resource type name for this resource class.
property cfnProperties
readonly cfnProperties: { [key: string]: any };
property notificationArns
notificationArns: string[];
The Amazon Simple Notification Service (Amazon SNS) topic ARNs to publish stack related events. You can find your Amazon SNS topic ARNs using the Amazon SNS console or your Command Line Interface (CLI).
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-stack.html#cfn-cloudformation-stack-notificationarns
property parameters
parameters: cdk.IResolvable | { [key: string]: string };
The set value pairs that represent the parameters passed to CloudFormation when this nested stack is created. Each parameter has a name corresponding to a parameter defined in the embedded template and a value representing the value that you want to set for the parameter.
> If you use the
Ref
function to pass a parameter value to a nested stack, comma-delimited list parameters must be of typeString
. In other words, you can't pass values that are of typeCommaDelimitedList
to nested stacks.Conditional. Required if the nested stack requires input parameters.
Whether an update causes interruptions depends on the resources that are being updated. An update never causes a nested stack to be replaced.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-stack.html#cfn-cloudformation-stack-parameters
property tags
readonly tags: cdk.TagManager;
Key-value pairs to associate with this stack. AWS CloudFormation also propagates these tags to the resources created in the stack. A maximum number of 50 tags can be specified.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-stack.html#cfn-cloudformation-stack-tags
property templateUrl
templateUrl: string;
Location of file containing the template body. The URL must point to a template (max size: 460,800 bytes) that's located in an Amazon S3 bucket. For more information, see [Template anatomy](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html) .
Whether an update causes interruptions depends on the resources that are being updated. An update never causes a nested stack to be replaced.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-stack.html#cfn-cloudformation-stack-templateurl
property timeoutInMinutes
timeoutInMinutes: number;
The length of time, in minutes, that CloudFormation waits for the nested stack to reach the
CREATE_COMPLETE
state. The default is no timeout. When CloudFormation detects that the nested stack has reached theCREATE_COMPLETE
state, it marks the nested stack resource asCREATE_COMPLETE
in the parent stack and resumes creating the parent stack. If the timeout period expires before the nested stack reachesCREATE_COMPLETE
, CloudFormation marks the nested stack as failed and rolls back both the nested stack and parent stack.Updates aren't supported.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-stack.html#cfn-cloudformation-stack-timeoutinminutes
method inspect
inspect: (inspector: cdk.TreeInspector) => void;
Examines the CloudFormation resource and discloses attributes.
Parameter inspector
tree inspector to collect and process attributes
method renderProperties
protected renderProperties: (props: { [key: string]: any }) => { [key: string]: any;};
class CfnStackSet
class CfnStackSet extends cdk.CfnResource implements cdk.IInspectable {}
A CloudFormation
AWS::CloudFormation::StackSet
The
AWS::CloudFormation::StackSet
enables you to provision stacks into AWS accounts and across Regions by using a single CloudFormation template. In the stack set, you specify the template to use, in addition to any parameters and capabilities that the template requires.AWS::CloudFormation::StackSet external
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-stackset.html
constructor
constructor(scope: cdk.Construct, id: string, props: cdk.CfnStackSetProps);
Create a new
AWS::CloudFormation::StackSet
.Parameter scope
scope in which this resource is defined
Parameter id
scoped id of the resource
Parameter props
resource properties
property administrationRoleArn
administrationRoleArn: string;
The Amazon Resource Number (ARN) of the IAM role to use to create this stack set. Specify an IAM role only if you are using customized administrator roles to control which users or groups can manage specific stack sets within the same administrator account.
Use customized administrator roles to control which users or groups can manage specific stack sets within the same administrator account. For more information, see [Prerequisites: Granting Permissions for Stack Set Operations](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-prereqs.html) in the *AWS CloudFormation User Guide* .
*Minimum* :
20
*Maximum* :
2048
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-stackset.html#cfn-cloudformation-stackset-administrationrolearn
property attrStackSetId
readonly attrStackSetId: string;
The ID of the stack that you're creating. StackSetId
property autoDeployment
autoDeployment: cdk.IResolvable | cdk.CfnStackSet.AutoDeploymentProperty;
[
Service-managed
permissions] Describes whether StackSets automatically deploys to AWS Organizations accounts that are added to a target organization or organizational unit (OU).http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-stackset.html#cfn-cloudformation-stackset-autodeployment
property callAs
callAs: string;
[Service-managed permissions] Specifies whether you are acting as an account administrator in the organization's management account or as a delegated administrator in a member account.
By default,
SELF
is specified. UseSELF
for stack sets with self-managed permissions.- To create a stack set with service-managed permissions while signed in to the management account, specify
SELF
. - To create a stack set with service-managed permissions while signed in to a delegated administrator account, specifyDELEGATED_ADMIN
.Your AWS account must be registered as a delegated admin in the management account. For more information, see [Register a delegated administrator](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-orgs-delegated-admin.html) in the *AWS CloudFormation User Guide* .
Stack sets with service-managed permissions are created in the management account, including stack sets that are created by delegated administrators.
*Valid Values* :
SELF
|DELEGATED_ADMIN
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-stackset.html#cfn-cloudformation-stackset-callas
property capabilities
capabilities: string[];
The capabilities that are allowed in the stack set. Some stack set templates might include resources that can affect permissions in your AWS account —for example, by creating new AWS Identity and Access Management ( IAM ) users. For more information, see [Acknowledging IAM Resources in AWS CloudFormation Templates](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html#capabilities) .
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-stackset.html#cfn-cloudformation-stackset-capabilities
property CFN_RESOURCE_TYPE_NAME
static readonly CFN_RESOURCE_TYPE_NAME: string;
The CloudFormation resource type name for this resource class.
property cfnProperties
readonly cfnProperties: { [key: string]: any };
property description
description: string;
A description of the stack set.
*Minimum* :
1
*Maximum* :
1024
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-stackset.html#cfn-cloudformation-stackset-description
property executionRoleName
executionRoleName: string;
The name of the IAM execution role to use to create the stack set. If you don't specify an execution role, AWS CloudFormation uses the
AWSCloudFormationStackSetExecutionRole
role for the stack set operation.*Minimum* :
1
*Maximum* :
64
*Pattern* :
[a-zA-Z_0-9+=,.@-]+
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-stackset.html#cfn-cloudformation-stackset-executionrolename
property managedExecution
managedExecution: any;
Describes whether StackSets performs non-conflicting operations concurrently and queues conflicting operations.
When active, StackSets performs non-conflicting operations concurrently and queues conflicting operations. After conflicting operations finish, StackSets starts queued operations in request order.
> If there are already running or queued operations, StackSets queues all incoming operations even if they are non-conflicting. > > You can't modify your stack set's execution configuration while there are running or queued operations for that stack set.
When inactive (default), StackSets performs one operation at a time in request order.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-stackset.html#cfn-cloudformation-stackset-managedexecution
property operationPreferences
operationPreferences: | cdk.IResolvable | cdk.CfnStackSet.OperationPreferencesProperty;
The user-specified preferences for how AWS CloudFormation performs a stack set operation.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-stackset.html#cfn-cloudformation-stackset-operationpreferences
property parameters
parameters: | cdk.IResolvable | (cdk.IResolvable | cdk.CfnStackSet.ParameterProperty)[];
The input parameters for the stack set template.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-stackset.html#cfn-cloudformation-stackset-parameters
property permissionModel
permissionModel: string;
Describes how the IAM roles required for stack set operations are created.
- With
SELF_MANAGED
permissions, you must create the administrator and execution roles required to deploy to target accounts. For more information, see [Grant Self-Managed Stack Set Permissions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-prereqs-self-managed.html) . - WithSERVICE_MANAGED
permissions, StackSets automatically creates the IAM roles required to deploy to accounts managed by AWS Organizations . For more information, see [Grant Service-Managed Stack Set Permissions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-prereqs-service-managed.html) .http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-stackset.html#cfn-cloudformation-stackset-permissionmodel
property stackInstancesGroup
stackInstancesGroup: | cdk.IResolvable | (cdk.IResolvable | cdk.CfnStackSet.StackInstancesProperty)[];
A group of stack instances with parameters in some specific accounts and Regions.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-stackset.html#cfn-cloudformation-stackset-stackinstancesgroup
property stackSetName
stackSetName: string;
The name to associate with the stack set. The name must be unique in the Region where you create your stack set.
*Maximum* :
128
*Pattern* :
^[a-zA-Z][a-zA-Z0-9-]{0,127}$
> The
StackSetName
property is required.http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-stackset.html#cfn-cloudformation-stackset-stacksetname
property tags
readonly tags: cdk.TagManager;
The key-value pairs to associate with this stack set and the stacks created from it. AWS CloudFormation also propagates these tags to supported resources that are created in the stacks. A maximum number of 50 tags can be specified.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-stackset.html#cfn-cloudformation-stackset-tags
property templateBody
templateBody: string;
The structure that contains the template body, with a minimum length of 1 byte and a maximum length of 51,200 bytes.
You must include either
TemplateURL
orTemplateBody
in a StackSet, but you can't use both. Dynamic references in theTemplateBody
may not work correctly in all cases. It's recommended to pass templates containing dynamic references throughTemplateUrl
instead.*Minimum* :
1
*Maximum* :
51200
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-stackset.html#cfn-cloudformation-stackset-templatebody
property templateUrl
templateUrl: string;
Location of file containing the template body. The URL must point to a template (max size: 460,800 bytes) that's located in an Amazon S3 bucket.
You must include either
TemplateURL
orTemplateBody
in a StackSet, but you can't use both.*Minimum* :
1
*Maximum* :
1024
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-stackset.html#cfn-cloudformation-stackset-templateurl
method inspect
inspect: (inspector: cdk.TreeInspector) => void;
Examines the CloudFormation resource and discloses attributes.
Parameter inspector
tree inspector to collect and process attributes
method renderProperties
protected renderProperties: (props: { [key: string]: any }) => { [key: string]: any;};
class CfnTypeActivation
class CfnTypeActivation extends cdk.CfnResource implements cdk.IInspectable {}
A CloudFormation
AWS::CloudFormation::TypeActivation
Activates a public third-party extension, making it available for use in stack templates. For more information, see [Using public extensions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/registry-public.html) in the *AWS CloudFormation User Guide* .
Once you have activated a public third-party extension in your account and Region, use [SetTypeConfiguration](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_SetTypeConfiguration.html) to specify configuration properties for the extension. For more information, see [Configuring extensions at the account level](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/registry-register.html#registry-set-configuration) in the *CloudFormation User Guide* .
AWS::CloudFormation::TypeActivation external
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-typeactivation.html
constructor
constructor( scope: cdk.Construct, id: string, props?: cdk.CfnTypeActivationProps);
Create a new
AWS::CloudFormation::TypeActivation
.Parameter scope
scope in which this resource is defined
Parameter id
scoped id of the resource
Parameter props
resource properties
property attrArn
readonly attrArn: string;
The Amazon Resource Number (ARN) of the activated extension, in this account and Region. Arn
property autoUpdate
autoUpdate: boolean | cdk.IResolvable;
Whether to automatically update the extension in this account and Region when a new *minor* version is published by the extension publisher. Major versions released by the publisher must be manually updated.
The default is
true
.http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-typeactivation.html#cfn-cloudformation-typeactivation-autoupdate
property CFN_RESOURCE_TYPE_NAME
static readonly CFN_RESOURCE_TYPE_NAME: string;
The CloudFormation resource type name for this resource class.
property cfnProperties
readonly cfnProperties: { [key: string]: any };
property executionRoleArn
executionRoleArn: string;
The name of the IAM execution role to use to activate the extension.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-typeactivation.html#cfn-cloudformation-typeactivation-executionrolearn
property loggingConfig
loggingConfig: cdk.IResolvable | cdk.CfnTypeActivation.LoggingConfigProperty;
Specifies logging configuration information for an extension.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-typeactivation.html#cfn-cloudformation-typeactivation-loggingconfig
property majorVersion
majorVersion: string;
The major version of this extension you want to activate, if multiple major versions are available. The default is the latest major version. CloudFormation uses the latest available *minor* version of the major version selected.
You can specify
MajorVersion
orVersionBump
, but not both.http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-typeactivation.html#cfn-cloudformation-typeactivation-majorversion
property publicTypeArn
publicTypeArn: string;
The Amazon Resource Number (ARN) of the public extension.
Conditional: You must specify
PublicTypeArn
, orTypeName
,Type
, andPublisherId
.http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-typeactivation.html#cfn-cloudformation-typeactivation-publictypearn
property publisherId
publisherId: string;
The ID of the extension publisher.
Conditional: You must specify
PublicTypeArn
, orTypeName
,Type
, andPublisherId
.http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-typeactivation.html#cfn-cloudformation-typeactivation-publisherid
property type
type: string;
The extension type.
Conditional: You must specify
PublicTypeArn
, orTypeName
,Type
, andPublisherId
.http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-typeactivation.html#cfn-cloudformation-typeactivation-type
property typeName
typeName: string;
The name of the extension.
Conditional: You must specify
PublicTypeArn
, orTypeName
,Type
, andPublisherId
.http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-typeactivation.html#cfn-cloudformation-typeactivation-typename
property typeNameAlias
typeNameAlias: string;
An alias to assign to the public extension, in this account and Region. If you specify an alias for the extension, CloudFormation treats the alias as the extension type name within this account and Region. You must use the alias to refer to the extension in your templates, API calls, and CloudFormation console.
An extension alias must be unique within a given account and Region. You can activate the same public resource multiple times in the same account and Region, using different type name aliases.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-typeactivation.html#cfn-cloudformation-typeactivation-typenamealias
property versionBump
versionBump: string;
Manually updates a previously-activated type to a new major or minor version, if available. You can also use this parameter to update the value of
AutoUpdate
.-
MAJOR
: CloudFormation updates the extension to the newest major version, if one is available. -MINOR
: CloudFormation updates the extension to the newest minor version, if one is available.http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-typeactivation.html#cfn-cloudformation-typeactivation-versionbump
method inspect
inspect: (inspector: cdk.TreeInspector) => void;
Examines the CloudFormation resource and discloses attributes.
Parameter inspector
tree inspector to collect and process attributes
method renderProperties
protected renderProperties: (props: { [key: string]: any }) => { [key: string]: any;};
class CfnWaitCondition
class CfnWaitCondition extends cdk.CfnResource implements cdk.IInspectable {}
A CloudFormation
AWS::CloudFormation::WaitCondition
> For Amazon EC2 and Auto Scaling resources, we recommend that you use a
CreationPolicy
attribute instead of wait conditions. Add a CreationPolicy attribute to those resources, and use the cfn-signal helper script to signal when an instance creation process has completed successfully.You can use a wait condition for situations like the following:
- To coordinate stack resource creation with configuration actions that are external to the stack creation. - To track the status of a configuration process.
For these situations, we recommend that you associate a [CreationPolicy](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-creationpolicy.html) attribute with the wait condition so that you don't have to use a wait condition handle. For more information and an example, see [Creating wait conditions in a template](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-waitcondition.html) . If you use a CreationPolicy with a wait condition, don't specify any of the wait condition's properties.
> If you use the [VPC endpoints](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-endpoints.html) feature, resources in the VPC that respond to wait conditions must have access to CloudFormation , specific Amazon Simple Storage Service ( Amazon S3 ) buckets. Resources must send wait condition responses to a presigned Amazon S3 URL. If they can't send responses to Amazon S3 , CloudFormation won't receive a response and the stack operation fails. For more information, see [Setting up VPC endpoints for AWS CloudFormation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-vpce-bucketnames.html) .
AWS::CloudFormation::WaitCondition external
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-waitcondition.html
constructor
constructor(scope: cdk.Construct, id: string, props?: cdk.CfnWaitConditionProps);
Create a new
AWS::CloudFormation::WaitCondition
.Parameter scope
scope in which this resource is defined
Parameter id
scoped id of the resource
Parameter props
resource properties
property attrData
readonly attrData: cdk.IResolvable;
A JSON object that contains the
UniqueId
andData
values from the wait condition signal(s) for the specified wait condition. For more information about wait condition signals, see [Wait condition signal JSON format](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-waitcondition.html#using-cfn-waitcondition-signaljson) .Example return value for a wait condition with 2 signals:
{ "Signal1" : "Step 1 complete." , "Signal2" : "Step 2 complete." }
Data
property CFN_RESOURCE_TYPE_NAME
static readonly CFN_RESOURCE_TYPE_NAME: string;
The CloudFormation resource type name for this resource class.
property cfnProperties
readonly cfnProperties: { [key: string]: any };
property count
count: number;
The number of success signals that CloudFormation must receive before it continues the stack creation process. When the wait condition receives the requisite number of success signals, CloudFormation resumes the creation of the stack. If the wait condition doesn't receive the specified number of success signals before the Timeout period expires, CloudFormation assumes that the wait condition has failed and rolls the stack back.
Updates aren't supported.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-waitcondition.html#cfn-waitcondition-count
property handle
handle: string;
A reference to the wait condition handle used to signal this wait condition. Use the
Ref
intrinsic function to specify an [AWS::CloudFormation::WaitConditionHandle
](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-waitconditionhandle.html) resource.Anytime you add a
WaitCondition
resource during a stack update, you must associate the wait condition with a new WaitConditionHandle resource. Don't reuse an old wait condition handle that has already been defined in the template. If you reuse a wait condition handle, the wait condition might evaluate old signals from a previous create or update stack command.Updates aren't supported.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-waitcondition.html#cfn-waitcondition-handle
property timeout
timeout: string;
The length of time (in seconds) to wait for the number of signals that the
Count
property specifies.Timeout
is a minimum-bound property, meaning the timeout occurs no sooner than the time you specify, but can occur shortly thereafter. The maximum time that can be specified for this property is 12 hours (43200 seconds).Updates aren't supported.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-waitcondition.html#cfn-waitcondition-timeout
method inspect
inspect: (inspector: cdk.TreeInspector) => void;
Examines the CloudFormation resource and discloses attributes.
Parameter inspector
tree inspector to collect and process attributes
method renderProperties
protected renderProperties: (props: { [key: string]: any }) => { [key: string]: any;};
class CfnWaitConditionHandle
class CfnWaitConditionHandle extends cdk.CfnResource implements cdk.IInspectable {}
A CloudFormation
AWS::CloudFormation::WaitConditionHandle
> For Amazon EC2 and Auto Scaling resources, we recommend that you use a
CreationPolicy
attribute instead of wait conditions. Add aCreationPolicy
attribute to those resources, and use the cfn-signal helper script to signal when an instance creation process has completed successfully. > > For more information, see [Deploying applications on Amazon EC2 with AWS CloudFormation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/deploying.applications.html) .The
AWS::CloudFormation::WaitConditionHandle
type has no properties. When you reference theWaitConditionHandle
resource by using theRef
function, AWS CloudFormation returns a presigned URL. You pass this URL to applications or scripts that are running on your Amazon EC2 instances to send signals to that URL. An associatedAWS::CloudFormation::WaitCondition
resource checks the URL for the required number of success signals or for a failure signal.> Anytime you add a
WaitCondition
resource during a stack update or update a resource with a wait condition, you must associate the wait condition with a newWaitConditionHandle
resource. Don't reuse an old wait condition handle that has already been defined in the template. If you reuse a wait condition handle, the wait condition might evaluate old signals from a previous create or update stack command. > Updates aren't supported for this resource.AWS::CloudFormation::WaitConditionHandle external
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-waitconditionhandle.html
constructor
constructor(scope: cdk.Construct, id: string);
Create a new
AWS::CloudFormation::WaitConditionHandle
.Parameter scope
scope in which this resource is defined
Parameter id
scoped id of the resource
Parameter props
resource properties
property CFN_RESOURCE_TYPE_NAME
static readonly CFN_RESOURCE_TYPE_NAME: string;
The CloudFormation resource type name for this resource class.
method inspect
inspect: (inspector: cdk.TreeInspector) => void;
Examines the CloudFormation resource and discloses attributes.
Parameter inspector
tree inspector to collect and process attributes
class CliCredentialsStackSynthesizer
class CliCredentialsStackSynthesizer extends StackSynthesizer {}
A synthesizer that uses conventional asset locations, but not conventional deployment roles
Instead of assuming the bootstrapped deployment roles, all stack operations will be performed using the CLI's current credentials.
- This synthesizer does not support deploying to accounts to which the CLI does not have credentials. It also does not support deploying using **CDK Pipelines**. For either of those features, use
DefaultStackSynthesizer
. - This synthesizer requires an S3 bucket and ECR repository with well-known names. To not depend on those, useLegacyStackSynthesizer
.Be aware that your CLI credentials must be valid for the duration of the entire deployment. If you are using session credentials, make sure the session lifetime is long enough.
By default, expects the environment to have been bootstrapped with just the staging resources of the Bootstrap Stack V2 (also known as "modern bootstrap stack"). You can override the default names using the synthesizer's construction properties.
constructor
constructor(props?: CliCredentialsStackSynthesizerProps);
method addDockerImageAsset
addDockerImageAsset: (asset: DockerImageAssetSource) => DockerImageAssetLocation;
method addFileAsset
addFileAsset: (asset: FileAssetSource) => FileAssetLocation;
method bind
bind: (stack: Stack) => void;
method synthesize
synthesize: (session: ISynthesisSession) => void;
Synthesize the associated stack to the session
class ConcreteDependable
class ConcreteDependable implements IDependable {}
A set of constructs to be used as a dependable
This class can be used when a set of constructs which are disjoint in the construct tree needs to be combined to be used as a single dependable.
constructor
constructor();
method add
add: (construct: IConstruct) => void;
Add a construct to the dependency roots
class Construct
class Construct extends constructs.Construct implements IConstruct {}
Represents the building block of the construct graph.
All constructs besides the root construct must be created within the scope of another construct.
constructor
constructor(scope: constructs.Construct, id: string);
property node
readonly node: ConstructNode;
The construct tree node associated with this construct.
method isConstruct
static isConstruct: (x: any) => x is Construct;
Return whether the given object is a Construct
method onPrepare
protected onPrepare: () => void;
Perform final modifications before synthesis
This method can be implemented by derived constructs in order to perform final changes before synthesis. prepare() will be called after child constructs have been prepared.
This is an advanced framework feature. Only use this if you understand the implications.
method onSynthesize
protected onSynthesize: (session: constructs.ISynthesisSession) => void;
Allows this construct to emit artifacts into the cloud assembly during synthesis.
This method is usually implemented by framework-level constructs such as
Stack
andAsset
as they participate in synthesizing the cloud assembly.Parameter session
The synthesis session.
method onValidate
protected onValidate: () => string[];
Validate the current construct.
This method can be implemented by derived constructs in order to perform validation logic. It is called on all constructs before synthesis.
Returns
An array of validation error messages, or an empty array if the construct is valid.
method prepare
protected prepare: () => void;
Perform final modifications before synthesis
This method can be implemented by derived constructs in order to perform final changes before synthesis. prepare() will be called after child constructs have been prepared.
This is an advanced framework feature. Only use this if you understand the implications.
method synthesize
protected synthesize: (session: ISynthesisSession) => void;
Allows this construct to emit artifacts into the cloud assembly during synthesis.
This method is usually implemented by framework-level constructs such as
Stack
andAsset
as they participate in synthesizing the cloud assembly.Parameter session
The synthesis session.
method validate
protected validate: () => string[];
Validate the current construct.
This method can be implemented by derived constructs in order to perform validation logic. It is called on all constructs before synthesis.
Returns
An array of validation error messages, or an empty array if the construct is valid.
class ConstructNode
class ConstructNode {}
Represents the construct node in the scope tree.
constructor
constructor(host: Construct, scope: IConstruct, id: string);
property addr
readonly addr: string;
Returns an opaque tree-unique address for this construct.
Addresses are 42 characters hexadecimal strings. They begin with "c8" followed by 40 lowercase hexadecimal characters (0-9a-f).
Addresses are calculated using a SHA-1 of the components of the construct path.
To enable refactorings of construct trees, constructs with the ID
Default
will be excluded from the calculation. In those cases constructs in the same tree may have the same addreess.Example value:
c83a2846e506bcc5f10682b564084bca2d275709ee
property children
readonly children: IConstruct[];
All direct children of this construct.
property defaultChild
defaultChild: IConstruct;
Returns the child construct that has the id
Default
orResource"
. This is usually the construct that provides the bulk of the underlying functionality. Useful for modifications of the underlying construct that are not available at the higher levels.Returns
a construct or undefined if there is no default child
Throws
if there is more than one child
property dependencies
readonly dependencies: Dependency[];
Return all dependencies registered on this node or any of its children
property id
readonly id: string;
The id of this construct within the current scope.
This is a a scope-unique id. To obtain an app-unique id for this construct, use
uniqueId
.
property locked
readonly locked: boolean;
Returns true if this construct or the scopes in which it is defined are locked.
property metadata
readonly metadata: cxapi.MetadataEntry[];
DEPRECATED
Deprecated
use
metadataEntry
property metadataEntry
readonly metadataEntry: constructs.MetadataEntry[];
An immutable array of metadata objects associated with this construct. This can be used, for example, to implement support for deprecation notices, source mapping, etc.
property path
readonly path: string;
The full, absolute path of this construct in the tree.
Components are separated by '/'.
property PATH_SEP
static readonly PATH_SEP: string;
Separator used to delimit construct path components.
property root
readonly root: IConstruct;
Returns
The root of the construct tree.
property scope
readonly scope: IConstruct;
Returns the scope in which this construct is defined.
The value is
undefined
at the root of the construct scope tree.
property scopes
readonly scopes: IConstruct[];
All parent scopes of this construct.
Returns
a list of parent scopes. The last element in the list will always be the current construct and the first element will be the root of the tree.
property uniqueId
readonly uniqueId: string;
A tree-global unique alphanumeric identifier for this construct. Includes all components of the tree.
Deprecated
use
node.addr
to obtain a consistent 42 character address for this node (see https://github.com/aws/constructs/pull/314). Alternatively, to get a CloudFormation-compatible unique identifier, useNames.uniqueId()
.
method addDependency
addDependency: (...dependencies: IDependable[]) => void;
Add an ordering dependency on another Construct.
All constructs in the dependency's scope will be deployed before any construct in this construct's scope.
method addError
addError: (message: string) => void;
DEPRECATED: Adds an { "error": } metadata entry to this construct. The toolkit will fail synthesis when errors are reported.
Parameter message
The error message.
Deprecated
use
Annotations.of(construct).addError()
method addInfo
addInfo: (message: string) => void;
DEPRECATED: Adds a { "info": } metadata entry to this construct. The toolkit will display the info message when apps are synthesized.
Parameter message
The info message.
Deprecated
use
Annotations.of(construct).addInfo()
method addMetadata
addMetadata: (type: string, data: any, fromFunction?: any) => void;
Adds a metadata entry to this construct. Entries are arbitrary values and will also include a stack trace to allow tracing back to the code location for when the entry was added. It can be used, for example, to include source mapping in CloudFormation templates to improve diagnostics.
Parameter type
a string denoting the type of metadata
Parameter data
the value of the metadata (can be a Token). If null/undefined, metadata will not be added.
Parameter fromFunction
a function under which to restrict the metadata entry's stack trace (defaults to this.addMetadata)
method addValidation
addValidation: (validation: constructs.IValidation) => void;
Add a validator to this construct Node
method addWarning
addWarning: (message: string) => void;
DEPRECATED: Adds a { "warning": } metadata entry to this construct. The toolkit will display the warning when an app is synthesized, or fail if run in --strict mode.
Parameter message
The warning message.
Deprecated
use
Annotations.of(construct).addWarning()
method applyAspect
applyAspect: (aspect: IAspect) => void;
DEPRECATED: Applies the aspect to this Constructs node
Deprecated
This API is going to be removed in the next major version of the AWS CDK. Please use
Aspects.of(scope).add()
instead.
method findAll
findAll: (order?: ConstructOrder) => IConstruct[];
Return this construct and all of its children in the given order
method findChild
findChild: (id: string) => IConstruct;
Return a direct child by id
Throws an error if the child is not found.
Parameter id
Identifier of direct child
Returns
Child with the given id.
method prepare
static prepare: (node: ConstructNode) => void;
Invokes "prepare" on all constructs (depth-first, post-order) in the tree under
node
.Parameter node
The root node
Deprecated
Use
app.synth()
instead
method setContext
setContext: (key: string, value: any) => void;
This can be used to set contextual values. Context must be set before any children are added, since children may consult context info during construction. If the key already exists, it will be overridden.
Parameter key
The context key
Parameter value
The context value
method synth
static synth: ( node: ConstructNode, options?: SynthesisOptions) => cxapi.CloudAssembly;
Synthesizes a CloudAssembly from a construct tree.
Parameter node
The root of the construct tree.
Parameter options
Synthesis options.
Deprecated
Use
app.synth()
orstage.synth()
instead
method tryFindChild
tryFindChild: (id: string) => IConstruct | undefined;
Return a direct child by id, or undefined
Parameter id
Identifier of direct child
Returns
the child if found, or undefined
method tryGetContext
tryGetContext: (key: string) => any;
Retrieves a value from tree context.
Context is usually initialized at the root, but can be overridden at any point in the tree.
Parameter key
The context key
Returns
The context value or
undefined
if there is no context value for the key.
method tryRemoveChild
tryRemoveChild: (childName: string) => boolean;
Remove the child with the given name, if present.
Returns
Whether a child with the given name was deleted.
method validate
static validate: (node: ConstructNode) => ValidationError[];
Invokes "validate" on all constructs in the tree (depth-first, pre-order) and returns the list of all errors. An empty list indicates that there are no errors.
Parameter node
The root node
class ContextProvider
class ContextProvider {}
Base class for the model side of context providers
Instances of this class communicate with context provider plugins in the 'cdk toolkit' via context variables (input), outputting specialized queries for more context variables (output).
ContextProvider needs access to a Construct to hook into the context mechanism.
method getKey
static getKey: ( scope: Construct, options: GetContextKeyOptions) => GetContextKeyResult;
Returns
the context key or undefined if a key cannot be rendered (due to tokens used in any of the props)
method getValue
static getValue: ( scope: Construct, options: GetContextValueOptions) => GetContextValueResult;
class CustomResource
class CustomResource extends Resource {}
Instantiation of a custom resource, whose implementation is provided a Provider
This class is intended to be used by construct library authors. Application builder should not be able to tell whether or not a construct is backed by a custom resource, and so the use of this class should be invisible.
Instead, construct library authors declare a custom construct that hides the choice of provider, and accepts a strongly-typed properties object with the properties your provider accepts.
Your custom resource provider (identified by the
serviceToken
property) can be one of 4 constructs:- If you are authoring a construct library or application, we recommend you use the
Provider
class in thecustom-resources
module. - If you are authoring a construct for the CDK's AWS Construct Library, you should use theCustomResourceProvider
construct in this package. - If you want full control over the provider, you can always directly use a Lambda Function or SNS Topic by passing the ARN intoserviceToken
.AWS::CloudFormation::CustomResource
constructor
constructor(scope: Construct, id: string, props: CustomResourceProps);
property ref
readonly ref: string;
The physical name of this custom resource.
method getAtt
getAtt: (attributeName: string) => import('./reference').Reference;
Returns the value of an attribute of the custom resource of an arbitrary type. Attributes are returned from the custom resource provider through the
Data
map where the key is the attribute name.Parameter attributeName
the name of the attribute
Returns
a token for
Fn::GetAtt
. UseToken.asXxx
to encode the returnedReference
as a specific type or use the conveniencegetAttString
for string attributes.
method getAttString
getAttString: (attributeName: string) => string;
Returns the value of an attribute of the custom resource of type string. Attributes are returned from the custom resource provider through the
Data
map where the key is the attribute name.Parameter attributeName
the name of the attribute
Returns
a token for
Fn::GetAtt
encoded as a string.
class CustomResourceProvider
class CustomResourceProvider extends CoreConstruct {}
An AWS-Lambda backed custom resource provider, for CDK Construct Library constructs
This is a provider for
CustomResource
constructs, backed by an AWS Lambda Function. It only supports NodeJS runtimes.**This is not a generic custom resource provider class**. It is specifically intended to be used only by constructs in the AWS CDK Construct Library, and only exists here because of reverse dependency issues (for example, it cannot use
iam.PolicyStatement
objects, since theiam
library already depends on the CDKcore
library and we cannot have cyclic dependencies).If you are not writing constructs for the AWS Construct Library, you should use the
Provider
class in thecustom-resources
module instead, which has a better API and supports all Lambda runtimes, not just Node.N.B.: When you are writing Custom Resource Providers, there are a number of lifecycle events you have to pay attention to. These are documented in the README of the
custom-resources
module. Be sure to give the documentation in that module a read, regardless of whether you end up using the Provider class in there or this one.
constructor
protected constructor( scope: Construct, id: string, props: CustomResourceProviderProps);
property codeHash
readonly codeHash: string;
The hash of the lambda code backing this provider. Can be used to trigger updates on code changes, even when the properties of a custom resource remain unchanged.
property roleArn
readonly roleArn: string;
The ARN of the provider's AWS Lambda function role.
property serviceToken
readonly serviceToken: string;
The ARN of the provider's AWS Lambda function which should be used as the
serviceToken
when defining a custom resource.Example 1
declare const myProvider: CustomResourceProvider;
new CustomResource(this, 'MyCustomResource', { serviceToken: myProvider.serviceToken, properties: { myPropertyOne: 'one', myPropertyTwo: 'two', }, });
method getOrCreate
static getOrCreate: ( scope: Construct, uniqueid: string, props: CustomResourceProviderProps) => string;
Returns a stack-level singleton ARN (service token) for the custom resource provider.
Parameter scope
Construct scope
Parameter uniqueid
A globally unique id that will be used for the stack-level construct.
Parameter props
Provider properties which will only be applied when the provider is first created.
Returns
the service token of the custom resource provider, which should be used when defining a
CustomResource
.
method getOrCreateProvider
static getOrCreateProvider: ( scope: Construct, uniqueid: string, props: CustomResourceProviderProps) => CustomResourceProvider;
Returns a stack-level singleton for the custom resource provider.
Parameter scope
Construct scope
Parameter uniqueid
A globally unique id that will be used for the stack-level construct.
Parameter props
Provider properties which will only be applied when the provider is first created.
Returns
the service token of the custom resource provider, which should be used when defining a
CustomResource
.
class DefaultStackSynthesizer
class DefaultStackSynthesizer extends StackSynthesizer {}
Uses conventionally named roles and asset storage locations
This synthesizer:
- Supports cross-account deployments (the CLI can have credentials to one account, and you can still deploy to another account by assuming roles with well-known names in the other account). - Supports the **CDK Pipelines** library.
Requires the environment to have been bootstrapped with Bootstrap Stack V2 (also known as "modern bootstrap stack"). The synthesizer adds a version check to the template, to make sure the bootstrap stack is recent enough to support all features expected by this synthesizer.
constructor
constructor(props?: DefaultStackSynthesizerProps);
property cloudFormationExecutionRoleArn
readonly cloudFormationExecutionRoleArn: string;
Returns the ARN of the CFN execution Role.
property DEFAULT_BOOTSTRAP_STACK_VERSION_SSM_PARAMETER
static readonly DEFAULT_BOOTSTRAP_STACK_VERSION_SSM_PARAMETER: string;
Default bootstrap stack version SSM parameter.
property DEFAULT_CLOUDFORMATION_ROLE_ARN
static readonly DEFAULT_CLOUDFORMATION_ROLE_ARN: string;
Default CloudFormation role ARN.
property DEFAULT_DEPLOY_ROLE_ARN
static readonly DEFAULT_DEPLOY_ROLE_ARN: string;
Default deploy role ARN.
property DEFAULT_DOCKER_ASSET_PREFIX
static readonly DEFAULT_DOCKER_ASSET_PREFIX: string;
Default Docker asset prefix
property DEFAULT_FILE_ASSET_KEY_ARN_EXPORT_NAME
static readonly DEFAULT_FILE_ASSET_KEY_ARN_EXPORT_NAME: string;
Name of the CloudFormation Export with the asset key name
property DEFAULT_FILE_ASSET_PREFIX
static readonly DEFAULT_FILE_ASSET_PREFIX: string;
Default file asset prefix
property DEFAULT_FILE_ASSET_PUBLISHING_ROLE_ARN
static readonly DEFAULT_FILE_ASSET_PUBLISHING_ROLE_ARN: string;
Default asset publishing role ARN for file (S3) assets.
property DEFAULT_FILE_ASSETS_BUCKET_NAME
static readonly DEFAULT_FILE_ASSETS_BUCKET_NAME: string;
Default file assets bucket name
property DEFAULT_IMAGE_ASSET_PUBLISHING_ROLE_ARN
static readonly DEFAULT_IMAGE_ASSET_PUBLISHING_ROLE_ARN: string;
Default asset publishing role ARN for image (ECR) assets.
property DEFAULT_IMAGE_ASSETS_REPOSITORY_NAME
static readonly DEFAULT_IMAGE_ASSETS_REPOSITORY_NAME: string;
Default image assets repository name
property DEFAULT_LOOKUP_ROLE_ARN
static readonly DEFAULT_LOOKUP_ROLE_ARN: string;
Default lookup role ARN for missing values.
property DEFAULT_QUALIFIER
static readonly DEFAULT_QUALIFIER: string;
Default ARN qualifier
property deployRoleArn
readonly deployRoleArn: string;
Returns the ARN of the deploy Role.
property stack
readonly stack: Stack;
method addDockerImageAsset
addDockerImageAsset: (asset: DockerImageAssetSource) => DockerImageAssetLocation;
method addFileAsset
addFileAsset: (asset: FileAssetSource) => FileAssetLocation;
method bind
bind: (stack: Stack) => void;
method synthesize
synthesize: (session: ISynthesisSession) => void;
Synthesize the associated stack to the session
method synthesizeStackTemplate
protected synthesizeStackTemplate: ( stack: Stack, session: ISynthesisSession) => void;
class DefaultTokenResolver
class DefaultTokenResolver implements ITokenResolver {}
Default resolver implementation
constructor
constructor(concat: IFragmentConcatenator);
method resolveList
resolveList: (xs: string[], context: IResolveContext) => any;
method resolveString
resolveString: ( fragments: TokenizedStringFragments, context: IResolveContext) => any;
Resolve string fragments to Tokens
method resolveToken
resolveToken: ( t: IResolvable, context: IResolveContext, postProcessor: IPostProcessor) => any;
Default Token resolution
Resolve the Token, recurse into whatever it returns, then finally post-process it.
class DependableTrait
abstract class DependableTrait {}
Trait for IDependable
Traits are interfaces that are privately implemented by objects. Instead of showing up in the public interface of a class, they need to be queried explicitly. This is used to implement certain framework features that are not intended to be used by Construct consumers, and so should be hidden from accidental use.
Example 1
// Usage const roots = DependableTrait.get(construct).dependencyRoots;
// Definition class TraitImplementation implements DependableTrait { public readonly dependencyRoots: IConstruct[]; constructor() { this.dependencyRoots = [constructA, constructB, constructC]; } } DependableTrait.implement(construct, new TraitImplementation());
property dependencyRoots
abstract readonly dependencyRoots: IConstruct[];
The set of constructs that form the root of this dependable
All resources under all returned constructs are included in the ordering dependency.
method get
static get: (instance: IDependable) => DependableTrait;
Return the matching DependableTrait for the given class instance.
method implement
static implement: (instance: IDependable, trait: DependableTrait) => void;
Register
instance
to have the given DependableTraitShould be called in the class constructor.
class DockerIgnoreStrategy
class DockerIgnoreStrategy extends IgnoreStrategy {}
Ignores file paths based on the [
.dockerignore specification
](https://docs.docker.com/engine/reference/builder/#dockerignore-file).
constructor
constructor(absoluteRootPath: string, patterns: string[]);
method add
add: (pattern: string) => void;
Adds another pattern. pattern the pattern to add
method ignores
ignores: (absoluteFilePath: string) => boolean;
Determines whether a given file path should be ignored or not.
Parameter absoluteFilePath
absolute file path to be assessed against the pattern
Returns
true
if the file should be ignored
class DockerImage
class DockerImage extends BundlingDockerImage {}
A Docker image
constructor
constructor(image: string, _imageHash?: string);
property image
readonly image: string;
The Docker image
method cp
cp: (imagePath: string, outputPath?: string) => string;
Copies a file or directory out of the Docker image to the local filesystem.
If
outputPath
is omitted the destination path is a temporary directory.Parameter imagePath
the path in the Docker image
Parameter outputPath
the destination path for the copy operation
Returns
the destination path
method fromBuild
static fromBuild: (path: string, options?: DockerBuildOptions) => DockerImage;
Builds a Docker image
Parameter path
The path to the directory containing the Docker file
Parameter options
Docker build options
method fromRegistry
static fromRegistry: (image: string) => DockerImage;
Reference an image on DockerHub or another online registry.
Parameter image
the image name
method run
run: (options?: DockerRunOptions) => void;
Runs a Docker image
method toJSON
toJSON: () => string;
Provides a stable representation of this image for JSON serialization.
The overridden image name if set or image hash name in that order
class Duration
class Duration {}
Represents a length of time.
The amount can be specified either as a literal value (e.g:
10
) which cannot be negative, or as an unresolved number token.When the amount is passed as a token, unit conversion is not possible.
method days
static days: (amount: number) => Duration;
Create a Duration representing an amount of days
Parameter amount
the amount of Days the
Duration
will represent.Returns
a new
Duration
representingamount
Days.
method formatTokenToNumber
formatTokenToNumber: () => string;
Returns stringified number of duration
method hours
static hours: (amount: number) => Duration;
Create a Duration representing an amount of hours
Parameter amount
the amount of Hours the
Duration
will represent.Returns
a new
Duration
representingamount
Hours.
method isUnresolved
isUnresolved: () => boolean;
Checks if duration is a token or a resolvable object
method millis
static millis: (amount: number) => Duration;
Create a Duration representing an amount of milliseconds
Parameter amount
the amount of Milliseconds the
Duration
will represent.Returns
a new
Duration
representingamount
ms.
method minus
minus: (rhs: Duration) => Duration;
Substract two Durations together
method minutes
static minutes: (amount: number) => Duration;
Create a Duration representing an amount of minutes
Parameter amount
the amount of Minutes the
Duration
will represent.Returns
a new
Duration
representingamount
Minutes.
method parse
static parse: (duration: string) => Duration;
Parse a period formatted according to the ISO 8601 standard
Parameter duration
an ISO-formtted duration to be parsed.
Returns
the parsed
Duration
.See Also
https://www.iso.org/fr/standard/70907.html
method plus
plus: (rhs: Duration) => Duration;
Add two Durations together
method seconds
static seconds: (amount: number) => Duration;
Create a Duration representing an amount of seconds
Parameter amount
the amount of Seconds the
Duration
will represent.Returns
a new
Duration
representingamount
Seconds.
method toDays
toDays: (opts?: TimeConversionOptions) => number;
Return the total number of days in this Duration
Returns
the value of this
Duration
expressed in Days.
method toHours
toHours: (opts?: TimeConversionOptions) => number;
Return the total number of hours in this Duration
Returns
the value of this
Duration
expressed in Hours.
method toHumanString
toHumanString: () => string;
Turn this duration into a human-readable string
method toIsoString
toIsoString: () => string;
Return an ISO 8601 representation of this period
Returns
a string starting with 'P' describing the period
See Also
https://www.iso.org/fr/standard/70907.html
method toISOString
toISOString: () => string;
Return an ISO 8601 representation of this period
Returns
a string starting with 'P' describing the period
See Also
https://www.iso.org/fr/standard/70907.html
Deprecated
Use
toIsoString()
instead.
method toMilliseconds
toMilliseconds: (opts?: TimeConversionOptions) => number;
Return the total number of milliseconds in this Duration
Returns
the value of this
Duration
expressed in Milliseconds.
method toMinutes
toMinutes: (opts?: TimeConversionOptions) => number;
Return the total number of minutes in this Duration
Returns
the value of this
Duration
expressed in Minutes.
method toSeconds
toSeconds: (opts?: TimeConversionOptions) => number;
Return the total number of seconds in this Duration
Returns
the value of this
Duration
expressed in Seconds.
method toString
toString: () => string;
Returns a string representation of this
Duration
This is is never the right function to use when you want to use the
Duration
object in a template. UsetoSeconds()
,toMinutes()
,toDays()
, etc. instead.
method unitLabel
unitLabel: () => string;
Returns unit of the duration
class Expiration
class Expiration {}
Represents a date of expiration.
The amount can be specified either as a Date object, timestamp, Duration or string.
property date
readonly date: Date;
Expiration value as a Date object
method after
static after: (t: Duration) => Expiration;
Expire once the specified duration has passed since deployment time
Parameter t
the duration to wait before expiring
method atDate
static atDate: (d: Date) => Expiration;
Expire at the specified date
Parameter d
date to expire at
method atTimestamp
static atTimestamp: (t: number) => Expiration;
Expire at the specified timestamp
Parameter t
timestamp in unix milliseconds
method fromString
static fromString: (s: string) => Expiration;
Expire at specified date, represented as a string
Parameter s
the string that represents date to expire at
method isAfter
isAfter: (t: Duration) => boolean;
Check if Exipiration expires after input
Parameter t
the duration to check against
method isBefore
isBefore: (t: Duration) => boolean;
Check if Exipiration expires before input
Parameter t
the duration to check against
method toEpoch
toEpoch: () => number;
Exipration Value in a formatted Unix Epoch Time in seconds
class FeatureFlags
class FeatureFlags {}
Features that are implemented behind a flag in order to preserve backwards compatibility for existing apps. The list of flags are available in the
@aws-cdk/cx-api
module.The state of the flag for this application is stored as a CDK context variable.
method isEnabled
isEnabled: (featureFlag: string) => boolean | undefined;
Check whether a feature flag is enabled. If configured, the flag is present in the construct node context. Falls back to the defaults defined in the
cx-api
module.
method of
static of: (scope: IConstruct) => FeatureFlags;
Inspect feature flags on the construct node's context.
class FileSystem
class FileSystem {}
File system utilities.
property tmpdir
static readonly tmpdir: string;
The real path of the system temp directory
method copyDirectory
static copyDirectory: ( srcDir: string, destDir: string, options?: CopyOptions, rootDir?: string) => void;
Copies an entire directory structure.
Parameter srcDir
Source directory
Parameter destDir
Destination directory
Parameter options
options
Parameter rootDir
Root directory to calculate exclusions from
method fingerprint
static fingerprint: ( fileOrDirectory: string, options?: FingerprintOptions) => string;
Produces fingerprint based on the contents of a single file or an entire directory tree.
The fingerprint will also include: 1. An extra string if defined in
options.extra
. 2. The set of exclude patterns, if defined inoptions.exclude
3. The symlink follow mode value.Parameter fileOrDirectory
The directory or file to fingerprint
Parameter options
Fingerprinting options
method isEmpty
static isEmpty: (dir: string) => boolean;
Checks whether a directory is empty
Parameter dir
The directory to check
method mkdtemp
static mkdtemp: (prefix: string) => string;
Creates a unique temporary directory in the **system temp directory**.
Parameter prefix
A prefix for the directory name. Six random characters will be generated and appended behind this prefix.
class Fn
class Fn {}
CloudFormation intrinsic functions. http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference.html
method base64
static base64: (data: string) => string;
The intrinsic function ``Fn::Base64`` returns the Base64 representation of the input string. This function is typically used to pass encoded data to Amazon EC2 instances by way of the UserData property.
Parameter data
The string value you want to convert to Base64.
Returns
a token represented as a string
method cidr
static cidr: (ipBlock: string, count: number, sizeMask?: string) => string[];
The intrinsic function ``Fn::Cidr`` returns the specified Cidr address block.
Parameter ipBlock
The user-specified default Cidr address block.
Parameter count
The number of subnets' Cidr block wanted. Count can be 1 to 256.
Parameter sizeMask
The digit covered in the subnet.
Returns
a token represented as a string
method conditionAnd
static conditionAnd: ( ...conditions: ICfnConditionExpression[]) => ICfnRuleConditionExpression;
Returns true if all the specified conditions evaluate to true, or returns false if any one of the conditions evaluates to false. ``Fn::And`` acts as an AND operator. The minimum number of conditions that you can include is 1.
Parameter conditions
conditions to AND
Returns
an FnCondition token
method conditionContains
static conditionContains: ( listOfStrings: string[], value: string) => ICfnRuleConditionExpression;
Returns true if a specified string matches at least one value in a list of strings.
Parameter listOfStrings
A list of strings, such as "A", "B", "C".
Parameter value
A string, such as "A", that you want to compare against a list of strings.
Returns
an FnCondition token
method conditionEachMemberEquals
static conditionEachMemberEquals: ( listOfStrings: string[], value: string) => ICfnRuleConditionExpression;
Returns true if a specified string matches all values in a list.
Parameter listOfStrings
A list of strings, such as "A", "B", "C".
Parameter value
A string, such as "A", that you want to compare against a list of strings.
Returns
an FnCondition token
method conditionEachMemberIn
static conditionEachMemberIn: ( stringsToCheck: string[], stringsToMatch: string[]) => ICfnRuleConditionExpression;
Returns true if each member in a list of strings matches at least one value in a second list of strings.
Parameter stringsToCheck
A list of strings, such as "A", "B", "C". AWS CloudFormation checks whether each member in the strings_to_check parameter is in the strings_to_match parameter.
Parameter stringsToMatch
A list of strings, such as "A", "B", "C". Each member in the strings_to_match parameter is compared against the members of the strings_to_check parameter.
Returns
an FnCondition token
method conditionEquals
static conditionEquals: (lhs: any, rhs: any) => ICfnRuleConditionExpression;
Compares if two values are equal. Returns true if the two values are equal or false if they aren't.
Parameter lhs
A value of any type that you want to compare.
Parameter rhs
A value of any type that you want to compare.
Returns
an FnCondition token
method conditionIf
static conditionIf: ( conditionId: string, valueIfTrue: any, valueIfFalse: any) => ICfnRuleConditionExpression;
Returns one value if the specified condition evaluates to true and another value if the specified condition evaluates to false. Currently, AWS CloudFormation supports the ``Fn::If`` intrinsic function in the metadata attribute, update policy attribute, and property values in the Resources section and Outputs sections of a template. You can use the AWS::NoValue pseudo parameter as a return value to remove the corresponding property.
Parameter conditionId
A reference to a condition in the Conditions section. Use the condition's name to reference it.
Parameter valueIfTrue
A value to be returned if the specified condition evaluates to true.
Parameter valueIfFalse
A value to be returned if the specified condition evaluates to false.
Returns
an FnCondition token
method conditionNot
static conditionNot: ( condition: ICfnConditionExpression) => ICfnRuleConditionExpression;
Returns true for a condition that evaluates to false or returns false for a condition that evaluates to true. ``Fn::Not`` acts as a NOT operator.
Parameter condition
A condition such as ``Fn::Equals`` that evaluates to true or false.
Returns
an FnCondition token
method conditionOr
static conditionOr: ( ...conditions: ICfnConditionExpression[]) => ICfnRuleConditionExpression;
Returns true if any one of the specified conditions evaluate to true, or returns false if all of the conditions evaluates to false. ``Fn::Or`` acts as an OR operator. The minimum number of conditions that you can include is 1.
Parameter conditions
conditions that evaluates to true or false.
Returns
an FnCondition token
method findInMap
static findInMap: ( mapName: string, topLevelKey: string, secondLevelKey: string) => string;
The intrinsic function ``Fn::FindInMap`` returns the value corresponding to keys in a two-level map that is declared in the Mappings section.
Returns
a token represented as a string
method getAtt
static getAtt: ( logicalNameOfResource: string, attributeName: string) => IResolvable;
The ``Fn::GetAtt`` intrinsic function returns the value of an attribute from a resource in the template.
Parameter logicalNameOfResource
The logical name (also called logical ID) of the resource that contains the attribute that you want.
Parameter attributeName
The name of the resource-specific attribute whose value you want. See the resource's reference page for details about the attributes available for that resource type.
Returns
an IResolvable object
method getAzs
static getAzs: (region?: string) => string[];
The intrinsic function ``Fn::GetAZs`` returns an array that lists Availability Zones for a specified region. Because customers have access to different Availability Zones, the intrinsic function ``Fn::GetAZs`` enables template authors to write templates that adapt to the calling user's access. That way you don't have to hard-code a full list of Availability Zones for a specified region.
Parameter region
The name of the region for which you want to get the Availability Zones. You can use the AWS::Region pseudo parameter to specify the region in which the stack is created. Specifying an empty string is equivalent to specifying AWS::Region.
Returns
a token represented as a string array
method importListValue
static importListValue: ( sharedValueToImport: string, assumedLength: number, delimiter?: string) => string[];
Like
Fn.importValue
, but import a list with a known lengthIf you explicitly want a list with an unknown length, call `Fn.split(',', Fn.importValue(exportName))
. See the documentation of
Fn.split` to read more about the limitations of using lists of unknown length.Fn.importListValue(exportName, assumedLength)
is the same asFn.split(',', Fn.importValue(exportName), assumedLength)
, but easier to read and impossible to forget to passassumedLength
.
method importValue
static importValue: (sharedValueToImport: string) => string;
The intrinsic function ``Fn::ImportValue`` returns the value of an output exported by another stack. You typically use this function to create cross-stack references. In the following example template snippets, Stack A exports VPC security group values and Stack B imports them.
Parameter sharedValueToImport
The stack output value that you want to import.
Returns
a token represented as a string
method join
static join: (delimiter: string, listOfValues: string[]) => string;
The intrinsic function ``Fn::Join`` appends a set of values into a single value, separated by the specified delimiter. If a delimiter is the empty string, the set of values are concatenated with no delimiter.
Parameter delimiter
The value you want to occur between fragments. The delimiter will occur between fragments only. It will not terminate the final value.
Parameter listOfValues
The list of values you want combined.
Returns
a token represented as a string
method parseDomainName
static parseDomainName: (url: string) => string;
Given an url, parse the domain name
Parameter url
the url to parse
method ref
static ref: (logicalName: string) => string;
The ``Ref`` intrinsic function returns the value of the specified parameter or resource. Note that it doesn't validate the logicalName, it mainly serves paremeter/resource reference defined in a ``CfnInclude`` template.
Parameter logicalName
The logical name of a parameter/resource for which you want to retrieve its value.
method refAll
static refAll: (parameterType: string) => string[];
Returns all values for a specified parameter type.
Parameter parameterType
An AWS-specific parameter type, such as AWS::EC2::SecurityGroup::Id or AWS::EC2::VPC::Id. For more information, see Parameters in the AWS CloudFormation User Guide.
Returns
a token represented as a string array
method select
static select: (index: number, array: string[]) => string;
The intrinsic function ``Fn::Select`` returns a single object from a list of objects by index.
Parameter index
The index of the object to retrieve. This must be a value from zero to N-1, where N represents the number of elements in the array.
Parameter array
The list of objects to select from. This list must not be null, nor can it have null entries.
Returns
a token represented as a string
method split
static split: ( delimiter: string, source: string, assumedLength?: number) => string[];
Split a string token into a token list of string values.
Specify the location of splits with a delimiter such as ',' (a comma). Renders to the
Fn::Split
intrinsic function.Lists with unknown lengths (default) -------------------------------------
Since this function is used to work with deploy-time values, if
assumedLength
is not given the CDK cannot know the length of the resulting list at synthesis time. This brings the following restrictions:- You must use
Fn.select(i, list)
to pick elements out of the list (you must not uselist[i]
). - You cannot add elements to the list, remove elements from the list, combine two such lists together, or take a slice of the list. - You cannot pass the list to constructs that do any of the above.The only valid operation with such a tokenized list is to pass it unmodified to a CloudFormation Resource construct.
Lists with assumed lengths --------------------------
Pass
assumedLength
if you know the length of the list that will be produced by splitting. The actual list length at deploy time may be *longer* than the number you pass, but not *shorter*.The returned list will look like:
[Fn.select(0, split), Fn.select(1, split), Fn.select(2, split), ...]The restrictions from the section "Lists with unknown lengths" will now be lifted, at the expense of having to know and fix the length of the list.
Parameter delimiter
A string value that determines where the source string is divided.
Parameter source
The string value that you want to split.
Parameter assumedLength
The length of the list that will be produced by splitting
Returns
a token represented as a string array
method sub
static sub: (body: string, variables?: { [key: string]: string }) => string;
The intrinsic function ``Fn::Sub`` substitutes variables in an input string with values that you specify. In your templates, you can use this function to construct commands or outputs that include values that aren't available until you create or update a stack.
Parameter body
A string with variables that AWS CloudFormation substitutes with their associated values at runtime. Write variables as ${MyVarName}. Variables can be template parameter names, resource logical IDs, resource attributes, or a variable in a key-value map. If you specify only template parameter names, resource logical IDs, and resource attributes, don't specify a key-value map.
Parameter variables
The name of a variable that you included in the String parameter. The value that AWS CloudFormation substitutes for the associated variable name at runtime.
Returns
a token represented as a string
method transform
static transform: ( macroName: string, parameters: { [name: string]: any }) => IResolvable;
Creates a token representing the ``Fn::Transform`` expression
Parameter macroName
The name of the macro to perform the processing
Parameter parameters
The parameters to be passed to the macro
Returns
a token representing the transform expression
See Also
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-transform.html
method valueOf
static valueOf: (parameterOrLogicalId: string, attribute: string) => string;
Returns an attribute value or list of values for a specific parameter and attribute.
Parameter parameterOrLogicalId
The name of a parameter for which you want to retrieve attribute values. The parameter must be declared in the Parameters section of the template.
Parameter attribute
The name of an attribute from which you want to retrieve a value.
Returns
a token represented as a string
method valueOfAll
static valueOfAll: (parameterType: string, attribute: string) => string[];
Returns a list of all attribute values for a given parameter type and attribute.
Parameter parameterType
An AWS-specific parameter type, such as AWS::EC2::SecurityGroup::Id or AWS::EC2::VPC::Id. For more information, see Parameters in the AWS CloudFormation User Guide.
Parameter attribute
The name of an attribute from which you want to retrieve a value. For more information about attributes, see Supported Attributes.
Returns
a token represented as a string array
class GitIgnoreStrategy
class GitIgnoreStrategy extends IgnoreStrategy {}
Ignores file paths based on the [
.gitignore specification
](https://git-scm.com/docs/gitignore).
constructor
constructor(absoluteRootPath: string, patterns: string[]);
method add
add: (pattern: string) => void;
Adds another pattern. pattern the pattern to add
method ignores
ignores: (absoluteFilePath: string) => boolean;
Determines whether a given file path should be ignored or not.
Parameter absoluteFilePath
absolute file path to be assessed against the pattern
Returns
true
if the file should be ignored
class GlobIgnoreStrategy
class GlobIgnoreStrategy extends IgnoreStrategy {}
Ignores file paths based on simple glob patterns.
constructor
constructor(absoluteRootPath: string, patterns: string[]);
method add
add: (pattern: string) => void;
Adds another pattern. pattern the pattern to add
method ignores
ignores: (absoluteFilePath: string) => boolean;
Determines whether a given file path should be ignored or not.
Parameter absoluteFilePath
absolute file path to be assessed against the pattern
Returns
true
if the file should be ignored
class IgnoreStrategy
abstract class IgnoreStrategy {}
Represents file path ignoring behavior.
method add
abstract add: (pattern: string) => void;
Adds another pattern. pattern the pattern to add
method docker
static docker: ( absoluteRootPath: string, patterns: string[]) => DockerIgnoreStrategy;
Ignores file paths based on the [
.dockerignore specification
](https://docs.docker.com/engine/reference/builder/#dockerignore-file).Parameter absoluteRootPath
the absolute path to the root directory of the paths to be considered
Parameter patterns
Returns
DockerIgnorePattern
associated with the given patterns.
method fromCopyOptions
static fromCopyOptions: ( options: CopyOptions, absoluteRootPath: string) => IgnoreStrategy;
Creates an IgnoreStrategy based on the
ignoreMode
andexclude
in aCopyOptions
.Parameter absoluteRootPath
the absolute path to the root directory of the paths to be considered
Parameter options
the
CopyOptions
to create theIgnoreStrategy
fromReturns
IgnoreStrategy
based on theCopyOptions
method git
static git: (absoluteRootPath: string, patterns: string[]) => GitIgnoreStrategy;
Ignores file paths based on the [
.gitignore specification
](https://git-scm.com/docs/gitignore).Parameter absoluteRootPath
the absolute path to the root directory of the paths to be considered
Parameter patterns
Returns
GitIgnorePattern
associated with the given patterns.
method glob
static glob: ( absoluteRootPath: string, patterns: string[]) => GlobIgnoreStrategy;
Ignores file paths based on simple glob patterns.
Parameter absoluteRootPath
the absolute path to the root directory of the paths to be considered
Parameter patterns
Returns
GlobIgnorePattern
associated with the given patterns.
method ignores
abstract ignores: (absoluteFilePath: string) => boolean;
Determines whether a given file path should be ignored or not.
Parameter absoluteFilePath
absolute file path to be assessed against the pattern
Returns
true
if the file should be ignored
class Intrinsic
class Intrinsic implements IResolvable {}
Token subclass that represents values intrinsic to the target document language
WARNING: this class should not be externally exposed, but is currently visible because of a limitation of jsii (https://github.com/aws/jsii/issues/524).
This class will disappear in a future release and should not be used.
constructor
constructor(value: any, options?: IntrinsicProps);
property creationStack
readonly creationStack: string[];
The captured stack trace which represents the location in which this token was created.
method newError
protected newError: (message: string) => any;
Creates a throwable Error object that contains the token creation stack trace.
Parameter message
Error message
method resolve
resolve: (_context: IResolveContext) => any;
method toJSON
toJSON: () => any;
Turn this Token into JSON
Called automatically when JSON.stringify() is called on a Token.
method toString
toString: () => string;
Convert an instance of this Token to a string
This method will be called implicitly by language runtimes if the object is embedded into a string. We treat it the same as an explicit stringification.
class Lazy
class Lazy {}
Lazily produce a value
Can be used to return a string, list or numeric value whose actual value will only be calculated later, during synthesis.
method any
static any: ( producer: IStableAnyProducer, options?: LazyAnyValueOptions) => IResolvable;
Defer the one-time calculation of an arbitrarily typed value to synthesis time
Use this if you want to render an object to a template whose actual value depends on some state mutation that may happen after the construct has been created.
The inner function will only be invoked one time and cannot depend on resolution context.
method anyValue
static anyValue: ( producer: IAnyProducer, options?: LazyAnyValueOptions) => IResolvable;
Defer the one-time calculation of an arbitrarily typed value to synthesis time
Use this if you want to render an object to a template whose actual value depends on some state mutation that may happen after the construct has been created.
Deprecated
Use
Lazy.any()
orLazy.uncachedAny()
instead.
method list
static list: ( producer: IStableListProducer, options?: LazyListValueOptions) => string[];
Defer the one-time calculation of a list value to synthesis time
Use this if you want to render a list to a template whose actual value depends on some state mutation that may happen after the construct has been created.
If you are simply looking to force a value to a
string[]
type and don't need the calculation to be deferred, useToken.asList()
instead.The inner function will only be invoked once, and the resolved value cannot depend on the Stack the Token is used in.
method listValue
static listValue: ( producer: IListProducer, options?: LazyListValueOptions) => string[];
Defer the one-time calculation of a list value to synthesis time
Use this if you want to render a list to a template whose actual value depends on some state mutation that may happen after the construct has been created.
If you are simply looking to force a value to a
string[]
type and don't need the calculation to be deferred, useToken.asList()
instead.Deprecated
Use
Lazy.list()
orLazy.uncachedList()
instead.
method number
static number: (producer: IStableNumberProducer) => number;
Defer the one-time calculation of a number value to synthesis time
Use this if you want to render a number to a template whose actual value depends on some state mutation that may happen after the construct has been created.
If you are simply looking to force a value to a
number
type and don't need the calculation to be deferred, useToken.asNumber()
instead.The inner function will only be invoked once, and the resolved value cannot depend on the Stack the Token is used in.
method numberValue
static numberValue: (producer: INumberProducer) => number;
Defer the one-time calculation of a number value to synthesis time
Use this if you want to render a number to a template whose actual value depends on some state mutation that may happen after the construct has been created.
If you are simply looking to force a value to a
number
type and don't need the calculation to be deferred, useToken.asNumber()
instead.Deprecated
Use
Lazy.number()
orLazy.uncachedNumber()
instead.
method string
static string: ( producer: IStableStringProducer, options?: LazyStringValueOptions) => string;
Defer the one-time calculation of a string value to synthesis time
Use this if you want to render a string to a template whose actual value depends on some state mutation that may happen after the construct has been created.
If you are simply looking to force a value to a
string
type and don't need the calculation to be deferred, useToken.asString()
instead.The inner function will only be invoked once, and the resolved value cannot depend on the Stack the Token is used in.
method stringValue
static stringValue: ( producer: IStringProducer, options?: LazyStringValueOptions) => string;
Defer the calculation of a string value to synthesis time
Use this if you want to render a string to a template whose actual value depends on some state mutation that may happen after the construct has been created.
If you are simply looking to force a value to a
string
type and don't need the calculation to be deferred, useToken.asString()
instead.Deprecated
Use
Lazy.string()
orLazy.uncachedString()
instead.
method uncachedAny
static uncachedAny: ( producer: IAnyProducer, options?: LazyAnyValueOptions) => IResolvable;
Defer the calculation of an untyped value to synthesis time
Use of this function is not recommended; unless you know you need it for sure, you probably don't. Use
Lazy.any()
instead.The inner function may be invoked multiple times during synthesis. You should only use this method if the returned value depends on variables that may change during the Aspect application phase of synthesis, or if the value depends on the Stack the value is being used in. Both of these cases are rare, and only ever occur for AWS Construct Library authors.
method uncachedList
static uncachedList: ( producer: IListProducer, options?: LazyListValueOptions) => string[];
Defer the calculation of a list value to synthesis time
Use of this function is not recommended; unless you know you need it for sure, you probably don't. Use
Lazy.list()
instead.The inner function may be invoked multiple times during synthesis. You should only use this method if the returned value depends on variables that may change during the Aspect application phase of synthesis, or if the value depends on the Stack the value is being used in. Both of these cases are rare, and only ever occur for AWS Construct Library authors.
method uncachedNumber
static uncachedNumber: (producer: INumberProducer) => number;
Defer the calculation of a number value to synthesis time
Use of this function is not recommended; unless you know you need it for sure, you probably don't. Use
Lazy.number()
instead.The inner function may be invoked multiple times during synthesis. You should only use this method if the returned value depends on variables that may change during the Aspect application phase of synthesis, or if the value depends on the Stack the value is being used in. Both of these cases are rare, and only ever occur for AWS Construct Library authors.
method uncachedString
static uncachedString: ( producer: IStringProducer, options?: LazyStringValueOptions) => string;
Defer the calculation of a string value to synthesis time
Use of this function is not recommended; unless you know you need it for sure, you probably don't. Use
Lazy.string()
instead.The inner function may be invoked multiple times during synthesis. You should only use this method if the returned value depends on variables that may change during the Aspect application phase of synthesis, or if the value depends on the Stack the value is being used in. Both of these cases are rare, and only ever occur for AWS Construct Library authors.
class LegacyStackSynthesizer
class LegacyStackSynthesizer extends StackSynthesizer {}
Use the CDK classic way of referencing assets
This synthesizer will generate CloudFormation parameters for every referenced asset, and use the CLI's current credentials to deploy the stack.
- It does not support cross-account deployment (the CLI must have credentials to the account you are trying to deploy to). - It cannot be used with **CDK Pipelines**. To deploy using CDK Pipelines, you must use the
DefaultStackSynthesizer
. - Each asset will take up a CloudFormation Parameter in your template. Keep in mind that there is a maximum of 200 parameters in a CloudFormation template. To use determinstic asset locations instead, useCliCredentialsStackSynthesizer
.Be aware that your CLI credentials must be valid for the duration of the entire deployment. If you are using session credentials, make sure the session lifetime is long enough.
This is the only StackSynthesizer that supports customizing asset behavior by overriding
Stack.addFileAsset()
andStack.addDockerImageAsset()
.
method addDockerImageAsset
addDockerImageAsset: (asset: DockerImageAssetSource) => DockerImageAssetLocation;
method addFileAsset
addFileAsset: (asset: FileAssetSource) => FileAssetLocation;
method bind
bind: (stack: Stack) => void;
method synthesize
synthesize: (session: ISynthesisSession) => void;
Synthesize the associated stack to the session
class Names
class Names {}
Functions for devising unique names for constructs. For example, those can be used to allocate unique physical names for resources.
method nodeUniqueId
static nodeUniqueId: (node: ConstructNode) => string;
Returns a CloudFormation-compatible unique identifier for a construct based on its path. The identifier includes a human readable portion rendered from the path components and a hash suffix.
TODO (v2): replace with API to use
constructs.Node
.Parameter node
The construct node
Returns
a unique id based on the construct path
method uniqueId
static uniqueId: (construct: Construct) => string;
Returns a CloudFormation-compatible unique identifier for a construct based on its path. The identifier includes a human readable portion rendered from the path components and a hash suffix.
Parameter construct
The construct
Returns
a unique id based on the construct path
class NestedStack
class NestedStack extends Stack {}
A CloudFormation nested stack.
When you apply template changes to update a top-level stack, CloudFormation updates the top-level stack and initiates an update to its nested stacks. CloudFormation updates the resources of modified nested stacks, but does not update the resources of unmodified nested stacks.
Furthermore, this stack will not be treated as an independent deployment artifact (won't be listed in "cdk list" or deployable through "cdk deploy"), but rather only synthesized as a template and uploaded as an asset to S3.
Cross references of resource attributes between the parent stack and the nested stack will automatically be translated to stack parameters and outputs.
constructor
constructor(scope: Construct, id: string, props?: NestedStackProps);
property nestedStackResource
readonly nestedStackResource?: CfnResource;
property stackId
readonly stackId: string;
An attribute that represents the ID of the stack.
This is a context aware attribute: - If this is referenced from the parent stack, it will return
{ "Ref": "LogicalIdOfNestedStackResource" }
. - If this is referenced from the context of the nested stack, it will return{ "Ref": "AWS::StackId" }
Example value:
arn:aws:cloudformation:us-east-2:123456789012:stack/mystack-mynestedstack-sggfrhxhum7w/f449b250-b969-11e0-a185-5081d0136786
property stackName
readonly stackName: string;
An attribute that represents the name of the nested stack.
This is a context aware attribute: - If this is referenced from the parent stack, it will return a token that parses the name from the stack ID. - If this is referenced from the context of the nested stack, it will return
{ "Ref": "AWS::StackName" }
Example value:
mystack-mynestedstack-sggfrhxhum7w
property templateFile
readonly templateFile: string;
method isNestedStack
static isNestedStack: (x: any) => x is NestedStack;
Checks if
x
is an object of typeNestedStack
.
method setParameter
setParameter: (name: string, value: string) => void;
Assign a value to one of the nested stack parameters.
Parameter name
The parameter name (ID)
Parameter value
The value to assign
class NestedStackSynthesizer
class NestedStackSynthesizer extends StackSynthesizer {}
Synthesizer for a nested stack
Forwards all calls to the parent stack's synthesizer.
This synthesizer is automatically used for
NestedStack
constructs. App builder do not need to use this class directly.
constructor
constructor(parentDeployment: IStackSynthesizer);
method addDockerImageAsset
addDockerImageAsset: (asset: DockerImageAssetSource) => DockerImageAssetLocation;
method addFileAsset
addFileAsset: (asset: FileAssetSource) => FileAssetLocation;
method bind
bind: (stack: Stack) => void;
method synthesize
synthesize: (session: ISynthesisSession) => void;
class PhysicalName
class PhysicalName {}
Includes special markers for automatic generation of physical names.
property GENERATE_IF_NEEDED
static readonly GENERATE_IF_NEEDED: string;
Use this to automatically generate a physical name for an AWS resource only if the resource is referenced across environments (account/region). Otherwise, the name will be allocated during deployment by CloudFormation.
If you are certain that a resource will be referenced across environments, you may also specify an explicit physical name for it. This option is mostly designed for reusable constructs which may or may not be referenced acrossed environments.
class Reference
abstract class Reference extends Intrinsic {}
An intrinsic Token that represents a reference to a construct.
References are recorded.
constructor
constructor(value: any, target: IConstruct, displayName?: string);
property displayName
readonly displayName: string;
property target
readonly target: IConstruct;
method isReference
static isReference: (x: any) => x is Reference;
Check whether this is actually a Reference
class RemoveTag
class RemoveTag extends TagBase {}
The RemoveTag Aspect will handle removing tags from this node and children
constructor
constructor(key: string, props?: TagProps);
method applyTag
protected applyTag: (resource: ITaggable) => void;
class Resource
abstract class Resource extends CoreConstruct implements IResource {}
A construct which represents an AWS resource.
constructor
constructor(scope: Construct, id: string, props?: ResourceProps);
property env
readonly env: ResourceEnvironment;
property physicalName
protected readonly physicalName: string;
Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.
This value will resolve to one of the following: - a concrete value (e.g.
"my-awesome-bucket"
) -undefined
, when a name should be generated by CloudFormation - a concrete name generated automatically during synthesis, in cross-environment scenarios.
property stack
readonly stack: Stack;
method applyRemovalPolicy
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
).
method generatePhysicalName
protected generatePhysicalName: () => string;
method getResourceArnAttribute
protected getResourceArnAttribute: ( arnAttr: string, arnComponents: ArnComponents) => string;
Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g.
bucket.bucketArn
).Normally, this token will resolve to
arnAttr
, but if the resource is referenced across environments,arnComponents
will be used to synthesize a concrete ARN with the resource's physical name. Make sure to referencethis.physicalName
inarnComponents
.Parameter arnAttr
The CFN attribute which resolves to the ARN of the resource. Commonly it will be called "Arn" (e.g.
resource.attrArn
), but sometimes it's the CFN resource'sref
.Parameter arnComponents
The format of the ARN of this resource. You must reference
this.physicalName
somewhere within the ARN in order for cross-environment references to work.
method getResourceNameAttribute
protected getResourceNameAttribute: (nameAttr: string) => string;
Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g.
bucket.bucketName
).Normally, this token will resolve to
nameAttr
, but if the resource is referenced across environments, it will be resolved tothis.physicalName
, which will be a concrete name.Parameter nameAttr
The CFN attribute which resolves to the resource's name. Commonly this is the resource's
ref
.
method isResource
static isResource: (construct: IConstruct) => construct is CfnResource;
Check whether the given construct is a Resource
class ScopedAws
class ScopedAws {}
Accessor for scoped pseudo parameters
These pseudo parameters are anchored to a stack somewhere in the construct tree, and their values will be exported automatically.
constructor
constructor(scope: Construct);
property accountId
readonly accountId: string;
property notificationArns
readonly notificationArns: string[];
property partition
readonly partition: string;
property region
readonly region: string;
property stackId
readonly stackId: string;
property stackName
readonly stackName: string;
property urlSuffix
readonly urlSuffix: string;
class SecretValue
class SecretValue extends Intrinsic {}
Work with secret values in the CDK
Constructs that need secrets will declare parameters of type
SecretValue
.The actual values of these secrets should not be committed to your repository, or even end up in the synthesized CloudFormation template. Instead, you should store them in an external system like AWS Secrets Manager or SSM Parameter Store, and you can reference them by calling
SecretValue.secretsManager()
orSecretValue.ssmSecure()
.You can use
SecretValue.unsafePlainText()
to construct aSecretValue
from a literal string, but doing so is highly discouraged.To make sure secret values don't accidentally end up in readable parts of your infrastructure definition (such as the environment variables of an AWS Lambda Function, where everyone who can read the function definition has access to the secret), using secret values directly is not allowed. You must pass them to constructs that accept
SecretValue
properties, which are guaranteed to use the value only in CloudFormation properties that are write-only.If you are sure that what you are doing is safe, you can call
secretValue.unsafeUnwrap()
to access the protected string of the secret value.(If you are writing something like an AWS Lambda Function and need to access a secret inside it, make the API call to
GetSecretValue
directly inside your Lamba's code, instead of using environment variables.)
constructor
constructor(protectedValue: any, options?: IntrinsicProps);
Construct a SecretValue (do not use!)
Do not use the constructor directly: use one of the factory functions on the class instead.
method cfnDynamicReference
static cfnDynamicReference: (ref: CfnDynamicReference) => SecretValue;
Obtain the secret value through a CloudFormation dynamic reference.
If possible, use
SecretValue.ssmSecure
orSecretValue.secretsManager
directly.Parameter ref
The dynamic reference to use.
method cfnParameter
static cfnParameter: (param: CfnParameter) => SecretValue;
Obtain the secret value through a CloudFormation parameter.
Generally, this is not a recommended approach. AWS Secrets Manager is the recommended way to reference secrets.
Parameter param
The CloudFormation parameter to use.
method isSecretValue
static isSecretValue: (x: any) => x is SecretValue;
Test whether an object is a SecretValue
method plainText
static plainText: (secret: string) => SecretValue;
Construct a literal secret value for use with secret-aware constructs
Do not use this method for any secrets that you care about! The value will be visible to anyone who has access to the CloudFormation template (via the AWS Console, SDKs, or CLI).
The only reasonable use case for using this method is when you are testing.
Deprecated
Use
unsafePlainText()
instead.
method resolve
resolve: (context: IResolveContext) => any;
Resolve the secret
If the feature flag is not set, resolve as normal. Otherwise, throw a descriptive error that the usage guard is missing.
method resourceAttribute
static resourceAttribute: (attr: string) => SecretValue;
Use a resource's output as secret value
method secretsManager
static secretsManager: ( secretId: string, options?: SecretsManagerSecretOptions) => SecretValue;
Creates a
SecretValue
with a value which is dynamically loaded from AWS Secrets Manager.Parameter secretId
The ID or ARN of the secret
Parameter options
Options
method ssmSecure
static ssmSecure: (parameterName: string, version?: string) => SecretValue;
Use a secret value stored from a Systems Manager (SSM) parameter.
Parameter parameterName
The name of the parameter in the Systems Manager Parameter Store. The parameter name is case-sensitive.
Parameter version
An integer that specifies the version of the parameter to use. If you don't specify the exact version, AWS CloudFormation uses the latest version of the parameter.
method unsafePlainText
static unsafePlainText: (secret: string) => SecretValue;
Construct a literal secret value for use with secret-aware constructs
Do not use this method for any secrets that you care about! The value will be visible to anyone who has access to the CloudFormation template (via the AWS Console, SDKs, or CLI).
The only reasonable use case for using this method is when you are testing.
method unsafeUnwrap
unsafeUnwrap: () => string;
Disable usage protection on this secret
Call this to indicate that you want to use the secret value held by this object in an unchecked way. If you don't call this method, using the secret value directly in a string context or as a property value somewhere will produce an error.
This method has 'unsafe' in the name on purpose! Make sure that the construct property you are using the returned value in is does not end up in a place in your AWS infrastructure where it could be read by anyone unexpected.
When in doubt, don't call this method and only pass the object to constructs that accept
SecretValue
parameters.
class Size
class Size {}
Represents the amount of digital storage.
The amount can be specified either as a literal value (e.g:
10
) which cannot be negative, or as an unresolved number token.When the amount is passed as a token, unit conversion is not possible.
method gibibytes
static gibibytes: (amount: number) => Size;
Create a Storage representing an amount gibibytes. 1 GiB = 1024 MiB
Parameter amount
the amount of gibibytes to be represented
Returns
a new
Size
instance
method isUnresolved
isUnresolved: () => boolean;
Checks if size is a token or a resolvable object
method kibibytes
static kibibytes: (amount: number) => Size;
Create a Storage representing an amount kibibytes. 1 KiB = 1024 bytes
Parameter amount
the amount of kibibytes to be represented
Returns
a new
Size
instance
method mebibytes
static mebibytes: (amount: number) => Size;
Create a Storage representing an amount mebibytes. 1 MiB = 1024 KiB
Parameter amount
the amount of mebibytes to be represented
Returns
a new
Size
instance
method pebibyte
static pebibyte: (amount: number) => Size;
Create a Storage representing an amount pebibytes. 1 PiB = 1024 TiB
Deprecated
use
pebibytes
instead
method pebibytes
static pebibytes: (amount: number) => Size;
Create a Storage representing an amount pebibytes. 1 PiB = 1024 TiB
Parameter amount
the amount of pebibytes to be represented
Returns
a new
Size
instance
method tebibytes
static tebibytes: (amount: number) => Size;
Create a Storage representing an amount tebibytes. 1 TiB = 1024 GiB
Parameter amount
the amount of tebibytes to be represented
Returns
a new
Size
instance
method toGibibytes
toGibibytes: (opts?: SizeConversionOptions) => number;
Return this storage as a total number of gibibytes.
Parameter opts
the conversion options
Returns
the quantity of bytes expressed in gibibytes
method toKibibytes
toKibibytes: (opts?: SizeConversionOptions) => number;
Return this storage as a total number of kibibytes.
Parameter opts
the conversion options
Returns
the quantity of bytes expressed in kibibytes
method toMebibytes
toMebibytes: (opts?: SizeConversionOptions) => number;
Return this storage as a total number of mebibytes.
Parameter opts
the conversion options
Returns
the quantity of bytes expressed in mebibytes
method toPebibytes
toPebibytes: (opts?: SizeConversionOptions) => number;
Return this storage as a total number of pebibytes.
Parameter opts
the conversion options
Returns
the quantity of bytes expressed in pebibytes
method toTebibytes
toTebibytes: (opts?: SizeConversionOptions) => number;
Return this storage as a total number of tebibytes.
Parameter opts
the conversion options
Returns
the quantity of bytes expressed in tebibytes
class Stack
class Stack extends CoreConstruct implements ITaggable {}
A root construct which represents a single CloudFormation stack.
constructor
constructor(scope?: Construct, id?: string, props?: StackProps);
Creates a new stack.
Parameter scope
Parent of this stack, usually an
App
or aStage
, but could be any construct.Parameter id
The construct ID of this stack. If
stackName
is not explicitly defined, this id (and any parent IDs) will be used to determine the physical ID of the stack.Parameter props
Stack properties.
property account
readonly account: string;
The AWS account into which this stack will be deployed.
This value is resolved according to the following rules:
1. The value provided to
env.account
when the stack is defined. This can either be a concerete account (e.g.585695031111
) or theAws.accountId
token. 3.Aws.accountId
, which represents the CloudFormation intrinsic reference{ "Ref": "AWS::AccountId" }
encoded as a string token.Preferably, you should use the return value as an opaque string and not attempt to parse it to implement your logic. If you do, you must first check that it is a concerete value an not an unresolved token. If this value is an unresolved token (
Token.isUnresolved(stack.account)
returnstrue
), this implies that the user wishes that this stack will synthesize into a **account-agnostic template**. In this case, your code should either fail (throw an error, emit a synth error usingAnnotations.of(construct).addError()
) or implement some other region-agnostic behavior.
property artifactId
readonly artifactId: string;
The ID of the cloud assembly artifact for this stack.
property availabilityZones
readonly availabilityZones: string[];
Returns the list of AZs that are available in the AWS environment (account/region) associated with this stack.
If the stack is environment-agnostic (either account and/or region are tokens), this property will return an array with 2 tokens that will resolve at deploy-time to the first two availability zones returned from CloudFormation's
Fn::GetAZs
intrinsic function.If they are not available in the context, returns a set of dummy values and reports them as missing, and let the CLI resolve them by calling EC2
DescribeAvailabilityZones
on the target environment.To specify a different strategy for selecting availability zones override this method.
property bundlingRequired
readonly bundlingRequired: boolean;
Indicates whether the stack requires bundling or not
property dependencies
readonly dependencies: Stack[];
Return the stacks this stack depends on
property environment
readonly environment: string;
The environment coordinates in which this stack is deployed. In the form
aws://account/region
. Usestack.account
andstack.region
to obtain the specific values, no need to parse.You can use this value to determine if two stacks are targeting the same environment.
If either
stack.account
orstack.region
are not concrete values (e.g.Aws.account
orAws.region
) the special stringsunknown-account
and/orunknown-region
will be used respectively to indicate this stack is region/account-agnostic.
property nested
readonly nested: boolean;
Indicates if this is a nested stack, in which case
parentStack
will include a reference to it's parent.
property nestedStackParent
readonly nestedStackParent: Stack;
If this is a nested stack, returns it's parent stack.
property nestedStackResource
readonly nestedStackResource?: CfnResource;
If this is a nested stack, this represents its
AWS::CloudFormation::Stack
resource.undefined
for top-level (non-nested) stacks.
property notificationArns
readonly notificationArns: string[];
Returns the list of notification Amazon Resource Names (ARNs) for the current stack.
property parentStack
readonly parentStack: Stack;
Returns the parent of a nested stack.
Deprecated
use
nestedStackParent
property partition
readonly partition: string;
The partition in which this stack is defined
property region
readonly region: string;
The AWS region into which this stack will be deployed (e.g.
us-west-2
).This value is resolved according to the following rules:
1. The value provided to
env.region
when the stack is defined. This can either be a concerete region (e.g.us-west-2
) or theAws.region
token. 3.Aws.region
, which is represents the CloudFormation intrinsic reference{ "Ref": "AWS::Region" }
encoded as a string token.Preferably, you should use the return value as an opaque string and not attempt to parse it to implement your logic. If you do, you must first check that it is a concerete value an not an unresolved token. If this value is an unresolved token (
Token.isUnresolved(stack.region)
returnstrue
), this implies that the user wishes that this stack will synthesize into a **region-agnostic template**. In this case, your code should either fail (throw an error, emit a synth error usingAnnotations.of(construct).addError()
) or implement some other region-agnostic behavior.
property stackId
readonly stackId: string;
The ID of the stack
Example 1
// After resolving, looks like 'arn:aws:cloudformation:us-west-2:123456789012:stack/teststack/51af3dc0-da77-11e4-872e-1234567db123'
property stackName
readonly stackName: string;
The concrete CloudFormation physical stack name.
This is either the name defined explicitly in the
stackName
prop or allocated based on the stack's location in the construct tree. Stacks that are directly defined under the app use their constructid
as their stack name. Stacks that are defined deeper within the tree will use a hashed naming scheme based on the construct path to ensure uniqueness.If you wish to obtain the deploy-time AWS::StackName intrinsic, you can use
Aws.stackName
directly.
property synthesizer
readonly synthesizer: IStackSynthesizer;
Synthesis method for this stack
property tags
readonly tags: TagManager;
Tags to be applied to the stack.
property templateFile
readonly templateFile: string;
The name of the CloudFormation template file emitted to the output directory during synthesis.
Example value:
MyStack.template.json
property templateOptions
readonly templateOptions: ITemplateOptions;
Options for CloudFormation template (like version, transform, description).
property terminationProtection
readonly terminationProtection?: boolean;
Whether termination protection is enabled for this stack.
property urlSuffix
readonly urlSuffix: string;
The Amazon domain suffix for the region in which this stack is defined
method addDependency
addDependency: (target: Stack, reason?: string) => void;
Add a dependency between this stack and another stack.
This can be used to define dependencies between any two stacks within an app, and also supports nested stacks.
method addDockerImageAsset
addDockerImageAsset: (asset: DockerImageAssetSource) => DockerImageAssetLocation;
Register a docker image asset on this Stack
Deprecated
Use
stack.synthesizer.addDockerImageAsset()
if you are calling, and a differentIStackSynthesizer
class if you are implementing.
method addFileAsset
addFileAsset: (asset: FileAssetSource) => FileAssetLocation;
Register a file asset on this Stack
Deprecated
Use
stack.synthesizer.addFileAsset()
if you are calling, and a different IStackSynthesizer class if you are implementing.
method addTransform
addTransform: (transform: string) => void;
Add a Transform to this stack. A Transform is a macro that AWS CloudFormation uses to process your template.
Duplicate values are removed when stack is synthesized.
Parameter transform
The transform to add
Example 1
declare const stack: Stack;
stack.addTransform('AWS::Serverless-2016-10-31')
See Also
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/transform-section-structure.html
method allocateLogicalId
protected allocateLogicalId: (cfnElement: CfnElement) => string;
Returns the naming scheme used to allocate logical IDs. By default, uses the
HashedAddressingScheme
but this method can be overridden to customize this behavior.In order to make sure logical IDs are unique and stable, we hash the resource construct tree path (i.e. toplevel/secondlevel/.../myresource) and add it as a suffix to the path components joined without a separator (CloudFormation IDs only allow alphanumeric characters).
The result will be:
<path.join('')><md5(path.join('/')> "human" "hash"
If the "human" part of the ID exceeds 240 characters, we simply trim it so the total ID doesn't exceed CloudFormation's 255 character limit.
We only take 8 characters from the md5 hash (0.000005 chance of collision).
Special cases:
- If the path only contains a single component (i.e. it's a top-level resource), we won't add the hash to it. The hash is not needed for disamiguation and also, it allows for a more straightforward migration an existing CloudFormation template to a CDK stack without logical ID changes (or renames). - For aesthetic reasons, if the last components of the path are the same (i.e.
L1/L2/Pipeline/Pipeline
), they will be de-duplicated to make the resulting human portion of the ID more pleasing:L1L2Pipeline<HASH>
instead ofL1L2PipelinePipeline<HASH>
- If a component is named "Default" it will be omitted from the path. This allows refactoring higher level abstractions around constructs without affecting the IDs of already deployed resources. - If a component is named "Resource" it will be omitted from the user-visible path, but included in the hash. This reduces visual noise in the human readable part of the identifier.Parameter cfnElement
The element for which the logical ID is allocated.
method exportValue
exportValue: (exportedValue: any, options?: ExportValueOptions) => string;
Create a CloudFormation Export for a value
Returns a string representing the corresponding
Fn.importValue()
expression for this Export. You can control the name for the export by passing thename
option.If you don't supply a value for
name
, the value you're exporting must be a Resource attribute (for example:bucket.bucketName
) and it will be given the same name as the automatic cross-stack reference that would be created if you used the attribute in another Stack.One of the uses for this method is to *remove* the relationship between two Stacks established by automatic cross-stack references. It will temporarily ensure that the CloudFormation Export still exists while you remove the reference from the consuming stack. After that, you can remove the resource and the manual export.
## Example
Here is how the process works. Let's say there are two stacks,
producerStack
andconsumerStack
, andproducerStack
has a bucket calledbucket
, which is referenced byconsumerStack
(perhaps because an AWS Lambda Function writes into it, or something like that).It is not safe to remove
producerStack.bucket
because as the bucket is being deleted,consumerStack
might still be using it.Instead, the process takes two deployments:
### Deployment 1: break the relationship
- Make sure
consumerStack
no longer referencesbucket.bucketName
(maybe the consumer stack now uses its own bucket, or it writes to an AWS DynamoDB table, or maybe you just remove the Lambda Function altogether). - In theProducerStack
class, callthis.exportValue(this.bucket.bucketName)
. This will make sure the CloudFormation Export continues to exist while the relationship between the two stacks is being broken. - Deploy (this will effectively only change theconsumerStack
, but it's safe to deploy both).### Deployment 2: remove the bucket resource
- You are now free to remove the
bucket
resource fromproducerStack
. - Don't forget to remove theexportValue()
call as well. - Deploy again (this time only theproducerStack
will be changed -- the bucket will be deleted).
method formatArn
formatArn: (components: ArnComponents) => string;
Creates an ARN from components.
If
partition
,region
oraccount
are not specified, the stack's partition, region and account will be used.If any component is the empty string, an empty string will be inserted into the generated ARN at the location that component corresponds to.
The ARN will be formatted as follows:
arn:{partition}:{service}:{region}:{account}:{resource}{sep}}{resource-name}
The required ARN pieces that are omitted will be taken from the stack that the 'scope' is attached to. If all ARN pieces are supplied, the supplied scope can be 'undefined'.
method getLogicalId
getLogicalId: (element: CfnElement) => string;
Allocates a stack-unique CloudFormation-compatible logical identity for a specific resource.
This method is called when a
CfnElement
is created and used to render the initial logical identity of resources. Logical ID renames are applied at this stage.This method uses the protected method
allocateLogicalId
to render the logical ID for an element. To modify the naming scheme, extend theStack
class and override this method.Parameter element
The CloudFormation element for which a logical identity is needed.
method isStack
static isStack: (x: any) => x is Stack;
Return whether the given object is a Stack.
We do attribute detection since we can't reliably use 'instanceof'.
method of
static of: (construct: IConstruct) => Stack;
Looks up the first stack scope in which
construct
is defined. Fails if there is no stack up the tree.Parameter construct
The construct to start the search from.
method parseArn
parseArn: (arn: string, sepIfToken?: string, hasName?: boolean) => ArnComponents;
Given an ARN, parses it and returns components.
IF THE ARN IS A CONCRETE STRING...
...it will be parsed and validated. The separator (
sep
) will be set to '/' if the 6th component includes a '/', in which case,resource
will be set to the value before the '/' andresourceName
will be the rest. In case there is no '/',resource
will be set to the 6th components andresourceName
will be set to the rest of the string.IF THE ARN IS A TOKEN...
...it cannot be validated, since we don't have the actual value yet at the time of this function call. You will have to supply
sepIfToken
and whether or not ARNs of the expected format usually have resource names in order to parse it properly. The resultingArnComponents
object will contain tokens for the subexpressions of the ARN, not string literals.If the resource name could possibly contain the separator char, the actual resource name cannot be properly parsed. This only occurs if the separator char is '/', and happens for example for S3 object ARNs, IAM Role ARNs, IAM OIDC Provider ARNs, etc. To properly extract the resource name from a Tokenized ARN, you must know the resource type and call
Arn.extractResourceName
.Parameter arn
The ARN string to parse
Parameter sepIfToken
The separator used to separate resource from resourceName
Parameter hasName
Whether there is a name component in the ARN at all. For example, SNS Topics ARNs have the 'resource' component contain the topic name, and no 'resourceName' component.
Returns
an ArnComponents object which allows access to the various components of the ARN.
Deprecated
use splitArn instead
method prepareCrossReference
protected prepareCrossReference: ( _sourceStack: Stack, reference: Reference) => IResolvable;
Deprecated.
Returns
reference itself without any change
See Also
https://github.com/aws/aws-cdk/pull/7187
Deprecated
cross reference handling has been moved to
App.prepare()
.
method regionalFact
regionalFact: (factName: string, defaultValue?: string) => string;
Look up a fact value for the given fact for the region of this stack
Will return a definite value only if the region of the current stack is resolved. If not, a lookup map will be added to the stack and the lookup will be done at CDK deployment time.
What regions will be included in the lookup map is controlled by the
@aws-cdk/core:target-partitions
context value: it must be set to a list of partitions, and only regions from the given partitions will be included. If no such context key is set, all regions will be included.This function is intended to be used by construct library authors. Application builders can rely on the abstractions offered by construct libraries and do not have to worry about regional facts.
If
defaultValue
is not given, it is an error if the fact is unknown for the given region.
method renameLogicalId
renameLogicalId: (oldId: string, newId: string) => void;
Rename a generated logical identities
To modify the naming scheme strategy, extend the
Stack
class and override theallocateLogicalId
method.
method reportMissingContext
reportMissingContext: (report: cxapi.MissingContext) => void;
DEPRECATED
Deprecated
use
reportMissingContextKey()
method reportMissingContextKey
reportMissingContextKey: (report: cxschema.MissingContext) => void;
Indicate that a context key was expected
Contains instructions which will be emitted into the cloud assembly on how the key should be supplied.
Parameter report
The set of parameters needed to obtain the context
method resolve
resolve: (obj: any) => any;
Resolve a tokenized value in the context of the current stack.
method splitArn
splitArn: (arn: string, arnFormat: ArnFormat) => ArnComponents;
Splits the provided ARN into its components. Works both if 'arn' is a string like 'arn:aws:s3:::bucket', and a Token representing a dynamic CloudFormation expression (in which case the returned components will also be dynamic CloudFormation expressions, encoded as Tokens).
Parameter arn
the ARN to split into its components
Parameter arnFormat
the expected format of 'arn' - depends on what format the service 'arn' represents uses
method toJsonString
toJsonString: (obj: any, space?: number) => string;
Convert an object, potentially containing tokens, to a JSON string
class StackSynthesizer
abstract class StackSynthesizer implements IStackSynthesizer {}
Base class for implementing an IStackSynthesizer
This class needs to exist to provide public surface area for external implementations of stack synthesizers. The protected methods give access to functions that are otherwise @_internal to the framework and could not be accessed by external implementors.
method addDockerImageAsset
abstract addDockerImageAsset: ( asset: DockerImageAssetSource) => DockerImageAssetLocation;
Register a Docker Image Asset
Returns the parameters that can be used to refer to the asset inside the template.
method addFileAsset
abstract addFileAsset: (asset: FileAssetSource) => FileAssetLocation;
Register a File Asset
Returns the parameters that can be used to refer to the asset inside the template.
method bind
abstract bind: (stack: Stack) => void;
Bind to the stack this environment is going to be used on
Must be called before any of the other methods are called.
method emitStackArtifact
protected emitStackArtifact: ( stack: Stack, session: ISynthesisSession, options?: SynthesizeStackArtifactOptions) => void;
Write the stack artifact to the session
Use default settings to add a CloudFormationStackArtifact artifact to the given synthesis session.
method synthesize
abstract synthesize: (session: ISynthesisSession) => void;
Synthesize the associated stack to the session
method synthesizeStackTemplate
protected synthesizeStackTemplate: ( stack: Stack, session: ISynthesisSession) => void;
Have the stack write out its template
class Stage
class Stage extends CoreConstruct {}
An abstract application modeling unit consisting of Stacks that should be deployed together.
Derive a subclass of
Stage
and use it to model a single instance of your application.You can then instantiate your subclass multiple times to model multiple copies of your application which should be be deployed to different environments.
constructor
constructor(scope: Construct, id: string, props?: StageProps);
property account
readonly account?: string;
The default account for all resources defined within this stage.
property artifactId
readonly artifactId: string;
Artifact ID of the assembly if it is a nested stage. The root stage (app) will return an empty string.
Derived from the construct path.
property assetOutdir
readonly assetOutdir: string;
The cloud assembly asset output directory.
property outdir
readonly outdir: string;
The cloud assembly output directory.
property parentStage
readonly parentStage?: Stage;
The parent stage or
undefined
if this is the app. *
property region
readonly region?: string;
The default region for all resources defined within this stage.
property stageName
readonly stageName: string;
The name of the stage. Based on names of the parent stages separated by hypens.
method isStage
static isStage: (x: any) => x is Stage;
Test whether the given construct is a stage.
method of
static of: (construct: IConstruct) => Stage | undefined;
Return the stage this construct is contained with, if available. If called on a nested stage, returns its parent.
method synth
synth: (options?: StageSynthesisOptions) => cxapi.CloudAssembly;
Synthesize this stage into a cloud assembly.
Once an assembly has been synthesized, it cannot be modified. Subsequent calls will return the same assembly.
class StringConcat
class StringConcat implements IFragmentConcatenator {}
Converts all fragments to strings and concats those
Drops 'undefined's.
method join
join: (left: any | undefined, right: any | undefined) => any;
class Tag
class Tag extends TagBase {}
The Tag Aspect will handle adding a tag to this node and cascading tags to children
constructor
constructor(key: string, value: string, props?: TagProps);
property value
readonly value: string;
The string value of the tag
method add
static add: ( scope: Construct, key: string, value: string, props?: TagProps) => void;
DEPRECATED: add tags to the node of a construct and all its the taggable children
Deprecated
use
Tags.of(scope).add()
method applyTag
protected applyTag: (resource: ITaggable) => void;
method remove
static remove: (scope: Construct, key: string, props?: TagProps) => void;
DEPRECATED: remove tags to the node of a construct and all its the taggable children
Deprecated
use
Tags.of(scope).remove()
class TagManager
class TagManager {}
TagManager facilitates a common implementation of tagging for Constructs
Normally, you do not need to use this class, as the CloudFormation specification will indicate which resources are taggable. However, sometimes you will need this to make custom resources taggable. Used
tagManager.renderedTags
to obtain a value that will resolve to the tags at synthesis time.Example 1
import * as cdk from '@aws-cdk/core';
class MyConstruct extends cdk.Resource implements cdk.ITaggable { public readonly tags = new cdk.TagManager(cdk.TagType.KEY_VALUE, 'Whatever::The::Type');
constructor(scope: cdk.Construct, id: string) { super(scope, id);
new cdk.CfnResource(this, 'Resource', { type: 'Whatever::The::Type', properties: { // ... Tags: this.tags.renderedTags, }, }); } }
constructor
constructor( tagType: TagType, resourceTypeName: string, tagStructure?: any, options?: TagManagerOptions);
property renderedTags
readonly renderedTags: IResolvable;
A lazy value that represents the rendered tags at synthesis time
If you need to make a custom construct taggable, use the value of this property to pass to the
tags
property of the underlying construct.
property tagPropertyName
readonly tagPropertyName: string;
The property name for tag values
Normally this is
tags
but some resources choose a different name. Cognito UserPool uses UserPoolTags
method applyTagAspectHere
applyTagAspectHere: (include?: string[], exclude?: string[]) => boolean;
Determine if the aspect applies here
Looks at the include and exclude resourceTypeName arrays to determine if the aspect applies here
method hasTags
hasTags: () => boolean;
Returns true if there are any tags defined
method isTaggable
static isTaggable: (construct: any) => construct is ITaggable;
Check whether the given construct is Taggable
method removeTag
removeTag: (key: string, priority: number) => void;
Removes the specified tag from the array if it exists
Parameter key
The tag to remove
Parameter priority
The priority of the remove operation
method renderTags
renderTags: () => any;
Renders tags into the proper format based on TagType
This method will eagerly render the tags currently applied. In most cases, you should be using
tagManager.renderedTags
instead, which will return aLazy
value that will resolve to the correct tags at synthesis time.
method setTag
setTag: ( key: string, value: string, priority?: number, applyToLaunchedInstances?: boolean) => void;
Adds the specified tag to the array of tags
method tagValues
tagValues: () => Record<string, string>;
Render the tags in a readable format
class Tags
class Tags {}
Manages AWS tags for all resources within a construct scope.
method add
add: (key: string, value: string, props?: TagProps) => void;
add tags to the node of a construct and all its the taggable children
method of
static of: (scope: IConstruct) => Tags;
Returns the tags API for this scope.
Parameter scope
The scope
method remove
remove: (key: string, props?: TagProps) => void;
remove tags to the node of a construct and all its the taggable children
class Token
class Token {}
Represents a special or lazily-evaluated value.
Can be used to delay evaluation of a certain value in case, for example, that it requires some context or late-bound data. Can also be used to mark values that need special processing at document rendering time.
Tokens can be embedded into strings while retaining their original semantics.
method asAny
static asAny: (value: any) => IResolvable;
Return a resolvable representation of the given value
method asList
static asList: (value: any, options?: EncodingOptions) => string[];
Return a reversible list representation of this token
method asNumber
static asNumber: (value: any) => number;
Return a reversible number representation of this token
method asString
static asString: (value: any, options?: EncodingOptions) => string;
Return a reversible string representation of this token
If the Token is initialized with a literal, the stringified value of the literal is returned. Otherwise, a special quoted string representation of the Token is returned that can be embedded into other strings.
Strings with quoted Tokens in them can be restored back into complex values with the Tokens restored by calling
resolve()
on the string.
method compareStrings
static compareStrings: ( possibleToken1: string, possibleToken2: string) => TokenComparison;
Compare two strings that might contain Tokens with each other.
method isUnresolved
static isUnresolved: (obj: any) => boolean;
Returns true if obj represents an unresolved value
One of these must be true:
-
obj
is an IResolvable -obj
is a string containing at least one encodedIResolvable
-obj
is either an encoded number or listThis does NOT recurse into lists or objects to see if they containing resolvables.
Parameter obj
The object to test.
class TokenComparison
class TokenComparison {}
An enum-like class that represents the result of comparing two Tokens. The return type of Token.compareStrings.
property BOTH_UNRESOLVED
static readonly BOTH_UNRESOLVED: TokenComparison;
This means both components are Tokens.
property DIFFERENT
static readonly DIFFERENT: TokenComparison;
This means we're certain the two components are NOT Tokens, and different.
property ONE_UNRESOLVED
static readonly ONE_UNRESOLVED: TokenComparison;
This means exactly one of the components is a Token.
property SAME
static readonly SAME: TokenComparison;
This means we're certain the two components are NOT Tokens, and identical.
class Tokenization
class Tokenization {}
Less oft-needed functions to manipulate Tokens
method isResolvable
static isResolvable: (obj: any) => obj is IResolvable;
Return whether the given object is an IResolvable object
This is different from Token.isUnresolved() which will also check for encoded Tokens, whereas this method will only do a type check on the given object.
method resolve
static resolve: (obj: any, options: ResolveOptions) => any;
Resolves an object by evaluating all tokens and removing any undefined or empty objects or arrays. Values can only be primitives, arrays or tokens. Other objects (i.e. with methods) will be rejected.
Parameter obj
The object to resolve.
Parameter options
Prefix key path components for diagnostics.
method reverse
static reverse: (x: any, options?: ReverseOptions) => IResolvable | undefined;
Reverse any value into a Resolvable, if possible
In case of a string, the string must not be a concatenation.
method reverseCompleteString
static reverseCompleteString: (s: string) => IResolvable | undefined;
Un-encode a string which is either a complete encoded token, or doesn't contain tokens at all
It's illegal for the string to be a concatenation of an encoded token and something else.
method reverseList
static reverseList: (l: string[]) => IResolvable | undefined;
Un-encode a Tokenized value from a list
method reverseNumber
static reverseNumber: (n: number) => IResolvable | undefined;
Un-encode a Tokenized value from a number
method reverseString
static reverseString: (s: string) => TokenizedStringFragments;
Un-encode a string potentially containing encoded tokens
method stringifyNumber
static stringifyNumber: (x: number) => string;
Stringify a number directly or lazily if it's a Token. If it is an object (i.e., { Ref: 'SomeLogicalId' }), return it as-is.
class TokenizedStringFragments
class TokenizedStringFragments {}
Fragments of a concatenated string containing stringified Tokens
property firstToken
readonly firstToken: IResolvable;
property firstValue
readonly firstValue: any;
property length
readonly length: number;
property tokens
readonly tokens: IResolvable[];
Return all Tokens from this string
method addIntrinsic
addIntrinsic: (value: any) => void;
method addLiteral
addLiteral: (lit: any) => void;
method addToken
addToken: (token: IResolvable) => void;
method join
join: (concat: IFragmentConcatenator) => any;
Combine the string fragments using the given joiner.
If there are any
method mapTokens
mapTokens: (mapper: ITokenMapper) => TokenizedStringFragments;
Apply a transformation function to all tokens in the string
class TreeInspector
class TreeInspector {}
Inspector that maintains an attribute bag
property attributes
readonly attributes: { [key: string]: any };
Represents the bag of attributes as key-value pairs.
method addAttribute
addAttribute: (key: string, value: any) => void;
Adds attribute to bag. Keys should be added by convention to prevent conflicts i.e. L1 constructs will contain attributes with keys prefixed with aws:cdk:cloudformation
Parameter key
key for metadata
Parameter value
value of metadata.
class ValidationResult
class ValidationResult {}
Representation of validation results
Models a tree of validation errors so that we have as much information as possible about the failure that occurred.
constructor
constructor(errorMessage?: string, results?: ValidationResults);
property errorMessage
readonly errorMessage: string;
property isSuccess
readonly isSuccess: boolean;
property results
readonly results: ValidationResults;
method assertSuccess
assertSuccess: () => void;
Turn a failed validation into an exception
method errorTree
errorTree: () => string;
Return a string rendering of the tree of validation failures
method prefix
prefix: (message: string) => ValidationResult;
Wrap this result with an error message, if it concerns an error
class ValidationResults
class ValidationResults {}
A collection of validation results
constructor
constructor(results?: ValidationResult[]);
property isSuccess
readonly isSuccess: boolean;
property results
results: ValidationResult[];
method collect
collect: (result: ValidationResult) => void;
method errorTreeList
errorTreeList: () => string;
method wrap
wrap: (message: string) => ValidationResult;
Wrap up all validation results into a single tree node
If there are failures in the collection, add a message, otherwise return a success.
Interfaces
interface AppProps
interface AppProps {}
Initialization props for apps.
property analyticsReporting
readonly analyticsReporting?: boolean;
Include runtime versioning information in the Stacks of this app
Value of 'aws:cdk:version-reporting' context key
property autoSynth
readonly autoSynth?: boolean;
Automatically call
synth()
before the program exits.If you set this, you don't have to call
synth()
explicitly. Note that this feature is only available for certain programming languages, and callingsynth()
is still recommended.true if running via CDK CLI (
CDK_OUTDIR
is set),false
otherwise
property context
readonly context?: { [key: string]: any;};
Additional context values for the application.
Context set by the CLI or the
context
key incdk.json
has precedence.Context can be read from any construct using
node.getContext(key)
.- no additional context
property outdir
readonly outdir?: string;
The output directory into which to emit synthesized artifacts.
You should never need to set this value. By default, the value you pass to the CLI's
--output
flag will be used, and if you change it to a different directory the CLI will fail to pick up the generated Cloud Assembly.This property is intended for internal and testing use.
- If this value is _not_ set, considers the environment variable
CDK_OUTDIR
. IfCDK_OUTDIR
is not defined, uses a temp directory.
property runtimeInfo
readonly runtimeInfo?: boolean;
Include runtime versioning information in the Stacks of this app
Deprecated
use
versionReporting
instead Value of 'aws:cdk:version-reporting' context key
property stackTraces
readonly stackTraces?: boolean;
Include construct creation stack trace in the
aws:cdk:trace
metadata key of all constructs. true stack traces are included unlessaws:cdk:disable-stack-trace
is set in the context.
property treeMetadata
readonly treeMetadata?: boolean;
Include construct tree metadata as part of the Cloud Assembly.
true
interface ArnComponents
interface ArnComponents {}
property account
readonly account?: string;
The ID of the AWS account that owns the resource, without the hyphens. For example, 123456789012. Note that the ARNs for some resources don't require an account number, so this component might be omitted.
The account the stack is deployed to.
property arnFormat
readonly arnFormat?: ArnFormat;
The specific ARN format to use for this ARN value.
- uses value of
sep
as the separator for formatting,ArnFormat.SLASH_RESOURCE_NAME
if that property was also not provided
property partition
readonly partition?: string;
The partition that the resource is in. For standard AWS regions, the partition is aws. If you have resources in other partitions, the partition is aws-partitionname. For example, the partition for resources in the China (Beijing) region is aws-cn.
The AWS partition the stack is deployed to.
property region
readonly region?: string;
The region the resource resides in. Note that the ARNs for some resources do not require a region, so this component might be omitted.
The region the stack is deployed to.
property resource
readonly resource: string;
Resource type (e.g. "table", "autoScalingGroup", "certificate"). For some resource types, e.g. S3 buckets, this field defines the bucket name.
property resourceName
readonly resourceName?: string;
Resource name or path within the resource (i.e. S3 bucket object key) or a wildcard such as ``"*"``. This is service-dependent.
property sep
readonly sep?: string;
Separator between resource type and the resource.
Can be either '/', ':' or an empty string. Will only be used if resourceName is defined. '/'
Deprecated
use arnFormat instead
property service
readonly service: string;
The service namespace that identifies the AWS product (for example, 's3', 'iam', 'codepipline').
interface AssetOptions
interface AssetOptions {}
Asset hash options
property assetHash
readonly assetHash?: string;
Specify a custom hash for this asset. If
assetHashType
is set it must be set toAssetHashType.CUSTOM
. For consistency, this custom hash will be SHA256 hashed and encoded as hex. The resulting hash will be the asset hash.NOTE: the hash is used in order to identify a specific revision of the asset, and used for optimizing and caching deployment activities related to this asset such as packaging, uploading to Amazon S3, etc. If you chose to customize the hash, you will need to make sure it is updated every time the asset changes, or otherwise it is possible that some deployments will not be invalidated.
- based on
assetHashType
property assetHashType
readonly assetHashType?: AssetHashType;
Specifies the type of hash to calculate for this asset.
If
assetHash
is configured, this option must beundefined
orAssetHashType.CUSTOM
.- the default is
AssetHashType.SOURCE
, but ifassetHash
is explicitly specified this value defaults toAssetHashType.CUSTOM
.
property bundling
readonly bundling?: BundlingOptions;
Bundle the asset by executing a command in a Docker container or a custom bundling provider.
The asset path will be mounted at
/asset-input
. The Docker container is responsible for putting content at/asset-output
. The content at/asset-output
will be zipped and used as the final asset.- uploaded as-is to S3 if the asset is a regular file or a .zip file, archived into a .zip file and uploaded to S3 otherwise
interface AssetStagingProps
interface AssetStagingProps extends FingerprintOptions, AssetOptions {}
Initialization properties for
AssetStaging
.
property sourcePath
readonly sourcePath: string;
The source file or directory to copy from.
interface BootstraplessSynthesizerProps
interface BootstraplessSynthesizerProps {}
Construction properties of BootstraplessSynthesizer.
property cloudFormationExecutionRoleArn
readonly cloudFormationExecutionRoleArn?: string;
The CFN execution Role ARN to use.
- No CloudFormation role (use CLI credentials)
property deployRoleArn
readonly deployRoleArn?: string;
The deploy Role ARN to use.
- No deploy role (use CLI credentials)
interface BundlingOptions
interface BundlingOptions {}
Bundling options
property command
readonly command?: string[];
The command to run in the Docker container.
Example value:
['npm', 'install']
See Also
https://docs.docker.com/engine/reference/run/
- run the command defined in the image
property entrypoint
readonly entrypoint?: string[];
The entrypoint to run in the Docker container.
Example value:
['/bin/sh', '-c']
See Also
https://docs.docker.com/engine/reference/builder/#entrypoint
- run the entrypoint defined in the image
property environment
readonly environment?: { [key: string]: string;};
The environment variables to pass to the Docker container.
- no environment variables.
property image
readonly image: DockerImage;
The Docker image where the command will run.
property local
readonly local?: ILocalBundling;
Local bundling provider.
The provider implements a method
tryBundle()
which should returntrue
if local bundling was performed. Iffalse
is returned, docker bundling will be done.- bundling will only be performed in a Docker container
property outputType
readonly outputType?: BundlingOutput;
The type of output that this bundling operation is producing.
BundlingOutput.AUTO_DISCOVER
property securityOpt
readonly securityOpt?: string;
[Security configuration](https://docs.docker.com/engine/reference/run/#security-configuration) when running the docker container.
- no security options
property user
readonly user?: string;
The user to use when running the Docker container.
user | user:group | uid | uid:gid | user:gid | uid:group
See Also
https://docs.docker.com/engine/reference/run/#user
- uid:gid of the current user or 1000:1000 on Windows
property volumes
readonly volumes?: DockerVolume[];
Additional Docker volumes to mount.
- no additional volumes are mounted
property workingDirectory
readonly workingDirectory?: string;
Working directory inside the Docker container.
/asset-input
interface CfnAutoScalingReplacingUpdate
interface CfnAutoScalingReplacingUpdate {}
Specifies whether an Auto Scaling group and the instances it contains are replaced during an update. During replacement, AWS CloudFormation retains the old group until it finishes creating the new one. If the update fails, AWS CloudFormation can roll back to the old Auto Scaling group and delete the new Auto Scaling group.
While AWS CloudFormation creates the new group, it doesn't detach or attach any instances. After successfully creating the new Auto Scaling group, AWS CloudFormation deletes the old Auto Scaling group during the cleanup process.
When you set the WillReplace parameter, remember to specify a matching CreationPolicy. If the minimum number of instances (specified by the MinSuccessfulInstancesPercent property) don't signal success within the Timeout period (specified in the CreationPolicy policy), the replacement update fails and AWS CloudFormation rolls back to the old Auto Scaling group.
property willReplace
readonly willReplace?: boolean;
interface CfnAutoScalingRollingUpdate
interface CfnAutoScalingRollingUpdate {}
To specify how AWS CloudFormation handles rolling updates for an Auto Scaling group, use the AutoScalingRollingUpdate policy. Rolling updates enable you to specify whether AWS CloudFormation updates instances that are in an Auto Scaling group in batches or all at once.
property maxBatchSize
readonly maxBatchSize?: number;
Specifies the maximum number of instances that AWS CloudFormation updates.
property minInstancesInService
readonly minInstancesInService?: number;
Specifies the minimum number of instances that must be in service within the Auto Scaling group while AWS CloudFormation updates old instances.
property minSuccessfulInstancesPercent
readonly minSuccessfulInstancesPercent?: number;
Specifies the percentage of instances in an Auto Scaling rolling update that must signal success for an update to succeed. You can specify a value from 0 to 100. AWS CloudFormation rounds to the nearest tenth of a percent. For example, if you update five instances with a minimum successful percentage of 50, three instances must signal success.
If an instance doesn't send a signal within the time specified in the PauseTime property, AWS CloudFormation assumes that the instance wasn't updated.
If you specify this property, you must also enable the WaitOnResourceSignals and PauseTime properties.
property pauseTime
readonly pauseTime?: string;
The amount of time that AWS CloudFormation pauses after making a change to a batch of instances to give those instances time to start software applications. For example, you might need to specify PauseTime when scaling up the number of instances in an Auto Scaling group.
If you enable the WaitOnResourceSignals property, PauseTime is the amount of time that AWS CloudFormation should wait for the Auto Scaling group to receive the required number of valid signals from added or replaced instances. If the PauseTime is exceeded before the Auto Scaling group receives the required number of signals, the update fails. For best results, specify a time period that gives your applications sufficient time to get started. If the update needs to be rolled back, a short PauseTime can cause the rollback to fail.
Specify PauseTime in the ISO8601 duration format (in the format PT#H#M#S, where each # is the number of hours, minutes, and seconds, respectively). The maximum PauseTime is one hour (PT1H).
property suspendProcesses
readonly suspendProcesses?: string[];
Specifies the Auto Scaling processes to suspend during a stack update. Suspending processes prevents Auto Scaling from interfering with a stack update. For example, you can suspend alarming so that Auto Scaling doesn't execute scaling policies associated with an alarm. For valid values, see the ScalingProcesses.member.N parameter for the SuspendProcesses action in the Auto Scaling API Reference.
property waitOnResourceSignals
readonly waitOnResourceSignals?: boolean;
Specifies whether the Auto Scaling group waits on signals from new instances during an update. Use this property to ensure that instances have completed installing and configuring applications before the Auto Scaling group update proceeds. AWS CloudFormation suspends the update of an Auto Scaling group after new EC2 instances are launched into the group. AWS CloudFormation must receive a signal from each new instance within the specified PauseTime before continuing the update. To signal the Auto Scaling group, use the cfn-signal helper script or SignalResource API.
To have instances wait for an Elastic Load Balancing health check before they signal success, add a health-check verification by using the cfn-init helper script. For an example, see the verify_instance_health command in the Auto Scaling rolling updates sample template.
interface CfnAutoScalingScheduledAction
interface CfnAutoScalingScheduledAction {}
With scheduled actions, the group size properties of an Auto Scaling group can change at any time. When you update a stack with an Auto Scaling group and scheduled action, AWS CloudFormation always sets the group size property values of your Auto Scaling group to the values that are defined in the AWS::AutoScaling::AutoScalingGroup resource of your template, even if a scheduled action is in effect.
If you do not want AWS CloudFormation to change any of the group size property values when you have a scheduled action in effect, use the AutoScalingScheduledAction update policy to prevent AWS CloudFormation from changing the MinSize, MaxSize, or DesiredCapacity properties unless you have modified these values in your template.\
property ignoreUnmodifiedGroupSizeProperties
readonly ignoreUnmodifiedGroupSizeProperties?: boolean;
interface CfnCodeDeployBlueGreenAdditionalOptions
interface CfnCodeDeployBlueGreenAdditionalOptions {}
Additional options for the blue/green deployment. The type of the CfnCodeDeployBlueGreenHookProps.additionalOptions property.
property terminationWaitTimeInMinutes
readonly terminationWaitTimeInMinutes?: number;
Specifies time to wait, in minutes, before terminating the blue resources.
- 5 minutes
interface CfnCodeDeployBlueGreenApplication
interface CfnCodeDeployBlueGreenApplication {}
The application actually being deployed. Type of the CfnCodeDeployBlueGreenHookProps.applications property.
property ecsAttributes
readonly ecsAttributes: CfnCodeDeployBlueGreenEcsAttributes;
The detailed attributes of the deployed target.
property target
readonly target: CfnCodeDeployBlueGreenApplicationTarget;
The target that is being deployed.
interface CfnCodeDeployBlueGreenApplicationTarget
interface CfnCodeDeployBlueGreenApplicationTarget {}
Type of the CfnCodeDeployBlueGreenApplication.target property.
interface CfnCodeDeployBlueGreenEcsAttributes
interface CfnCodeDeployBlueGreenEcsAttributes {}
The attributes of the ECS Service being deployed. Type of the CfnCodeDeployBlueGreenApplication.ecsAttributes property.
property taskDefinitions
readonly taskDefinitions: string[];
The logical IDs of the blue and green, respectively, AWS::ECS::TaskDefinition task definitions.
property taskSets
readonly taskSets: string[];
The logical IDs of the blue and green, respectively, AWS::ECS::TaskSet task sets.
property trafficRouting
readonly trafficRouting: CfnTrafficRouting;
The traffic routing configuration.
interface CfnCodeDeployBlueGreenHookProps
interface CfnCodeDeployBlueGreenHookProps {}
Construction properties of CfnCodeDeployBlueGreenHook.
property additionalOptions
readonly additionalOptions?: CfnCodeDeployBlueGreenAdditionalOptions;
Additional options for the blue/green deployment.
- no additional options
property applications
readonly applications: CfnCodeDeployBlueGreenApplication[];
Properties of the Amazon ECS applications being deployed.
property lifecycleEventHooks
readonly lifecycleEventHooks?: CfnCodeDeployBlueGreenLifecycleEventHooks;
Use lifecycle event hooks to specify a Lambda function that CodeDeploy can call to validate a deployment. You can use the same function or a different one for deployment lifecycle events. Following completion of the validation tests, the Lambda CfnCodeDeployBlueGreenLifecycleEventHooks.afterAllowTraffic function calls back CodeDeploy and delivers a result of 'Succeeded' or 'Failed'.
- no lifecycle event hooks
property serviceRole
readonly serviceRole: string;
The IAM Role for CloudFormation to use to perform blue-green deployments.
property trafficRoutingConfig
readonly trafficRoutingConfig?: CfnTrafficRoutingConfig;
Traffic routing configuration settings.
- time-based canary traffic shifting, with a 15% step percentage and a five minute bake time
interface CfnCodeDeployBlueGreenLifecycleEventHooks
interface CfnCodeDeployBlueGreenLifecycleEventHooks {}
Lifecycle events for blue-green deployments. The type of the CfnCodeDeployBlueGreenHookProps.lifecycleEventHooks property.
property afterAllowTestTraffic
readonly afterAllowTestTraffic?: string;
Function to use to run tasks after the test listener serves traffic to the replacement task set.
- none
property afterAllowTraffic
readonly afterAllowTraffic?: string;
Function to use to run tasks after the second target group serves traffic to the replacement task set.
- none
property afterInstall
readonly afterInstall?: string;
Function to use to run tasks after the replacement task set is created and one of the target groups is associated with it.
- none
property beforeAllowTraffic
readonly beforeAllowTraffic?: string;
Function to use to run tasks after the second target group is associated with the replacement task set, but before traffic is shifted to the replacement task set.
- none
property beforeInstall
readonly beforeInstall?: string;
Function to use to run tasks before the replacement task set is created.
- none
interface CfnCodeDeployLambdaAliasUpdate
interface CfnCodeDeployLambdaAliasUpdate {}
To perform an AWS CodeDeploy deployment when the version changes on an AWS::Lambda::Alias resource, use the CodeDeployLambdaAliasUpdate update policy.
property afterAllowTrafficHook
readonly afterAllowTrafficHook?: string;
The name of the Lambda function to run after traffic routing completes.
property applicationName
readonly applicationName: string;
The name of the AWS CodeDeploy application.
property beforeAllowTrafficHook
readonly beforeAllowTrafficHook?: string;
The name of the Lambda function to run before traffic routing starts.
property deploymentGroupName
readonly deploymentGroupName: string;
The name of the AWS CodeDeploy deployment group. This is where the traffic-shifting policy is set.
interface CfnConditionProps
interface CfnConditionProps {}
property expression
readonly expression?: ICfnConditionExpression;
The expression that the condition will evaluate.
- None.
interface CfnCreationPolicy
interface CfnCreationPolicy {}
Associate the CreationPolicy attribute with a resource to prevent its status from reaching create complete until AWS CloudFormation receives a specified number of success signals or the timeout period is exceeded. To signal a resource, you can use the cfn-signal helper script or SignalResource API. AWS CloudFormation publishes valid signals to the stack events so that you track the number of signals sent.
The creation policy is invoked only when AWS CloudFormation creates the associated resource. Currently, the only AWS CloudFormation resources that support creation policies are AWS::AutoScaling::AutoScalingGroup, AWS::EC2::Instance, and AWS::CloudFormation::WaitCondition.
Use the CreationPolicy attribute when you want to wait on resource configuration actions before stack creation proceeds. For example, if you install and configure software applications on an EC2 instance, you might want those applications to be running before proceeding. In such cases, you can add a CreationPolicy attribute to the instance, and then send a success signal to the instance after the applications are installed and configured. For a detailed example, see Deploying Applications on Amazon EC2 with AWS CloudFormation.
property autoScalingCreationPolicy
readonly autoScalingCreationPolicy?: CfnResourceAutoScalingCreationPolicy;
For an Auto Scaling group replacement update, specifies how many instances must signal success for the update to succeed.
property resourceSignal
readonly resourceSignal?: CfnResourceSignal;
When AWS CloudFormation creates the associated resource, configures the number of required success signals and the length of time that AWS CloudFormation waits for those signals.
interface CfnCustomResourceProps
interface CfnCustomResourceProps {}
Properties for defining a
CfnCustomResource
external
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cfn-customresource.html
property serviceToken
readonly serviceToken: string;
> Only one property is defined by AWS for a custom resource:
ServiceToken
. All other properties are defined by the service provider.The service token that was given to the template developer by the service provider to access the service, such as an Amazon SNS topic ARN or Lambda function ARN. The service token must be from the same Region in which you are creating the stack.
Updates aren't supported.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cfn-customresource.html#cfn-customresource-servicetoken
interface CfnDynamicReferenceProps
interface CfnDynamicReferenceProps {}
Properties for a Dynamic Reference
property referenceKey
readonly referenceKey: string;
The reference key of the dynamic reference
property service
readonly service: CfnDynamicReferenceService;
The service to retrieve the dynamic reference from
interface CfnHookDefaultVersionProps
interface CfnHookDefaultVersionProps {}
Properties for defining a
CfnHookDefaultVersion
external
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-hookdefaultversion.html
property typeName
readonly typeName?: string;
The name of the hook.
You must specify either
TypeVersionArn
, orTypeName
andVersionId
.http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-hookdefaultversion.html#cfn-cloudformation-hookdefaultversion-typename
property typeVersionArn
readonly typeVersionArn?: string;
The version ID of the type configuration.
You must specify either
TypeVersionArn
, orTypeName
andVersionId
.http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-hookdefaultversion.html#cfn-cloudformation-hookdefaultversion-typeversionarn
property versionId
readonly versionId?: string;
The version ID of the type specified.
You must specify either
TypeVersionArn
, orTypeName
andVersionId
.http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-hookdefaultversion.html#cfn-cloudformation-hookdefaultversion-versionid
interface CfnHookProps
interface CfnHookProps {}
Construction properties of CfnHook.
property properties
readonly properties?: { [name: string]: any;};
The properties of the hook.
- no properties
property type
readonly type: string;
The type of the hook (for example, "AWS::CodeDeploy::BlueGreen").
interface CfnHookTypeConfigProps
interface CfnHookTypeConfigProps {}
Properties for defining a
CfnHookTypeConfig
external
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-hooktypeconfig.html
property configuration
readonly configuration: string;
Specifies the activated hook type configuration, in this AWS account and AWS Region .
You must specify either
TypeName
andConfiguration
orTypeARN
andConfiguration
.http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-hooktypeconfig.html#cfn-cloudformation-hooktypeconfig-configuration
property configurationAlias
readonly configurationAlias?: string;
Specifies the activated hook type configuration, in this AWS account and AWS Region .
Defaults to
default
alias. Hook types currently support default configuration alias.http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-hooktypeconfig.html#cfn-cloudformation-hooktypeconfig-configurationalias
property typeArn
readonly typeArn?: string;
The Amazon Resource Number (ARN) for the hook to set
Configuration
for.You must specify either
TypeName
andConfiguration
orTypeARN
andConfiguration
.http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-hooktypeconfig.html#cfn-cloudformation-hooktypeconfig-typearn
property typeName
readonly typeName?: string;
The unique name for your hook. Specifies a three-part namespace for your hook, with a recommended pattern of
Organization::Service::Hook
.You must specify either
TypeName
andConfiguration
orTypeARN
andConfiguration
.http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-hooktypeconfig.html#cfn-cloudformation-hooktypeconfig-typename
interface CfnHookVersionProps
interface CfnHookVersionProps {}
Properties for defining a
CfnHookVersion
external
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-hookversion.html
property executionRoleArn
readonly executionRoleArn?: string;
The Amazon Resource Name (ARN) of the task execution role that grants the hook permission.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-hookversion.html#cfn-cloudformation-hookversion-executionrolearn
property loggingConfig
readonly loggingConfig?: CfnHookVersion.LoggingConfigProperty | cdk.IResolvable;
Contains logging configuration information for an extension.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-hookversion.html#cfn-cloudformation-hookversion-loggingconfig
property schemaHandlerPackage
readonly schemaHandlerPackage: string;
A URL to the Amazon S3 bucket containing the hook project package that contains the necessary files for the hook you want to register.
For information on generating a schema handler package for the resource you want to register, see [submit](https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-cli-submit.html) in the *CloudFormation CLI User Guide for Extension Development* .
> The user registering the resource must be able to access the package in the S3 bucket. That's, the user must have [GetObject](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html) permissions for the schema handler package. For more information, see [Actions, Resources, and Condition Keys for Amazon S3](https://docs.aws.amazon.com/IAM/latest/UserGuide/list_amazons3.html) in the *AWS Identity and Access Management User Guide* .
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-hookversion.html#cfn-cloudformation-hookversion-schemahandlerpackage
property typeName
readonly typeName: string;
The unique name for your hook. Specifies a three-part namespace for your hook, with a recommended pattern of
Organization::Service::Hook
.> The following organization namespaces are reserved and can't be used in your hook type names: > > -
Alexa
> -AMZN
> -Amazon
> -ASK
> -AWS
> -Custom
> -Dev
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-hookversion.html#cfn-cloudformation-hookversion-typename
interface CfnIncludeProps
interface CfnIncludeProps {}
Construction properties for CfnInclude.
Deprecated
use the CfnInclude class from the cloudformation-include module instead
property template
readonly template: object;
The CloudFormation template to include in the stack (as is).
interface CfnJsonProps
interface CfnJsonProps {}
property value
readonly value: any;
The value to resolve. Can be any JavaScript object, including tokens and references in keys or values.
interface CfnMacroProps
interface CfnMacroProps {}
Properties for defining a
CfnMacro
external
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-macro.html
property description
readonly description?: string;
A description of the macro.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-macro.html#cfn-cloudformation-macro-description
property functionName
readonly functionName: string;
The Amazon Resource Name (ARN) of the underlying AWS Lambda function that you want AWS CloudFormation to invoke when the macro is run.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-macro.html#cfn-cloudformation-macro-functionname
property logGroupName
readonly logGroupName?: string;
The CloudWatch Logs group to which AWS CloudFormation sends error logging information when invoking the macro's underlying AWS Lambda function.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-macro.html#cfn-cloudformation-macro-loggroupname
property logRoleArn
readonly logRoleArn?: string;
The ARN of the role AWS CloudFormation should assume when sending log entries to CloudWatch Logs .
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-macro.html#cfn-cloudformation-macro-logrolearn
property name
readonly name: string;
The name of the macro. The name of the macro must be unique across all macros in the account.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-macro.html#cfn-cloudformation-macro-name
interface CfnMappingProps
interface CfnMappingProps {}
property lazy
readonly lazy?: boolean;
property mapping
readonly mapping?: Mapping;
Mapping of key to a set of corresponding set of named values. The key identifies a map of name-value pairs and must be unique within the mapping.
For example, if you want to set values based on a region, you can create a mapping that uses the region name as a key and contains the values you want to specify for each specific region.
- No mapping.
interface CfnModuleDefaultVersionProps
interface CfnModuleDefaultVersionProps {}
Properties for defining a
CfnModuleDefaultVersion
external
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-moduledefaultversion.html
property arn
readonly arn?: string;
The Amazon Resource Name (ARN) of the module version to set as the default version.
Conditional: You must specify either
Arn
, orModuleName
andVersionId
.http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-moduledefaultversion.html#cfn-cloudformation-moduledefaultversion-arn
property moduleName
readonly moduleName?: string;
The name of the module.
Conditional: You must specify either
Arn
, orModuleName
andVersionId
.http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-moduledefaultversion.html#cfn-cloudformation-moduledefaultversion-modulename
property versionId
readonly versionId?: string;
The ID for the specific version of the module.
Conditional: You must specify either
Arn
, orModuleName
andVersionId
.http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-moduledefaultversion.html#cfn-cloudformation-moduledefaultversion-versionid
interface CfnModuleVersionProps
interface CfnModuleVersionProps {}
Properties for defining a
CfnModuleVersion
external
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-moduleversion.html
property moduleName
readonly moduleName: string;
The name of the module being registered.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-moduleversion.html#cfn-cloudformation-moduleversion-modulename
property modulePackage
readonly modulePackage: string;
A URL to the S3 bucket containing the package that contains the template fragment and schema files for the module version to register.
> The user registering the module version must be able to access the module package in the S3 bucket. That's, the user needs to have [GetObject](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html) permissions for the package. For more information, see [Actions, Resources, and Condition Keys for Amazon S3](https://docs.aws.amazon.com/IAM/latest/UserGuide/list_amazons3.html) in the *AWS Identity and Access Management User Guide* .
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-moduleversion.html#cfn-cloudformation-moduleversion-modulepackage
interface CfnOutputProps
interface CfnOutputProps {}
property condition
readonly condition?: CfnCondition;
A condition to associate with this output value. If the condition evaluates to
false
, this output value will not be included in the stack.- No condition is associated with the output.
property description
readonly description?: string;
A String type that describes the output value. The description can be a maximum of 4 K in length.
- No description.
property exportName
readonly exportName?: string;
The name used to export the value of this output across stacks.
To import the value from another stack, use
Fn.importValue(exportName)
.- the output is not exported
property value
readonly value: string;
The value of the property returned by the aws cloudformation describe-stacks command. The value of an output can include literals, parameter references, pseudo-parameters, a mapping value, or intrinsic functions.
interface CfnParameterProps
interface CfnParameterProps {}
property allowedPattern
readonly allowedPattern?: string;
A regular expression that represents the patterns to allow for String types.
- No constraints on patterns allowed for parameter.
property allowedValues
readonly allowedValues?: string[];
An array containing the list of values allowed for the parameter.
- No constraints on values allowed for parameter.
property constraintDescription
readonly constraintDescription?: string;
A string that explains a constraint when the constraint is violated. For example, without a constraint description, a parameter that has an allowed pattern of [A-Za-z0-9]+ displays the following error message when the user specifies an invalid value:
- No description with customized error message when user specifies invalid values.
property default
readonly default?: any;
A value of the appropriate type for the template to use if no value is specified when a stack is created. If you define constraints for the parameter, you must specify a value that adheres to those constraints.
- No default value for parameter.
property description
readonly description?: string;
A string of up to 4000 characters that describes the parameter.
- No description for the parameter.
property maxLength
readonly maxLength?: number;
An integer value that determines the largest number of characters you want to allow for String types.
- None.
property maxValue
readonly maxValue?: number;
A numeric value that determines the largest numeric value you want to allow for Number types.
- None.
property minLength
readonly minLength?: number;
An integer value that determines the smallest number of characters you want to allow for String types.
- None.
property minValue
readonly minValue?: number;
A numeric value that determines the smallest numeric value you want to allow for Number types.
- None.
property noEcho
readonly noEcho?: boolean;
Whether to mask the parameter value when anyone makes a call that describes the stack. If you set the value to ``true``, the parameter value is masked with asterisks (``*****``).
- Parameter values are not masked.
property type
readonly type?: string;
The data type for the parameter (DataType).
String
interface CfnPublicTypeVersionProps
interface CfnPublicTypeVersionProps {}
Properties for defining a
CfnPublicTypeVersion
external
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-publictypeversion.html
property arn
readonly arn?: string;
The Amazon Resource Number (ARN) of the extension.
Conditional: You must specify
Arn
, orTypeName
andType
.http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-publictypeversion.html#cfn-cloudformation-publictypeversion-arn
property logDeliveryBucket
readonly logDeliveryBucket?: string;
The S3 bucket to which CloudFormation delivers the contract test execution logs.
CloudFormation delivers the logs by the time contract testing has completed and the extension has been assigned a test type status of
PASSED
orFAILED
.The user initiating the stack operation must be able to access items in the specified S3 bucket. Specifically, the user needs the following permissions:
- GetObject - PutObject
For more information, see [Actions, Resources, and Condition Keys for Amazon S3](https://docs.aws.amazon.com/service-authorization/latest/reference/list_amazons3.html) in the *AWS Identity and Access Management User Guide* .
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-publictypeversion.html#cfn-cloudformation-publictypeversion-logdeliverybucket
property publicVersionNumber
readonly publicVersionNumber?: string;
The version number to assign to this version of the extension.
Use the following format, and adhere to semantic versioning when assigning a version number to your extension:
MAJOR.MINOR.PATCH
For more information, see [Semantic Versioning 2.0.0](https://docs.aws.amazon.com/https://semver.org/) .
If you don't specify a version number, CloudFormation increments the version number by one minor version release.
You cannot specify a version number the first time you publish a type. AWS CloudFormation automatically sets the first version number to be
1.0.0
.http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-publictypeversion.html#cfn-cloudformation-publictypeversion-publicversionnumber
property type
readonly type?: string;
The type of the extension to test.
Conditional: You must specify
Arn
, orTypeName
andType
.http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-publictypeversion.html#cfn-cloudformation-publictypeversion-type
property typeName
readonly typeName?: string;
The name of the extension to test.
Conditional: You must specify
Arn
, orTypeName
andType
.http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-publictypeversion.html#cfn-cloudformation-publictypeversion-typename
interface CfnPublisherProps
interface CfnPublisherProps {}
Properties for defining a
CfnPublisher
external
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-publisher.html
property acceptTermsAndConditions
readonly acceptTermsAndConditions: boolean | cdk.IResolvable;
Whether you accept the [Terms and Conditions](https://docs.aws.amazon.com/https://cloudformation-registry-documents.s3.amazonaws.com/Terms_and_Conditions_for_AWS_CloudFormation_Registry_Publishers.pdf) for publishing extensions in the CloudFormation registry. You must accept the terms and conditions in order to register to publish public extensions to the CloudFormation registry.
The default is
false
.http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-publisher.html#cfn-cloudformation-publisher-accepttermsandconditions
property connectionArn
readonly connectionArn?: string;
If you are using a Bitbucket or GitHub account for identity verification, the Amazon Resource Name (ARN) for your connection to that account.
For more information, see [Registering your account to publish CloudFormation extensions](https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/publish-extension.html#publish-extension-prereqs) in the *CloudFormation CLI User Guide* .
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-publisher.html#cfn-cloudformation-publisher-connectionarn
interface CfnResourceAutoScalingCreationPolicy
interface CfnResourceAutoScalingCreationPolicy {}
For an Auto Scaling group replacement update, specifies how many instances must signal success for the update to succeed.
property minSuccessfulInstancesPercent
readonly minSuccessfulInstancesPercent?: number;
Specifies the percentage of instances in an Auto Scaling replacement update that must signal success for the update to succeed. You can specify a value from 0 to 100. AWS CloudFormation rounds to the nearest tenth of a percent. For example, if you update five instances with a minimum successful percentage of 50, three instances must signal success. If an instance doesn't send a signal within the time specified by the Timeout property, AWS CloudFormation assumes that the instance wasn't created.
interface CfnResourceDefaultVersionProps
interface CfnResourceDefaultVersionProps {}
Properties for defining a
CfnResourceDefaultVersion
external
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-resourcedefaultversion.html
property typeName
readonly typeName?: string;
The name of the resource.
Conditional: You must specify either
TypeVersionArn
, orTypeName
andVersionId
.http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-resourcedefaultversion.html#cfn-cloudformation-resourcedefaultversion-typename
property typeVersionArn
readonly typeVersionArn?: string;
The Amazon Resource Name (ARN) of the resource version.
Conditional: You must specify either
TypeVersionArn
, orTypeName
andVersionId
.http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-resourcedefaultversion.html#cfn-cloudformation-resourcedefaultversion-typeversionarn
property versionId
readonly versionId?: string;
The ID of a specific version of the resource. The version ID is the value at the end of the Amazon Resource Name (ARN) assigned to the resource version when it's registered.
Conditional: You must specify either
TypeVersionArn
, orTypeName
andVersionId
.http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-resourcedefaultversion.html#cfn-cloudformation-resourcedefaultversion-versionid
interface CfnResourceProps
interface CfnResourceProps {}
property properties
readonly properties?: { [name: string]: any;};
Resource properties.
- No resource properties.
property type
readonly type: string;
CloudFormation resource type (e.g.
AWS::S3::Bucket
).
interface CfnResourceSignal
interface CfnResourceSignal {}
When AWS CloudFormation creates the associated resource, configures the number of required success signals and the length of time that AWS CloudFormation waits for those signals.
property count
readonly count?: number;
The number of success signals AWS CloudFormation must receive before it sets the resource status as CREATE_COMPLETE. If the resource receives a failure signal or doesn't receive the specified number of signals before the timeout period expires, the resource creation fails and AWS CloudFormation rolls the stack back.
property timeout
readonly timeout?: string;
The length of time that AWS CloudFormation waits for the number of signals that was specified in the Count property. The timeout period starts after AWS CloudFormation starts creating the resource, and the timeout expires no sooner than the time you specify but can occur shortly thereafter. The maximum time that you can specify is 12 hours.
interface CfnResourceVersionProps
interface CfnResourceVersionProps {}
Properties for defining a
CfnResourceVersion
external
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-resourceversion.html
property executionRoleArn
readonly executionRoleArn?: string;
The Amazon Resource Name (ARN) of the IAM role for CloudFormation to assume when invoking the resource. If your resource calls AWS APIs in any of its handlers, you must create an *[IAM execution role](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html)* that includes the necessary permissions to call those AWS APIs, and provision that execution role in your account. When CloudFormation needs to invoke the resource type handler, CloudFormation assumes this execution role to create a temporary session token, which it then passes to the resource type handler, thereby supplying your resource type with the appropriate credentials.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-resourceversion.html#cfn-cloudformation-resourceversion-executionrolearn
property loggingConfig
readonly loggingConfig?: | CfnResourceVersion.LoggingConfigProperty | cdk.IResolvable;
Logging configuration information for a resource.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-resourceversion.html#cfn-cloudformation-resourceversion-loggingconfig
property schemaHandlerPackage
readonly schemaHandlerPackage: string;
A URL to the S3 bucket containing the resource project package that contains the necessary files for the resource you want to register.
For information on generating a schema handler package for the resource you want to register, see [submit](https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-cli-submit.html) in the *CloudFormation CLI User Guide* .
> The user registering the resource must be able to access the package in the S3 bucket. That is, the user needs to have [GetObject](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html) permissions for the schema handler package. For more information, see [Actions, Resources, and Condition Keys for Amazon S3](https://docs.aws.amazon.com/IAM/latest/UserGuide/list_amazons3.html) in the *AWS Identity and Access Management User Guide* .
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-resourceversion.html#cfn-cloudformation-resourceversion-schemahandlerpackage
property typeName
readonly typeName: string;
The name of the resource being registered.
We recommend that resource names adhere to the following pattern: *company_or_organization* :: *service* :: *type* .
> The following organization namespaces are reserved and can't be used in your resource names: > > -
Alexa
> -AMZN
> -Amazon
> -AWS
> -Custom
> -Dev
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-resourceversion.html#cfn-cloudformation-resourceversion-typename
interface CfnRuleAssertion
interface CfnRuleAssertion {}
A rule assertion.
property assert
readonly assert: ICfnConditionExpression;
The assertion.
property assertDescription
readonly assertDescription: string;
The assertion description.
interface CfnRuleProps
interface CfnRuleProps {}
A rule can include a RuleCondition property and must include an Assertions property. For each rule, you can define only one rule condition; you can define one or more asserts within the Assertions property. You define a rule condition and assertions by using rule-specific intrinsic functions.
You can use the following rule-specific intrinsic functions to define rule conditions and assertions:
Fn::And Fn::Contains Fn::EachMemberEquals Fn::EachMemberIn Fn::Equals Fn::If Fn::Not Fn::Or Fn::RefAll Fn::ValueOf Fn::ValueOfAll
https://docs.aws.amazon.com/servicecatalog/latest/adminguide/reference-template_constraint_rules.html
property assertions
readonly assertions?: CfnRuleAssertion[];
Assertions which define the rule.
- No assertions for the rule.
property ruleCondition
readonly ruleCondition?: ICfnConditionExpression;
If the rule condition evaluates to false, the rule doesn't take effect. If the function in the rule condition evaluates to true, expressions in each assert are evaluated and applied.
- Rule's assertions will always take effect.
interface CfnStackProps
interface CfnStackProps {}
Properties for defining a
CfnStack
external
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-stack.html
property notificationArns
readonly notificationArns?: string[];
The Amazon Simple Notification Service (Amazon SNS) topic ARNs to publish stack related events. You can find your Amazon SNS topic ARNs using the Amazon SNS console or your Command Line Interface (CLI).
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-stack.html#cfn-cloudformation-stack-notificationarns
property parameters
readonly parameters?: | { [key: string]: string; } | cdk.IResolvable;
The set value pairs that represent the parameters passed to CloudFormation when this nested stack is created. Each parameter has a name corresponding to a parameter defined in the embedded template and a value representing the value that you want to set for the parameter.
> If you use the
Ref
function to pass a parameter value to a nested stack, comma-delimited list parameters must be of typeString
. In other words, you can't pass values that are of typeCommaDelimitedList
to nested stacks.Conditional. Required if the nested stack requires input parameters.
Whether an update causes interruptions depends on the resources that are being updated. An update never causes a nested stack to be replaced.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-stack.html#cfn-cloudformation-stack-parameters
property tags
readonly tags?: cdk.CfnTag[];
Key-value pairs to associate with this stack. AWS CloudFormation also propagates these tags to the resources created in the stack. A maximum number of 50 tags can be specified.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-stack.html#cfn-cloudformation-stack-tags
property templateUrl
readonly templateUrl: string;
Location of file containing the template body. The URL must point to a template (max size: 460,800 bytes) that's located in an Amazon S3 bucket. For more information, see [Template anatomy](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html) .
Whether an update causes interruptions depends on the resources that are being updated. An update never causes a nested stack to be replaced.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-stack.html#cfn-cloudformation-stack-templateurl
property timeoutInMinutes
readonly timeoutInMinutes?: number;
The length of time, in minutes, that CloudFormation waits for the nested stack to reach the
CREATE_COMPLETE
state. The default is no timeout. When CloudFormation detects that the nested stack has reached theCREATE_COMPLETE
state, it marks the nested stack resource asCREATE_COMPLETE
in the parent stack and resumes creating the parent stack. If the timeout period expires before the nested stack reachesCREATE_COMPLETE
, CloudFormation marks the nested stack as failed and rolls back both the nested stack and parent stack.Updates aren't supported.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-stack.html#cfn-cloudformation-stack-timeoutinminutes
interface CfnStackSetProps
interface CfnStackSetProps {}
Properties for defining a
CfnStackSet
external
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-stackset.html
property administrationRoleArn
readonly administrationRoleArn?: string;
The Amazon Resource Number (ARN) of the IAM role to use to create this stack set. Specify an IAM role only if you are using customized administrator roles to control which users or groups can manage specific stack sets within the same administrator account.
Use customized administrator roles to control which users or groups can manage specific stack sets within the same administrator account. For more information, see [Prerequisites: Granting Permissions for Stack Set Operations](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-prereqs.html) in the *AWS CloudFormation User Guide* .
*Minimum* :
20
*Maximum* :
2048
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-stackset.html#cfn-cloudformation-stackset-administrationrolearn
property autoDeployment
readonly autoDeployment?: CfnStackSet.AutoDeploymentProperty | cdk.IResolvable;
[
Service-managed
permissions] Describes whether StackSets automatically deploys to AWS Organizations accounts that are added to a target organization or organizational unit (OU).http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-stackset.html#cfn-cloudformation-stackset-autodeployment
property callAs
readonly callAs?: string;
[Service-managed permissions] Specifies whether you are acting as an account administrator in the organization's management account or as a delegated administrator in a member account.
By default,
SELF
is specified. UseSELF
for stack sets with self-managed permissions.- To create a stack set with service-managed permissions while signed in to the management account, specify
SELF
. - To create a stack set with service-managed permissions while signed in to a delegated administrator account, specifyDELEGATED_ADMIN
.Your AWS account must be registered as a delegated admin in the management account. For more information, see [Register a delegated administrator](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-orgs-delegated-admin.html) in the *AWS CloudFormation User Guide* .
Stack sets with service-managed permissions are created in the management account, including stack sets that are created by delegated administrators.
*Valid Values* :
SELF
|DELEGATED_ADMIN
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-stackset.html#cfn-cloudformation-stackset-callas
property capabilities
readonly capabilities?: string[];
The capabilities that are allowed in the stack set. Some stack set templates might include resources that can affect permissions in your AWS account —for example, by creating new AWS Identity and Access Management ( IAM ) users. For more information, see [Acknowledging IAM Resources in AWS CloudFormation Templates](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html#capabilities) .
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-stackset.html#cfn-cloudformation-stackset-capabilities
property description
readonly description?: string;
A description of the stack set.
*Minimum* :
1
*Maximum* :
1024
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-stackset.html#cfn-cloudformation-stackset-description
property executionRoleName
readonly executionRoleName?: string;
The name of the IAM execution role to use to create the stack set. If you don't specify an execution role, AWS CloudFormation uses the
AWSCloudFormationStackSetExecutionRole
role for the stack set operation.*Minimum* :
1
*Maximum* :
64
*Pattern* :
[a-zA-Z_0-9+=,.@-]+
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-stackset.html#cfn-cloudformation-stackset-executionrolename
property managedExecution
readonly managedExecution?: any | cdk.IResolvable;
Describes whether StackSets performs non-conflicting operations concurrently and queues conflicting operations.
When active, StackSets performs non-conflicting operations concurrently and queues conflicting operations. After conflicting operations finish, StackSets starts queued operations in request order.
> If there are already running or queued operations, StackSets queues all incoming operations even if they are non-conflicting. > > You can't modify your stack set's execution configuration while there are running or queued operations for that stack set.
When inactive (default), StackSets performs one operation at a time in request order.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-stackset.html#cfn-cloudformation-stackset-managedexecution
property operationPreferences
readonly operationPreferences?: | CfnStackSet.OperationPreferencesProperty | cdk.IResolvable;
The user-specified preferences for how AWS CloudFormation performs a stack set operation.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-stackset.html#cfn-cloudformation-stackset-operationpreferences
property parameters
readonly parameters?: | Array<CfnStackSet.ParameterProperty | cdk.IResolvable> | cdk.IResolvable;
The input parameters for the stack set template.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-stackset.html#cfn-cloudformation-stackset-parameters
property permissionModel
readonly permissionModel: string;
Describes how the IAM roles required for stack set operations are created.
- With
SELF_MANAGED
permissions, you must create the administrator and execution roles required to deploy to target accounts. For more information, see [Grant Self-Managed Stack Set Permissions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-prereqs-self-managed.html) . - WithSERVICE_MANAGED
permissions, StackSets automatically creates the IAM roles required to deploy to accounts managed by AWS Organizations . For more information, see [Grant Service-Managed Stack Set Permissions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-prereqs-service-managed.html) .http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-stackset.html#cfn-cloudformation-stackset-permissionmodel
property stackInstancesGroup
readonly stackInstancesGroup?: | Array<CfnStackSet.StackInstancesProperty | cdk.IResolvable> | cdk.IResolvable;
A group of stack instances with parameters in some specific accounts and Regions.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-stackset.html#cfn-cloudformation-stackset-stackinstancesgroup
property stackSetName
readonly stackSetName: string;
The name to associate with the stack set. The name must be unique in the Region where you create your stack set.
*Maximum* :
128
*Pattern* :
^[a-zA-Z][a-zA-Z0-9-]{0,127}$
> The
StackSetName
property is required.http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-stackset.html#cfn-cloudformation-stackset-stacksetname
property tags
readonly tags?: cdk.CfnTag[];
The key-value pairs to associate with this stack set and the stacks created from it. AWS CloudFormation also propagates these tags to supported resources that are created in the stacks. A maximum number of 50 tags can be specified.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-stackset.html#cfn-cloudformation-stackset-tags
property templateBody
readonly templateBody?: string;
The structure that contains the template body, with a minimum length of 1 byte and a maximum length of 51,200 bytes.
You must include either
TemplateURL
orTemplateBody
in a StackSet, but you can't use both. Dynamic references in theTemplateBody
may not work correctly in all cases. It's recommended to pass templates containing dynamic references throughTemplateUrl
instead.*Minimum* :
1
*Maximum* :
51200
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-stackset.html#cfn-cloudformation-stackset-templatebody
property templateUrl
readonly templateUrl?: string;
Location of file containing the template body. The URL must point to a template (max size: 460,800 bytes) that's located in an Amazon S3 bucket.
You must include either
TemplateURL
orTemplateBody
in a StackSet, but you can't use both.*Minimum* :
1
*Maximum* :
1024
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-stackset.html#cfn-cloudformation-stackset-templateurl
interface CfnTag
interface CfnTag {}
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html
property key
readonly key: string;
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html#cfn-resource-tags-key
property value
readonly value: string;
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html#cfn-resource-tags-value
interface CfnTrafficRoute
interface CfnTrafficRoute {}
A traffic route, representing where the traffic is being directed to.
interface CfnTrafficRouting
interface CfnTrafficRouting {}
Type of the CfnCodeDeployBlueGreenEcsAttributes.trafficRouting property.
property prodTrafficRoute
readonly prodTrafficRoute: CfnTrafficRoute;
The listener to be used by your load balancer to direct traffic to your target groups.
property targetGroups
readonly targetGroups: string[];
The logical IDs of the blue and green, respectively, AWS::ElasticLoadBalancingV2::TargetGroup target groups.
property testTrafficRoute
readonly testTrafficRoute: CfnTrafficRoute;
The listener to be used by your load balancer to direct traffic to your target groups.
interface CfnTrafficRoutingConfig
interface CfnTrafficRoutingConfig {}
Traffic routing configuration settings. The type of the CfnCodeDeployBlueGreenHookProps.trafficRoutingConfig property.
property timeBasedCanary
readonly timeBasedCanary?: CfnTrafficRoutingTimeBasedCanary;
The configuration for traffic routing when is CfnTrafficRoutingType.TIME_BASED_CANARY.
- none
property timeBasedLinear
readonly timeBasedLinear?: CfnTrafficRoutingTimeBasedLinear;
The configuration for traffic routing when is CfnTrafficRoutingType.TIME_BASED_LINEAR.
- none
property type
readonly type: CfnTrafficRoutingType;
The type of traffic shifting used by the blue-green deployment configuration.
interface CfnTrafficRoutingTimeBasedCanary
interface CfnTrafficRoutingTimeBasedCanary {}
The traffic routing configuration if is CfnTrafficRoutingType.TIME_BASED_CANARY.
property bakeTimeMins
readonly bakeTimeMins?: number;
The number of minutes between the first and second traffic shifts of a time-based canary deployment.
5
property stepPercentage
readonly stepPercentage?: number;
The percentage of traffic to shift in the first increment of a time-based canary deployment. The step percentage must be 14% or greater.
15
interface CfnTrafficRoutingTimeBasedLinear
interface CfnTrafficRoutingTimeBasedLinear {}
The traffic routing configuration if is CfnTrafficRoutingType.TIME_BASED_LINEAR.
property bakeTimeMins
readonly bakeTimeMins?: number;
The number of minutes between the first and second traffic shifts of a time-based linear deployment.
5
property stepPercentage
readonly stepPercentage?: number;
The percentage of traffic that is shifted at the start of each increment of a time-based linear deployment. The step percentage must be 14% or greater.
15
interface CfnTypeActivationProps
interface CfnTypeActivationProps {}
Properties for defining a
CfnTypeActivation
external
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-typeactivation.html
property autoUpdate
readonly autoUpdate?: boolean | cdk.IResolvable;
Whether to automatically update the extension in this account and Region when a new *minor* version is published by the extension publisher. Major versions released by the publisher must be manually updated.
The default is
true
.http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-typeactivation.html#cfn-cloudformation-typeactivation-autoupdate
property executionRoleArn
readonly executionRoleArn?: string;
The name of the IAM execution role to use to activate the extension.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-typeactivation.html#cfn-cloudformation-typeactivation-executionrolearn
property loggingConfig
readonly loggingConfig?: | CfnTypeActivation.LoggingConfigProperty | cdk.IResolvable;
Specifies logging configuration information for an extension.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-typeactivation.html#cfn-cloudformation-typeactivation-loggingconfig
property majorVersion
readonly majorVersion?: string;
The major version of this extension you want to activate, if multiple major versions are available. The default is the latest major version. CloudFormation uses the latest available *minor* version of the major version selected.
You can specify
MajorVersion
orVersionBump
, but not both.http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-typeactivation.html#cfn-cloudformation-typeactivation-majorversion
property publicTypeArn
readonly publicTypeArn?: string;
The Amazon Resource Number (ARN) of the public extension.
Conditional: You must specify
PublicTypeArn
, orTypeName
,Type
, andPublisherId
.http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-typeactivation.html#cfn-cloudformation-typeactivation-publictypearn
property publisherId
readonly publisherId?: string;
The ID of the extension publisher.
Conditional: You must specify
PublicTypeArn
, orTypeName
,Type
, andPublisherId
.http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-typeactivation.html#cfn-cloudformation-typeactivation-publisherid
property type
readonly type?: string;
The extension type.
Conditional: You must specify
PublicTypeArn
, orTypeName
,Type
, andPublisherId
.http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-typeactivation.html#cfn-cloudformation-typeactivation-type
property typeName
readonly typeName?: string;
The name of the extension.
Conditional: You must specify
PublicTypeArn
, orTypeName
,Type
, andPublisherId
.http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-typeactivation.html#cfn-cloudformation-typeactivation-typename
property typeNameAlias
readonly typeNameAlias?: string;
An alias to assign to the public extension, in this account and Region. If you specify an alias for the extension, CloudFormation treats the alias as the extension type name within this account and Region. You must use the alias to refer to the extension in your templates, API calls, and CloudFormation console.
An extension alias must be unique within a given account and Region. You can activate the same public resource multiple times in the same account and Region, using different type name aliases.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-typeactivation.html#cfn-cloudformation-typeactivation-typenamealias
property versionBump
readonly versionBump?: string;
Manually updates a previously-activated type to a new major or minor version, if available. You can also use this parameter to update the value of
AutoUpdate
.-
MAJOR
: CloudFormation updates the extension to the newest major version, if one is available. -MINOR
: CloudFormation updates the extension to the newest minor version, if one is available.http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-typeactivation.html#cfn-cloudformation-typeactivation-versionbump
interface CfnUpdatePolicy
interface CfnUpdatePolicy {}
Use the UpdatePolicy attribute to specify how AWS CloudFormation handles updates to the AWS::AutoScaling::AutoScalingGroup resource. AWS CloudFormation invokes one of three update policies depending on the type of change you make or whether a scheduled action is associated with the Auto Scaling group.
property autoScalingReplacingUpdate
readonly autoScalingReplacingUpdate?: CfnAutoScalingReplacingUpdate;
Specifies whether an Auto Scaling group and the instances it contains are replaced during an update. During replacement, AWS CloudFormation retains the old group until it finishes creating the new one. If the update fails, AWS CloudFormation can roll back to the old Auto Scaling group and delete the new Auto Scaling group.
property autoScalingRollingUpdate
readonly autoScalingRollingUpdate?: CfnAutoScalingRollingUpdate;
To specify how AWS CloudFormation handles rolling updates for an Auto Scaling group, use the AutoScalingRollingUpdate policy. Rolling updates enable you to specify whether AWS CloudFormation updates instances that are in an Auto Scaling group in batches or all at once.
property autoScalingScheduledAction
readonly autoScalingScheduledAction?: CfnAutoScalingScheduledAction;
To specify how AWS CloudFormation handles updates for the MinSize, MaxSize, and DesiredCapacity properties when the AWS::AutoScaling::AutoScalingGroup resource has an associated scheduled action, use the AutoScalingScheduledAction policy.
property codeDeployLambdaAliasUpdate
readonly codeDeployLambdaAliasUpdate?: CfnCodeDeployLambdaAliasUpdate;
To perform an AWS CodeDeploy deployment when the version changes on an AWS::Lambda::Alias resource, use the CodeDeployLambdaAliasUpdate update policy.
property enableVersionUpgrade
readonly enableVersionUpgrade?: boolean;
To upgrade an Amazon ES domain to a new version of Elasticsearch rather than replacing the entire AWS::Elasticsearch::Domain resource, use the EnableVersionUpgrade update policy.
property useOnlineResharding
readonly useOnlineResharding?: boolean;
To modify a replication group's shards by adding or removing shards, rather than replacing the entire AWS::ElastiCache::ReplicationGroup resource, use the UseOnlineResharding update policy.
interface CfnWaitConditionProps
interface CfnWaitConditionProps {}
Properties for defining a
CfnWaitCondition
external
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-waitcondition.html
property count
readonly count?: number;
The number of success signals that CloudFormation must receive before it continues the stack creation process. When the wait condition receives the requisite number of success signals, CloudFormation resumes the creation of the stack. If the wait condition doesn't receive the specified number of success signals before the Timeout period expires, CloudFormation assumes that the wait condition has failed and rolls the stack back.
Updates aren't supported.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-waitcondition.html#cfn-waitcondition-count
property handle
readonly handle?: string;
A reference to the wait condition handle used to signal this wait condition. Use the
Ref
intrinsic function to specify an [AWS::CloudFormation::WaitConditionHandle
](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-waitconditionhandle.html) resource.Anytime you add a
WaitCondition
resource during a stack update, you must associate the wait condition with a new WaitConditionHandle resource. Don't reuse an old wait condition handle that has already been defined in the template. If you reuse a wait condition handle, the wait condition might evaluate old signals from a previous create or update stack command.Updates aren't supported.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-waitcondition.html#cfn-waitcondition-handle
property timeout
readonly timeout?: string;
The length of time (in seconds) to wait for the number of signals that the
Count
property specifies.Timeout
is a minimum-bound property, meaning the timeout occurs no sooner than the time you specify, but can occur shortly thereafter. The maximum time that can be specified for this property is 12 hours (43200 seconds).Updates aren't supported.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-waitcondition.html#cfn-waitcondition-timeout
interface CliCredentialsStackSynthesizerProps
interface CliCredentialsStackSynthesizerProps {}
Properties for the CliCredentialsStackSynthesizer
property bucketPrefix
readonly bucketPrefix?: string;
bucketPrefix to use while storing S3 Assets
- DefaultStackSynthesizer.DEFAULT_FILE_ASSET_PREFIX
property dockerTagPrefix
readonly dockerTagPrefix?: string;
A prefix to use while tagging and uploading Docker images to ECR.
This does not add any separators - the source hash will be appended to this string directly.
- DefaultStackSynthesizer.DEFAULT_DOCKER_ASSET_PREFIX
property fileAssetsBucketName
readonly fileAssetsBucketName?: string;
Name of the S3 bucket to hold file assets
You must supply this if you have given a non-standard name to the staging bucket.
The placeholders
${Qualifier}
,${AWS::AccountId}
and${AWS::Region}
will be replaced with the values of qualifier and the stack's account and region, respectively.DefaultStackSynthesizer.DEFAULT_FILE_ASSETS_BUCKET_NAME
property imageAssetsRepositoryName
readonly imageAssetsRepositoryName?: string;
Name of the ECR repository to hold Docker Image assets
You must supply this if you have given a non-standard name to the ECR repository.
The placeholders
${Qualifier}
,${AWS::AccountId}
and${AWS::Region}
will be replaced with the values of qualifier and the stack's account and region, respectively.DefaultStackSynthesizer.DEFAULT_IMAGE_ASSETS_REPOSITORY_NAME
property qualifier
readonly qualifier?: string;
Qualifier to disambiguate multiple environments in the same account
You can use this and leave the other naming properties empty if you have deployed the bootstrap environment with standard names but only differnet qualifiers.
- Value of context key '@aws-cdk/core:bootstrapQualifier' if set, otherwise
DefaultStackSynthesizer.DEFAULT_QUALIFIER
interface CopyOptions
interface CopyOptions extends FileOptions {}
Options applied when copying directories
property follow
readonly follow?: SymlinkFollowMode;
A strategy for how to handle symlinks.
SymlinkFollowMode.NEVER
interface CustomResourceProps
interface CustomResourceProps {}
Properties to provide a Lambda-backed custom resource
property pascalCaseProperties
readonly pascalCaseProperties?: boolean;
Convert all property keys to pascal case.
false
property properties
readonly properties?: { [key: string]: any;};
Properties to pass to the Lambda
- No properties.
property removalPolicy
readonly removalPolicy?: RemovalPolicy;
The policy to apply when this resource is removed from the application.
cdk.RemovalPolicy.Destroy
property resourceType
readonly resourceType?: string;
For custom resources, you can specify AWS::CloudFormation::CustomResource (the default) as the resource type, or you can specify your own resource type name. For example, you can use "Custom::MyCustomResourceTypeName".
Custom resource type names must begin with "Custom::" and can include alphanumeric characters and the following characters: _@-. You can specify a custom resource type name up to a maximum length of 60 characters. You cannot change the type during an update.
Using your own resource type names helps you quickly differentiate the types of custom resources in your stack. For example, if you had two custom resources that conduct two different ping tests, you could name their type as Custom::PingTester to make them easily identifiable as ping testers (instead of using AWS::CloudFormation::CustomResource).
See Also
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cfn-customresource.html#aws-cfn-resource-type-name
- AWS::CloudFormation::CustomResource
property serviceToken
readonly serviceToken: string;
The ARN of the provider which implements this custom resource type.
You can implement a provider by listening to raw AWS CloudFormation events and specify the ARN of an SNS topic (
topic.topicArn
) or the ARN of an AWS Lambda function (lambda.functionArn
) or use the CDK's custom [resource provider framework] which makes it easier to implement robust providers.[resource provider framework]: https://docs.aws.amazon.com/cdk/api/latest/docs/custom-resources-readme.html
Provider framework:
// use the provider framework from aws-cdk/custom-resources:const provider = new customresources.Provider(this, 'ResourceProvider', {onEventHandler,isCompleteHandler, // optional});new CustomResource(this, 'MyResource', {serviceToken: provider.serviceToken,});AWS Lambda function:
// invoke an AWS Lambda function when a lifecycle event occurs:new CustomResource(this, 'MyResource', {serviceToken: myFunction.functionArn,});SNS topic:
// publish lifecycle events to an SNS topic:new CustomResource(this, 'MyResource', {serviceToken: myTopic.topicArn,});
interface CustomResourceProviderProps
interface CustomResourceProviderProps {}
Initialization properties for
CustomResourceProvider
.
property codeDirectory
readonly codeDirectory: string;
A local file system directory with the provider's code. The code will be bundled into a zip asset and wired to the provider's AWS Lambda function.
property description
readonly description?: string;
A description of the function.
- No description.
property environment
readonly environment?: { [key: string]: string;};
Key-value pairs that are passed to Lambda as Environment
- No environment variables.
property memorySize
readonly memorySize?: Size;
The amount of memory that your function has access to. Increasing the function's memory also increases its CPU allocation.
Size.mebibytes(128)
property policyStatements
readonly policyStatements?: any[];
A set of IAM policy statements to include in the inline policy of the provider's lambda function.
**Please note**: these are direct IAM JSON policy blobs, *not*
iam.PolicyStatement
objects like you will see in the rest of the CDK.- no additional inline policy
Example 1
const provider = CustomResourceProvider.getOrCreateProvider(this, 'Custom::MyCustomResourceType', { codeDirectory:
${__dirname}/my-handler
, runtime: CustomResourceProviderRuntime.NODEJS_14_X, policyStatements: [ { Effect: 'Allow', Action: 's3:PutObject*', Resource: '*', } ], });
property runtime
readonly runtime: CustomResourceProviderRuntime;
The AWS Lambda runtime and version to use for the provider.
property timeout
readonly timeout?: Duration;
AWS Lambda timeout for the provider.
Duration.minutes(15)
interface DefaultStackSynthesizerProps
interface DefaultStackSynthesizerProps {}
Configuration properties for DefaultStackSynthesizer
property bootstrapStackVersionSsmParameter
readonly bootstrapStackVersionSsmParameter?: string;
Bootstrap stack version SSM parameter.
The placeholder
${Qualifier}
will be replaced with the value of qualifier.DefaultStackSynthesizer.DEFAULT_BOOTSTRAP_STACK_VERSION_SSM_PARAMETER
property bucketPrefix
readonly bucketPrefix?: string;
bucketPrefix to use while storing S3 Assets
- DefaultStackSynthesizer.DEFAULT_FILE_ASSET_PREFIX
property cloudFormationExecutionRole
readonly cloudFormationExecutionRole?: string;
The role CloudFormation will assume when deploying the Stack
You must supply this if you have given a non-standard name to the execution role.
The placeholders
${Qualifier}
,${AWS::AccountId}
and${AWS::Region}
will be replaced with the values of qualifier and the stack's account and region, respectively.DefaultStackSynthesizer.DEFAULT_CLOUDFORMATION_ROLE_ARN
property deployRoleArn
readonly deployRoleArn?: string;
The role to assume to initiate a deployment in this environment
You must supply this if you have given a non-standard name to the publishing role.
The placeholders
${Qualifier}
,${AWS::AccountId}
and${AWS::Region}
will be replaced with the values of qualifier and the stack's account and region, respectively.DefaultStackSynthesizer.DEFAULT_DEPLOY_ROLE_ARN
property deployRoleExternalId
readonly deployRoleExternalId?: string;
External ID to use when assuming role for cloudformation deployments
- No external ID
property dockerTagPrefix
readonly dockerTagPrefix?: string;
A prefix to use while tagging and uploading Docker images to ECR.
This does not add any separators - the source hash will be appended to this string directly.
- DefaultStackSynthesizer.DEFAULT_DOCKER_ASSET_PREFIX
property fileAssetKeyArnExportName
readonly fileAssetKeyArnExportName?: string;
Name of the CloudFormation Export with the asset key name
You must supply this if you have given a non-standard name to the KMS key export
The placeholders
${Qualifier}
,${AWS::AccountId}
and${AWS::Region}
will be replaced with the values of qualifier and the stack's account and region, respectively.DefaultStackSynthesizer.DEFAULT_FILE_ASSET_KEY_ARN_EXPORT_NAME
Deprecated
This property is not used anymore
property fileAssetPublishingExternalId
readonly fileAssetPublishingExternalId?: string;
External ID to use when assuming role for file asset publishing
- No external ID
property fileAssetPublishingRoleArn
readonly fileAssetPublishingRoleArn?: string;
The role to use to publish file assets to the S3 bucket in this environment
You must supply this if you have given a non-standard name to the publishing role.
The placeholders
${Qualifier}
,${AWS::AccountId}
and${AWS::Region}
will be replaced with the values of qualifier and the stack's account and region, respectively.DefaultStackSynthesizer.DEFAULT_FILE_ASSET_PUBLISHING_ROLE_ARN
property fileAssetsBucketName
readonly fileAssetsBucketName?: string;
Name of the S3 bucket to hold file assets
You must supply this if you have given a non-standard name to the staging bucket.
The placeholders
${Qualifier}
,${AWS::AccountId}
and${AWS::Region}
will be replaced with the values of qualifier and the stack's account and region, respectively.DefaultStackSynthesizer.DEFAULT_FILE_ASSETS_BUCKET_NAME
property generateBootstrapVersionRule
readonly generateBootstrapVersionRule?: boolean;
Whether to add a Rule to the stack template verifying the bootstrap stack version
This generally should be left set to
true
, unless you explicitly want to be able to deploy to an unbootstrapped environment.true
property imageAssetPublishingExternalId
readonly imageAssetPublishingExternalId?: string;
External ID to use when assuming role for image asset publishing
- No external ID
property imageAssetPublishingRoleArn
readonly imageAssetPublishingRoleArn?: string;
The role to use to publish image assets to the ECR repository in this environment
You must supply this if you have given a non-standard name to the publishing role.
The placeholders
${Qualifier}
,${AWS::AccountId}
and${AWS::Region}
will be replaced with the values of qualifier and the stack's account and region, respectively.DefaultStackSynthesizer.DEFAULT_IMAGE_ASSET_PUBLISHING_ROLE_ARN
property imageAssetsRepositoryName
readonly imageAssetsRepositoryName?: string;
Name of the ECR repository to hold Docker Image assets
You must supply this if you have given a non-standard name to the ECR repository.
The placeholders
${Qualifier}
,${AWS::AccountId}
and${AWS::Region}
will be replaced with the values of qualifier and the stack's account and region, respectively.DefaultStackSynthesizer.DEFAULT_IMAGE_ASSETS_REPOSITORY_NAME
property lookupRoleArn
readonly lookupRoleArn?: string;
The role to use to look up values from the target AWS account during synthesis
- None
property lookupRoleExternalId
readonly lookupRoleExternalId?: string;
External ID to use when assuming lookup role
- No external ID
property qualifier
readonly qualifier?: string;
Qualifier to disambiguate multiple environments in the same account
You can use this and leave the other naming properties empty if you have deployed the bootstrap environment with standard names but only differnet qualifiers.
- Value of context key '@aws-cdk/core:bootstrapQualifier' if set, otherwise
DefaultStackSynthesizer.DEFAULT_QUALIFIER
property useLookupRoleForStackOperations
readonly useLookupRoleForStackOperations?: boolean;
Use the bootstrapped lookup role for (read-only) stack operations
Use the lookup role when performing a
cdk diff
. If set tofalse
, thedeploy role
credentials will be used to perform acdk diff
.Requires bootstrap stack version 8.
true
interface Dependency
interface Dependency {}
A single dependency
interface DockerBuildOptions
interface DockerBuildOptions {}
Docker build options
property buildArgs
readonly buildArgs?: { [key: string]: string;};
Build args
- no build args
property file
readonly file?: string;
Name of the Dockerfile, must relative to the docker build path.
Dockerfile
property platform
readonly platform?: string;
Set platform if server is multi-platform capable. _Requires Docker Engine API v1.38+_.
Example value:
linux/amd64
- no platform specified
interface DockerImageAssetLocation
interface DockerImageAssetLocation {}
The location of the published docker image. This is where the image can be consumed at runtime.
property imageUri
readonly imageUri: string;
The URI of the image in Amazon ECR.
property repositoryName
readonly repositoryName: string;
The name of the ECR repository.
interface DockerImageAssetSource
interface DockerImageAssetSource {}
property directoryName
readonly directoryName?: string;
The directory where the Dockerfile is stored, must be relative to the cloud assembly root.
- Exactly one of
directoryName
andexecutable
is required
property dockerBuildArgs
readonly dockerBuildArgs?: { [key: string]: string;};
Build args to pass to the
docker build
command.Since Docker build arguments are resolved before deployment, keys and values cannot refer to unresolved tokens (such as
lambda.functionArn
orqueue.queueUrl
).Only allowed when
directoryName
is specified.- no build args are passed
property dockerBuildTarget
readonly dockerBuildTarget?: string;
Docker target to build to
Only allowed when
directoryName
is specified.- no target
property dockerFile
readonly dockerFile?: string;
Path to the Dockerfile (relative to the directory).
Only allowed when
directoryName
is specified.- no file
property executable
readonly executable?: string[];
An external command that will produce the packaged asset.
The command should produce the name of a local Docker image on
stdout
.- Exactly one of
directoryName
andexecutable
is required
property networkMode
readonly networkMode?: string;
Networking mode for the RUN commands during build. _Requires Docker Engine API v1.25+_.
Specify this property to build images on a specific networking mode.
- no networking mode specified
property platform
readonly platform?: string;
Platform to build for. _Requires Docker Buildx_.
Specify this property to build images on a specific platform.
- no platform specified (the current machine architecture will be used)
property repositoryName
readonly repositoryName?: string;
ECR repository name
Specify this property if you need to statically address the image, e.g. from a Kubernetes Pod. Note, this is only the repository name, without the registry and the tag parts.
- automatically derived from the asset's ID.
Deprecated
repository name should be specified at the environment-level and not at the image level
property sourceHash
readonly sourceHash: string;
The hash of the contents of the docker build context. This hash is used throughout the system to identify this image and avoid duplicate work in case the source did not change.
NOTE: this means that if you wish to update your docker image, you must make a modification to the source (e.g. add some metadata to your Dockerfile).
interface DockerRunOptions
interface DockerRunOptions {}
Docker run options
property command
readonly command?: string[];
The command to run in the container.
- run the command defined in the image
property entrypoint
readonly entrypoint?: string[];
The entrypoint to run in the container.
- run the entrypoint defined in the image
property environment
readonly environment?: { [key: string]: string;};
The environment variables to pass to the container.
- no environment variables.
property securityOpt
readonly securityOpt?: string;
[Security configuration](https://docs.docker.com/engine/reference/run/#security-configuration) when running the docker container.
- no security options
property user
readonly user?: string;
The user to use when running the container.
- root or image default
property volumes
readonly volumes?: DockerVolume[];
Docker volumes to mount.
- no volumes are mounted
property workingDirectory
readonly workingDirectory?: string;
Working directory inside the container.
- image default
interface DockerVolume
interface DockerVolume {}
A Docker volume
property consistency
readonly consistency?: DockerVolumeConsistency;
Mount consistency. Only applicable for macOS
DockerConsistency.DELEGATED
See Also
https://docs.docker.com/storage/bind-mounts/#configure-mount-consistency-for-macos
property containerPath
readonly containerPath: string;
The path where the file or directory is mounted in the container
property hostPath
readonly hostPath: string;
The path to the file or directory on the host machine
interface EncodingOptions
interface EncodingOptions {}
Properties to string encodings
property displayHint
readonly displayHint?: string;
A hint for the Token's purpose when stringifying it
interface Environment
interface Environment {}
The deployment environment for a stack.
property account
readonly account?: string;
The AWS account ID for this environment.
This can be either a concrete value such as
585191031104
orAws.accountId
which indicates that account ID will only be determined during deployment (it will resolve to the CloudFormation intrinsic{"Ref":"AWS::AccountId"}
). Note that certain features, such as cross-stack references and environmental context providers require concerete region information and will cause this stack to emit synthesis errors.Aws.accountId which means that the stack will be account-agnostic.
property region
readonly region?: string;
The AWS region for this environment.
This can be either a concrete value such as
eu-west-2
orAws.region
which indicates that account ID will only be determined during deployment (it will resolve to the CloudFormation intrinsic{"Ref":"AWS::Region"}
). Note that certain features, such as cross-stack references and environmental context providers require concerete region information and will cause this stack to emit synthesis errors.Aws.region which means that the stack will be region-agnostic.
interface ExportValueOptions
interface ExportValueOptions {}
Options for the
stack.exportValue()
method
property name
readonly name?: string;
The name of the export to create
- A name is automatically chosen
interface FileAssetLocation
interface FileAssetLocation {}
The location of the published file asset. This is where the asset can be consumed at runtime.
property bucketName
readonly bucketName: string;
The name of the Amazon S3 bucket.
property httpUrl
readonly httpUrl: string;
The HTTP URL of this asset on Amazon S3.
This value suitable for inclusion in a CloudFormation template, and may be an encoded token.
Example value:
https://s3-us-east-1.amazonaws.com/mybucket/myobject
property kmsKeyArn
readonly kmsKeyArn?: string;
The ARN of the KMS key used to encrypt the file asset bucket, if any.
The CDK bootstrap stack comes with a key policy that does not require setting this property, so you only need to set this property if you have customized the bootstrap stack to require it.
- Asset bucket is not encrypted, or decryption permissions are defined by a Key Policy.
property objectKey
readonly objectKey: string;
The Amazon S3 object key.
property s3ObjectUrl
readonly s3ObjectUrl: string;
The S3 URL of this asset on Amazon S3.
This value suitable for inclusion in a CloudFormation template, and may be an encoded token.
Example value:
s3://mybucket/myobject
property s3ObjectUrlWithPlaceholders
readonly s3ObjectUrlWithPlaceholders?: string;
Like
s3ObjectUrl
, but not suitable for CloudFormation consumptionIf there are placeholders in the S3 URL, they will be returned unreplaced and un-evaluated.
- This feature cannot be used
property s3Url
readonly s3Url?: string;
The HTTP URL of this asset on Amazon S3. - value specified in
httpUrl
is used.Deprecated
use
httpUrl
interface FileAssetSource
interface FileAssetSource {}
Represents the source for a file asset.
property executable
readonly executable?: string[];
An external command that will produce the packaged asset.
The command should produce the location of a ZIP file on
stdout
.- Exactly one of
directory
andexecutable
is required
property fileName
readonly fileName?: string;
The path, relative to the root of the cloud assembly, in which this asset source resides. This can be a path to a file or a directory, depending on the packaging type.
- Exactly one of
directory
andexecutable
is required
property packaging
readonly packaging?: FileAssetPackaging;
Which type of packaging to perform.
- Required if
fileName
is specified.
property sourceHash
readonly sourceHash: string;
A hash on the content source. This hash is used to uniquely identify this asset throughout the system. If this value doesn't change, the asset will not be rebuilt or republished.
interface FileCopyOptions
interface FileCopyOptions extends FileOptions {}
Options applied when copying directories into the staging location.
property followSymlinks
readonly followSymlinks?: SymlinkFollowMode;
A strategy for how to handle symlinks.
SymlinkFollowMode.NEVER
interface FileFingerprintOptions
interface FileFingerprintOptions extends FileCopyOptions, ExtraHashOptions {}
Options related to calculating source hash.
interface FingerprintOptions
interface FingerprintOptions extends CopyOptions, ExtraHashOptions {}
Options related to calculating source hash.
interface GetContextKeyOptions
interface GetContextKeyOptions {}
property includeEnvironment
readonly includeEnvironment?: boolean;
Whether to include the stack's account and region automatically.
true
property props
readonly props?: { [key: string]: any;};
Provider-specific properties.
property provider
readonly provider: string;
The context provider to query.
interface GetContextKeyResult
interface GetContextKeyResult {}
interface GetContextValueOptions
interface GetContextValueOptions extends GetContextKeyOptions {}
property dummyValue
readonly dummyValue: any;
The value to return if the context value was not found and a missing context is reported. This should be a dummy value that should preferably fail during deployment since it represents an invalid state.
interface GetContextValueResult
interface GetContextValueResult {}
property value
readonly value?: any;
interface IAnyProducer
interface IAnyProducer {}
Interface for lazy untyped value producers
method produce
produce: (context: IResolveContext) => any;
Produce the value
interface IAspect
interface IAspect {}
Represents an Aspect
method visit
visit: (node: IConstruct) => void;
All aspects can visit an IConstruct
interface IAsset
interface IAsset {}
Common interface for all assets.
property assetHash
readonly assetHash: string;
A hash of this asset, which is available at construction time. As this is a plain string, it can be used in construct IDs in order to enforce creation of a new resource when the content hash has changed.
interface ICfnConditionExpression
interface ICfnConditionExpression extends IResolvable {}
Represents a CloudFormation element that can be used within a Condition.
You can use intrinsic functions, such as ``Fn.conditionIf``, ``Fn.conditionEquals``, and ``Fn.conditionNot``, to conditionally create stack resources. These conditions are evaluated based on input parameters that you declare when you create or update a stack. After you define all your conditions, you can associate them with resources or resource properties in the Resources and Outputs sections of a template.
You define all conditions in the Conditions section of a template except for ``Fn.conditionIf`` conditions. You can use the ``Fn.conditionIf`` condition in the metadata attribute, update policy attribute, and property values in the Resources section and Outputs sections of a template.
You might use conditions when you want to reuse a template that can create resources in different contexts, such as a test environment versus a production environment. In your template, you can add an EnvironmentType input parameter, which accepts either prod or test as inputs. For the production environment, you might include Amazon EC2 instances with certain capabilities; however, for the test environment, you want to use less capabilities to save costs. With conditions, you can define which resources are created and how they're configured for each environment type.
You can use
toString
when you wish to embed a condition expression in a property value that accepts astring
. For example:new sqs.Queue(this, 'MyQueue', {queueName: Fn.conditionIf('Condition', 'Hello', 'World').toString()});
interface ICfnResourceOptions
interface ICfnResourceOptions {}
property condition
condition?: CfnCondition;
A condition to associate with this resource. This means that only if the condition evaluates to 'true' when the stack is deployed, the resource will be included. This is provided to allow CDK projects to produce legacy templates, but noramlly there is no need to use it in CDK projects.
property creationPolicy
creationPolicy?: CfnCreationPolicy;
Associate the CreationPolicy attribute with a resource to prevent its status from reaching create complete until AWS CloudFormation receives a specified number of success signals or the timeout period is exceeded. To signal a resource, you can use the cfn-signal helper script or SignalResource API. AWS CloudFormation publishes valid signals to the stack events so that you track the number of signals sent.
property deletionPolicy
deletionPolicy?: CfnDeletionPolicy;
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default. Note that this capability also applies to update operations that lead to resources being removed.
property description
description?: string;
The description of this resource. Used for informational purposes only, is not processed in any way (and stays with the CloudFormation template, is not passed to the underlying resource, even if it does have a 'description' property).
property metadata
metadata?: { [key: string]: any;};
Metadata associated with the CloudFormation resource. This is not the same as the construct metadata which can be added using construct.addMetadata(), but would not appear in the CloudFormation template automatically.
property updatePolicy
updatePolicy?: CfnUpdatePolicy;
Use the UpdatePolicy attribute to specify how AWS CloudFormation handles updates to the AWS::AutoScaling::AutoScalingGroup resource. AWS CloudFormation invokes one of three update policies depending on the type of change you make or whether a scheduled action is associated with the Auto Scaling group.
property updateReplacePolicy
updateReplacePolicy?: CfnDeletionPolicy;
Use the UpdateReplacePolicy attribute to retain or (in some cases) backup the existing physical instance of a resource when it is replaced during a stack update operation.
property version
version?: string;
The version of this resource. Used only for custom CloudFormation resources.
See Also
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cfn-customresource.html
interface ICfnRuleConditionExpression
interface ICfnRuleConditionExpression extends ICfnConditionExpression {}
Interface to specify certain functions as Service Catalog rule-specifc. These functions can only be used in ``Rules`` section of template.
property disambiguator
readonly disambiguator: boolean;
This field is only needed to defeat TypeScript's structural typing. It is never used.
interface IConstruct
interface IConstruct extends constructs.IConstruct, IDependable {}
Represents a construct.
property node
readonly node: ConstructNode;
The construct tree node for this construct.
interface IDependable
interface IDependable {}
Trait marker for classes that can be depended upon
The presence of this interface indicates that an object has an
IDependableTrait
implementation.This interface can be used to take an (ordering) dependency on a set of constructs. An ordering dependency implies that the resources represented by those constructs are deployed before the resources depending ON them are deployed.
interface IFragmentConcatenator
interface IFragmentConcatenator {}
Function used to concatenate symbols in the target document language
Interface so it could potentially be exposed over jsii.
method join
join: (left: any | undefined, right: any | undefined) => any;
Join the fragment on the left and on the right
interface IInspectable
interface IInspectable {}
Interface for examining a construct and exposing metadata.
method inspect
inspect: (inspector: TreeInspector) => void;
Examines construct
Parameter inspector
tree inspector to collect and process attributes
interface IListProducer
interface IListProducer {}
Interface for lazy list producers
method produce
produce: (context: IResolveContext) => string[] | undefined;
Produce the list value
interface ILocalBundling
interface ILocalBundling {}
Local bundling
method tryBundle
tryBundle: (outputDir: string, options: BundlingOptions) => boolean;
This method is called before attempting docker bundling to allow the bundler to be executed locally. If the local bundler exists, and bundling was performed locally, return
true
. Otherwise, returnfalse
.Parameter outputDir
the directory where the bundled asset should be output
Parameter options
bundling options for this asset
interface IntrinsicProps
interface IntrinsicProps {}
Customization properties for an Intrinsic token
property stackTrace
readonly stackTrace?: boolean;
Capture the stack trace of where this token is created
true
interface INumberProducer
interface INumberProducer {}
Interface for lazy number producers
method produce
produce: (context: IResolveContext) => number | undefined;
Produce the number value
interface IPostProcessor
interface IPostProcessor {}
A Token that can post-process the complete resolved value, after resolve() has recursed over it
method postProcess
postProcess: (input: any, context: IResolveContext) => any;
Process the completely resolved value, after full recursion/resolution has happened
interface IResolvable
interface IResolvable {}
Interface for values that can be resolvable later
Tokens are special objects that participate in synthesis.
property creationStack
readonly creationStack: string[];
The creation stack of this resolvable which will be appended to errors thrown during resolution.
This may return an array with a single informational element indicating how to get this property populated, if it was skipped for performance reasons.
method resolve
resolve: (context: IResolveContext) => any;
Produce the Token's value at resolution time
method toString
toString: () => string;
Return a string representation of this resolvable object.
Returns a reversible string representation.
interface IResolveContext
interface IResolveContext {}
Current resolution context for tokens
property documentPath
readonly documentPath: string[];
Path in the JSON document that is being constructed
property preparing
readonly preparing: boolean;
True when we are still preparing, false if we're rendering the final output
property scope
readonly scope: IConstruct;
The scope from which resolution has been initiated
method registerPostProcessor
registerPostProcessor: (postProcessor: IPostProcessor) => void;
Use this postprocessor after the entire token structure has been resolved
method resolve
resolve: (x: any, options?: ResolveChangeContextOptions) => any;
Resolve an inner object
interface IResource
interface IResource extends IConstruct {}
Interface for the Resource construct.
property env
readonly env: 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.
property stack
readonly stack: Stack;
The stack in which this resource is defined.
method applyRemovalPolicy
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
).
interface IStableAnyProducer
interface IStableAnyProducer {}
Interface for (stable) lazy untyped value producers
method produce
produce: () => any;
Produce the value
interface IStableListProducer
interface IStableListProducer {}
Interface for (stable) lazy list producers
method produce
produce: () => string[] | undefined;
Produce the list value
interface IStableNumberProducer
interface IStableNumberProducer {}
Interface for (stable) lazy number producers
method produce
produce: () => number | undefined;
Produce the number value
interface IStableStringProducer
interface IStableStringProducer {}
Interface for (stable) lazy string producers
method produce
produce: () => string | undefined;
Produce the string value
interface IStackSynthesizer
interface IStackSynthesizer {}
Encodes information how a certain Stack should be deployed
method addDockerImageAsset
addDockerImageAsset: (asset: DockerImageAssetSource) => DockerImageAssetLocation;
Register a Docker Image Asset
Returns the parameters that can be used to refer to the asset inside the template.
method addFileAsset
addFileAsset: (asset: FileAssetSource) => FileAssetLocation;
Register a File Asset
Returns the parameters that can be used to refer to the asset inside the template.
method bind
bind: (stack: Stack) => void;
Bind to the stack this environment is going to be used on
Must be called before any of the other methods are called.
method synthesize
synthesize: (session: ISynthesisSession) => void;
Synthesize the associated stack to the session
interface IStringProducer
interface IStringProducer {}
Interface for lazy string producers
method produce
produce: (context: IResolveContext) => string | undefined;
Produce the string value
interface ISynthesisSession
interface ISynthesisSession {}
Represents a single session of synthesis. Passed into
Construct.synthesize()
methods.
property assembly
assembly: cxapi.CloudAssemblyBuilder;
Cloud assembly builder.
property outdir
outdir: string;
The output directory for this synthesis session.
property validateOnSynth
validateOnSynth?: boolean;
Whether the stack should be validated after synthesis to check for error metadata
- false
interface ITaggable
interface ITaggable {}
Interface to implement tags.
property tags
readonly tags: TagManager;
TagManager to set, remove and format tags
interface ITemplateOptions
interface ITemplateOptions {}
CloudFormation template options for a stack.
property description
description?: string;
Gets or sets the description of this stack. If provided, it will be included in the CloudFormation template's "Description" attribute.
property metadata
metadata?: { [key: string]: any;};
Metadata associated with the CloudFormation template.
property templateFormatVersion
templateFormatVersion?: string;
Gets or sets the AWSTemplateFormatVersion field of the CloudFormation template.
property transform
transform?: string;
Gets or sets the top-level template transform for this stack (e.g. "AWS::Serverless-2016-10-31").
Deprecated
use
transforms
instead.
property transforms
transforms?: string[];
Gets or sets the top-level template transform(s) for this stack (e.g.
["AWS::Serverless-2016-10-31"]
).
interface ITokenMapper
interface ITokenMapper {}
Interface to apply operation to tokens in a string
Interface so it can be exported via jsii.
method mapToken
mapToken: (t: IResolvable) => any;
Replace a single token
interface ITokenResolver
interface ITokenResolver {}
How to resolve tokens
method resolveList
resolveList: (l: string[], context: IResolveContext) => any;
Resolve a tokenized list
method resolveString
resolveString: (s: TokenizedStringFragments, context: IResolveContext) => any;
Resolve a string with at least one stringified token in it
(May use concatenation)
method resolveToken
resolveToken: ( t: IResolvable, context: IResolveContext, postProcessor: IPostProcessor) => any;
Resolve a single token
interface LazyAnyValueOptions
interface LazyAnyValueOptions {}
Options for creating lazy untyped tokens
property displayHint
readonly displayHint?: string;
Use the given name as a display hint
- No hint
property omitEmptyArray
readonly omitEmptyArray?: boolean;
If the produced value is an array and it is empty, return 'undefined' instead
false
interface LazyListValueOptions
interface LazyListValueOptions {}
Options for creating a lazy list token
property displayHint
readonly displayHint?: string;
Use the given name as a display hint
- No hint
property omitEmpty
readonly omitEmpty?: boolean;
If the produced list is empty, return 'undefined' instead
false
interface LazyStringValueOptions
interface LazyStringValueOptions {}
Options for creating a lazy string token
property displayHint
readonly displayHint?: string;
Use the given name as a display hint
- No hint
interface NestedStackProps
interface NestedStackProps {}
Initialization props for the
NestedStack
construct.
property notificationArns
readonly notificationArns?: string[];
The Simple Notification Service (SNS) topics to publish stack related events.
- notifications are not sent for this stack.
property parameters
readonly parameters?: { [key: string]: string;};
The set value pairs that represent the parameters passed to CloudFormation when this nested stack is created. Each parameter has a name corresponding to a parameter defined in the embedded template and a value representing the value that you want to set for the parameter.
The nested stack construct will automatically synthesize parameters in order to bind references from the parent stack(s) into the nested stack.
- no user-defined parameters are passed to the nested stack
property removalPolicy
readonly removalPolicy?: RemovalPolicy;
Policy to apply when the nested stack is removed
The default is
Destroy
, because all Removal Policies of resources inside the Nested Stack should already have been set correctly. You normally should not need to set this value.RemovalPolicy.DESTROY
property timeout
readonly timeout?: Duration;
The length of time that CloudFormation waits for the nested stack to reach the CREATE_COMPLETE state.
When CloudFormation detects that the nested stack has reached the CREATE_COMPLETE state, it marks the nested stack resource as CREATE_COMPLETE in the parent stack and resumes creating the parent stack. If the timeout period expires before the nested stack reaches CREATE_COMPLETE, CloudFormation marks the nested stack as failed and rolls back both the nested stack and parent stack.
- no timeout
interface RemovalPolicyOptions
interface RemovalPolicyOptions {}
property applyToUpdateReplacePolicy
readonly applyToUpdateReplacePolicy?: boolean;
Apply the same deletion policy to the resource's "UpdateReplacePolicy" true
property default
readonly default?: RemovalPolicy;
The default policy to apply in case the removal policy is not defined.
- Default value is resource specific. To determine the default value for a resoure, please consult that specific resource's documentation.
interface ResolveChangeContextOptions
interface ResolveChangeContextOptions {}
Options that can be changed while doing a recursive resolve
property allowIntrinsicKeys
readonly allowIntrinsicKeys?: boolean;
Change the 'allowIntrinsicKeys' option
- Unchanged
interface ResolveOptions
interface ResolveOptions {}
Options to the resolve() operation
NOT the same as the ResolveContext; ResolveContext is exposed to Token implementors and resolution hooks, whereas this struct is just to bundle a number of things that would otherwise be arguments to resolve() in a readable way.
property preparing
readonly preparing?: boolean;
Whether the resolution is being executed during the prepare phase or not. false
property removeEmpty
readonly removeEmpty?: boolean;
Whether to remove undefined elements from arrays and objects when resolving.
true
property resolver
readonly resolver: ITokenResolver;
The resolver to apply to any resolvable tokens found
property scope
readonly scope: IConstruct;
The scope from which resolution is performed
interface ResourceEnvironment
interface ResourceEnvironment {}
Represents the environment a given resource lives in. Used as the return value for the IResource.env property.
property account
readonly account: string;
The AWS account ID that this resource belongs to. Since this can be a Token (for example, when the account is CloudFormation's AWS::AccountId intrinsic), make sure to use Token.compareStrings() instead of just comparing the values for equality.
property region
readonly region: string;
The AWS region that this resource belongs to. Since this can be a Token (for example, when the region is CloudFormation's AWS::Region intrinsic), make sure to use Token.compareStrings() instead of just comparing the values for equality.
interface ResourceProps
interface ResourceProps {}
Construction properties for Resource.
property account
readonly account?: string;
The AWS account ID this resource belongs to.
- the resource is in the same account as the stack it belongs to
property environmentFromArn
readonly environmentFromArn?: string;
ARN to deduce region and account from
The ARN is parsed and the account and region are taken from the ARN. This should be used for imported resources.
Cannot be supplied together with either
account
orregion
.- take environment from
account
,region
parameters, or use Stack environment.
property physicalName
readonly physicalName?: string;
The value passed in by users to the physical name prop of the resource.
-
undefined
implies that a physical name will be allocated by CloudFormation during deployment. - a concrete value implies a specific physical name -PhysicalName.GENERATE_IF_NEEDED
is a marker that indicates that a physical will only be generated by the CDK if it is needed for cross-environment references. Otherwise, it will be allocated by CloudFormation.- The physical name will be allocated by CloudFormation at deployment time
property region
readonly region?: string;
The AWS region this resource belongs to.
- the resource is in the same region as the stack it belongs to
interface ReverseOptions
interface ReverseOptions {}
Options for the 'reverse()' operation
property failConcat
readonly failConcat?: boolean;
Fail if the given string is a concatenation
If
false
, just returnundefined
.true
interface SecretsManagerSecretOptions
interface SecretsManagerSecretOptions {}
Options for referencing a secret value from Secrets Manager.
property jsonField
readonly jsonField?: string;
The key of a JSON field to retrieve. This can only be used if the secret stores a JSON object.
- returns all the content stored in the Secrets Manager secret.
property versionId
readonly versionId?: string;
Specifies the unique identifier of the version of the secret you want to use.
Can specify at most one of
versionId
andversionStage
.AWSCURRENT
property versionStage
readonly versionStage?: string;
Specifies the secret version that you want to retrieve by the staging label attached to the version.
Can specify at most one of
versionId
andversionStage
.AWSCURRENT
interface SizeConversionOptions
interface SizeConversionOptions {}
Options for how to convert time to a different unit.
property rounding
readonly rounding?: SizeRoundingBehavior;
How conversions should behave when it encounters a non-integer result SizeRoundingBehavior.FAIL
interface StackProps
interface StackProps {}
property analyticsReporting
readonly analyticsReporting?: boolean;
Include runtime versioning information in this Stack
analyticsReporting
setting of containingApp
, or value of 'aws:cdk:version-reporting' context key
property description
readonly description?: string;
A description of the stack.
- No description.
property env
readonly env?: Environment;
The AWS environment (account/region) where this stack will be deployed.
Set the
region
/account
fields ofenv
to either a concrete value to select the indicated environment (recommended for production stacks), or to the values of environment variablesCDK_DEFAULT_REGION
/CDK_DEFAULT_ACCOUNT
to let the target environment depend on the AWS credentials/configuration that the CDK CLI is executed under (recommended for development stacks).If the
Stack
is instantiated inside aStage
, any undefinedregion
/account
fields fromenv
will default to the same field on the encompassingStage
, if configured there.If either
region
oraccount
are not set nor inherited fromStage
, the Stack will be considered "*environment-agnostic*"". Environment-agnostic stacks can be deployed to any environment but may not be able to take advantage of all features of the CDK. For example, they will not be able to use environmental context lookups such asec2.Vpc.fromLookup
and will not automatically translate Service Principals to the right format based on the environment's AWS partition, and other such enhancements.Example 1
// Use a concrete account and region to deploy this stack to: //
.account
and.region
will simply return these values. new Stack(app, 'Stack1', { env: { account: '123456789012', region: 'us-east-1' }, });// Use the CLI's current credentials to determine the target environment: //
.account
and.region
will reflect the account+region the CLI // is configured to use (based on the user CLI credentials) new Stack(app, 'Stack2', { env: { account: process.env.CDK_DEFAULT_ACCOUNT, region: process.env.CDK_DEFAULT_REGION }, });// Define multiple stacks stage associated with an environment const myStage = new Stage(app, 'MyStage', { env: { account: '123456789012', region: 'us-east-1' } });
// both of these stacks will use the stage's account/region: //
.account
and.region
will resolve to the concrete values as above new MyStack(myStage, 'Stack1'); new YourStack(myStage, 'Stack2');// Define an environment-agnostic stack: //
.account
and.region
will resolve to{ "Ref": "AWS::AccountId" }
and{ "Ref": "AWS::Region" }
respectively. // which will only resolve to actual values by CloudFormation during deployment. new MyStack(app, 'Stack1');- The environment of the containing
Stage
if available, otherwise create the stack will be environment-agnostic.
property stackName
readonly stackName?: string;
Name to deploy the stack with
- Derived from construct path.
property synthesizer
readonly synthesizer?: IStackSynthesizer;
Synthesis method to use while deploying this stack
-
DefaultStackSynthesizer
if the@aws-cdk/core:newStyleStackSynthesis
feature flag is set,LegacyStackSynthesizer
otherwise.
property tags
readonly tags?: { [key: string]: string;};
Stack tags that will be applied to all the taggable resources and the stack itself.
{}
property terminationProtection
readonly terminationProtection?: boolean;
Whether to enable termination protection for this stack.
false
interface StageProps
interface StageProps {}
Initialization props for a stage.
property env
readonly env?: Environment;
Default AWS environment (account/region) for
Stack
s in thisStage
.Stacks defined inside this
Stage
with eitherregion
oraccount
missing from its env will use the corresponding field given here.If either
region
oraccount
is is not configured forStack
(either on theStack
itself or on the containingStage
), the Stack will be *environment-agnostic*.Environment-agnostic stacks can be deployed to any environment, may not be able to take advantage of all features of the CDK. For example, they will not be able to use environmental context lookups, will not automatically translate Service Principals to the right format based on the environment's AWS partition, and other such enhancements.
Example 1
// Use a concrete account and region to deploy this Stage to new Stage(app, 'Stage1', { env: { account: '123456789012', region: 'us-east-1' }, });
// Use the CLI's current credentials to determine the target environment new Stage(app, 'Stage2', { env: { account: process.env.CDK_DEFAULT_ACCOUNT, region: process.env.CDK_DEFAULT_REGION }, });
- The environments should be configured on the
Stack
s.
property outdir
readonly outdir?: string;
The output directory into which to emit synthesized artifacts.
Can only be specified if this stage is the root stage (the app). If this is specified and this stage is nested within another stage, an error will be thrown.
- for nested stages, outdir will be determined as a relative directory to the outdir of the app. For apps, if outdir is not specified, a temporary directory will be created.
interface StageSynthesisOptions
interface StageSynthesisOptions {}
Options for assembly synthesis.
property force
readonly force?: boolean;
Force a re-synth, even if the stage has already been synthesized. This is used by tests to allow for incremental verification of the output. Do not use in production. false
property skipValidation
readonly skipValidation?: boolean;
Should we skip construct validation. - false
property validateOnSynthesis
readonly validateOnSynthesis?: boolean;
Whether the stack should be validated after synthesis to check for error metadata
- false
interface SynthesisOptions
interface SynthesisOptions extends cxapi.AssemblyBuildOptions {}
Options for synthesis.
Deprecated
use
app.synth()
orstage.synth()
instead
property outdir
readonly outdir?: string;
The output directory into which to synthesize the cloud assembly. - creates a temporary directory
property skipValidation
readonly skipValidation?: boolean;
Whether synthesis should skip the validation phase. false
property validateOnSynthesis
readonly validateOnSynthesis?: boolean;
Whether the stack should be validated after synthesis to check for error metadata
- false
interface SynthesizeStackArtifactOptions
interface SynthesizeStackArtifactOptions {}
Stack artifact options
A subset of
cxschema.AwsCloudFormationStackProperties
of optional settings that need to be configurable by synthesizers, plusadditionalDependencies
.
property additionalDependencies
readonly additionalDependencies?: string[];
Identifiers of additional dependencies
- No additional dependencies
property assumeRoleArn
readonly assumeRoleArn?: string;
The role that needs to be assumed to deploy the stack
- No role is assumed (current credentials are used)
property assumeRoleExternalId
readonly assumeRoleExternalId?: string;
The externalID to use with the assumeRoleArn
- No externalID is used
property bootstrapStackVersionSsmParameter
readonly bootstrapStackVersionSsmParameter?: string;
SSM parameter where the bootstrap stack version number can be found
Only used if
requiresBootstrapStackVersion
is set.- If this value is not set, the bootstrap stack name must be known at deployment time so the stack version can be looked up from the stack outputs. - If this value is set, the bootstrap stack can have any name because we won't need to look it up.
- Bootstrap stack version number looked up
property cloudFormationExecutionRoleArn
readonly cloudFormationExecutionRoleArn?: string;
The role that is passed to CloudFormation to execute the change set
- No role is passed (currently assumed role/credentials are used)
property lookupRole
readonly lookupRole?: cxschema.BootstrapRole;
The role to use to look up values from the target AWS account
- None
property parameters
readonly parameters?: { [id: string]: string;};
Values for CloudFormation stack parameters that should be passed when the stack is deployed.
- No parameters
property requiresBootstrapStackVersion
readonly requiresBootstrapStackVersion?: number;
Version of bootstrap stack required to deploy this stack
- No bootstrap stack required
property stackTemplateAssetObjectUrl
readonly stackTemplateAssetObjectUrl?: string;
If the stack template has already been included in the asset manifest, its asset URL
- Not uploaded yet, upload just before deploying
interface TagManagerOptions
interface TagManagerOptions {}
Options to configure TagManager behavior
property tagPropertyName
readonly tagPropertyName?: string;
The name of the property in CloudFormation for these tags
Normally this is
tags
, but Cognito UserPool uses UserPoolTags"tags"
interface TagProps
interface TagProps {}
Properties for a tag
property applyToLaunchedInstances
readonly applyToLaunchedInstances?: boolean;
Whether the tag should be applied to instances in an AutoScalingGroup
true
property excludeResourceTypes
readonly excludeResourceTypes?: string[];
An array of Resource Types that will not receive this tag
An empty array will allow this tag to be applied to all resources. A non-empty array will apply this tag only if the Resource type is not in this array. []
property includeResourceTypes
readonly includeResourceTypes?: string[];
An array of Resource Types that will receive this tag
An empty array will match any Resource. A non-empty array will apply this tag only to Resource types that are included in this array. []
property priority
readonly priority?: number;
Priority of the tag operation
Higher or equal priority tags will take precedence.
Setting priority will enable the user to control tags when they need to not follow the default precedence pattern of last applied and closest to the construct in the tree.
Default priorities:
- 100 for SetTag - 200 for RemoveTag - 50 for tags added directly to CloudFormation resources
interface TimeConversionOptions
interface TimeConversionOptions {}
Options for how to convert time to a different unit.
property integral
readonly integral?: boolean;
If
true
, conversions into a larger time unit (e.g.Seconds
toMinutes
) will fail if the result is not an integer.true
interface ValidationError
interface ValidationError {}
An error returned during the validation phase.
Enums
enum ArnFormat
enum ArnFormat { NO_RESOURCE_NAME = 'arn:aws:service:region:account:resource', COLON_RESOURCE_NAME = 'arn:aws:service:region:account:resource:resourceName', SLASH_RESOURCE_NAME = 'arn:aws:service:region:account:resource/resourceName', SLASH_RESOURCE_SLASH_RESOURCE_NAME = 'arn:aws:service:region:account:/resource/resourceName',}
An enum representing the various ARN formats that different services use.
member COLON_RESOURCE_NAME
COLON_RESOURCE_NAME = 'arn:aws:service:region:account:resource:resourceName'
This represents a format where the 'resource' and 'resourceName' parts are separated with a colon. Like in: 'arn:aws:service:region:account:resource:resourceName'. Everything after the last colon is considered the 'resourceName', even if it contains slashes, like in 'arn:aws:apigateway:region:account:resource:/test/mydemoresource/*'.
member NO_RESOURCE_NAME
NO_RESOURCE_NAME = 'arn:aws:service:region:account:resource'
This represents a format where there is no 'resourceName' part. This format is used for S3 resources, like 'arn:aws:s3:::bucket'. Everything after the last colon is considered the 'resource', even if it contains slashes, like in 'arn:aws:s3:::bucket/object.zip'.
member SLASH_RESOURCE_NAME
SLASH_RESOURCE_NAME = 'arn:aws:service:region:account:resource/resourceName'
This represents a format where the 'resource' and 'resourceName' parts are separated with a slash. Like in: 'arn:aws:service:region:account:resource/resourceName'. Everything after the separating slash is considered the 'resourceName', even if it contains colons, like in 'arn:aws:cognito-sync:region:account:identitypool/us-east-1:1a1a1a1a-ffff-1111-9999-12345678:bla'.
member SLASH_RESOURCE_SLASH_RESOURCE_NAME
SLASH_RESOURCE_SLASH_RESOURCE_NAME = 'arn:aws:service:region:account:/resource/resourceName'
This represents a format where the 'resource' and 'resourceName' parts are seperated with a slash, but there is also an additional slash after the colon separating 'account' from 'resource'. Like in: 'arn:aws:service:region:account:/resource/resourceName'. Note that the leading slash is _not_ included in the parsed 'resource' part.
enum AssetHashType
enum AssetHashType { SOURCE = 'source', BUNDLE = 'bundle', OUTPUT = 'output', CUSTOM = 'custom',}
The type of asset hash
NOTE: the hash is used in order to identify a specific revision of the asset, and used for optimizing and caching deployment activities related to this asset such as packaging, uploading to Amazon S3, etc.
member BUNDLE
BUNDLE = 'bundle'
Based on the content of the bundled path
Deprecated
use
OUTPUT
instead
member CUSTOM
CUSTOM = 'custom'
Use a custom hash
member OUTPUT
OUTPUT = 'output'
Based on the content of the bundling output
Use
OUTPUT
when the source of the asset is a top level folder containing code and/or dependencies that are not directly linked to the asset.
member SOURCE
SOURCE = 'source'
Based on the content of the source path
When bundling, use
SOURCE
when the content of the bundling output is not stable across repeated bundling operations.
enum BundlingOutput
enum BundlingOutput { ARCHIVED = 'archived', NOT_ARCHIVED = 'not-archived', AUTO_DISCOVER = 'auto-discover',}
The type of output that a bundling operation is producing.
member ARCHIVED
ARCHIVED = 'archived'
The bundling output directory includes a single .zip or .jar file which will be used as the final bundle. If the output directory does not include exactly a single archive, bundling will fail.
member AUTO_DISCOVER
AUTO_DISCOVER = 'auto-discover'
If the bundling output directory contains a single archive file (zip or jar) it will be used as the bundle output as-is. Otherwise all the files in the bundling output directory will be zipped.
member NOT_ARCHIVED
NOT_ARCHIVED = 'not-archived'
The bundling output directory contains one or more files which will be archived and uploaded as a .zip file to S3.
enum CfnCapabilities
enum CfnCapabilities { NONE = '', ANONYMOUS_IAM = 'CAPABILITY_IAM', NAMED_IAM = 'CAPABILITY_NAMED_IAM', AUTO_EXPAND = 'CAPABILITY_AUTO_EXPAND',}
Capabilities that affect whether CloudFormation is allowed to change IAM resources
member ANONYMOUS_IAM
ANONYMOUS_IAM = 'CAPABILITY_IAM'
Capability to create anonymous IAM resources
Pass this capability if you're only creating anonymous resources. https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html#using-iam-capabilities
member AUTO_EXPAND
AUTO_EXPAND = 'CAPABILITY_AUTO_EXPAND'
Capability to run CloudFormation macros
Pass this capability if your template includes macros, for example AWS::Include or AWS::Serverless.
https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_CreateStack.html
member NAMED_IAM
NAMED_IAM = 'CAPABILITY_NAMED_IAM'
Capability to create named IAM resources.
Pass this capability if you're creating IAM resources that have physical names.
CloudFormationCapabilities.NamedIAM
impliesCloudFormationCapabilities.IAM
; you don't have to pass both. https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html#using-iam-capabilities
member NONE
NONE = ''
No IAM Capabilities
Pass this capability if you wish to block the creation IAM resources. https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html#using-iam-capabilities
enum CfnDeletionPolicy
enum CfnDeletionPolicy { DELETE = 'Delete', RETAIN = 'Retain', SNAPSHOT = 'Snapshot',}
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default. Note that this capability also applies to update operations that lead to resources being removed.
member DELETE
DELETE = 'Delete'
AWS CloudFormation deletes the resource and all its content if applicable during stack deletion. You can add this deletion policy to any resource type. By default, if you don't specify a DeletionPolicy, AWS CloudFormation deletes your resources. However, be aware of the following considerations:
member RETAIN
RETAIN = 'Retain'
AWS CloudFormation keeps the resource without deleting the resource or its contents when its stack is deleted. You can add this deletion policy to any resource type. Note that when AWS CloudFormation completes the stack deletion, the stack will be in Delete_Complete state; however, resources that are retained continue to exist and continue to incur applicable charges until you delete those resources.
member SNAPSHOT
SNAPSHOT = 'Snapshot'
For resources that support snapshots (AWS::EC2::Volume, AWS::ElastiCache::CacheCluster, AWS::ElastiCache::ReplicationGroup, AWS::RDS::DBInstance, AWS::RDS::DBCluster, and AWS::Redshift::Cluster), AWS CloudFormation creates a snapshot for the resource before deleting it. Note that when AWS CloudFormation completes the stack deletion, the stack will be in the Delete_Complete state; however, the snapshots that are created with this policy continue to exist and continue to incur applicable charges until you delete those snapshots.
enum CfnDynamicReferenceService
enum CfnDynamicReferenceService { SSM = 'ssm', SSM_SECURE = 'ssm-secure', SECRETS_MANAGER = 'secretsmanager',}
The service to retrieve the dynamic reference from
member SECRETS_MANAGER
SECRETS_MANAGER = 'secretsmanager'
Secret stored in AWS Secrets Manager
member SSM
SSM = 'ssm'
Plaintext value stored in AWS Systems Manager Parameter Store
member SSM_SECURE
SSM_SECURE = 'ssm-secure'
Secure string stored in AWS Systems Manager Parameter Store
enum CfnTrafficRoutingType
enum CfnTrafficRoutingType { ALL_AT_ONCE = 'AllAtOnce', TIME_BASED_CANARY = 'TimeBasedCanary', TIME_BASED_LINEAR = 'TimeBasedLinear',}
The possible types of traffic shifting for the blue-green deployment configuration. The type of the property.
member ALL_AT_ONCE
ALL_AT_ONCE = 'AllAtOnce'
Switch from blue to green at once.
member TIME_BASED_CANARY
TIME_BASED_CANARY = 'TimeBasedCanary'
Specifies a configuration that shifts traffic from blue to green in two increments.
member TIME_BASED_LINEAR
TIME_BASED_LINEAR = 'TimeBasedLinear'
Specifies a configuration that shifts traffic from blue to green in equal increments, with an equal number of minutes between each increment.
enum ConstructOrder
enum ConstructOrder { PREORDER = 0, POSTORDER = 1,}
In what order to return constructs
enum CustomResourceProviderRuntime
enum CustomResourceProviderRuntime { NODEJS_12 = 'deprecated_nodejs12.x', NODEJS_12_X = 'nodejs12.x', NODEJS_14_X = 'nodejs14.x', NODEJS_16_X = 'nodejs16.x',}
The lambda runtime to use for the resource provider. This also indicates which language is used for the handler.
member NODEJS_12
NODEJS_12 = 'deprecated_nodejs12.x'
Node.js 12.x
Deprecated
Use NODEJS_14_X
member NODEJS_12_X
NODEJS_12_X = 'nodejs12.x'
Node.js 12.x
member NODEJS_14_X
NODEJS_14_X = 'nodejs14.x'
Node.js 14.x
member NODEJS_16_X
NODEJS_16_X = 'nodejs16.x'
Node.js 16.x
enum DockerVolumeConsistency
enum DockerVolumeConsistency { CONSISTENT = 'consistent', DELEGATED = 'delegated', CACHED = 'cached',}
Supported Docker volume consistency types. Only valid on macOS due to the way file storage works on Mac
member CACHED
CACHED = 'cached'
Read/write operations on mounted Docker volumes are first applied on the host machine and then synchronized to the container
member CONSISTENT
CONSISTENT = 'consistent'
Read/write operations inside the Docker container are applied immediately on the mounted host machine volumes
member DELEGATED
DELEGATED = 'delegated'
Read/write operations on mounted Docker volumes are first written inside the container and then synchronized to the host machine
enum FileAssetPackaging
enum FileAssetPackaging { ZIP_DIRECTORY = 'zip', FILE = 'file',}
Packaging modes for file assets.
member FILE
FILE = 'file'
The asset source path points to a single file, which should be uploaded to Amazon S3.
member ZIP_DIRECTORY
ZIP_DIRECTORY = 'zip'
The asset source path points to a directory, which should be archived using zip and and then uploaded to Amazon S3.
enum IgnoreMode
enum IgnoreMode { GLOB = 'glob', GIT = 'git', DOCKER = 'docker',}
Determines the ignore behavior to use.
member DOCKER
DOCKER = 'docker'
Ignores file paths based on the [
.dockerignore specification
](https://docs.docker.com/engine/reference/builder/#dockerignore-file).This is the default for Docker image assets if the '@aws-cdk/aws-ecr-assets:dockerIgnoreSupport' context flag is set.
member GIT
GIT = 'git'
Ignores file paths based on the [
.gitignore specification
](https://git-scm.com/docs/gitignore).
member GLOB
GLOB = 'glob'
Ignores file paths based on simple glob patterns.
This is the default for file assets.
It is also the default for Docker image assets, unless the '@aws-cdk/aws-ecr-assets:dockerIgnoreSupport' context flag is set.
enum RemovalPolicy
enum RemovalPolicy { DESTROY = 'destroy', RETAIN = 'retain', SNAPSHOT = 'snapshot',}
Possible values for a resource's Removal Policy
The removal policy controls what happens to the resource if it stops being managed by CloudFormation. This can happen in one of three situations:
- The resource is removed from the template, so CloudFormation stops managing it; - A change to the resource is made that requires it to be replaced, so CloudFormation stops managing it; - The stack is deleted, so CloudFormation stops managing all resources in it.
The Removal Policy applies to all above cases.
Many stateful resources in the AWS Construct Library will accept a
removalPolicy
as a property, typically defaulting it toRETAIN
.If the AWS Construct Library resource does not accept a
removalPolicy
argument, you can always configure it by using the escape hatch mechanism, as shown in the following example:declare const bucket: s3.Bucket;const cfnBucket = bucket.node.findChild('Resource') as CfnResource;cfnBucket.applyRemovalPolicy(RemovalPolicy.DESTROY);
member DESTROY
DESTROY = 'destroy'
This is the default removal policy. It means that when the resource is removed from the app, it will be physically destroyed.
member RETAIN
RETAIN = 'retain'
This uses the 'Retain' DeletionPolicy, which will cause the resource to be retained in the account, but orphaned from the stack.
member SNAPSHOT
SNAPSHOT = 'snapshot'
This retention policy deletes the resource, but saves a snapshot of its data before deleting, so that it can be re-created later. Only available for some stateful resources, like databases, EFS volumes, etc.
See Also
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html#aws-attribute-deletionpolicy-options
enum SizeRoundingBehavior
enum SizeRoundingBehavior { FAIL = 0, FLOOR = 1, NONE = 2,}
Rounding behaviour when converting between units of
Size
.
enum SymlinkFollowMode
enum SymlinkFollowMode { NEVER = 'never', ALWAYS = 'always', EXTERNAL = 'external', BLOCK_EXTERNAL = 'internal-only',}
Determines how symlinks are followed.
member ALWAYS
ALWAYS = 'always'
Materialize all symlinks, whether they are internal or external to the source directory.
member BLOCK_EXTERNAL
BLOCK_EXTERNAL = 'internal-only'
Forbids source from having any symlinks pointing outside of the source tree.
This is the safest mode of operation as it ensures that copy operations won't materialize files from the user's file system. Internal symlinks are not followed.
If the copy operation runs into an external symlink, it will fail.
member EXTERNAL
EXTERNAL = 'external'
Only follows symlinks that are external to the source directory.
member NEVER
NEVER = 'never'
Never follow symlinks.
enum TagType
enum TagType { STANDARD = 'StandardTag', AUTOSCALING_GROUP = 'AutoScalingGroupTag', MAP = 'StringToStringMap', KEY_VALUE = 'KeyValue', NOT_TAGGABLE = 'NotTaggable',}
member AUTOSCALING_GROUP
AUTOSCALING_GROUP = 'AutoScalingGroupTag'
member KEY_VALUE
KEY_VALUE = 'KeyValue'
member MAP
MAP = 'StringToStringMap'
member NOT_TAGGABLE
NOT_TAGGABLE = 'NotTaggable'
member STANDARD
STANDARD = 'StandardTag'
Type Aliases
Namespaces
namespace CfnHookVersion
namespace CfnHookVersion {}
interface LoggingConfigProperty
interface LoggingConfigProperty {}
The
LoggingConfig
property type specifies logging configuration information for an extension.external
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudformation-hookversion-loggingconfig.html
property logGroupName
readonly logGroupName?: string;
The Amazon CloudWatch Logs group to which CloudFormation sends error logging information when invoking the extension's handlers.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudformation-hookversion-loggingconfig.html#cfn-cloudformation-hookversion-loggingconfig-loggroupname
property logRoleArn
readonly logRoleArn?: string;
The Amazon Resource Name (ARN) of the role that CloudFormation should assume when sending log entries to CloudWatch Logs.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudformation-hookversion-loggingconfig.html#cfn-cloudformation-hookversion-loggingconfig-logrolearn
namespace CfnResourceVersion
namespace CfnResourceVersion {}
interface LoggingConfigProperty
interface LoggingConfigProperty {}
Logging configuration information for a resource.
external
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudformation-resourceversion-loggingconfig.html
property logGroupName
readonly logGroupName?: string;
The Amazon CloudWatch logs group to which CloudFormation sends error logging information when invoking the type's handlers.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudformation-resourceversion-loggingconfig.html#cfn-cloudformation-resourceversion-loggingconfig-loggroupname
property logRoleArn
readonly logRoleArn?: string;
The ARN of the role that CloudFormation should assume when sending log entries to CloudWatch logs.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudformation-resourceversion-loggingconfig.html#cfn-cloudformation-resourceversion-loggingconfig-logrolearn
namespace CfnStackSet
namespace CfnStackSet {}
interface AutoDeploymentProperty
interface AutoDeploymentProperty {}
[
Service-managed
permissions] Describes whether StackSets automatically deploys to AWS Organizations accounts that are added to a target organizational unit (OU).external
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudformation-stackset-autodeployment.html
property enabled
readonly enabled?: boolean | cdk.IResolvable;
If set to
true
, StackSets automatically deploys additional stack instances to AWS Organizations accounts that are added to a target organization or organizational unit (OU) in the specified Regions. If an account is removed from a target organization or OU, StackSets deletes stack instances from the account in the specified Regions.http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudformation-stackset-autodeployment.html#cfn-cloudformation-stackset-autodeployment-enabled
property retainStacksOnAccountRemoval
readonly retainStacksOnAccountRemoval?: boolean | cdk.IResolvable;
If set to
true
, stack resources are retained when an account is removed from a target organization or OU. If set tofalse
, stack resources are deleted. Specify only ifEnabled
is set toTrue
.http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudformation-stackset-autodeployment.html#cfn-cloudformation-stackset-autodeployment-retainstacksonaccountremoval
interface DeploymentTargetsProperty
interface DeploymentTargetsProperty {}
The AWS OrganizationalUnitIds or Accounts for which to create stack instances in the specified Regions.
external
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudformation-stackset-deploymenttargets.html
property accountFilterType
readonly accountFilterType?: string;
Limit deployment targets to individual accounts or include additional accounts with provided OUs.
The following is a list of possible values for the
AccountFilterType
operation.-
INTERSECTION
: StackSets deploys to the accounts specified inAccounts
parameter. -DIFFERENCE
: StackSets excludes the accounts specified inAccounts
parameter. This enables user to avoid certain accounts within an OU such as suspended accounts. -UNION
: StackSets includes additional accounts deployment targets.This is the default value if
AccountFilterType
is not provided. This enables user to update an entire OU and individual accounts from a different OU in one request, which used to be two separate requests. -NONE
: Deploys to all the accounts in specified organizational units (OU).http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudformation-stackset-deploymenttargets.html#cfn-cloudformation-stackset-deploymenttargets-accountfiltertype
property accounts
readonly accounts?: string[];
The names of one or more AWS accounts for which you want to deploy stack set updates.
*Pattern* :
^[0-9]{12}$
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudformation-stackset-deploymenttargets.html#cfn-cloudformation-stackset-deploymenttargets-accounts
property organizationalUnitIds
readonly organizationalUnitIds?: string[];
The organization root ID or organizational unit (OU) IDs to which StackSets deploys.
*Pattern* :
^(ou-[a-z0-9]{4,32}-[a-z0-9]{8,32}|r-[a-z0-9]{4,32})$
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudformation-stackset-deploymenttargets.html#cfn-cloudformation-stackset-deploymenttargets-organizationalunitids
interface ManagedExecutionProperty
interface ManagedExecutionProperty {}
Describes whether StackSets performs non-conflicting operations concurrently and queues conflicting operations.
external
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudformation-stackset-managedexecution.html
property active
readonly active?: boolean | cdk.IResolvable;
When
true
, StackSets performs non-conflicting operations concurrently and queues conflicting operations. After conflicting operations finish, StackSets starts queued operations in request order.> If there are already running or queued operations, StackSets queues all incoming operations even if they are non-conflicting. > > You can't modify your stack set's execution configuration while there are running or queued operations for that stack set.
When
false
(default), StackSets performs one operation at a time in request order.http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudformation-stackset-managedexecution.html#cfn-cloudformation-stackset-managedexecution-active
interface OperationPreferencesProperty
interface OperationPreferencesProperty {}
The user-specified preferences for how AWS CloudFormation performs a stack set operation. For more information on maximum concurrent accounts and failure tolerance, see [Stack set operation options](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-concepts.html#stackset-ops-options) .
external
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudformation-stackset-operationpreferences.html
property failureToleranceCount
readonly failureToleranceCount?: number;
The number of accounts, per Region, for which this operation can fail before AWS CloudFormation stops the operation in that Region. If the operation is stopped in a Region, AWS CloudFormation doesn't attempt the operation in any subsequent Regions.
Conditional: You must specify either
FailureToleranceCount
orFailureTolerancePercentage
(but not both).http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudformation-stackset-operationpreferences.html#cfn-cloudformation-stackset-operationpreferences-failuretolerancecount
property failureTolerancePercentage
readonly failureTolerancePercentage?: number;
The percentage of accounts, per Region, for which this stack operation can fail before AWS CloudFormation stops the operation in that Region. If the operation is stopped in a Region, AWS CloudFormation doesn't attempt the operation in any subsequent Regions.
When calculating the number of accounts based on the specified percentage, AWS CloudFormation rounds *down* to the next whole number.
Conditional: You must specify either
FailureToleranceCount
orFailureTolerancePercentage
, but not both.http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudformation-stackset-operationpreferences.html#cfn-cloudformation-stackset-operationpreferences-failuretolerancepercentage
property maxConcurrentCount
readonly maxConcurrentCount?: number;
The maximum number of accounts in which to perform this operation at one time. This is dependent on the value of
FailureToleranceCount
.MaxConcurrentCount
is at most one more than theFailureToleranceCount
.Note that this setting lets you specify the *maximum* for operations. For large deployments, under certain circumstances the actual number of accounts acted upon concurrently may be lower due to service throttling.
Conditional: You must specify either
MaxConcurrentCount
orMaxConcurrentPercentage
, but not both.http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudformation-stackset-operationpreferences.html#cfn-cloudformation-stackset-operationpreferences-maxconcurrentcount
property maxConcurrentPercentage
readonly maxConcurrentPercentage?: number;
The maximum percentage of accounts in which to perform this operation at one time.
When calculating the number of accounts based on the specified percentage, AWS CloudFormation rounds down to the next whole number. This is true except in cases where rounding down would result is zero. In this case, CloudFormation sets the number as one instead.
Note that this setting lets you specify the *maximum* for operations. For large deployments, under certain circumstances the actual number of accounts acted upon concurrently may be lower due to service throttling.
Conditional: You must specify either
MaxConcurrentCount
orMaxConcurrentPercentage
, but not both.http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudformation-stackset-operationpreferences.html#cfn-cloudformation-stackset-operationpreferences-maxconcurrentpercentage
property regionConcurrencyType
readonly regionConcurrencyType?: string;
The concurrency type of deploying StackSets operations in Regions, could be in parallel or one Region at a time.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudformation-stackset-operationpreferences.html#cfn-cloudformation-stackset-operationpreferences-regionconcurrencytype
property regionOrder
readonly regionOrder?: string[];
The order of the Regions where you want to perform the stack operation.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudformation-stackset-operationpreferences.html#cfn-cloudformation-stackset-operationpreferences-regionorder
interface ParameterProperty
interface ParameterProperty {}
The Parameter data type.
external
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudformation-stackset-parameter.html
property parameterKey
readonly parameterKey: string;
The key associated with the parameter. If you don't specify a key and value for a particular parameter, AWS CloudFormation uses the default value that's specified in your template.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudformation-stackset-parameter.html#cfn-cloudformation-stackset-parameter-parameterkey
property parameterValue
readonly parameterValue: string;
The input value associated with the parameter.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudformation-stackset-parameter.html#cfn-cloudformation-stackset-parameter-parametervalue
interface StackInstancesProperty
interface StackInstancesProperty {}
Stack instances in some specific accounts and Regions.
external
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudformation-stackset-stackinstances.html
property deploymentTargets
readonly deploymentTargets: | CfnStackSet.DeploymentTargetsProperty | cdk.IResolvable;
The AWS
OrganizationalUnitIds
orAccounts
for which to create stack instances in the specified Regions.http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudformation-stackset-stackinstances.html#cfn-cloudformation-stackset-stackinstances-deploymenttargets
property parameterOverrides
readonly parameterOverrides?: | Array<CfnStackSet.ParameterProperty | cdk.IResolvable> | cdk.IResolvable;
A list of stack set parameters whose values you want to override in the selected stack instances.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudformation-stackset-stackinstances.html#cfn-cloudformation-stackset-stackinstances-parameteroverrides
property regions
readonly regions: string[];
The names of one or more Regions where you want to create stack instances using the specified AWS accounts .
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudformation-stackset-stackinstances.html#cfn-cloudformation-stackset-stackinstances-regions
namespace CfnTypeActivation
namespace CfnTypeActivation {}
interface LoggingConfigProperty
interface LoggingConfigProperty {}
Contains logging configuration information for an extension.
external
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudformation-typeactivation-loggingconfig.html
property logGroupName
readonly logGroupName?: string;
The Amazon CloudWatch Logs group to which CloudFormation sends error logging information when invoking the extension's handlers.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudformation-typeactivation-loggingconfig.html#cfn-cloudformation-typeactivation-loggingconfig-loggroupname
property logRoleArn
readonly logRoleArn?: string;
The Amazon Resource Name (ARN) of the role that CloudFormation should assume when sending log entries to CloudWatch Logs.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudformation-typeactivation-loggingconfig.html#cfn-cloudformation-typeactivation-loggingconfig-logrolearn
Package Files (65)
- lib/annotations.d.ts
- lib/app.d.ts
- lib/arn.d.ts
- lib/aspect.d.ts
- lib/asset-staging.d.ts
- lib/assets.d.ts
- lib/bundling.d.ts
- lib/cfn-capabilities.d.ts
- lib/cfn-codedeploy-blue-green-hook.d.ts
- lib/cfn-condition.d.ts
- lib/cfn-dynamic-reference.d.ts
- lib/cfn-element.d.ts
- lib/cfn-fn.d.ts
- lib/cfn-hook.d.ts
- lib/cfn-include.d.ts
- lib/cfn-json.d.ts
- lib/cfn-mapping.d.ts
- lib/cfn-output.d.ts
- lib/cfn-parameter.d.ts
- lib/cfn-pseudo.d.ts
- lib/cfn-resource-policy.d.ts
- lib/cfn-resource.d.ts
- lib/cfn-rule.d.ts
- lib/cfn-tag.d.ts
- lib/cloudformation.generated.d.ts
- lib/construct-compat.d.ts
- lib/context-provider.d.ts
- lib/custom-resource-provider/custom-resource-provider.d.ts
- lib/custom-resource.d.ts
- lib/dependency.d.ts
- lib/duration.d.ts
- lib/environment.d.ts
- lib/expiration.d.ts
- lib/feature-flags.d.ts
- lib/fs/ignore.d.ts
- lib/fs/index.d.ts
- lib/fs/options.d.ts
- lib/index.d.ts
- lib/lazy.d.ts
- lib/names.d.ts
- lib/nested-stack.d.ts
- lib/physical-name.d.ts
- lib/private/intrinsic.d.ts
- lib/reference.d.ts
- lib/removal-policy.d.ts
- lib/resolvable.d.ts
- lib/resource.d.ts
- lib/runtime.d.ts
- lib/secret-value.d.ts
- lib/size.d.ts
- lib/stack-synthesizers/bootstrapless-synthesizer.d.ts
- lib/stack-synthesizers/cli-credentials-synthesizer.d.ts
- lib/stack-synthesizers/default-synthesizer.d.ts
- lib/stack-synthesizers/legacy.d.ts
- lib/stack-synthesizers/nested.d.ts
- lib/stack-synthesizers/stack-synthesizer.d.ts
- lib/stack-synthesizers/types.d.ts
- lib/stack-trace.d.ts
- lib/stack.d.ts
- lib/stage.d.ts
- lib/string-fragments.d.ts
- lib/tag-aspect.d.ts
- lib/tag-manager.d.ts
- lib/token.d.ts
- lib/tree.d.ts
Dependencies (8)
Dev Dependencies (15)
Peer Dependencies (4)
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@aws-cdk/core
.
- Markdown[![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@aws-cdk/core)
- HTML<a href="https://www.jsdocs.io/package/@aws-cdk/core"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 13307 ms. - Missing or incorrect documentation? Open an issue for this package.