- Più recenti
- Maggior numero di voti
- Maggior numero di commenti
If you just want to switch the template from a local file to an object in S3 on an existing stack, use the update-stack operation instead of the create-stack
operation.
Hello. To migrate the backend of an AWS CloudFormation stack to use an S3 bucket, you typically need to recreate the stack with a different name. CloudFormation stack names are unique within an AWS account and region, so you cannot have two stacks with the same name in the same region.
Best regards, Andrii
Hello,
For using the same Cloud formation stack, you can use the deletion policy in the first stack and remove the resource from your CFT and provision the stack, since the deletion policy is applied the resources created by the CFT would be detached from the stack and would remain in the AWS.
use the same copy of the CFT which was there in local in s3 and provision the resource, this would import the existing resource which was there. then you can update your s3 CFT for any update operation in the resources.
By using this method, you can shift/migrate the resources to different CFTs without deleting it.
When you use the command you listed to create a stack from the "local" file the CLI is actually first uploading your template file to S3 and then creating the stack. Therefore your current stack is already "using s3". Once a stack is deployed it does not maintain any link to the source file that created it, it keeps a copy of the template in the CloudFormation service, which is what you see when you view the Template tab in the console. It is not showing you the file locally or even the file in S3.
So for now you have no need to take any action. If you find a change you need to make in the future at that point you can do a update-stack
using an S3 location but there is no need until that time.
I hope this makes sense.
Contenuto pertinente
- AWS UFFICIALEAggiornata 2 anni fa
- AWS UFFICIALEAggiornata 3 anni fa
- AWS UFFICIALEAggiornata un anno fa
When using CLI I have this error: An error occurred (ValidationError) when calling the UpdateStack operation: No updates are to be performed. Maybe it will work when I will change some small part or add something.
Yes, if they are the exact same template, you will get that error.