-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Added name field to both custom project and org roles #3370
Changes from 1 commit
43396b7
0d06b29
e290faf
72c1289
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 |
---|---|---|
|
@@ -126,6 +126,7 @@ func resourceGoogleProjectIamCustomRoleRead(d *schema.ResourceData, meta interfa | |
|
||
d.Set("role_id", GetResourceNameFromSelfLink(role.Name)) | ||
d.Set("title", role.Title) | ||
d.Set("name", role.Name) | ||
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. Same as the previous comment |
||
d.Set("description", role.Description) | ||
d.Set("permissions", role.IncludedPermissions) | ||
d.Set("stage", role.Stage) | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -60,6 +60,8 @@ exported: | |||||
|
||||||
* `deleted` - (Optional) The current deleted state of the role. | ||||||
|
||||||
* `name` - The name of the role which can be used with iam role bindings in the format `organizations/{{org_id}}/roles/{{role_id}}` | ||||||
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. Let's separate out the definition and make the recommendation a bit more generic. Something like:
Suggested change
|
||||||
|
||||||
## Import | ||||||
|
||||||
Customized IAM organization role can be imported using their URI, e.g. | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -28,7 +28,8 @@ Four different resources help you manage your IAM policy for a project. Each of | |||||
from anyone without organization-level access to the project. Proceed with caution. | ||||||
It's not recommended to use `google_project_iam_policy` with your provider project | ||||||
to avoid locking yourself out, and it should generally only be used with projects | ||||||
fully managed by Terraform. | ||||||
fully managed by Terraform. If you do use this resource, **import** the policy before | ||||||
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.
Suggested change
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. nitpick here |
||||||
applying the change. | ||||||
|
||||||
```hcl | ||||||
resource "google_project_iam_policy" "project" { | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,7 +49,7 @@ The following arguments are supported: | |
|
||
* `stage` - (Optional) The current launch stage of the role. | ||
Defaults to `GA`. | ||
List of possible stages is [here](https://cloud.google.com/iam/reference/rest/v1/organizations.roles#Role.RoleLaunchStage). | ||
List of possible stages is [here](https://cloud.google.com/iam/reference/rest/v1/projects.roles#Role.RoleLaunchStage). | ||
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. Looks like only the "organizations" version of the link works, this version doesn't point to role launch stages |
||
|
||
* `description` - (Optional) A human-readable description for the role. | ||
|
||
|
@@ -60,6 +60,8 @@ exported: | |
|
||
* `deleted` - (Optional) The current deleted state of the role. | ||
|
||
* `name` - The name of the role which can be used with iam role bindings in the format `projects/{{project}}/roles/{{role_id}}` | ||
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. See the suggestion for |
||
|
||
## Import | ||
|
||
Customized IAM project role can be imported using their URI, e.g. | ||
|
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.
name
won't appear in state until the field is established as part of the schema. It will need to be set toComputed: true
as well.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 I set this in the schema definition on resourceGoogleProjectIamCustomRole function?
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.
Yep, within the schema map. Just needs to be set to a string and computed.