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_account: Batch now supports creation of managed identities, but SystemAssigned Identity block not available #8532

Closed
JSpenced opened this issue Sep 18, 2020 · 9 comments · Fixed by #13742

Comments

@JSpenced
Copy link

JSpenced commented Sep 18, 2020

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

Currently, Azure batch now supports creating batch accounts with a managed identity attached to it (https://docs.microsoft.com/en-us/azure/batch/batch-customer-managed-key). This makes accessing the keyvault much easier than a certificate solution. I was hoping this could be added to terraform with the principalId for the managed identity also returned so can be added in the access policy of the key vault.

New or Affected Resource(s)

azurerm_batch_account

Potential Terraform Configuration

# Initialize the Azure Resource Manager
provider "azurerm" {
  version = "2.25"
  features {}
  # https://www.terraform.io/docs/providers/azurerm/index.html#skip_provider_registration
  skip_provider_registration = true
}

# Make Terraform store the statefile in Azure Cloud instead of local storage
terraform {
  backend "azurerm" {
    resource_group_name  = "company-dev-ml-svy-etl"
    storage_account_name = "companydevmlusonly"
    container_name       = "tfstate-usonly"
    key                  = "dev.terraform.tfstateustest"
  }
}
variable "default-location" {
  type    = string
  default = "North Central US"
}

variable "default-storage" {
  type    = string
  default = "companydevmlsvystorage1"
}
variable "rg" {
  type        = string
  default     = "company-dev-ml-svy"
  description = "Name of the resource group."
}

variable "rg-us" {
  type        = string
  default     = "company-dev-ml-svy-etl"
  description = "Name of the etl resource group."
}

variable "etl-batch" {
  type        = string
  default     = "companydevmlsvybatchtest"
  description = "Name of the etl resource group."
}
variable "etl-storage" {
  type    = string
  default = "companydevmlsvyetlstoragetest"
}



data "azurerm_resource_group" "rg" {
  name = var.rg
}
data "azurerm_resource_group" "rg-us" {
  name = var.rg-us
}
data "azurerm_client_config" "current" {
}


resource "azurerm_storage_account" "etl-storage" {
  name                     = var.etl-storage
  resource_group_name      = var.rg-us
  location                 = var.default-location
  account_tier             = "Standard"
  account_replication_type = "LRS"
}

resource "azurerm_batch_account" "etl-batch" {
  name                 = var.etl-batch
  resource_group_name  = data.azurerm_resource_group.rg-us.name
  location             = var.default-location
  pool_allocation_mode = "BatchService"
  storage_account_id   = azurerm_storage_account.etl-storage.id

  identity {
    type = "SystemAssigned"
  }

  tags = {
    env = "company-ml-svy-dev"
  }
}
@JSpenced JSpenced changed the title Azure Batch now supports creation of managed identities, but optional identity block for terraform not available azurerm_batch_account: Batch now supports creation of managed identities, but SystemAssigned Identity block not available Sep 18, 2020
@mazen423

This comment has been minimized.

@sgutwein

This comment has been minimized.

@magodo magodo added the sdk/not-yet-supported Support for this does not exist in the upstream SDK at this time label Jul 19, 2021
@anibaldk

This comment has been minimized.

@haflidif
Copy link

haflidif commented Aug 12, 2021

I've posted feature request to Azure SDK For Go regarding this issue

Azure/azure-sdk-for-go#15274

@haflidif
Copy link

@magodo now it's supported in the SDK so it should now be possible to add the configuration into the Terraform Provider, using User Assigned Identity with Pool Creation :-)
Azure/azure-sdk-for-go#15274 (comment)

@magodo magodo removed the sdk/not-yet-supported Support for this does not exist in the upstream SDK at this time label Sep 13, 2021
@mazen423

This comment has been minimized.

@haflidif

This comment has been minimized.

@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.

8 participants