簡體   English   中英

如何在 terraform 上使用 azurerm 提供程序創建 appRoles

[英]How to create appRoles with azurerm provider on terraform

我正在嘗試使用迄今為止非常成功的 Terraform 來設置我的 azure 基礎設施。 我們的應用程序開發團隊需要在 AzureAD 應用程序的清單中定義應用程序特定的角色,我們目前通過簡單地修改清單來處理 Azure 門戶:

"appRoles": [
    {
        "allowedMemberTypes": [
        "Application"
        ],
        "displayName": "SurveyCreator",
        "id": "1b4f816e-5eaf-48b9-8613-7923830595ad",
        "isEnabled": true,
        "description": "Creators can create Surveys",
        "value": "SurveyCreator"
    }
]

我使用 Terraform 創建了一個azurerm_azuread_application ,現在想相應地修改清單。

resource "azurerm_azuread_application" "test" {
  name                       = "APP"
  homepage                   = "http://APPHOMEPAGE"
  identifier_uris            = ["http://APPHOMEPAGE"]
  reply_urls                 = ["http://APPHOMEPAGE/REPLYURL"]
  available_to_other_tenants = false
  oauth2_allow_implicit_flow = false
}

有沒有辦法只使用 Terraform 來實現這一點?

要創建 App 角色,您可以參考azuread_application_app_role

resource "azuread_application" "example" {
  name = "example"
}

resource "azuread_application_app_role" "example" {
  application_object_id = azuread_application.example.id
  allowed_member_types  = ["User"]
  description           = "Admins can manage roles and perform all task actions"
  display_name          = "Admin"
  is_enabled            = true
  value                 = "administer"
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM