question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to use only password of secret from RDS in ECS

See original GitHub issue

❓ 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

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:4
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
ogrodnekcommented, Apr 2, 2020

Would be great to get the json key support for ECS secrets!

4reactions
jogoldcommented, Jan 6, 2020

Sadly this is currently not possible without code modifications inside the conainter, see https://github.com/aws/containers-roadmap/issues/385

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pass secrets or sensitive information securely to containers in ...
As a security best practice, pass sensitive information to containers as environment variables. You can securely inject data into containers by ...
Read more >
I tell you a secret: Provide Database credentials to an ECS ...
The good thing about is, that we can use the password secret natively. The username needs to be converted to a string before...
Read more >
Best practice for getting RDS password to docker container on ...
This configuration is buried deep in the ECS web console. You have to: Navigate to Task Definitions.
Read more >
RDS secrets rotation and ECS update | by Woltter Xavier
Rotate RDS passwords in AWS is facilitated using the Secrets Manager service. However, you may have a fully automated deployment in your ...
Read more >
Use Credentials with ECS Environment Variables (Hands-On)
Learn how to use the Systems Manager Parameter Store to store Credentials and retrieve them as Environment Variables in the ECS Cluster.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found