Class StackSynthesizer
Base class for implementing an IStackSynthesizer.
Inheritance
Implements
Namespace: Amazon.CDK
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public abstract class StackSynthesizer : DeputyBase, IStackSynthesizer
Syntax (vb)
Public MustInherit Class StackSynthesizer
Inherits DeputyBase
Implements IStackSynthesizer
Remarks
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.
Synopsis
Constructors
StackSynthesizer() | |
StackSynthesizer(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
StackSynthesizer(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Properties
BootstrapQualifier | The qualifier used to bootstrap this stack. |
BoundStack | Retrieve the bound stack. |
LookupRole | The role used to lookup for this stack. |
Methods
AddBootstrapVersionRule(Double, String) | Add a CfnRule to the bound stack that checks whether an SSM parameter exceeds a given version. |
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. |
CloudFormationLocationFromDockerImageAsset(IDockerImageDestination) | Turn a docker asset location into a CloudFormation representation of that location. |
CloudFormationLocationFromFileAsset(IFileDestination) | Turn a file asset location into a CloudFormation representation of that location. |
EmitArtifact(ISynthesisSession, ISynthesizeStackArtifactOptions) | Write the CloudFormation stack artifact to the session. |
EmitStackArtifact(Stack, ISynthesisSession, ISynthesizeStackArtifactOptions) | (deprecated) Write the stack artifact to the session. |
Synthesize(ISynthesisSession) | Synthesize the associated stack to the session. |
SynthesizeStackTemplate(Stack, ISynthesisSession) | (deprecated) Have the stack write out its template. |
SynthesizeTemplate(ISynthesisSession, String) | Write the stack template to the given session. |
Constructors
StackSynthesizer()
protected StackSynthesizer()
StackSynthesizer(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected StackSynthesizer(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
StackSynthesizer(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected StackSynthesizer(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Properties
BootstrapQualifier
The qualifier used to bootstrap this stack.
public virtual string BootstrapQualifier { get; }
Property Value
System.String
BoundStack
Retrieve the bound stack.
protected virtual Stack BoundStack { get; }
Property Value
Remarks
Fails if the stack hasn't been bound yet.
LookupRole
The role used to lookup for this stack.
public virtual string LookupRole { get; }
Property Value
System.String
Methods
AddBootstrapVersionRule(Double, String)
Add a CfnRule to the bound stack that checks whether an SSM parameter exceeds a given version.
protected virtual void AddBootstrapVersionRule(double requiredVersion, string bootstrapStackVersionSsmParameter)
Parameters
- requiredVersion System.Double
- bootstrapStackVersionSsmParameter System.String
Remarks
This will modify the template, so must be called before the stack is synthesized.
AddDockerImageAsset(IDockerImageAssetSource)
Register a Docker Image Asset.
public abstract IDockerImageAssetLocation AddDockerImageAsset(IDockerImageAssetSource asset)
Parameters
- asset IDockerImageAssetSource
Returns
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 abstract IFileAssetLocation AddFileAsset(IFileAssetSource asset)
Parameters
- asset IFileAssetSource
Returns
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 virtual void Bind(Stack stack)
Parameters
- stack Stack
Remarks
Must be called before any of the other methods are called.
CloudFormationLocationFromDockerImageAsset(IDockerImageDestination)
Turn a docker asset location into a CloudFormation representation of that location.
protected virtual IDockerImageAssetLocation CloudFormationLocationFromDockerImageAsset(IDockerImageDestination dest)
Parameters
Returns
Remarks
If any of the fields contain placeholders, the result will be wrapped in a Fn.sub
.
CloudFormationLocationFromFileAsset(IFileDestination)
Turn a file asset location into a CloudFormation representation of that location.
protected virtual IFileAssetLocation CloudFormationLocationFromFileAsset(IFileDestination location)
Parameters
- location IFileDestination
Returns
Remarks
If any of the fields contain placeholders, the result will be wrapped in a Fn.sub
.
EmitArtifact(ISynthesisSession, ISynthesizeStackArtifactOptions)
Write the CloudFormation stack artifact to the session.
protected virtual void EmitArtifact(ISynthesisSession session, ISynthesizeStackArtifactOptions options = null)
Parameters
- session ISynthesisSession
- options ISynthesizeStackArtifactOptions
Remarks
Use default settings to add a CloudFormationStackArtifact artifact to the given synthesis session. The Stack artifact will control the settings for the CloudFormation deployment.
EmitStackArtifact(Stack, ISynthesisSession, ISynthesizeStackArtifactOptions)
(deprecated) Write the stack artifact to the session.
protected virtual void EmitStackArtifact(Stack stack, ISynthesisSession session, ISynthesizeStackArtifactOptions options = null)
Parameters
- stack Stack
- session ISynthesisSession
- options ISynthesizeStackArtifactOptions
Remarks
Use default settings to add a CloudFormationStackArtifact artifact to the given synthesis session.
Stability: Deprecated
Synthesize(ISynthesisSession)
Synthesize the associated stack to the session.
public abstract void Synthesize(ISynthesisSession session)
Parameters
- session ISynthesisSession
SynthesizeStackTemplate(Stack, ISynthesisSession)
(deprecated) Have the stack write out its template.
protected virtual void SynthesizeStackTemplate(Stack stack, ISynthesisSession session)
Parameters
- stack Stack
- session ISynthesisSession
Remarks
Stability: Deprecated
SynthesizeTemplate(ISynthesisSession, String)
Write the stack template to the given session.
protected virtual IFileAssetSource SynthesizeTemplate(ISynthesisSession session, string lookupRoleArn = null)
Parameters
- session ISynthesisSession
- lookupRoleArn System.String
Returns
Remarks
Return a descriptor that represents the stack template as a file asset
source, for adding to an asset manifest (if desired). This can be used to
have the asset manifest system (cdk-assets
) upload the template to S3
using the appropriate role, so that afterwards only a CloudFormation
deployment is necessary.
If the template is uploaded as an asset, the stackTemplateAssetObjectUrl
property should be set when calling emitArtifact.
If the template is NOT uploaded as an asset first and the template turns
out to be >50KB, it will need to be uploaded to S3 anyway. At that point
the credentials will be the same identity that is doing the UpdateStack
call, which may not have the right permissions to write to S3.