Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this,
"Secret2",
secretProps(aurora2, `${DB_CLUSTER_ID}2`)
);
secret.addDependsOn(aurora);
secret2.addDependsOn(aurora2);
new CfnOutput(this, "AASASecretArn", {
value: secret.ref
});
new CfnOutput(this, "AASASecretArn2", {
value: secret2.ref
});
// TEST USER
const user = new User(this, "TestUser");
const policy = new Policy(this, "TestUserPolicy", {
statements: [
new PolicyStatement({
actions: ["rds-data:*"],
resources: [
`arn:aws:rds:${this.region}:${this.account}:cluster:${DB_CLUSTER_ID}*`,
`arn:aws:rds:${this.region}:${this.account}:cluster:${DB_CLUSTER_ID}2*`
]
}),
new PolicyStatement({
actions: ["secretsmanager:*"],
resources: [`${secret.ref}*`, `${secret2.ref}*`]
})
]
});
user.attachInlinePolicy(policy);