-
Notifications
You must be signed in to change notification settings - Fork 160
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
Add project level auto destroy #1550
Conversation
91a6fb5
to
01a4069
Compare
CHANGELOG.md
Outdated
@@ -1,5 +1,13 @@ | |||
## Unreleased | |||
|
|||
BREAKING_CHANGES: | |||
* `r/tfe_workspace`: Add attribute `inherits_project_auto_destroy` to tfe_workspace, existing workspaces with auto-destroy settings should add `inherits_project_auto_destroy: false` to tfe_workspace resource [1550](https://github.com/hashicorp/terraform-provider-tfe/pull/1550) |
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.
IMO we should do fill this out for the user the same way we do on the frontend. Basically if they have one defined in config then we should automatically set this to false
Add business org delegation to the datasource test Run go mod tidy Add interface stub Use datasource for organzation Reference data source Add missing reference Modify resource to directly reference orgname
15be161
to
54858bc
Compare
Update latest version to v0.63.0 cdktf: update documentation empty Fix merged conflicts
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.
tested provider locally and looks good
Just tried this out, it looks like removing an |
Will sync with you on this. Cannot replicate this at the moment. |
d.Set("auto_destroy_activity_duration", v) | ||
} else { | ||
d.Set("auto_destroy_activity_duration", nil) |
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.
very minor nit, imitating the logic above for other nilable strings (and what we do in the project data source) would probably be better
var autoDestroyDuration string
if proj.AutoDestroyActivityDuration.IsSpecified() {
autoDestroyDuration, err = proj.AutoDestroyActivityDuration.Get()
if err != nil {
return diag.Errorf("Error reading auto destroy activity duration: %v", err)
}
}
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.
Thanks, looks good! 🚢
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.
Implementation is looking good. We're missing the doc changes for r/tfe_project
, r/tfe_workspace
and d/tfe_workspace
however
@@ -62,6 +62,33 @@ func TestAccTFEProjectDataSource_caseInsensitive(t *testing.T) { | |||
}) | |||
} | |||
|
|||
func TestAccTFEProjectDataSource_basicWithAutoDestroy(t *testing.T) { | |||
rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int() |
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.
Since this feature requires a subscription upgrade we should skip this test for our nightly TFE CI using skipUnlessCloud(t)
.
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.
I'll use skipIfEnterprise
if that's the flag you mean? I don't believe skipUnlessCloud
is a thing. Unless you mean the opposite in skipIfCloud
?
I added the docs for Edit: My bad, thanks for leting me know that we should still add it to the attribute reference section. |
Description
Add support in the tfe provider for the project level ephemeral workspace settings.
Remember to:
Testing plan
/app/<orgname>/workspaces/<workspace_name>/settings/delete
External links
Include any links here that might be helpful for people reviewing your PR. If there are none, feel free to delete this section.
Output from acceptance tests
Please run applicable acceptance tests locally and include the output here. See testing.md to learn how to run acceptance tests.
Project Resource
Workspace Resource
Project Data source
Workspace Data source