Class: AWSCDK::Pipelines::StackAsset

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
pipelines/stack_asset.rb

Overview

An asset used by a Stack.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(asset_id:, asset_manifest_path:, asset_selector:, asset_type:, is_template:, asset_publishing_role_arn: nil, display_name: nil) ⇒ StackAsset

Returns a new instance of StackAsset.

Parameters:

  • asset_id (String)

    Asset identifier.

  • asset_manifest_path (String)

    Absolute asset manifest path.

  • asset_selector (String)

    Asset selector to pass to cdk-assets.

  • asset_type (AWSCDK::Pipelines::AssetType)

    Type of asset to publish.

  • is_template (Boolean)

    Does this asset represent the CloudFormation template for the stack.

  • asset_publishing_role_arn (String, nil) (defaults to: nil)

    Role ARN to assume to publish.

  • display_name (String, nil) (defaults to: nil)

    The display name of this asset.



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'pipelines/stack_asset.rb', line 14

def initialize(asset_id:, asset_manifest_path:, asset_selector:, asset_type:, is_template:, asset_publishing_role_arn: nil, display_name: nil)
  @asset_id = asset_id
  Jsii::Type.check_type(@asset_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "assetId")
  @asset_manifest_path = asset_manifest_path
  Jsii::Type.check_type(@asset_manifest_path, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "assetManifestPath")
  @asset_selector = asset_selector
  Jsii::Type.check_type(@asset_selector, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "assetSelector")
  @asset_type = asset_type
  Jsii::Type.check_type(@asset_type, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5waXBlbGluZXMuQXNzZXRUeXBlIn0=")), "assetType")
  @is_template = is_template
  Jsii::Type.check_type(@is_template, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "isTemplate")
  @asset_publishing_role_arn = asset_publishing_role_arn
  Jsii::Type.check_type(@asset_publishing_role_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "assetPublishingRoleArn") unless @asset_publishing_role_arn.nil?
  @display_name = display_name
  Jsii::Type.check_type(@display_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "displayName") unless @display_name.nil?
end

Instance Attribute Details

#asset_idString (readonly)

Asset identifier.

Returns:

  • (String)


34
35
36
# File 'pipelines/stack_asset.rb', line 34

def asset_id
  @asset_id
end

#asset_manifest_pathString (readonly)

Absolute asset manifest path.

This needs to be made relative at a later point in time, but when this information is parsed we don't know about the root cloud assembly yet.

Returns:

  • (String)


41
42
43
# File 'pipelines/stack_asset.rb', line 41

def asset_manifest_path
  @asset_manifest_path
end

#asset_publishing_role_arnString? (readonly)

Note:

Default: - No need to assume any role

Role ARN to assume to publish.

Returns:

  • (String, nil)


59
60
61
# File 'pipelines/stack_asset.rb', line 59

def asset_publishing_role_arn
  @asset_publishing_role_arn
end

#asset_selectorString (readonly)

Asset selector to pass to cdk-assets.

Returns:

  • (String)


45
46
47
# File 'pipelines/stack_asset.rb', line 45

def asset_selector
  @asset_selector
end

#asset_typeAWSCDK::Pipelines::AssetType (readonly)

Type of asset to publish.



49
50
51
# File 'pipelines/stack_asset.rb', line 49

def asset_type
  @asset_type
end

#display_nameString? (readonly)

Note:

Default: - Use some generated string as display name

The display name of this asset.

Returns:

  • (String, nil)


64
65
66
# File 'pipelines/stack_asset.rb', line 64

def display_name
  @display_name
end

#is_templateBoolean (readonly)

Note:

Default: false

Does this asset represent the CloudFormation template for the stack.

Returns:

  • (Boolean)


54
55
56
# File 'pipelines/stack_asset.rb', line 54

def is_template
  @is_template
end

Class Method Details

.jsii_propertiesObject



66
67
68
69
70
71
72
73
74
75
76
# File 'pipelines/stack_asset.rb', line 66

def self.jsii_properties
  {
    :asset_id => "assetId",
    :asset_manifest_path => "assetManifestPath",
    :asset_selector => "assetSelector",
    :asset_type => "assetType",
    :is_template => "isTemplate",
    :asset_publishing_role_arn => "assetPublishingRoleArn",
    :display_name => "displayName",
  }
end

Instance Method Details

#to_jsiiObject



78
79
80
81
82
83
84
85
86
87
88
89
90
# File 'pipelines/stack_asset.rb', line 78

def to_jsii
  result = {}
  result.merge!({
    "assetId" => @asset_id,
    "assetManifestPath" => @asset_manifest_path,
    "assetSelector" => @asset_selector,
    "assetType" => @asset_type,
    "isTemplate" => @is_template,
    "assetPublishingRoleArn" => @asset_publishing_role_arn,
    "displayName" => @display_name,
  })
  result.compact
end