-
Notifications
You must be signed in to change notification settings - Fork 18
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
User and Project Update Fails #154
Comments
could you add more info around behaviour and include any steps to reproduce? |
Using terraform {
required_providers {
wiz = {
source = "AxtonGrams/wiz"
version = "~> 1.1.5"
}
}
}
provider "wiz" {}
resource "wiz_user" "bobsmith" {
email = "[email protected]"
name = "bob smith"
role = "PROJECT_READER"
assigned_project_ids = ["<PROJECT_ID>"]
}
resource "wiz_user" "bobsmith" {
email = "[email protected]"
name = "bob smith"
role = "DOCUMENTATION_READER"
assigned_project_ids = ["<PROJECT_ID>"]
}
{
"version": 4,
"terraform_version": "1.5.3",
"serial": 14,
"lineage": "68b385f2-6374-7a9b-4d70-e2af0dd975d3",
"outputs": {},
"resources": [
{
"mode": "managed",
"type": "wiz_user",
"name": "bobsmith",
"provider": "provider[\"registry.terraform.io/axtongrams/wiz\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"assigned_project_ids": [
"<PROJECT_ID>"
],
"email": "[email protected]",
"id": "<USER_ID>",
"name": "bob smith",
"role": "DOCUMENTATION_READER",
"send_email_invite": false
},
"sensitive_attributes": [],
"private": "bnVsbA=="
}
]
}
],
"check_results": null
} Note how however the Role is a global role and therefore does not need a list of project scopes, none the less it is persisted to state. Following this by changing the role back to
Note the projects IDs are missing because they are not changing. This will then cause apply error
|
Using terraform {
required_providers {
wiz = {
source = "AxtonGrams/wiz"
version = "~> 1.1.5"
}
}
}
provider "wiz" {}
resource "wiz_project" "project" {
name = "testing"
description = "testing"
risk_profile {
business_impact = "MBI"
is_regulated = "YES"
regulatory_standards = ["HIPPA_HITECH"]
}
cloud_account_link {
cloud_account_id = "<PROJECT_ID>"
environment = "DEVELOPMENT"
shared = false
}
}
make no changes...
This is only for |
I believe my initial suspicion on graphQl query could be incorrect, however the query does show a delta when compared to the The |
I think the best might be validation to avoid getting into this situation in the first place. AFAIK user roles aren't in the schema so if anything can be done to fix this, perhaps simply checking for if the role |
Terraform Version and Provider Version
Terraform v1.5.3
Affected Resource(s)
Expected Behavior
User and Projects should handle update in place
Actual Behavior
Users and Projects fail to update in place
Steps to Reproduce
Normal Terraform use
Important Factoids
Digging through the Wiz API Console and Audit Logs I am able to see what Wiz expects for the GraphQL queries. The update functions for these resources are out of date and do not match what is presented in the API Console.
Community Note
The text was updated successfully, but these errors were encountered: