Class: AWSCDK::SynthesizeStackArtifactOptions

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
synthesize_stack_artifact_options.rb

Overview

Stack artifact options.

A subset of cxschema.AwsCloudFormationStackProperties of optional settings that need to be configurable by synthesizers, plus additional_dependencies.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(additional_dependencies: nil, assume_role_additional_options: nil, assume_role_arn: nil, assume_role_external_id: nil, bootstrap_stack_version_ssm_parameter: nil, cloud_formation_execution_role_arn: nil, lookup_role: nil, parameters: nil, requires_bootstrap_stack_version: nil, stack_template_asset_object_url: nil) ⇒ SynthesizeStackArtifactOptions

Returns a new instance of SynthesizeStackArtifactOptions.

Parameters:

  • additional_dependencies (Array<String>, nil) (defaults to: nil)

    Identifiers of additional dependencies.

  • assume_role_additional_options (Hash{String => Object}, nil) (defaults to: nil)

    Additional options to pass to STS when assuming the role for cloudformation deployments.

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

    The role that needs to be assumed to deploy the stack.

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

    The externalID to use with the assumeRoleArn.

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

    SSM parameter where the bootstrap stack version number can be found.

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

    The role that is passed to CloudFormation to execute the change set.

  • lookup_role (AWSCDK::CloudAssemblySchema::BootstrapRole, nil) (defaults to: nil)

    The role to use to look up values from the target AWS account.

  • parameters (Hash{String => String}, nil) (defaults to: nil)

    Values for CloudFormation stack parameters that should be passed when the stack is deployed.

  • requires_bootstrap_stack_version (Numeric, nil) (defaults to: nil)

    Version of bootstrap stack required to deploy this stack.

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

    If the stack template has already been included in the asset manifest, its asset URL.



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'synthesize_stack_artifact_options.rb', line 20

def initialize(additional_dependencies: nil, assume_role_additional_options: nil, assume_role_arn: nil, assume_role_external_id: nil, bootstrap_stack_version_ssm_parameter: nil, cloud_formation_execution_role_arn: nil, lookup_role: nil, parameters: nil, requires_bootstrap_stack_version: nil, stack_template_asset_object_url: nil)
  @additional_dependencies = additional_dependencies
  Jsii::Type.check_type(@additional_dependencies, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "additionalDependencies") unless @additional_dependencies.nil?
  @assume_role_additional_options = assume_role_additional_options
  Jsii::Type.check_type(@assume_role_additional_options, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6ImFueSJ9LCJraW5kIjoibWFwIn19")), "assumeRoleAdditionalOptions") unless @assume_role_additional_options.nil?
  @assume_role_arn = assume_role_arn
  Jsii::Type.check_type(@assume_role_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "assumeRoleArn") unless @assume_role_arn.nil?
  @assume_role_external_id = assume_role_external_id
  Jsii::Type.check_type(@assume_role_external_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "assumeRoleExternalId") unless @assume_role_external_id.nil?
  @bootstrap_stack_version_ssm_parameter = bootstrap_stack_version_ssm_parameter
  Jsii::Type.check_type(@bootstrap_stack_version_ssm_parameter, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "bootstrapStackVersionSsmParameter") unless @bootstrap_stack_version_ssm_parameter.nil?
  @cloud_formation_execution_role_arn = cloud_formation_execution_role_arn
  Jsii::Type.check_type(@cloud_formation_execution_role_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "cloudFormationExecutionRoleArn") unless @cloud_formation_execution_role_arn.nil?
  @lookup_role = lookup_role.is_a?(Hash) ? ::AWSCDK::CloudAssemblySchema::BootstrapRole.new(**lookup_role.transform_keys(&:to_sym)) : lookup_role
  Jsii::Type.check_type(@lookup_role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5jbG91ZF9hc3NlbWJseV9zY2hlbWEuQm9vdHN0cmFwUm9sZSJ9")), "lookupRole") unless @lookup_role.nil?
  @parameters = parameters
  Jsii::Type.check_type(@parameters, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoibWFwIn19")), "parameters") unless @parameters.nil?
  @requires_bootstrap_stack_version = requires_bootstrap_stack_version
  Jsii::Type.check_type(@requires_bootstrap_stack_version, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "requiresBootstrapStackVersion") unless @requires_bootstrap_stack_version.nil?
  @stack_template_asset_object_url = stack_template_asset_object_url
  Jsii::Type.check_type(@stack_template_asset_object_url, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "stackTemplateAssetObjectUrl") unless @stack_template_asset_object_url.nil?
end

Instance Attribute Details

#additional_dependenciesArray<String>? (readonly)

Note:

Default: - No additional dependencies

Identifiers of additional dependencies.

Returns:

  • (Array<String>, nil)


47
48
49
# File 'synthesize_stack_artifact_options.rb', line 47

def additional_dependencies
  @additional_dependencies
end

#assume_role_additional_optionsHash{String => Object}? (readonly)

Note:

Default: - No additional options.

Additional options to pass to STS when assuming the role for cloudformation deployments.

  • RoleArn should not be used. Use the dedicated assume_role_arn property instead.
  • ExternalId should not be used. Use the dedicated assume_role_external_id instead.
  • TransitiveTagKeys defaults to use all keys (if any) specified in Tags. E.g, all tags are transitive by default.


57
58
59
# File 'synthesize_stack_artifact_options.rb', line 57

def assume_role_additional_options
  @assume_role_additional_options
end

#assume_role_arnString? (readonly)

Note:

Default: - No role is assumed (current credentials are used)

The role that needs to be assumed to deploy the stack.

Returns:

  • (String, nil)


62
63
64
# File 'synthesize_stack_artifact_options.rb', line 62

def assume_role_arn
  @assume_role_arn
end

#assume_role_external_idString? (readonly)

Note:

Default: - No externalID is used

The externalID to use with the assumeRoleArn.

Returns:

  • (String, nil)


67
68
69
# File 'synthesize_stack_artifact_options.rb', line 67

def assume_role_external_id
  @assume_role_external_id
end

#bootstrap_stack_version_ssm_parameterString? (readonly)

Note:

Default: - Bootstrap stack version number looked up

SSM parameter where the bootstrap stack version number can be found.

Only used if requires_bootstrap_stack_version is set.

  • If this value is not set, the bootstrap stack name must be known at deployment time so the stack version can be looked up from the stack outputs.
  • If this value is set, the bootstrap stack can have any name because we won't need to look it up.

Returns:

  • (String, nil)


80
81
82
# File 'synthesize_stack_artifact_options.rb', line 80

def bootstrap_stack_version_ssm_parameter
  @bootstrap_stack_version_ssm_parameter
end

#cloud_formation_execution_role_arnString? (readonly)

Note:

Default: - No role is passed (currently assumed role/credentials are used)

The role that is passed to CloudFormation to execute the change set.

Returns:

  • (String, nil)


85
86
87
# File 'synthesize_stack_artifact_options.rb', line 85

def cloud_formation_execution_role_arn
  @cloud_formation_execution_role_arn
end

#lookup_roleAWSCDK::CloudAssemblySchema::BootstrapRole? (readonly)

Note:

Default: - None

The role to use to look up values from the target AWS account.



90
91
92
# File 'synthesize_stack_artifact_options.rb', line 90

def lookup_role
  @lookup_role
end

#parametersHash{String => String}? (readonly)

Note:

Default: - No parameters

Values for CloudFormation stack parameters that should be passed when the stack is deployed.

Returns:

  • (Hash{String => String}, nil)


95
96
97
# File 'synthesize_stack_artifact_options.rb', line 95

def parameters
  @parameters
end

#requires_bootstrap_stack_versionNumeric? (readonly)

Note:

Default: - No bootstrap stack required

Version of bootstrap stack required to deploy this stack.

Returns:

  • (Numeric, nil)


100
101
102
# File 'synthesize_stack_artifact_options.rb', line 100

def requires_bootstrap_stack_version
  @requires_bootstrap_stack_version
end

#stack_template_asset_object_urlString? (readonly)

Note:

Default: - Not uploaded yet, upload just before deploying

If the stack template has already been included in the asset manifest, its asset URL.

Returns:

  • (String, nil)


105
106
107
# File 'synthesize_stack_artifact_options.rb', line 105

def stack_template_asset_object_url
  @stack_template_asset_object_url
end

Class Method Details

.jsii_propertiesObject



107
108
109
110
111
112
113
114
115
116
117
118
119
120
# File 'synthesize_stack_artifact_options.rb', line 107

def self.jsii_properties
  {
    :additional_dependencies => "additionalDependencies",
    :assume_role_additional_options => "assumeRoleAdditionalOptions",
    :assume_role_arn => "assumeRoleArn",
    :assume_role_external_id => "assumeRoleExternalId",
    :bootstrap_stack_version_ssm_parameter => "bootstrapStackVersionSsmParameter",
    :cloud_formation_execution_role_arn => "cloudFormationExecutionRoleArn",
    :lookup_role => "lookupRole",
    :parameters => "parameters",
    :requires_bootstrap_stack_version => "requiresBootstrapStackVersion",
    :stack_template_asset_object_url => "stackTemplateAssetObjectUrl",
  }
end

Instance Method Details

#to_jsiiObject



122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
# File 'synthesize_stack_artifact_options.rb', line 122

def to_jsii
  result = {}
  result.merge!({
    "additionalDependencies" => @additional_dependencies,
    "assumeRoleAdditionalOptions" => @assume_role_additional_options,
    "assumeRoleArn" => @assume_role_arn,
    "assumeRoleExternalId" => @assume_role_external_id,
    "bootstrapStackVersionSsmParameter" => @bootstrap_stack_version_ssm_parameter,
    "cloudFormationExecutionRoleArn" => @cloud_formation_execution_role_arn,
    "lookupRole" => @lookup_role,
    "parameters" => @parameters,
    "requiresBootstrapStackVersion" => @requires_bootstrap_stack_version,
    "stackTemplateAssetObjectUrl" => @stack_template_asset_object_url,
  })
  result.compact
end