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 for user-assigned-identity block #13758

Closed
haflidif opened this issue Oct 15, 2021 · 3 comments · Fixed by #13779
Closed

azurerm_batch_pool support for user-assigned-identity block #13758

haflidif opened this issue Oct 15, 2021 · 3 comments · Fixed by #13779

Comments

@haflidif
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

According to the Azure Documentation Batch Pool now supports User Assigend Managed Identity,
at the moment terraform provider doesn't support declaration of the identity block.

This is already supported in the SDK

New or Affected Resource(s)

  • azurerm_batch_pool

Potential Terraform Configuration

terraform {
  backend "azurerm" {
    resource_group_name  = "tfstate-rg"
    storage_account_name = "tfstatedev"
    container_name       = "tfstate-dev"
    key                  = "dev.terraform.tfstate"
  }
}

resource "azurerm_resource_group" "batch_resource_group" {
  name     = "batch-rg"
  location = "West Europe"
}

resource "azurerm_storage_account" "batch_storage" {
  name                     = "stbadev001"
  resource_group_name      = azurerm_resource_group.batch_resource_group.name
  location                 = azurerm_resource_group.batch_resource_group.location
  account_tier             = "Standard"
  account_replication_type = "LRS"
}

resource "azurerm_batch_account" "batch_account" {
  name                 = "batch-account-dev"
  resource_group_name  = azurerm_resource_group.batch_resource_group.name
  location             = azurerm_resource_group.batch_resource_group.location
  pool_allocation_mode = "BatchService"
  storage_account_id   = azurerm_storage_account.batch_storage.id
}

resource "azurerm_user_assigned_identity" "batch_testaccpool_mi" {
  name                = "mi-testaccpool"
  resource_group_name = azurerm_resource_group.batch_resource_group.name
  location            = azurerm_resource_group.batch_resource_group.location
}

resource "azurerm_batch_pool" "batch_pool" {
  name                = "testaccpool"
  resource_group_name = azurerm_resource_group.batch_resource_group.name
  account_name        = azurerm_batch_account.batch_account.name
  display_name        = "Test Acc Pool Auto"
  vm_size             = "Standard_A1"
  node_agent_sku_id   = "batch.node.ubuntu 16.04"


  storage_image_reference {
    publisher = "microsoft-azure-batch"
    offer     = "ubuntu-server-container"
    sku       = "16-04-lts"
    version   = "latest"
  }

  fixed_scale {
    target_dedicated_nodes    = 1
    target_low_priority_nodes = 0
    resize_timeout            = "PT15M"
  }

  start_task {
    command_line         = "echo 'Hello World from $env'"
    max_task_retry_count = 1
    wait_for_success     = true

    environment = {
      env = "TEST"
    }

    user_identity {
      auto_user {
        elevation_level = "NonAdmin"
        scope           = "Task"
      }
    }
  }

  identity {
    type = "UserAssigned"
    identity_ids = [
      azurerm_user_assigned_identity.batch_testaccpool_mi.id
    ]
  }
}

References

PR on Identity block in azurerm_batch_account: #13742

@aristosvo
Copy link
Collaborator

On it!~

@github-actions
Copy link

This functionality has been released in v2.82.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 issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, 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 Nov 21, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants