Class: AWSCDK::SecretsManagerSecretOptions

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

Overview

Options for referencing a secret value from Secrets Manager.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json_field: nil, version_id: nil, version_stage: nil) ⇒ SecretsManagerSecretOptions

Returns a new instance of SecretsManagerSecretOptions.

Parameters:

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

    The key of a JSON field to retrieve.

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

    Specifies the unique identifier of the version of the secret you want to use.

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

    Specifies the secret version that you want to retrieve by the staging label attached to the version.



10
11
12
13
14
15
16
17
# File 'secrets_manager_secret_options.rb', line 10

def initialize(json_field: nil, version_id: nil, version_stage: nil)
  @json_field = json_field
  Jsii::Type.check_type(@json_field, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "jsonField") unless @json_field.nil?
  @version_id = version_id
  Jsii::Type.check_type(@version_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "versionId") unless @version_id.nil?
  @version_stage = version_stage
  Jsii::Type.check_type(@version_stage, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "versionStage") unless @version_stage.nil?
end

Instance Attribute Details

#json_fieldString? (readonly)

Note:

Default: - returns all the content stored in the Secrets Manager secret.

The key of a JSON field to retrieve.

This can only be used if the secret stores a JSON object.

Returns:

  • (String, nil)


26
27
28
# File 'secrets_manager_secret_options.rb', line 26

def json_field
  @json_field
end

#version_idString? (readonly)

Note:

Default: AWSCURRENT

Specifies the unique identifier of the version of the secret you want to use.

Can specify at most one of version_id and version_stage.

Returns:

  • (String, nil)


33
34
35
# File 'secrets_manager_secret_options.rb', line 33

def version_id
  @version_id
end

#version_stageString? (readonly)

Note:

Default: AWSCURRENT

Specifies the secret version that you want to retrieve by the staging label attached to the version.

Can specify at most one of version_id and version_stage.

Returns:

  • (String, nil)


40
41
42
# File 'secrets_manager_secret_options.rb', line 40

def version_stage
  @version_stage
end

Class Method Details

.jsii_propertiesObject



42
43
44
45
46
47
48
# File 'secrets_manager_secret_options.rb', line 42

def self.jsii_properties
  {
    :json_field => "jsonField",
    :version_id => "versionId",
    :version_stage => "versionStage",
  }
end

Instance Method Details

#to_jsiiObject



50
51
52
53
54
55
56
57
58
# File 'secrets_manager_secret_options.rb', line 50

def to_jsii
  result = {}
  result.merge!({
    "jsonField" => @json_field,
    "versionId" => @version_id,
    "versionStage" => @version_stage,
  })
  result.compact
end