Class: AWSCDK::CloudAssemblySchema::BootstrapRole

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
cloud_assembly_schema/bootstrap_role.rb

Overview

Information needed to access an IAM role created as part of the bootstrap process.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(arn:, assume_role_additional_options: nil, assume_role_external_id: nil, bootstrap_stack_version_ssm_parameter: nil, requires_bootstrap_stack_version: nil) ⇒ BootstrapRole

Returns a new instance of BootstrapRole.

Parameters:

  • arn (String)

    The ARN of the IAM role created as part of bootrapping e.g. lookupRoleArn.

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

    Additional options to pass to STS when assuming the role.

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

    External ID to use when assuming the bootstrap role.

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

    Name of SSM parameter with bootstrap stack version.

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

    Version of bootstrap stack required to use this role.



12
13
14
15
16
17
18
19
20
21
22
23
# File 'cloud_assembly_schema/bootstrap_role.rb', line 12

def initialize(arn:, assume_role_additional_options: nil, assume_role_external_id: nil, bootstrap_stack_version_ssm_parameter: nil, requires_bootstrap_stack_version: nil)
  @arn = arn
  Jsii::Type.check_type(@arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "arn")
  @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_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?
  @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?
end

Instance Attribute Details

#arnString (readonly)

The ARN of the IAM role created as part of bootrapping e.g. lookupRoleArn.

Returns:

  • (String)


28
29
30
# File 'cloud_assembly_schema/bootstrap_role.rb', line 28

def arn
  @arn
end

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

Note:

Default: - No additional options.

Additional options to pass to STS when assuming the role.

  • RoleArn should not be used. Use the dedicated arn property instead.
  • ExternalId should not be used. Use the dedicated assume_role_external_id instead.


37
38
39
# File 'cloud_assembly_schema/bootstrap_role.rb', line 37

def assume_role_additional_options
  @assume_role_additional_options
end

#assume_role_external_idString? (readonly)

Note:

Default: - No external ID

External ID to use when assuming the bootstrap role.

Returns:

  • (String, nil)


42
43
44
# File 'cloud_assembly_schema/bootstrap_role.rb', line 42

def assume_role_external_id
  @assume_role_external_id
end

#bootstrap_stack_version_ssm_parameterString? (readonly)

Note:

Default: - Discover SSM parameter by reading stack

Name of SSM parameter with bootstrap stack version.

Returns:

  • (String, nil)


47
48
49
# File 'cloud_assembly_schema/bootstrap_role.rb', line 47

def bootstrap_stack_version_ssm_parameter
  @bootstrap_stack_version_ssm_parameter
end

#requires_bootstrap_stack_versionNumeric? (readonly)

Note:

Default: - No bootstrap stack required

Version of bootstrap stack required to use this role.

Returns:

  • (Numeric, nil)


52
53
54
# File 'cloud_assembly_schema/bootstrap_role.rb', line 52

def requires_bootstrap_stack_version
  @requires_bootstrap_stack_version
end

Class Method Details

.jsii_propertiesObject



54
55
56
57
58
59
60
61
62
# File 'cloud_assembly_schema/bootstrap_role.rb', line 54

def self.jsii_properties
  {
    :arn => "arn",
    :assume_role_additional_options => "assumeRoleAdditionalOptions",
    :assume_role_external_id => "assumeRoleExternalId",
    :bootstrap_stack_version_ssm_parameter => "bootstrapStackVersionSsmParameter",
    :requires_bootstrap_stack_version => "requiresBootstrapStackVersion",
  }
end

Instance Method Details

#to_jsiiObject



64
65
66
67
68
69
70
71
72
73
74
# File 'cloud_assembly_schema/bootstrap_role.rb', line 64

def to_jsii
  result = {}
  result.merge!({
    "arn" => @arn,
    "assumeRoleAdditionalOptions" => @assume_role_additional_options,
    "assumeRoleExternalId" => @assume_role_external_id,
    "bootstrapStackVersionSsmParameter" => @bootstrap_stack_version_ssm_parameter,
    "requiresBootstrapStackVersion" => @requires_bootstrap_stack_version,
  })
  result.compact
end