Skip to content

Conversation

@Markus-Schwer
Copy link

@Markus-Schwer Markus-Schwer commented Nov 28, 2025

Description

relates to STACKITIAM-1100

Checklist

  • Issue was linked above
  • Code format was applied: make fmt
  • Examples were added / adjusted (see examples/ directory)
  • Docs are up-to-date: make generate-docs (will be checked by CI)
  • Unit tests got implemented or updated
  • Acceptance tests got implemented or updated (see e.g. here)
  • Unit tests are passing: make test (will be checked by CI)
  • No linter issues: make lint (will be checked by CI)

@Markus-Schwer Markus-Schwer requested a review from a team as a code owner November 28, 2025 17:07
@Markus-Schwer Markus-Schwer force-pushed the feat/add-custom-role-resource-and-data-source branch 2 times, most recently from 6d5a812 to 41d31e7 Compare November 28, 2025 17:17
@Markus-Schwer
Copy link
Author

I will add the examples on monday

@Markus-Schwer
Copy link
Author

Markus-Schwer commented Dec 1, 2025

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.

@github-actions
Copy link

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.

@github-actions github-actions bot added the Stale PR is marked as stale due to inactivity. label Dec 16, 2025
@rubenhoenle rubenhoenle removed the Stale PR is marked as stale due to inactivity. label Dec 16, 2025
@Markus-Schwer Markus-Schwer force-pushed the feat/add-custom-role-resource-and-data-source branch 7 times, most recently from fa927b5 to 74b17af Compare January 15, 2026 13:30
Description: descriptions["role_id"],
Computed: true,
PlanModifiers: []planmodifier.String{
stringplanmodifier.UseStateForUnknown(), // TODO: check if this makes sense
Copy link
Contributor

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

Copy link
Author

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

Copy link
Contributor

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

@Markus-Schwer Markus-Schwer force-pushed the feat/add-custom-role-resource-and-data-source branch 2 times, most recently from e31d71a to b95eae2 Compare January 22, 2026 13:16
@Markus-Schwer Markus-Schwer force-pushed the feat/add-custom-role-resource-and-data-source branch 7 times, most recently from 724c10a to 5e53759 Compare January 23, 2026 08:27
Description: descriptions["role_id"],
Computed: true,
PlanModifiers: []planmodifier.String{
stringplanmodifier.UseStateForUnknown(), // TODO: check if this makes sense
Copy link
Contributor

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

@Markus-Schwer Markus-Schwer force-pushed the feat/add-custom-role-resource-and-data-source branch 2 times, most recently from 4e61233 to ef36c50 Compare January 23, 2026 09:16
@Markus-Schwer Markus-Schwer force-pushed the feat/add-custom-role-resource-and-data-source branch from ef36c50 to 4d23e1f Compare January 23, 2026 09:19
Comment on lines +74 to +77
"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.",
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants