Secret

class aws_cdk.aws_ecs.Secret

Bases: object

A secret environment variable.

Methods

abstract grant_read(grantee)

Grants reading the secret to a principal.

Parameters

grantee (IGrantable) –

Return type

Grant

Attributes

arn

The ARN of the secret.

Return type

str

has_field

Whether this secret uses a specific JSON field.

Return type

Optional[bool]

Static Methods

classmethod from_secrets_manager(secret, field=None)

Creates a environment variable value from a secret stored in AWS Secrets Manager.

Parameters
  • secret (ISecret) – the secret stored in AWS Secrets Manager.

  • field (Optional[str]) – the name of the field with the value that you want to set as the environment variable value. Only values in JSON format are supported. If you do not specify a JSON field, then the full content of the secret is used.

Return type

Secret

classmethod from_ssm_parameter(parameter)

Creates an environment variable value from a parameter stored in AWS Systems Manager Parameter Store.

Parameters

parameter (IParameter) –

Return type

Secret