Class: AWSCDK::ECS::CfnTaskDefinition::SecretProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
ecs/cfn_task_definition.rb

Overview

An object representing the secret to expose to your container.

Secrets can be exposed to a container in the following ways:

  • To inject sensitive data into your containers as environment variables, use the secrets container definition parameter.
  • To reference sensitive information in the log configuration of a container, use the secret_options container definition parameter.

For more information, see Specifying sensitive data in the Amazon Elastic Container Service Developer Guide .

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, value_from:) ⇒ SecretProperty

Returns a new instance of SecretProperty.

Parameters:

  • name (String)

    The name of the secret.

  • value_from (String)

    The secret to expose to the container.



3153
3154
3155
3156
3157
3158
# File 'ecs/cfn_task_definition.rb', line 3153

def initialize(name:, value_from:)
  @name = name
  Jsii::Type.check_type(@name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "name")
  @value_from = value_from
  Jsii::Type.check_type(@value_from, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "valueFrom")
end

Instance Attribute Details

#nameString (readonly)

The name of the secret.



3164
3165
3166
# File 'ecs/cfn_task_definition.rb', line 3164

def name
  @name
end

#value_fromString (readonly)

The secret to expose to the container.

The supported values are either the full ARN of the AWS Secrets Manager secret or the full ARN of the parameter in the SSM Parameter Store.

For information about the require AWS Identity and Access Management permissions, see Required IAM permissions for Amazon ECS secrets (for Secrets Manager) or Required IAM permissions for Amazon ECS secrets (for Systems Manager Parameter store) in the Amazon Elastic Container Service Developer Guide .

If the SSM Parameter Store parameter exists in the same Region as the task you're launching, then you can use either the full ARN or name of the parameter. If the parameter exists in a different Region, then the full ARN must be specified.



3175
3176
3177
# File 'ecs/cfn_task_definition.rb', line 3175

def value_from
  @value_from
end

Class Method Details

.jsii_propertiesObject



3177
3178
3179
3180
3181
3182
# File 'ecs/cfn_task_definition.rb', line 3177

def self.jsii_properties
  {
    :name => "name",
    :value_from => "valueFrom",
  }
end

Instance Method Details

#to_jsiiObject



3184
3185
3186
3187
3188
3189
3190
3191
# File 'ecs/cfn_task_definition.rb', line 3184

def to_jsii
  result = {}
  result.merge!({
    "name" => @name,
    "valueFrom" => @value_from,
  })
  result.compact
end