-
Notifications
You must be signed in to change notification settings - Fork 59
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
feat: Provider functions to build azure resource id #553
feat: Provider functions to build azure resource id #553
Conversation
9894ebf
to
002524d
Compare
Create main.yml Update codeql.yaml Update main.yml Update main.yml Update main.yml Update main.yml Update main.yml
This reverts commit e8701ff.
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.
Thank you so much for this PR! It mostly LGTM, just some minor suggestions, please check.
internal/services/functions/build_extension_scope_resource_id.go
Outdated
Show resolved
Hide resolved
internal/services/functions/build_extension_scope_resource_id.go
Outdated
Show resolved
Hide resolved
internal/services/functions/build_subscription_scope_resource_id_test.go
Outdated
Show resolved
Hide resolved
7f53aec
to
02953e2
Compare
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.
Thanks @hqhqhqhqhqhqhqhqhqhqhq for the PR! It mostly LGTM, just some minor suggestions. Once they're addressed, I'll merge this PR.
```terraform | ||
locals { | ||
resource_id = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1" | ||
extension_name = "Microsoft.Authorization/locks" |
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 guess it's a typo, it should be "resource_type"?
@@ -0,0 +1,216 @@ | |||
--- |
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 think we don't need this doc, because we have docs for each provider function.
} | ||
|
||
output "resource_id" { | ||
value = provider::azapi::build_resource_id(local.parent_id, local.resource_type, local.name) |
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 add a comment which shows the result of the provider function, it will help users understand how it works. And please also update other places.
And please also resolve the conflicts. |
c01626e
to
041978b
Compare
Required changes have been made, please review when available, thanks! |
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.
LGTM!
As a part of https://github.com/Azure/terraform-provider-azapi/issues/533>
Several functions are provided to build resource id of different scope
build_resource_id
withparent_id
,type
,name
build_tenant_scope_resource_id
withtype
,name
build_management_group_scope_resource_id
withmanagement_group_id
,type
,name
build_subscription_scope_resource_id
withsubscription_id
,type
,name
build_resource_group_scope_resource_id
withsubscription_id
,resource_group_name
,type
,name