Which solution will meet these requirements?
Add an –enable-termination-protection command line option to the create-stack command and the update-stack command.
Add a –disable-rollback command line option to the create-stack command and the update-stack command.
Add a –parameters ParameterKey=PreserveResources,ParameterValue=True command line option to the create-stack command and the update-stack command.
Add a –tags Key=PreserveResources,Value=True command line option to the create-stack command and the update-stack command.
Explanations:
The–enable-termination-protectionoption prevents the stack from being deleted, but it does not prevent rollback during stack creation or update. This option is used for protecting the entire stack rather than preserving successfully provisioned resources in case of errors.
The–disable-rollbackoption prevents CloudFormation from rolling back the entire stack to its previous state when an error occurs during stack creation or update. This allows successfully provisioned resources to remain in place while others fail, meeting the requirement to preserve them.
The–parameters ParameterKey=PreserveResources,ParameterValue=Trueoption is not a valid CloudFormation parameter for preserving resources. CloudFormation does not have a built-in mechanism that uses parameters to specify resource preservation in this way during stack creation or update.
The–tags Key=PreserveResources,Value=Trueoption is used to add tags to resources but does not affect the rollback behavior or the preservation of resources in case of errors. Tags do not influence how CloudFormation manages resource creation or error handling.