-
Notifications
You must be signed in to change notification settings - Fork 4.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
Adds service_principal_object_id attribute to data_source_arm_client_config #175
Conversation
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.
Hey @whiskeyjay
Thanks for this - one small question but this otherwise LGTM :)
@@ -43,6 +46,22 @@ func testAzureRMClientConfigAttr(name, key, value string) resource.TestCheckFunc | |||
} | |||
} | |||
|
|||
func testAzureRMClientConfigGUIDAttr(name, key string) resource.TestCheckFunc { | |||
return func(s *terraform.State) error { | |||
r, err := regexp.Compile("^[A-Fa-f0-9]{8}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{12}$") |
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.
would it make more sense to use this method in the go.uuid
library (which is already vendored) for this?
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 thought it is easier this way because I don't have to extract the attribute value from state myself?
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.
fair point - it's not a blocker by any means - just seeing if we can reuse the UUID parser if it made sense :)
Tests pass:
|
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks! |
The service principal ID is needed for granting a SP access to certain resources. For example, adding secrets to KeyVault and give access to the SP in the configuration (although currently the TF KeyVault resource doesn't support adding secrets yet). With this new attribute uses won't have to manually copy the object ID of the SP from portal and hard code it in the configuration file.