We have ECS farget service stack where we want to export the serviceName like:
In stack1:
new cdk.CfnOutput(this, 'EcsServiceExportName', {
value: this.service.serviceName,
exportName: "EcsExportName"
});
this.service.serviceName is a physical name created by CDK.
we want to import this service name in another stack (stack2) like:
Fn.importValue(ECS_PROD_SERVICE_EXPORT_NAME)
Our pipeline deploys stack2 then stack1.
How to deploy this code change in single deployment?
Is there any other way to export name and import in another stack?
Does CDK will change physical name? if it's changing the physical name we will face issue while deployment of Stack2 as Stack1 is using "EcsExportName".
[NOTE: We always update our service]