-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use only password of secret from RDS in ECS #5665
Labels
@aws-cdk/aws-ecs
Related to Amazon Elastic Container
@aws-cdk/aws-rds
Related to Amazon Relational Database
effort/medium
Medium work item – several days of effort
feature-request
A feature should be added or improved.
in-progress
This issue is being actively worked on.
Comments
Sadly this is currently not possible without code modifications inside the conainter, see aws/containers-roadmap#385 |
SomayaB
added
@aws-cdk/aws-ecs
Related to Amazon Elastic Container
@aws-cdk/aws-rds
Related to Amazon Relational Database
labels
Jan 7, 2020
Got a workaround: const wordpressDbPasswordSecret = new Secret(this, 'wordpressDbPassword', {
secretName: '/' + [this.account, this.stackName, 'wordpressDbPassword'].join('/'),
generateSecretString: {
passwordLength: 20,
}
})
const database = new rds.DatabaseCluster(this, 'DatabaseCluster', {
removalPolicy: RemovalPolicy.DESTROY,
defaultDatabaseName: 'wordpress',
masterUser: {
username: 'wordpress',
password: SecretValue.secretsManager(wordpressDbPasswordSecret.secretArn),
},
instances: 1,
engine: rds.DatabaseClusterEngine.AURORA,
instanceProps: {
instanceType: ec2.InstanceType.of(ec2.InstanceClass.T3, ec2.InstanceSize.SMALL),
vpc: vpc,
vpcSubnets: {
subnetType: ec2.SubnetType.PRIVATE,
},
},
}) |
This indeed works but note that you won't be able to rotate your DB password using the rotation application with this workaround. |
jogold
added a commit
to jogold/aws-cdk
that referenced
this issue
Feb 25, 2020
Amazon Elastic Container Service now supports reading AWS Secrets Manager secrets from a key within a JSON object. See https://aws.amazon.com/about-aws/whats-new/2020/02/amazon-ecs-now-supports-aws-secrets-manager-version-and-json-keys/ Closes aws#5665
Would be great to get the json key support for ECS secrets! |
mergify bot
pushed a commit
that referenced
this issue
Apr 6, 2020
feat(ecs): secret JSON key for environment variables Amazon Elastic Container Service now supports reading AWS Secrets Manager secrets from a key within a JSON object. See https://aws.amazon.com/about-aws/whats-new/2020/02/amazon-ecs-now-supports-aws-secrets-manager-version-and-json-keys/ Closes #5665
horsmand
pushed a commit
to horsmand/aws-cdk
that referenced
this issue
Apr 8, 2020
feat(ecs): secret JSON key for environment variables Amazon Elastic Container Service now supports reading AWS Secrets Manager secrets from a key within a JSON object. See https://aws.amazon.com/about-aws/whats-new/2020/02/amazon-ecs-now-supports-aws-secrets-manager-version-and-json-keys/ Closes aws#5665
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
@aws-cdk/aws-ecs
Related to Amazon Elastic Container
@aws-cdk/aws-rds
Related to Amazon Relational Database
effort/medium
Medium work item – several days of effort
feature-request
A feature should be added or improved.
in-progress
This issue is being actively worked on.
❓ General Issue
I wonder what's the proposed way to use the generated secret from an rds instance/cluster.
In ECS I would like to get only the password. All other information is known anyway.
but this does not work. Modifications inside the container should not be the solution.
Environment
The text was updated successfully, but these errors were encountered: