Skip to content

DefaultStackSynthesizer

Uses conventionally named roles and reify asset storage locations.

Initializers

import ros_cdk_core
ros_cdk_core.DefaultStackSynthesizer(
  bucket_prefix: str = None,
  file_assets_bucket_name: str = None,
  qualifier: str = None
)
Name Type Description
bucket_prefix str bucketPrefix to use while storing OSS Assets.
file_assets_bucket_name str Name of the OSS bucket to hold file assets.
qualifier str Qualifier to disambiguate multiple environments in the same account.

bucket_prefixOptional

  • Type: str
  • Default: DefaultStackSynthesizer.DEFAULT_FILE_ASSET_PREFIX

bucketPrefix to use while storing OSS Assets.


file_assets_bucket_nameOptional

  • Type: str
  • Default: DefaultStackSynthesizer.DEFAULT_FILE_ASSETS_BUCKET_NAME

Name of the OSS bucket to hold file assets.

You must supply this if you have given a non-standard name to the staging bucket.

The placeholders ${Qualifier}, ${ALIYUN::AccountId} and ${ALIYUN::Region} will be replaced with the values of qualifier and the stack's account and region, respectively.


qualifierOptional

  • Type: str

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.


Methods

Name Description
add_file_asset Register a File Asset.
bind Bind to the stack this environment is going to be used on.
synthesize Synthesize the associated stack to the session.
reusable_bind Produce a bound Stack Synthesizer for the given stack.
synthesize_stack_artifacts No description.

add_file_asset

def add_file_asset(
  source_hash: str,
  deploy_time: bool = None,
  executable: typing.List[str] = None,
  file_name: str = None,
  packaging: FileAssetPackaging = None
) -> FileAssetLocation

Register a File Asset.

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.

source_hashRequired

  • Type: str

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.


deploy_timeOptional

  • Type: bool
  • Default: false

Whether or not the asset needs to exist beyond deployment time;

i.e. are copied over to a different location and not needed afterwards. Setting this property to true has an impact on the lifecycle of the asset, because we will assume that it is safe to delete after the ROS deployment succeeds.

For example, FC Function assets are copied over to FC during deployment. Therefore, it is not necessary to store the asset in OSS bucket, so we consider those deployTime assets.


executableOptional

  • Type: typing.List[str]
  • Default: Exactly one of fileName and executable is required

An external command that will produce the packaged asset.

The command should produce the location of a ZIP file on stdout.


file_nameOptional

  • Type: str
  • Default: Exactly one of fileName and executable is required

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.


packagingOptional

Which type of packaging to perform.


bind

def bind(
  stack: Stack
) -> None

Bind to the stack this environment is going to be used on.

Must be called before any of the other methods are called.

stackRequired


synthesize

def synthesize(
  session: ISynthesisSession
) -> None

Synthesize the associated stack to the session.

sessionRequired


reusable_bind

def reusable_bind(
  stack: Stack
) -> IBoundStackSynthesizer

Produce a bound Stack Synthesizer for the given stack.

This method may be called more than once on the same object.

stackRequired


synthesize_stack_artifacts

def synthesize_stack_artifacts(
  session: ISynthesisSession
) -> None

sessionRequired


Constants

Name Type Description
DEFAULT_FILE_ASSET_PREFIX str Default file asset prefix.
DEFAULT_FILE_ASSETS_BUCKET_NAME str Default file assets bucket name.
DEFAULT_QUALIFIER str Default ARN qualifier.

DEFAULT_FILE_ASSET_PREFIXRequired

DEFAULT_FILE_ASSET_PREFIX: str
  • Type: str

Default file asset prefix.


DEFAULT_FILE_ASSETS_BUCKET_NAMERequired

DEFAULT_FILE_ASSETS_BUCKET_NAME: str
  • Type: str

Default file assets bucket name.


DEFAULT_QUALIFIERRequired

DEFAULT_QUALIFIER: str
  • Type: str

Default ARN qualifier.