Closed lockenj closed 1 month ago
Thanks for opening this issue! Please make sure to provide the following information to help us reproduce the issue:
Thanks for opening this issue. The ticket CLOUDP-267436 was created for internal tracking.
Hi @lockenj!
Could you provide additional information of CDK commands you are running and resulting logs in each step? Calling out which properties are being modified is also relevant for this case. From the error you are facing it would seem that a new stack is being created, instead of updating an existing stack.
Hi @AgustinBettati
We are running cdk deploy
from within Github Actions. That same command is ran when the archive stack is first deployed and again when we update our system. Unfortunately this runs any time the system is updated even though there are no changes to that stack and does not need to run.
@lockenj I think it has to do with these two lines:
const rando5Chars = (Math.random() + 1).toString(36).substring(7);
const archiveName = `${props.dbName}.${props.collName}-${rando5Chars}`;
archiveName
is passed as the id
to the CfnOnlineArchive
construct. I believe this id
needs to be the same between executions. Since you are using Math.random()
, I believe it will change every time you run cdk deploy
.
Can you try again by setting archiveName
to a static string? e.g.:
const archiveName = `${props.dbName}.${props.collName}`; // removing rando5Chars
See Logical ID stability in the AWS docs for more information
Thank you @EspenAlbert I totally forgot I added that to work around a previous bug that didnt teardown the archives when the stack was destroyed.
I will remove this snippet and verify everything works correctly.
Hi @lockenj, Did it work after the changes? If so, can we close this issue?
We were able to test things out this morning and it everything worked as expected. Thanks again!
Is there an existing issue for this?
CDK package version
3.6.0
CFN Resource version
2.1.0
CFN Resource Region
us-east-2
Current Behavior
We have a stack with multiple online archives setup. We recently updated the stack and we are getting this error back.
POST: HTTP 409 Conflict (Error code: "ONLINE_ARCHIVE_ALREADY_EXISTS")
AWS CDK code to reproduce the issue
Steps To Reproduce
cdk synth
No response
Code of Conduct