【问题标题】:How to create appRoles with azurerm provider on terraform如何在 terraform 上使用 azurerm 提供程序创建 appRoles
【发布时间】:2018-09-07 10:07:58
【问题描述】:

我正在尝试使用迄今为止非常成功的 Terraform 设置我的天蓝色基础架构。我们的应用程序开发团队需要在 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 来实现这一点?

【问题讨论】:

    标签: azure azure-active-directory terraform


    【解决方案1】:

    要创建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"
    }
    

    【讨论】:

      猜你喜欢
      • 2021-06-09
      • 2016-09-23
      • 2022-06-16
      • 2021-09-24
      • 2020-07-26
      • 1970-01-01
      • 2021-04-12
      • 1970-01-01
      • 2021-12-27
      相关资源
      最近更新 更多