CloudArtifact
- class aws_cdk.cx_api.CloudArtifact(assembly, id, *, type, additional_metadata_file=None, dependencies=None, display_name=None, environment=None, metadata=None, properties=None)
Bases:
objectRepresents an artifact within a cloud assembly.
- 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 # assume_role_additional_options: Any # cloud_assembly: cx_api.CloudAssembly cloud_artifact = cx_api.CloudArtifact.from_manifest(cloud_assembly, "MyCloudArtifact", type=cloud_assembly_schema.ArtifactType.NONE, # the properties below are optional additional_metadata_file="additionalMetadataFile", 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_additional_options={ "assume_role_additional_options_key": assume_role_additional_options }, 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_additional_options={ "assume_role_additional_options_key": assume_role_additional_options }, assume_role_external_id="assumeRoleExternalId", bootstrap_stack_version_ssm_parameter="bootstrapStackVersionSsmParameter", requires_bootstrap_stack_version=123 ), notification_arns=["notificationArns"], 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)id (
str)type (
ArtifactType) – The type of artifact.additional_metadata_file (
Optional[str]) – A file with additional metadata entries. The schema of this file is exactly the same as the type of themetadatafield. In other words, that file contains an object mapping construct paths to arrays of metadata entries. Default: - no additional metadatadependencies (
Optional[Sequence[str]]) – IDs of artifacts that must be deployed before this artifact. Default: - no dependencies.display_name (
Optional[str]) – A string that can be shown to a user to uniquely identify this artifact inside a cloud assembly tree. Is used by the CLI to present a list of stacks to the user in a way that makes sense to them. Even though the property name “display name” doesn’t imply it, this field is used to select stacks as well, so all stacks should have a unique display name. Default: - no display nameenvironment (
Optional[str]) – The environment into which this artifact is deployed. Default: - no envrionment.metadata (
Optional[Mapping[str,Sequence[Union[MetadataEntry,Dict[str,Any]]]]]) – Associated metadata. Metadata can be stored directly in the assembly manifest, as well as in a separate file (seeadditionalMetadataFile). It should prefer to be stored in the additional file, as that will reduce the size of the assembly manifest in cases of a lot of metdata (which CDK does emit by default). Default: - no metadata.properties (
Union[AwsCloudFormationStackProperties,Dict[str,Any],AssetManifestProperties,TreeArtifactProperties,NestedCloudAssemblyProperties,FeatureFlagReportProperties,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
- dependencies
Returns all the artifacts that this artifact depends on.
- 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.
- id
- manifest
The artifact’s manifest.
- messages
The set of messages extracted from the artifact’s metadata.
- metadata
Returns the metadata associated with this Cloud Artifact.
Static Methods
- classmethod from_manifest(assembly, id, *, type, additional_metadata_file=None, dependencies=None, display_name=None, environment=None, metadata=None, properties=None)
Returns a subclass of
CloudArtifactbased 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.additional_metadata_file (
Optional[str]) – A file with additional metadata entries. The schema of this file is exactly the same as the type of themetadatafield. In other words, that file contains an object mapping construct paths to arrays of metadata entries. Default: - no additional metadatadependencies (
Optional[Sequence[str]]) – IDs of artifacts that must be deployed before this artifact. Default: - no dependencies.display_name (
Optional[str]) – A string that can be shown to a user to uniquely identify this artifact inside a cloud assembly tree. Is used by the CLI to present a list of stacks to the user in a way that makes sense to them. Even though the property name “display name” doesn’t imply it, this field is used to select stacks as well, so all stacks should have a unique display name. Default: - no display nameenvironment (
Optional[str]) – The environment into which this artifact is deployed. Default: - no envrionment.metadata (
Optional[Mapping[str,Sequence[Union[MetadataEntry,Dict[str,Any]]]]]) – Associated metadata. Metadata can be stored directly in the assembly manifest, as well as in a separate file (seeadditionalMetadataFile). It should prefer to be stored in the additional file, as that will reduce the size of the assembly manifest in cases of a lot of metdata (which CDK does emit by default). Default: - no metadata.properties (
Union[AwsCloudFormationStackProperties,Dict[str,Any],AssetManifestProperties,TreeArtifactProperties,NestedCloudAssemblyProperties,FeatureFlagReportProperties,None]) – The set of properties for this artifact (depends on type). Default: - no properties.
- Return type:
Optional[CloudArtifact]- Returns:
the
CloudArtifactthat matches the artifact type orundefinedif it’s an artifact type that is unrecognized by this module.