-
Notifications
You must be signed in to change notification settings - Fork 48
Feat/add custom role resource and data source #1077
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
base: main
Are you sure you want to change the base?
Feat/add custom role resource and data source #1077
Conversation
6d5a812 to
41d31e7
Compare
|
I will add the examples on monday |
|
To clarify: this PR cannot be merged right now, because the API it uses is not public yet. We will make it public soon. When it is public, I will use the newly generated SDK and test this change again. Then it can be merged. For now I would still appreciate it if you review the changes, so that we can quickly merge this PR once the API is released. |
|
This PR was marked as stale after 7 days of inactivity and will be closed after another 7 days of further inactivity. If this PR should be kept open, just add a comment, remove the stale label or push new commits to it. |
fa927b5 to
74b17af
Compare
| Description: descriptions["role_id"], | ||
| Computed: true, | ||
| PlanModifiers: []planmodifier.String{ | ||
| stringplanmodifier.UseStateForUnknown(), // TODO: check if this makes sense |
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.
When the role_id remains always the same between in-place updates, this is correct
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 changed it to RequiresReplace, same as resource_id
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.
Please revert this change. This will trigger always a recreate for this resource, even if only the name should be updated.
Terraform will perform the following actions:
# stackit_authorization_project_custom_role.name must be replaced
-/+ resource "stackit_authorization_project_custom_role" "name" {
~ id = "66b03760-125b-4c63-9624-741e8a4*****,e623f5a5-4152-4546-bea7-43f6d0939e87" -> (known after apply)
~ name = "my.custom.role" -> "my.custom.roles"
~ role_id = "e623f5a5-4152-4546-bea7-43f6d0939e87" -> (known after apply) # forces replacement
# (3 unchanged attributes hidden)
}UseStateForUnknown was here correct
e31d71a to
b95eae2
Compare
724c10a to
5e53759
Compare
stackit/internal/services/authorization/customrole/datasource.go
Outdated
Show resolved
Hide resolved
| Description: descriptions["role_id"], | ||
| Computed: true, | ||
| PlanModifiers: []planmodifier.String{ | ||
| stringplanmodifier.UseStateForUnknown(), // TODO: check if this makes sense |
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.
Please revert this change. This will trigger always a recreate for this resource, even if only the name should be updated.
Terraform will perform the following actions:
# stackit_authorization_project_custom_role.name must be replaced
-/+ resource "stackit_authorization_project_custom_role" "name" {
~ id = "66b03760-125b-4c63-9624-741e8a4*****,e623f5a5-4152-4546-bea7-43f6d0939e87" -> (known after apply)
~ name = "my.custom.role" -> "my.custom.roles"
~ role_id = "e623f5a5-4152-4546-bea7-43f6d0939e87" -> (known after apply) # forces replacement
# (3 unchanged attributes hidden)
}UseStateForUnknown was here correct
4e61233 to
ef36c50
Compare
ef36c50 to
4d23e1f
Compare
| "main": "Custom Role resource schema.", | ||
| "id": "Terraform's internal resource identifier. It is structured as \"[resource_id],[role_id]\".", | ||
| "role_id": "The ID of the role.", | ||
| "resource_id": "Resource to add the custom role to.", |
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.
The description main and resource_id reads a bit weird when applied to the datasource schema.
Maybe we could reword these to be a bit more general.
But also not sure if worth fixing.
Description
relates to STACKITIAM-1100
Checklist
make fmtexamples/directory)make generate-docs(will be checked by CI)make test(will be checked by CI)make lint(will be checked by CI)