Hi all! I want to reinstall SST app on PROD but I ...
# sst
i
Hi all! I want to reinstall SST app on PROD but I want to preserve current buckets. Is there a way to do this without of seeing error
"a bucket with this name already exists"
?
a
there's an import feature in CloudFormation where you can import existing resources into a stack. I haven't used it yet but you can try. https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/resource-import-existing-stack.html I think a safe approach would be to check how a new Bucket looks like when generated by SST, and see how you need to plan the import of the already existing bucket so that everything matches accordingly.
f
@Ivan Roskoshnyi do u want to preserve the bucket names or items in the bucket? If it’s the latter, you can also create a new bucket, and copy the items over.
a
that too, I think
aws s3 sync
should do this easily https://docs.aws.amazon.com/cli/latest/reference/s3/sync.html
j
Another option is to import it into your stack. I was helping someone migrate their DDB resource and wrote down the steps we did. You can just follow from Step #2 onwards on here. It should work for S3 as well, just adjust the code as required. https://justindra.medium.com/moving-aws-cloudformation-resources-between-stacks-using-sst-ffbed2ff2cf2