Skip to content

(aws-ecs): addSecret() for a ContainerDefinition #18959

@danwiltshire

Description

@danwiltshire

Description

Similar to addEnvironment() I'd like to add an addSecret() method.

Use Case

I'm using Aspects to configure third-party services on ECS services. For example, setting environment variables and secrets for a logging solution.

Today I'm using an escape hatch to add additional Secrets.

Proposed Solution

const container = taskDefinition.addContainer('nginx', {
  image: ecs.ContainerImage.fromRegistry('nginx'),
});

container.addSecret('SECRET_1', ecs.Secret.fromSecretsManager(secret));
container.addSecret('SECRET_2', ecs.Secret.fromSecretsManager(secretField, 'password'));

Other information

Have written code for this and I will link soon.

Acknowledge

  • I may be able to implement this feature request
  • This feature might incur a breaking change

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/aws-ecsRelated to Amazon Elastic Containereffort/smallSmall work item – less than a day of effortfeature-requestA feature should be added or improved.in-progressThis issue is being actively worked on.p1

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions