File tree Expand file tree Collapse file tree 3 files changed +71
-0
lines changed
Expand file tree Collapse file tree 3 files changed +71
-0
lines changed Original file line number Diff line number Diff line change 1+ terraform {
2+ required_version = " ~> 1.3"
3+
4+ required_providers {
5+ azurerm = {
6+ source = " hashicorp/azurerm"
7+ version = " =3.40.0"
8+ }
9+ }
10+ backend "azurerm" {}
11+ }
12+
13+ provider "azurerm" {
14+ features {}
15+ }
16+
17+ data "azurerm_subscription" "current" {
18+ }
19+
20+ data "azurerm_api_management_api" "api" {
21+ name = var. name
22+ api_management_name = var. api_management_name
23+ resource_group_name = var. resource_group_name
24+ revision = var. api_revision
25+ }
26+
27+ data "azuread_application" "app_registration" {
28+ count = var. app_registration_name != null ? 1 : 0
29+ display_name = var. app_registration_name
30+ }
Original file line number Diff line number Diff line change 1+ output "resource_group_name" {
2+ value = var. resource_group_name
3+ }
4+
5+ output "api_management_name" {
6+ value = var. api_management_name
7+ }
8+
9+ output "id" {
10+ value = data. azurerm_api_management_api . api . id
11+ }
12+
13+ output "client_id" {
14+ value = var. app_registration_name != null ? data. azuread_application . app_registration [0 ]. client_id : null
15+ }
Original file line number Diff line number Diff line change 1+ variable "name" {
2+ type = string
3+ description = " API name"
4+ }
5+
6+ variable "api_management_name" {
7+ type = string
8+ description = " API management name"
9+ }
10+
11+ variable "resource_group_name" {
12+ type = string
13+ description = " name of the Resource group where APIM_Management is located"
14+ }
15+
16+ variable "api_revision" {
17+ type = string
18+ description = " revision of the API"
19+ default = " 1"
20+ }
21+
22+ variable "app_registration_name" {
23+ type = string
24+ description = " app registration name, that is responsible for authorizing the API"
25+ default = null
26+ }
You can’t perform that action at this time.
0 commit comments