Skip to content
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 - support user_accounts, data_disks and etc properties #18226

Merged
merged 16 commits into from
Sep 13, 2022

Conversation

liuwuliuyun
Copy link
Contributor

@liuwuliuyun liuwuliuyun commented Sep 2, 2022

azurerm_batch_pool support following new properties/property blocks:

  1. data_disks
  2. disk_encryption_configuration
  3. extensions
  4. inter_node_communication
  5. license_type
  6. node_placement_configuration
  7. os_disk_placement_setting
  8. windows_configuration
  9. user_accounts
  10. task_scheduling_policy

fixes #18267

Comment on lines -606 to -624
nodeAgentSkuID := d.Get("node_agent_sku_id").(string)

storageImageReferenceSet := d.Get("storage_image_reference").([]interface{})
imageReference, err := ExpandBatchPoolImageReference(storageImageReferenceSet)
if err != nil {
return fmt.Errorf("creating %s: %+v", id, err)
}

if imageReference != nil {
// if an image reference ID is specified, the user wants use a custom image. This property is mutually exclusive with other properties.
if imageReference.ID != nil && (imageReference.Offer != nil || imageReference.Publisher != nil || imageReference.Sku != nil || imageReference.Version != nil) {
return fmt.Errorf("creating %s: Properties version, offer, publish cannot be defined when using a custom image id", id)
} else if imageReference.ID == nil && (imageReference.Offer == nil || imageReference.Publisher == nil || imageReference.Sku == nil || imageReference.Version == nil) {
return fmt.Errorf("creating %s: Properties version, offer, publish and sku are mandatory when not using a custom image", id)
}
} else {
return fmt.Errorf("creating %s: image reference property can not be empty", id)
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check logic is moved to expandBatchPoolVirtualMachineConfiguration in batch_pool.go

@liuwuliuyun liuwuliuyun changed the title [WIP] azurerm_batch_pool - support user_accounts, data_disks and etc properties azurerm_batch_pool - support user_accounts, data_disks and etc properties Sep 7, 2022
@liuwuliuyun
Copy link
Contributor Author

image

@liuwuliuyun liuwuliuyun marked this pull request as ready for review September 7, 2022 02:24
@liuwuliuyun
Copy link
Contributor Author

This PR also fixes #18267

internal/services/batch/batch_pool.go Outdated Show resolved Hide resolved
internal/services/batch/batch_pool.go Outdated Show resolved Hide resolved
website/docs/d/batch_pool.html.markdown Outdated Show resolved Hide resolved
website/docs/d/batch_pool.html.markdown Outdated Show resolved Hide resolved
website/docs/d/batch_pool.html.markdown Outdated Show resolved Hide resolved
website/docs/d/batch_pool.html.markdown Outdated Show resolved Hide resolved
website/docs/d/batch_pool.html.markdown Show resolved Hide resolved
website/docs/d/batch_pool.html.markdown Outdated Show resolved Hide resolved
Co-authored-by: kt <kt@katbyte.me>
@liuwuliuyun
Copy link
Contributor Author

Thanks @katbyte for your review and feedbacks, here is the test result on the latest comments:
image

Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @liuwuliuyun - LGTM 🚜

@katbyte katbyte merged commit e456ed5 into hashicorp:main Sep 13, 2022
@github-actions github-actions bot added this to the v3.23.0 milestone Sep 13, 2022
katbyte added a commit that referenced this pull request Sep 13, 2022
@github-actions
Copy link

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!

@github-actions
Copy link

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.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 16, 2022
@liuwuliuyun liuwuliuyun deleted the batch_2 branch November 22, 2022 07:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for 'licenseType' property in azurerm_batch_pool
2 participants