-
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
azurerm_batch_pool's support user_assigned_identity_id #17104
azurerm_batch_pool's support user_assigned_identity_id #17104
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, thank you for this PR. A few remarks. Aside of adding it to schema, we need to use and set that value in Create/Update/Read functions and we need to extend acceptance tests so that this functionality will be tested.
I started working on that as well, but I'll let you finish your PR if you want. Here's an example of the code I literally had open just now:
|
@favoretti : thank you for the valuable feedback. incorporated the changes.Also tested with following terraform code locally generated azure provider. Request you to take a look.
|
@@ -268,6 +268,8 @@ A `resource_file` block supports the following: | |||
|
|||
* `storage_container_url` - (Optional) The URL of the blob container within Azure Blob Storage. This URL must be readable and listable using anonymous access; that is, the Batch service does not present any credentials when downloading the blob. There are two ways to get such a URL for a blob in Azure storage: include a Shared Access Signature (SAS) granting read and list permissions on the blob, or set the ACL for the blob or its container to allow public access. | |||
|
|||
* `identity_reference` - (Optional) An identity reference from pool's user assigned managed identity list. |
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.
what sort of identity is returned? and id? a guid? is it managed? could it be user or msi?
* `identity_reference` - (Optional) An identity reference from pool's user assigned managed identity list. | |
* `identity_id` - (Optional) An identity reference from pool's user assigned managed identity list. |
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.
Done.
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.
build failure:
[Step 4/5] in directory: /opt/teamcity-agent/work/5e6516bb4d10eb66/internal/services/batch
[05:32:15] [Step 4/5] # github.com/hashicorp/terraform-provider-azurerm/internal/services/batch
[05:32:15] [Step 4/5] ./batch_pool.go:160:23: armResourceFile.IdentityId undefined (type "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch".ResourceFile has no field or method IdentityId)
[05:32:15] [Step 4/5] ./batch_pool.go:161:52: armResourceFile.IdentityId undefined (type "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch".ResourceFile has no field or method IdentityId)
[05:32:15] [Step 4/5] ./batch_pool.go:507:25: undefined: batch.ComputeNodeIdentityId
[05:32:15] [Step 4/5] ./batch_pool.go:510:18: resourceFile.IdentityId undefined (type "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2022-01-01/batch".ResourceFile has no field or method IdentityId)
[05:32:15] [Step 4/5] Process exited with code 2
@katbyte @ayyagari74 Duplicate of #17416 ? |
@dkuzmenok - this seems to be adding identity_id to resource_files while #17416 is adding it to container_registeries? |
@katbyte Ah, you are right. Sorry.
|
Ok. |
agreed @dkuzmenok |
we can not rename identity_reference to neither user_assigned_identity_id nor identity_id.Because there is dependency on azure-adk-for-go library, in which the field is called IdentityReference.
so changed back to identity_reference. Build and unit tests are passed. |
@ayyagari74 - i'm not sure i follow why you cant change the schema to |
internal/services/batch/batch_pool.go file we are using armResourceFile class. Which is defined in azure-sdk-for-go library. // ResourceFile ...
} Yes technically i can do that. |
@ayyagari74 Yes, you should transform |
done. |
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 @ayyagari74 ! LGTM 🌩️
This functionality has been released in v3.23.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. |
updated resource_file of azurerm_batch_pool (data source and resource) to support managed identity of user.