CloudAssembly

class aws_cdk.cx_api.CloudAssembly(directory, *, skip_enum_check=None, skip_version_check=None, topo_sort=None)

Bases: object

Represents a deployable cloud application.

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.cx_api as cx_api

cloud_assembly = cx_api.CloudAssembly("directory",
    skip_enum_check=False,
    skip_version_check=False,
    topo_sort=False
)

Reads a cloud assembly from the specified directory.

Parameters:
  • directory (str) – The root directory of the assembly.

  • skip_enum_check (Optional[bool]) – Skip enum checks. This means you may read enum values you don’t know about yet. Make sure to always check the values of enums you encounter in the manifest. Default: false

  • skip_version_check (Optional[bool]) – Skip the version check. This means you may read a newer cloud assembly than the CX API is designed to support, and your application may not be aware of all features that in use in the Cloud Assembly. Default: false

  • topo_sort (Optional[bool]) – Topologically sort all artifacts. This parameter is only respected by the constructor of CloudAssembly. The property lives here for backwards compatibility reasons. Default: true

Methods

get_nested_assembly(artifact_id)

Returns a nested assembly.

Parameters:

artifact_id (str) – The artifact ID of the nested assembly.

Return type:

CloudAssembly

get_nested_assembly_artifact(artifact_id)

Returns a nested assembly artifact.

Parameters:

artifact_id (str) – The artifact ID of the nested assembly.

Return type:

NestedCloudAssemblyArtifact

get_stack(stack_name)

(deprecated) Returns a CloudFormation stack artifact by name from this assembly.

Parameters:

stack_name (str) –

Deprecated:

renamed to getStackByName (or getStackArtifact(id))

Stability:

deprecated

Return type:

CloudFormationStackArtifact

get_stack_artifact(artifact_id)

Returns a CloudFormation stack artifact from this assembly.

Parameters:

artifact_id (str) – the artifact id of the stack (can be obtained through stack.artifactId).

Return type:

CloudFormationStackArtifact

Returns:

a CloudFormationStackArtifact object.

Throws:

if there is no stack artifact with that id

get_stack_by_name(stack_name)

Returns a CloudFormation stack artifact from this assembly.

Will only search the current assembly.

Parameters:

stack_name (str) – the name of the CloudFormation stack.

Return type:

CloudFormationStackArtifact

Returns:

a CloudFormationStackArtifact object.

Throws:

if there is more than one stack with the same stack name. You can use getStackArtifact(stack.artifactId) instead.

tree()

Returns the tree metadata artifact from this assembly.

Return type:

Optional[TreeCloudArtifact]

Returns:

a TreeCloudArtifact object if there is one defined in the manifest, undefined otherwise.

Throws:

if there is no metadata artifact by that name

try_get_artifact(id)

Attempts to find an artifact with a specific identity.

Parameters:

id (str) – The artifact ID.

Return type:

Optional[CloudArtifact]

Returns:

A CloudArtifact object or undefined if the artifact does not exist in this assembly.

Attributes

artifacts

All artifacts included in this assembly.

directory

The root directory of the cloud assembly.

manifest

The raw assembly manifest.

nested_assemblies

The nested assembly artifacts in this assembly.

runtime

Runtime information such as module versions used to synthesize this assembly.

stacks

all the CloudFormation stack artifacts that are included in this assembly.

Type:

return

stacks_recursively

Returns all the stacks, including the ones in nested assemblies.

version

The schema version of the assembly manifest.