I really have to practice more with updating stack...
# help
a
I really have to practice more with updating stacks...it almost always fails for some reason (e.g. when I change some dynamodb config), then I delete the tables through amazon gui, try again and it seems even worse than before, usually resulting in a stack that sits forever in delete pending
is there some handy guide with a few scenarios that tells you what to do when you updated different things in your stacks?
d
I have also experienced this problem. Not that this helps you. Just wanted to let you know you're not alone!
f
@Adrian Schweizer if you have a specific scenario, ie. what config you changed and what CFN error do you get. I can see if it’s something specific to ur architecture, or just CFN being CFN 🤷‍♂️
a
Yeah, I'll take some notes next time. I have a feeling it's probably the latter.
ö
I guess that is because the changes you made require replacement for the resources, i.e., removal of the resource, and creation of a new resource. I also come across with this, with DynamoDB, say you change the primary key configuration, then I guess the easiest way would be to change the table name.
a
yeah, I just had this, I changed the name of a global seconday index, then tried to redeploy (it detected a change), but redeploy failed, with error
Cannot perform more than one GSI creation or deletion in a single update
I then deleted the whole table in dynamodb gui and redeployed again, but it didn't create the table
so i tried npx sst remove --stack=storage to remove the whole stack, and now it's deletion pending and won't stop
so I guess the way to go would be to first add GSI with the new name, redeploy, then remove GSI with old name?
ö
Yeah, or vice versa. But I guess a guide on updating stacks is really important, because what if you had this change in a production environment/stage.
a
yeah, I have no idea and am actually quite scared to go live with my app
ö
lol
I guess you need to first create a changeset and see what resources will create-deleted-modified
and maybe chcek the resource policies for each property
a
hmmm, yeah, I gotta read up about cloudformation, I had very little exposure to it so far
thanks for the links
f
Yeah, try to avoid manually changing/removing resources through AWS console directly. Whatever you change, CloudFormation isn’t aware of it. And when you deploy again, CloudFormation is likely to fail.
a
ok, that's good to know as a general guideline