Skip to content
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 an ability to import permissions, source control and sso resources #30

Merged
merged 4 commits into from
Aug 21, 2024

Conversation

ph-ph
Copy link
Contributor

@ph-ph ph-ph commented Aug 19, 2024

Description

At first, I didn't implement import support for resources that don't have straightforward "id". But being able to import them is actually pretty useful, given that it makes it possible to use generate configuration function of Terraform.

This change adds ImportState method to resources that don't have it yet. In most cases, we don't care about import id, but for permissions resource we use subject to identify it.

Tests

Updated acceptance tests and re-recorded requests.

@@ -125,7 +125,7 @@ func TestMain(m *testing.M) {
resource.TestMain(m)
}

func TestAccSourceControl(t *testing.T) {
func TestAccSourceControlTest(t *testing.T) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had to add ...Test in the end - otherwise, this test's name is a prefix for TestAccSourceControlSettings, and I couldn't run this test in isolation - go test would always run both, which is annoying.

@@ -37,8 +37,7 @@ func main() {
flag.Parse()

opts := providerserver.ServeOpts{
// TODO(dzmitry.kishylau): Update this string with the published name of Retool provider.
Address: "registry.terraform.io/retool/retool",
Address: "registry.terraform.io/tryretool/retool",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tbh, not sure what this string does exactly, but changing it to tryretool/retool breaks local dev for unknown reasons.

@ph-ph ph-ph requested a review from a team August 19, 2024 23:58
docs/resources/sso.md Outdated Show resolved Hide resolved
examples/resources/retool_sso/import.sh Outdated Show resolved Hide resolved
Dzmitry Kishylau and others added 2 commits August 21, 2024 09:22
@ph-ph ph-ph merged commit 1447e33 into main Aug 21, 2024
3 checks passed
@ph-ph ph-ph deleted the dzmitry-implement-import-for-remaining-resources branch August 21, 2024 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants