Class: AWSCDK::Pipelines::ExternalDockerCredentialOptions

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

Overview

Options for defining credentials for a Docker Credential.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(assume_role: nil, secret_password_field: nil, secret_username_field: nil, usages: nil) ⇒ ExternalDockerCredentialOptions

Returns a new instance of ExternalDockerCredentialOptions.

Parameters:

  • assume_role (AWSCDK::IAM::IRole, nil) (defaults to: nil)

    An IAM role to assume prior to accessing the secret.

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

    The name of the JSON field of the secret which contains the secret/password.

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

    The name of the JSON field of the secret which contains the user/login name.

  • usages (Array<AWSCDK::Pipelines::DockerCredentialUsage>, nil) (defaults to: nil)

    Defines which stages of the pipeline should be granted access to these credentials.



11
12
13
14
15
16
17
18
19
20
# File 'pipelines/external_docker_credential_options.rb', line 11

def initialize(assume_role: nil, secret_password_field: nil, secret_username_field: nil, usages: nil)
  @assume_role = assume_role
  Jsii::Type.check_type(@assume_role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklSb2xlIn0=")), "assumeRole") unless @assume_role.nil?
  @secret_password_field = secret_password_field
  Jsii::Type.check_type(@secret_password_field, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "secretPasswordField") unless @secret_password_field.nil?
  @secret_username_field = secret_username_field
  Jsii::Type.check_type(@secret_username_field, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "secretUsernameField") unless @secret_username_field.nil?
  @usages = usages
  Jsii::Type.check_type(@usages, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLnBpcGVsaW5lcy5Eb2NrZXJDcmVkZW50aWFsVXNhZ2UifSwia2luZCI6ImFycmF5In19")), "usages") unless @usages.nil?
end

Instance Attribute Details

#assume_roleAWSCDK::IAM::IRole? (readonly)

Note:

Default: - none. The current execution role will be used.

An IAM role to assume prior to accessing the secret.

Returns:



26
27
28
# File 'pipelines/external_docker_credential_options.rb', line 26

def assume_role
  @assume_role
end

#secret_password_fieldString? (readonly)

Note:

Default: 'secret'

The name of the JSON field of the secret which contains the secret/password.

Returns:

  • (String, nil)


31
32
33
# File 'pipelines/external_docker_credential_options.rb', line 31

def secret_password_field
  @secret_password_field
end

#secret_username_fieldString? (readonly)

Note:

Default: 'username'

The name of the JSON field of the secret which contains the user/login name.

Returns:

  • (String, nil)


36
37
38
# File 'pipelines/external_docker_credential_options.rb', line 36

def secret_username_field
  @secret_username_field
end

#usagesArray<AWSCDK::Pipelines::DockerCredentialUsage>? (readonly)

Note:

Default: - all relevant stages (synth, self-update, asset publishing) are granted access.

Defines which stages of the pipeline should be granted access to these credentials.



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

def usages
  @usages
end

Class Method Details

.jsii_propertiesObject



43
44
45
46
47
48
49
50
# File 'pipelines/external_docker_credential_options.rb', line 43

def self.jsii_properties
  {
    :assume_role => "assumeRole",
    :secret_password_field => "secretPasswordField",
    :secret_username_field => "secretUsernameField",
    :usages => "usages",
  }
end

Instance Method Details

#to_jsiiObject



52
53
54
55
56
57
58
59
60
61
# File 'pipelines/external_docker_credential_options.rb', line 52

def to_jsii
  result = {}
  result.merge!({
    "assumeRole" => @assume_role,
    "secretPasswordField" => @secret_password_field,
    "secretUsernameField" => @secret_username_field,
    "usages" => @usages,
  })
  result.compact
end