-
Notifications
You must be signed in to change notification settings - Fork 1
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
Docs: define import example for resources #113
Changes from 2 commits
05ba3e7
762c054
7927bdd
fddcbca
1ff3aee
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,11 @@ Role schema | |
## Example Usage | ||
|
||
```terraform | ||
import { | ||
id = 5 | ||
to = unleash_role.custom_root_role | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 5 is the id of the predefined Project Member role, maybe we should add it as a resource that is imported rather than a custom_root_role which could be misleading |
||
|
||
resource "unleash_role" "custom_root_role" { | ||
name = "A custom role" | ||
type = "root-custom" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,18 @@ User schema | |
## Example Usage | ||
|
||
```terraform | ||
import { | ||
id = 1 | ||
to = unleash_user.admin | ||
} | ||
|
||
resource "unleash_user" "admin" { | ||
email = "[email protected]" | ||
name = "Chuck Norris" | ||
root_role = 1 | ||
send_email = false | ||
} | ||
|
||
resource "unleash_user" "chuck" { | ||
email = "[email protected]" | ||
name = "Chuck Norris" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
import { | ||
id = 5 | ||
to = unleash_role.custom_root_role | ||
} | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Intention here is to import the project member role and override the permissions |
||
resource "unleash_role" "custom_root_role" { | ||
name = "A custom role" | ||
type = "root-custom" | ||
|
@@ -33,4 +38,4 @@ resource "unleash_role" "project_role" { | |
name = "UPDATE_FEATURE_ENVIRONMENT" | ||
environment = "development" | ||
}] | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,15 @@ | ||
import { | ||
id = 1 | ||
to = unleash_user.admin | ||
} | ||
|
||
resource "unleash_user" "admin" { | ||
email = "[email protected]" | ||
name = "Chuck Norris" | ||
root_role = 1 | ||
send_email = false | ||
} | ||
|
||
resource "unleash_user" "chuck" { | ||
email = "[email protected]" | ||
name = "Chuck Norris" | ||
|
@@ -11,4 +23,4 @@ resource "unleash_user" "with_password" { | |
root_role = 1 | ||
send_email = false | ||
password = "youcanseeme" | ||
} | ||
} |
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.
Not sure if this will work, because the resource is being created in line 50. What you can import maybe is the default project access
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.
Got it thanks. Importing the default project access and overriding the owner (I think)