Class: AWSCDK::SecretsManager::SecretAttributes

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
secrets_manager/secret_attributes.rb

Overview

Attributes required to import an existing secret into the Stack.

One ARN format (secret_arn, secret_complete_arn, secret_partial_arn) must be provided.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(encryption_key: nil, secret_complete_arn: nil, secret_partial_arn: nil) ⇒ SecretAttributes

Returns a new instance of SecretAttributes.

Parameters:

  • encryption_key (AWSCDK::KMS::IKey, nil) (defaults to: nil)

    The encryption key that is used to encrypt the secret, unless the default SecretsManager key is used.

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

    The complete ARN of the secret in SecretsManager.

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

    The partial ARN of the secret in SecretsManager.



12
13
14
15
16
17
18
19
# File 'secrets_manager/secret_attributes.rb', line 12

def initialize(encryption_key: nil, secret_complete_arn: nil, secret_partial_arn: nil)
  @encryption_key = encryption_key
  Jsii::Type.check_type(@encryption_key, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfa21zLklLZXkifQ==")), "encryptionKey") unless @encryption_key.nil?
  @secret_complete_arn = secret_complete_arn
  Jsii::Type.check_type(@secret_complete_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "secretCompleteArn") unless @secret_complete_arn.nil?
  @secret_partial_arn = secret_partial_arn
  Jsii::Type.check_type(@secret_partial_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "secretPartialArn") unless @secret_partial_arn.nil?
end

Instance Attribute Details

#encryption_keyAWSCDK::KMS::IKey? (readonly)

The encryption key that is used to encrypt the secret, unless the default SecretsManager key is used.

Returns:



24
25
26
# File 'secrets_manager/secret_attributes.rb', line 24

def encryption_key
  @encryption_key
end

#secret_complete_arnString? (readonly)

The complete ARN of the secret in SecretsManager.

This is the ARN including the Secrets Manager 6-character suffix. Cannot be used with secret_arn or secret_partial_arn.

Returns:

  • (String, nil)


31
32
33
# File 'secrets_manager/secret_attributes.rb', line 31

def secret_complete_arn
  @secret_complete_arn
end

#secret_partial_arnString? (readonly)

The partial ARN of the secret in SecretsManager.

This is the ARN without the Secrets Manager 6-character suffix. Cannot be used with secret_arn or secret_complete_arn.

Returns:

  • (String, nil)


38
39
40
# File 'secrets_manager/secret_attributes.rb', line 38

def secret_partial_arn
  @secret_partial_arn
end

Class Method Details

.jsii_propertiesObject



40
41
42
43
44
45
46
# File 'secrets_manager/secret_attributes.rb', line 40

def self.jsii_properties
  {
    :encryption_key => "encryptionKey",
    :secret_complete_arn => "secretCompleteArn",
    :secret_partial_arn => "secretPartialArn",
  }
end

Instance Method Details

#to_jsiiObject



48
49
50
51
52
53
54
55
56
# File 'secrets_manager/secret_attributes.rb', line 48

def to_jsii
  result = {}
  result.merge!({
    "encryptionKey" => @encryption_key,
    "secretCompleteArn" => @secret_complete_arn,
    "secretPartialArn" => @secret_partial_arn,
  })
  result.compact
end