Skip to content
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

aws_docdbelastic : When secret is updated, we have to manually reassign it to docDB #29291

Closed
Exter-dg opened this issue Feb 28, 2024 · 2 comments
Labels
@aws-cdk/aws-secretsmanager Related to AWS Secrets Manager bug This issue is a bug. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. effort/medium Medium work item – several days of effort p2 response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.

Comments

@Exter-dg
Copy link

Exter-dg commented Feb 28, 2024

Describe the bug

If docDb uses a secret manager for adminUserPassword and if the secret is updated, it doesn't automatically reflect in document db. It has to be manually reassigned from console.

Expected Behavior

Whenever secret is updated, docDb should automatically be updated

Current Behavior

Whenever secret is updated, docDb password is not updated

Reproduction Steps

Create docDB with below code and then update secret (by changing exclude characters)

import {
  aws_docdbelastic as docdbelastic,
  aws_secretsmanager as secretsmanager
} from 'aws-cdk-lib';

/**
 * Create a new secret
 * https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_secretsmanager.Secret.html
 */
const secret = new secretsmanager.Secret(this, 'Secret', {
  description: SecretDescription,
  secretName: SecretName,
  generateSecretString: {
    excludeCharacters: '/@":+&$?#[]',
  }
});

/**
 * Create a new Document DB Elastic Cluster
 * https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_docdbelastic.CfnCluster.html
 */
new docdbelastic.CfnCluster(this, 'elasticDocDbCluster', {
  adminUserName: AdminUserName,
  adminUserPassword: secret.secretArn,
  authType: "SECRET_ARN",
  clusterName: "ClusterName",
  shardCapacity: ShardCapacity,
  shardCount: ShardCount,
  subnetIds: dataSubnets,
  vpcSecurityGroupIds: [securityGroup.securityGroupId],
});

I believe this will also cause an issue similarly for Secret rotation.

Possible Solution

Looks like document db is still using the old version of the secret. Is this expected?

Additional Information/Context

No response

CDK CLI Version

2.123.0

Framework Version

No response

Node.js Version

v16.20.2

OS

Linux/UNIX

Language

TypeScript

Language Version

No response

Other information

No response

@Exter-dg Exter-dg added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Feb 28, 2024
@github-actions github-actions bot added the @aws-cdk/aws-secretsmanager Related to AWS Secrets Manager label Feb 28, 2024
@pahud
Copy link
Contributor

pahud commented Feb 28, 2024

I guess this is because docdb does not have native secret rotation support but I probably need to check the doc for the latest status. If it does not support then yes we need to manually update it after modify the value in secret manager. But this is beyond the scope of AWS CDK.

@pahud pahud added p2 response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. effort/medium Medium work item – several days of effort and removed needs-triage This issue or PR still needs to be triaged. labels Feb 28, 2024
Copy link

github-actions bot commented Mar 2, 2024

This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

@github-actions github-actions bot added closing-soon This issue will automatically close in 4 days unless further comments are made. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Mar 2, 2024
@github-actions github-actions bot closed this as completed Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-secretsmanager Related to AWS Secrets Manager bug This issue is a bug. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. effort/medium Medium work item – several days of effort p2 response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Projects
None yet
Development

No branches or pull requests

2 participants