-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat add force destroy to environment resource #175
feat add force destroy to environment resource #175
Conversation
…nt' into feat-trigger-deployments-for-environment
"name": environment.Name, | ||
"project_id": environment.ProjectId, | ||
"template_id": environment.LatestDeploymentLog.BlueprintId, | ||
"force_destroy": true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because now destroy requires "force_destroy" I had to add it to all the tests for test cleanup to work
canDestroy := d.Get("force_destroy") | ||
|
||
if canDestroy != true { | ||
return diag.Errorf(`must enable "force_destroy" safeguard in order to destroy`) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you sure about it? this means if the user didn't set force_destroy: true he can't destroy this environment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yea, thats what @avnerenv0 and @yaronya wanted
They said thats how it is in s3 tf provider
Personally I don't like it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mozar - The user should know when he does destroy the data will be deleted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@avnerenv0 do we sure about it for destory?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah man we had like 50 discussions about this already.
This concept comes from the aws_s3_bucket
resource and is pretty standard and accepted in TF.
Also exists for google_storage_bucket
, for example.
There is also prevent_destroy
concept but we'd like to go with the 'safer' option.
Issue & Steps to Reproduce / Feature Request
add force destroy safeguard to environment resource