Class: AWSCDK::CXAPI::AssetManifestArtifact

Inherits:
CloudArtifact
  • Object
show all
Defined in:
cxapi/asset_manifest_artifact.rb

Overview

Asset manifest is a description of a set of assets which need to be built and published.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(assembly, name, artifact) ⇒ AssetManifestArtifact

Returns a new instance of AssetManifestArtifact.

Parameters:



11
12
13
14
15
16
17
# File 'cxapi/asset_manifest_artifact.rb', line 11

def initialize(assembly, name, artifact)
  artifact = artifact.is_a?(Hash) ? ::AWSCDK::CloudAssemblySchema::ArtifactManifest.new(**artifact.transform_keys(&:to_sym)) : artifact
  Jsii::Type.check_type(assembly, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5jeF9hcGkuQ2xvdWRBc3NlbWJseSJ9")), "assembly")
  Jsii::Type.check_type(name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "name")
  Jsii::Type.check_type(artifact, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5jbG91ZF9hc3NlbWJseV9zY2hlbWEuQXJ0aWZhY3RNYW5pZmVzdCJ9")), "artifact")
  Jsii::Object.instance_method(:initialize).bind(self).call(assembly, name, artifact)
end

Class Method Details

.is_asset_manifest_artifact(art) ⇒ Boolean

Checks if art is an instance of this class.

Use this method instead of instanceof to properly detect AssetManifestArtifact 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 class AssetManifestArtifact in each copy of the cx-api library is seen as a different class, and an instance of one class will not test as instanceof 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 the cx-api library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

Parameters:

  • art (Object)

Returns:

  • (Boolean)


54
55
56
57
# File 'cxapi/asset_manifest_artifact.rb', line 54

def self.is_asset_manifest_artifact(art)
  Jsii::Type.check_type(art, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "art")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.cx_api.AssetManifestArtifact", "isAssetManifestArtifact", [art])
end

.jsii_overridable_methodsObject



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'cxapi/asset_manifest_artifact.rb', line 19

def self.jsii_overridable_methods
  {
    :assembly => { kind: :property, name: "assembly", is_optional: false },
    :dependencies => { kind: :property, name: "dependencies", is_optional: false },
    :hierarchical_id => { kind: :property, name: "hierarchicalId", is_optional: false },
    :id => { kind: :property, name: "id", is_optional: false },
    :manifest => { kind: :property, name: "manifest", is_optional: false },
    :messages => { kind: :property, name: "messages", is_optional: false },
    :metadata => { kind: :property, name: "metadata", is_optional: false },
    :contents => { kind: :property, name: "contents", is_optional: false },
    :file => { kind: :property, name: "file", is_optional: false },
    :bootstrap_stack_version_ssm_parameter => { kind: :property, name: "bootstrapStackVersionSsmParameter", is_optional: true },
    :requires_bootstrap_stack_version => { kind: :property, name: "requiresBootstrapStackVersion", is_optional: true },
    :find_metadata_by_type => { kind: :method, name: "findMetadataByType", is_optional: false },
  }
end

Instance Method Details

#assemblyAWSCDK::CXAPI::CloudAssembly



60
61
62
# File 'cxapi/asset_manifest_artifact.rb', line 60

def assembly()
  jsii_get_property("assembly")
end

#bootstrap_stack_version_ssm_parameterString?

Note:

Default: - Discover SSM parameter by reading stack

Name of SSM parameter with bootstrap stack version.

Returns:

  • (String, nil)


125
126
127
# File 'cxapi/asset_manifest_artifact.rb', line 125

def bootstrap_stack_version_ssm_parameter()
  jsii_get_property("bootstrapStackVersionSsmParameter")
end

#contentsAWSCDK::CloudAssemblySchema::AssetManifest

The Asset Manifest contents.



110
111
112
# File 'cxapi/asset_manifest_artifact.rb', line 110

def contents()
  jsii_get_property("contents")
end

#dependenciesArray<AWSCDK::CXAPI::CloudArtifact>

Returns all the artifacts that this artifact depends on.

Returns:



67
68
69
# File 'cxapi/asset_manifest_artifact.rb', line 67

def dependencies()
  jsii_get_property("dependencies")
end

#fileString

The file name of the asset manifest.

Returns:

  • (String)


117
118
119
# File 'cxapi/asset_manifest_artifact.rb', line 117

def file()
  jsii_get_property("file")
end

#find_metadata_by_type(type) ⇒ Array<AWSCDK::CXAPI::MetadataEntryResult>

Returns all the metadata entries of a specific type in this artifact.

Parameters:

  • type (String)

Returns:



138
139
140
141
# File 'cxapi/asset_manifest_artifact.rb', line 138

def (type)
  Jsii::Type.check_type(type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "type")
  jsii_call_method("findMetadataByType", [type])
end

#hierarchical_idString

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.

Returns:

  • (String)


77
78
79
# File 'cxapi/asset_manifest_artifact.rb', line 77

def hierarchical_id()
  jsii_get_property("hierarchicalId")
end

#idString

Returns:

  • (String)


82
83
84
# File 'cxapi/asset_manifest_artifact.rb', line 82

def id()
  jsii_get_property("id")
end

#manifestAWSCDK::CloudAssemblySchema::ArtifactManifest

The artifact's manifest.



89
90
91
# File 'cxapi/asset_manifest_artifact.rb', line 89

def manifest()
  jsii_get_property("manifest")
end

#messagesArray<AWSCDK::CXAPI::SynthesisMessage>

The set of messages extracted from the artifact's metadata.



96
97
98
# File 'cxapi/asset_manifest_artifact.rb', line 96

def messages()
  jsii_get_property("messages")
end

#metadataHash{String => Array<AWSCDK::CloudAssemblySchema::MetadataEntry>}

Returns the metadata associated with this Cloud Artifact.

Returns:



103
104
105
# File 'cxapi/asset_manifest_artifact.rb', line 103

def ()
  jsii_get_property("metadata")
end

#requires_bootstrap_stack_versionNumeric?

Version of bootstrap stack required to deploy this stack.

Returns:

  • (Numeric, nil)


132
133
134
# File 'cxapi/asset_manifest_artifact.rb', line 132

def requires_bootstrap_stack_version()
  jsii_get_property("requiresBootstrapStackVersion")
end