Skip to content

How to use only password of secret from RDS in ECS #5665

@konstantinj

Description

@konstantinj

❓ General Issue

I wonder what's the proposed way to use the generated secret from an rds instance/cluster.

const database = new rds.DatabaseCluster(this, 'DatabaseCluster', {
            removalPolicy: RemovalPolicy.DESTROY,
            defaultDatabaseName: scope.getConfig(this, 'wordpressDbName'),
            masterUser: {
                username: 'wordpress',
            },
            instances: 1,
            engine: rds.DatabaseClusterEngine.AURORA,
            instanceProps: {
                instanceType: ec2.InstanceType.of(ec2.InstanceClass.T3, ec2.InstanceSize.SMALL),
                vpc: vpc,
            }
        })

In ECS I would like to get only the password. All other information is known anyway.

WORDPRESS_DB_PASSWORD: ecs.Secret.fromSecretsManager(database.secret?.secretValueFromJson('password')),

but this does not work. Modifications inside the container should not be the solution.

Environment

  • CDK CLI Version: 1.19.0
  • Module Version: 1.19.0

Metadata

Metadata

Labels

@aws-cdk/aws-ecsRelated to Amazon Elastic Container@aws-cdk/aws-rdsRelated to Amazon Relational Databaseeffort/mediumMedium work item – several days of effortfeature-requestA feature should be added or improved.in-progressThis issue is being actively worked on.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions