Class DefaultStackSynthesizer
Uses conventionally named roles and asset storage locations.
Inherited Members
Namespace: Amazon.CDK
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class DefaultStackSynthesizer : StackSynthesizer, IReusableStackSynthesizer, IBoundStackSynthesizer, IStackSynthesizer
Syntax (vb)
Public Class DefaultStackSynthesizer
Inherits StackSynthesizer
Implements IReusableStackSynthesizer, IBoundStackSynthesizer, IStackSynthesizer
Remarks
This synthesizer:
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.
ExampleMetadata: infused
Examples
App app;
var prodStage = new Stage(app, "ProdStage", new StageProps {
PermissionsBoundary = PermissionsBoundary.FromName("cdk-${Qualifier}-PermissionsBoundary-${AWS::AccountId}-${AWS::Region}")
});
new Stack(prodStage, "ProdStack", new StackProps {
Synthesizer = new DefaultStackSynthesizer(new DefaultStackSynthesizerProps {
Qualifier = "custom"
})
});
Synopsis
Constructors
DefaultStackSynthesizer(IDefaultStackSynthesizerProps) | |
DefaultStackSynthesizer(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
DefaultStackSynthesizer(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Properties
BootstrapQualifier | The qualifier used to bootstrap this stack. |
CloudFormationExecutionRoleArn | Returns the ARN of the CFN execution Role. |
DEFAULT_BOOTSTRAP_STACK_VERSION_SSM_PARAMETER | Default bootstrap stack version SSM parameter. |
DEFAULT_CLOUDFORMATION_ROLE_ARN | Default CloudFormation role ARN. |
DEFAULT_DEPLOY_ROLE_ARN | Default deploy role ARN. |
DEFAULT_DOCKER_ASSET_PREFIX | Default Docker asset prefix. |
DEFAULT_FILE_ASSET_KEY_ARN_EXPORT_NAME | Name of the CloudFormation Export with the asset key name. |
DEFAULT_FILE_ASSET_PREFIX | Default file asset prefix. |
DEFAULT_FILE_ASSET_PUBLISHING_ROLE_ARN | Default asset publishing role ARN for file (S3) assets. |
DEFAULT_FILE_ASSETS_BUCKET_NAME | Default file assets bucket name. |
DEFAULT_IMAGE_ASSET_PUBLISHING_ROLE_ARN | Default asset publishing role ARN for image (ECR) assets. |
DEFAULT_IMAGE_ASSETS_REPOSITORY_NAME | Default image assets repository name. |
DEFAULT_LOOKUP_ROLE_ARN | Default lookup role ARN for missing values. |
DEFAULT_QUALIFIER | Default ARN qualifier. |
DeployRoleArn | Returns the ARN of the deploy Role. |
LookupRole | The role used to lookup for this stack. |
Stack | (deprecated) Return the currently bound stack. |
Methods
AddDockerImageAsset(IDockerImageAssetSource) | Register a Docker Image Asset. |
AddFileAsset(IFileAssetSource) | Register a File Asset. |
Bind(Stack) | Bind to the stack this environment is going to be used on. |
ReusableBind(Stack) | Produce a bound Stack Synthesizer for the given stack. |
Synthesize(ISynthesisSession) | Synthesize the associated stack to the session. |
SynthesizeStackTemplate(Stack, ISynthesisSession) | Synthesize the stack template to the given session, passing the configured lookup role ARN. |
Constructors
DefaultStackSynthesizer(IDefaultStackSynthesizerProps)
public DefaultStackSynthesizer(IDefaultStackSynthesizerProps props = null)
Parameters
DefaultStackSynthesizer(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected DefaultStackSynthesizer(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
DefaultStackSynthesizer(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected DefaultStackSynthesizer(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Properties
BootstrapQualifier
The qualifier used to bootstrap this stack.
public override string BootstrapQualifier { get; }
Property Value
System.String
Overrides
CloudFormationExecutionRoleArn
Returns the ARN of the CFN execution Role.
public virtual string CloudFormationExecutionRoleArn { get; }
Property Value
System.String
DEFAULT_BOOTSTRAP_STACK_VERSION_SSM_PARAMETER
Default bootstrap stack version SSM parameter.
public static string DEFAULT_BOOTSTRAP_STACK_VERSION_SSM_PARAMETER { get; }
Property Value
System.String
DEFAULT_CLOUDFORMATION_ROLE_ARN
Default CloudFormation role ARN.
public static string DEFAULT_CLOUDFORMATION_ROLE_ARN { get; }
Property Value
System.String
DEFAULT_DEPLOY_ROLE_ARN
Default deploy role ARN.
public static string DEFAULT_DEPLOY_ROLE_ARN { get; }
Property Value
System.String
DEFAULT_DOCKER_ASSET_PREFIX
Default Docker asset prefix.
public static string DEFAULT_DOCKER_ASSET_PREFIX { get; }
Property Value
System.String
DEFAULT_FILE_ASSET_KEY_ARN_EXPORT_NAME
Name of the CloudFormation Export with the asset key name.
public static string DEFAULT_FILE_ASSET_KEY_ARN_EXPORT_NAME { get; }
Property Value
System.String
DEFAULT_FILE_ASSET_PREFIX
Default file asset prefix.
public static string DEFAULT_FILE_ASSET_PREFIX { get; }
Property Value
System.String
DEFAULT_FILE_ASSET_PUBLISHING_ROLE_ARN
Default asset publishing role ARN for file (S3) assets.
public static string DEFAULT_FILE_ASSET_PUBLISHING_ROLE_ARN { get; }
Property Value
System.String
DEFAULT_FILE_ASSETS_BUCKET_NAME
Default file assets bucket name.
public static string DEFAULT_FILE_ASSETS_BUCKET_NAME { get; }
Property Value
System.String
DEFAULT_IMAGE_ASSET_PUBLISHING_ROLE_ARN
Default asset publishing role ARN for image (ECR) assets.
public static string DEFAULT_IMAGE_ASSET_PUBLISHING_ROLE_ARN { get; }
Property Value
System.String
DEFAULT_IMAGE_ASSETS_REPOSITORY_NAME
Default image assets repository name.
public static string DEFAULT_IMAGE_ASSETS_REPOSITORY_NAME { get; }
Property Value
System.String
DEFAULT_LOOKUP_ROLE_ARN
Default lookup role ARN for missing values.
public static string DEFAULT_LOOKUP_ROLE_ARN { get; }
Property Value
System.String
DEFAULT_QUALIFIER
Default ARN qualifier.
public static string DEFAULT_QUALIFIER { get; }
Property Value
System.String
DeployRoleArn
Returns the ARN of the deploy Role.
public virtual string DeployRoleArn { get; }
Property Value
System.String
LookupRole
The role used to lookup for this stack.
public override string LookupRole { get; }
Property Value
System.String
Overrides
Stack
(deprecated) Return the currently bound stack.
protected virtual Stack Stack { get; }
Property Value
Remarks
Stability: Deprecated
Methods
AddDockerImageAsset(IDockerImageAssetSource)
Register a Docker Image Asset.
public override IDockerImageAssetLocation AddDockerImageAsset(IDockerImageAssetSource asset)
Parameters
- asset IDockerImageAssetSource
Returns
Overrides
Remarks
Returns the parameters that can be used to refer to the asset inside the template.
The synthesizer must rely on some out-of-band mechanism to make sure the given files
are actually placed in the returned location before the deployment happens. This can
be by writing the instructions to the asset manifest (for use by the cdk-assets
tool),
by relying on the CLI to upload files (legacy behavior), or some other operator controlled
mechanism.
AddFileAsset(IFileAssetSource)
Register a File Asset.
public override IFileAssetLocation AddFileAsset(IFileAssetSource asset)
Parameters
- asset IFileAssetSource
Returns
Overrides
Remarks
Returns the parameters that can be used to refer to the asset inside the template.
The synthesizer must rely on some out-of-band mechanism to make sure the given files
are actually placed in the returned location before the deployment happens. This can
be by writing the instructions to the asset manifest (for use by the cdk-assets
tool),
by relying on the CLI to upload files (legacy behavior), or some other operator controlled
mechanism.
Bind(Stack)
Bind to the stack this environment is going to be used on.
public override void Bind(Stack stack)
Parameters
- stack Stack
Overrides
Remarks
Must be called before any of the other methods are called.
ReusableBind(Stack)
Produce a bound Stack Synthesizer for the given stack.
public virtual IBoundStackSynthesizer ReusableBind(Stack stack)
Parameters
- stack Stack
Returns
Remarks
This method may be called more than once on the same object.
Synthesize(ISynthesisSession)
Synthesize the associated stack to the session.
public override void Synthesize(ISynthesisSession session)
Parameters
- session ISynthesisSession
Overrides
SynthesizeStackTemplate(Stack, ISynthesisSession)
Synthesize the stack template to the given session, passing the configured lookup role ARN.
protected override void SynthesizeStackTemplate(Stack stack, ISynthesisSession session)
Parameters
- stack Stack
- session ISynthesisSession