azure - 如何在 terraform 上使用 azurerm 提供程序创建 appRoles
问题描述
我正在尝试使用迄今为止非常成功的 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 来实现这一点?
解决方案
要创建 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"
}
推荐阅读
- machine-learning - sklearn train_test_split 混淆
- ios - Swift - 如何关闭我的 RootViewController?
- javascript - 在运行时针对不同国家/地区对 Angular 应用程序进行区域化
- c++ - Integer 在 VSCommunity2019,windows10 中未初始化
- .net - 为什么我收到“处理您的请求时发生错误”?
- firebase - Cloud/Firebase 功能启动(被触发)但不运行
- python - Python:创建一个仅包含指定索引号数组中的行的新数据框
- git - 如何在检查 github 拉取请求时处理错误?
- git - Git revert hard:来自另一个分支的文件保留在项目中
- amazon-web-services - 如何循环浏览 AWS CLI 输出?