AssetManifestArtifact¶
-
class
aws_cdk.cx_api.
AssetManifestArtifact
(assembly, name, *, type, dependencies=None, display_name=None, environment=None, metadata=None, properties=None)¶ Bases:
aws_cdk.cx_api.CloudArtifact
Asset manifest is a description of a set of assets which need to be built and published.
- 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.cloud_assembly_schema as cloud_assembly_schema import aws_cdk.cx_api as cx_api # cloud_assembly: cx_api.CloudAssembly asset_manifest_artifact = cx_api.AssetManifestArtifact(cloud_assembly, "name", type=cloud_assembly_schema.ArtifactType.NONE, # the properties below are optional dependencies=["dependencies"], display_name="displayName", environment="environment", metadata={ "metadata_key": [cloud_assembly_schema.MetadataEntry( type="type", # the properties below are optional data="data", trace=["trace"] )] }, properties=cloud_assembly_schema.AwsCloudFormationStackProperties( template_file="templateFile", # the properties below are optional assume_role_arn="assumeRoleArn", assume_role_external_id="assumeRoleExternalId", bootstrap_stack_version_ssm_parameter="bootstrapStackVersionSsmParameter", cloud_formation_execution_role_arn="cloudFormationExecutionRoleArn", lookup_role=cloud_assembly_schema.BootstrapRole( arn="arn", # the properties below are optional assume_role_external_id="assumeRoleExternalId", bootstrap_stack_version_ssm_parameter="bootstrapStackVersionSsmParameter", requires_bootstrap_stack_version=123 ), parameters={ "parameters_key": "parameters" }, requires_bootstrap_stack_version=123, stack_name="stackName", stack_template_asset_object_url="stackTemplateAssetObjectUrl", tags={ "tags_key": "tags" }, termination_protection=False, validate_on_synth=False ) )
- Parameters
assembly (
CloudAssembly
) –name (
str
) –type (
ArtifactType
) – The type of artifact.dependencies (
Optional
[Sequence
[str
]]) – IDs of artifacts that must be deployed before this artifact. Default: - no dependencies.display_name (
Optional
[str
]) – A string that represents this artifact. Should only be used in user interfaces. Default: - no display nameenvironment (
Optional
[str
]) – The environment into which this artifact is deployed. Default: - no envrionment.metadata (
Optional
[Mapping
[str
,Sequence
[MetadataEntry
]]]) – Associated metadata. Default: - no metadata.properties (
Union
[AwsCloudFormationStackProperties
,AssetManifestProperties
,TreeArtifactProperties
,NestedCloudAssemblyProperties
,None
]) – The set of properties for this artifact (depends on type). Default: - no properties.
Methods
-
find_metadata_by_type
(type)¶ - Parameters
type (
str
) –- Return type
List
[MetadataEntryResult
]- Returns
all the metadata entries of a specific type in this artifact.
Attributes
-
assembly
¶ - Return type
-
bootstrap_stack_version_ssm_parameter
¶ Name of SSM parameter with bootstrap stack version.
- Default
Discover SSM parameter by reading stack
- Return type
Optional
[str
]
-
dependencies
¶ Returns all the artifacts that this artifact depends on.
- Return type
List
[CloudArtifact
]
-
file
¶ The file name of the asset manifest.
- Return type
str
-
hierarchical_id
¶ An identifier that shows where this artifact is located in the tree of nested assemblies, based on their manifests.
Defaults to the normal id. Should only be used in user interfaces.
- Return type
str
-
id
¶ - Return type
str
-
manifest
¶ The artifact’s manifest.
- Return type
-
messages
¶ The set of messages extracted from the artifact’s metadata.
- Return type
List
[SynthesisMessage
]
-
requires_bootstrap_stack_version
¶ Version of bootstrap stack required to deploy this stack.
- Return type
Union
[int
,float
]
Static Methods
-
classmethod
from_manifest
(assembly, id, *, type, dependencies=None, display_name=None, environment=None, metadata=None, properties=None)¶ Returns a subclass of
CloudArtifact
based on the artifact type defined in the artifact manifest.- Parameters
assembly (
CloudAssembly
) – The cloud assembly from which to load the artifact.id (
str
) – The artifact ID.type (
ArtifactType
) – The type of artifact.dependencies (
Optional
[Sequence
[str
]]) – IDs of artifacts that must be deployed before this artifact. Default: - no dependencies.display_name (
Optional
[str
]) – A string that represents this artifact. Should only be used in user interfaces. Default: - no display nameenvironment (
Optional
[str
]) – The environment into which this artifact is deployed. Default: - no envrionment.metadata (
Optional
[Mapping
[str
,Sequence
[MetadataEntry
]]]) – Associated metadata. Default: - no metadata.properties (
Union
[AwsCloudFormationStackProperties
,AssetManifestProperties
,TreeArtifactProperties
,NestedCloudAssemblyProperties
,None
]) – The set of properties for this artifact (depends on type). Default: - no properties.
- Return type
Optional
[CloudArtifact
]- Returns
the
CloudArtifact
that matches the artifact type orundefined
if it’s an artifact type that is unrecognized by this module.
-
classmethod
is_asset_manifest_artifact
(art)¶ Checks if
art
is an instance of this class.Use this method instead of
instanceof
to properly detectAssetManifestArtifact
instances, even when the construct library is symlinked.Explanation: in JavaScript, multiple copies of the
cx-api
library on disk are seen as independent, completely different libraries. As a consequence, the classAssetManifestArtifact
in each copy of thecx-api
library is seen as a different class, and an instance of one class will not test asinstanceof
the other class.npm install
will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of thecx-api
library can be accidentally installed, andinstanceof
will behave unpredictably. It is safest to avoid usinginstanceof
, and using this type-testing method instead.- Parameters
art (
Any
) –- Return type
bool