- Newest
- Most votes
- Most comments
Hello,
Per the VolumeType property, updates to this property after the instance is running results in an instance replacement. There is no way for CloudFormation to update the EBS volume type for the instance that is already running without an instance replacement.
An workaround is to first remove the instance from CloudFormation management (delete the instance from the stack after having applied the DeletionPolicy: Retain) as in your template above. After this, manually modify the EBS volume to gp3 via the EC2 console and after modification is complete, import the instance back to CloudFormation.
Additionally, note that because Service Catalog is being used, the stack needs to first be disassociated from Service Catalog using the "--retain-physical-resources" option in the terminate-provisioned-product command. After the instance have been imported back to the stack as in the step above, you can then add this stack back to Service Catalog using the import-as-provisioned-product CLI command.
Relevant content
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 4 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 months ago
@Ugochukwu_I
Are you referring to this? https://aws.amazon.com/premiumsupport/knowledge-center/cloudformation-update-volume-instance/
Are you able to explain this further? "An workaround is to first remove the instance from CloudFormation management (delete the instance from the stack after having applied the DeletionPolicy: Retain) as in your template above."
How do I remove the instance from the current Cloudformation template? Can you highlight what needs to be changed from the cloudformation template?
Hello Kyiori,
I was referring to your use-case where you want to modify the volume without instance replacement. The workaround for this is to use the CloudFormation import feature. First, you perform a stack update where you apply a "DeletionPolicy: Retain" on the instance (which you have already done). To remove/delete the instance from CloudFormation management, simply comment out the EC2Instance from the template and update the stack. CloudFormation will take it out of its management. Then you can manually update the volume from EC2 and when done import the instance back to CloudFormation