1 réponse
- Le plus récent
- Le plus de votes
- La plupart des commentaires
0
Aravind,
Unfortunately, I have not found a straightforward way to customize the name of those types of resources. However, since the {prefix} and {suffix} you're seeing are likely derived from the logical ID of the resource in your CDK application (auto-generated hash to ensure uniqueness), you should be able to work around the issue by differentiating the resources between the two stacks by assigning different logical IDs or adding another level of nesting.
For example, you can put each of your stack instances in a different CDK Stage, or you can differentiate the resources by adding a unique identifier to the logical IDs or to the stack names.
Here is an example using stages:
class MyStage extends cdk.Stage {
constructor(scope: cdk.Construct, id: string, props?: cdk.StageProps) {
super(scope, id, props);
new MyStack(this, 'MyStack');
}
}
const app = new cdk.App();
new MyStage(app, 'Prod', { env: { region: 'us-west-2' } });
new MyStage(app, 'Dev', { env: { region: 'us-west-2' } });
Hope that helps!
-Zac
répondu il y a un an
Contenus pertinents
- demandé il y a un an
- demandé il y a 3 mois
- demandé il y a un an
- AWS OFFICIELA mis à jour il y a 2 ans
- AWS OFFICIELA mis à jour il y a 5 mois