Skip to content

Commit

Permalink
Add example for Microsoft.ManagedIdentity_userAssignedIdentities_fede…
Browse files Browse the repository at this point in the history
…ratedIdentityCredentials@2023-01-31 (#778)
  • Loading branch information
neil-yechenwei authored Feb 20, 2025
1 parent 804f94c commit b132e70
Showing 1 changed file with 50 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
terraform {
required_providers {
azapi = {
source = "Azure/azapi"
}
}
}

provider "azapi" {
skip_provider_registration = false
}

variable "resource_name" {
type = string
default = "acctest0001"
}

variable "location" {
type = string
default = "westeurope"
}

resource "azapi_resource" "resourceGroup" {
type = "Microsoft.Resources/resourceGroups@2020-06-01"
name = var.resource_name
location = var.location
}

resource "azapi_resource" "userAssignedIdentity" {
type = "Microsoft.ManagedIdentity/userAssignedIdentities@2023-01-31"
parent_id = azapi_resource.resourceGroup.id
name = var.resource_name
location = var.location
}

resource "azapi_resource" "federatedIdentityCredential" {
type = "Microsoft.ManagedIdentity/userAssignedIdentities/federatedIdentityCredentials@2022-01-31-preview"
parent_id = azapi_resource.userAssignedIdentity.id
name = var.resource_name
location = var.location
body = {
properties = {
issuer = "https://foo"
subject = "foo"
audiences = ["foo"]
}
}
schema_validation_enabled = false
response_export_values = ["*"]
}

0 comments on commit b132e70

Please sign in to comment.