Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fabric E2E Sample] Terraform version upgrade #965

Open
wants to merge 1 commit into
base: feat/e2e-fabric-dataops-sample-v0-2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ module "fabric_capacity" {
source = "./modules/fabric/capacity"
create_fabric_capacity = var.create_fabric_capacity
capacity_name = local.fabric_capacity_name
resource_group_id = data.azurerm_resource_group.rg.id
resource_group_name = data.azurerm_resource_group.rg.name
location = data.azurerm_resource_group.rg.location
admin_members = local.fabric_capacity_admins
sku = "F2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "4.9.0"
version = "4.14.0"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "4.9.0"
version = "4.14.0"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,33 +1,37 @@
resource "azapi_resource" "fab_capacity" {
count = var.create_fabric_capacity ? 1 : 0
type = "Microsoft.Fabric/capacities@2023-11-01"
name = var.capacity_name
parent_id = var.resource_group_id
location = var.location
schema_validation_enabled = false
resource "azurerm_fabric_capacity" "capacity" {
count = var.create_fabric_capacity ? 1 : 0
name = var.capacity_name
resource_group_name = var.resource_group_name
location = var.location
administration_members = var.admin_members

body = {
properties = {
administration = {
members = var.admin_members
}
}
sku = {
name = var.sku,
tier = "Fabric"
}
sku {
name = var.sku
tier = "Fabric"
}

tags = var.tags
ignore_missing_property = true
tags = var.tags
}

data "fabric_capacity" "created_capacity_id" {
count = var.create_fabric_capacity ? 1 : 0
display_name = resource.azapi_resource.fab_capacity[0].name
display_name = resource.azurerm_fabric_capacity.capacity[0].name

lifecycle {
postcondition {
condition = self.state == "Active"
error_message = "Fabric Capacity is not in Active state. Please check the Fabric Capacity status."
}
}
}

data "fabric_capacity" "provided_capacity_id" {
count = var.create_fabric_capacity ? 0 : 1
display_name = var.capacity_name

lifecycle {
postcondition {
condition = self.state == "Active"
error_message = "Fabric Capacity is not in Active state. Please check the Fabric Capacity status."
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,30 @@ variable "capacity_name" {
description = "Name of the Fabric capacity."
}

variable "resource_group_id" {
variable "resource_group_name" {
type = string
description = "Resource group id"
description = "Resource group name where the Fabric capacity will be created"
}

variable "location" {
description = "The Azure region where the resources will be created"
description = "The Azure region where the Fabric capacity will be created"
type = string
}

variable "admin_members" {
type = list(string)
type = set(string)
description = "Fabric capacity admin members, can be email (for user) or id (for service principal)"
}

variable "sku" {
type = string
description = "Fabric capacity SKU name"
default = "F2"

validation {
condition = contains(["F2", "F4", "F8", "F16", "F32", "F64", "F128", "F256", "F512", "F1024", "F2048"], var.sku)
error_message = "Please specify a valid Fabric Capacity SKU. Valid values are: [ 'F2', 'F4', 'F8', 'F16', 'F32', 'F64', 'F128', 'F256', 'F512', 'F1024', 'F2048' ]."
}
}

variable "tags" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ terraform {
required_version = ">= 1.9.8, < 2.0"

required_providers {
azapi = {
source = "azure/azapi"
version = "2.0.1"
azurerm = {
source = "hashicorp/azurerm"
version = "4.14.0"
}
fabric = {
source = "microsoft/fabric"
version = "0.1.0-beta.4"
version = "0.1.0-beta.6"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
fabric = {
source = "microsoft/fabric"
version = "0.1.0-beta.4"
version = "0.1.0-beta.6"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
fabric = {
source = "microsoft/fabric"
version = "0.1.0-beta.4"
version = "0.1.0-beta.6"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
fabric = {
source = "microsoft/fabric"
version = "0.1.0-beta.4"
version = "0.1.0-beta.6"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
fabric = {
source = "microsoft/fabric"
version = "0.1.0-beta.4"
version = "0.1.0-beta.6"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
fabric = {
source = "microsoft/fabric"
version = "0.1.0-beta.4"
version = "0.1.0-beta.6"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
fabric = {
source = "microsoft/fabric"
version = "0.1.0-beta.4"
version = "0.1.0-beta.6"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
fabric = {
source = "microsoft/fabric"
version = "0.1.0-beta.4"
version = "0.1.0-beta.6"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
fabric = {
source = "microsoft/fabric"
version = "0.1.0-beta.4"
version = "0.1.0-beta.6"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
fabric = {
source = "microsoft/fabric"
version = "0.1.0-beta.4"
version = "0.1.0-beta.6"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
fabric = {
source = "microsoft/fabric"
version = "0.1.0-beta.4"
version = "0.1.0-beta.6"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
fabric = {
source = "microsoft/fabric"
version = "0.1.0-beta.4"
version = "0.1.0-beta.6"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
fabric = {
source = "microsoft/fabric"
version = "0.1.0-beta.4"
version = "0.1.0-beta.6"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
fabric = {
source = "microsoft/fabric"
version = "0.1.0-beta.4"
version = "0.1.0-beta.6"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
fabric = {
source = "microsoft/fabric"
version = "0.1.0-beta.4"
version = "0.1.0-beta.6"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
fabric = {
source = "microsoft/fabric"
version = "0.1.0-beta.4"
version = "0.1.0-beta.6"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
fabric = {
source = "microsoft/fabric"
version = "0.1.0-beta.4"
version = "0.1.0-beta.6"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "4.9.0"
version = "4.14.0"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "4.9.0"
version = "4.14.0"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "4.9.0"
version = "4.14.0"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "4.9.0"
version = "4.14.0"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,3 @@ provider "azurerm" {
}
}
}

provider "azapi" {
tenant_id = var.tenant_id
subscription_id = var.subscription_id
client_id = var.use_msi || var.use_cli ? null : var.client_id
client_secret = var.use_msi || var.use_cli ? null : var.client_secret
use_msi = var.use_msi
use_cli = var.use_cli
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,15 @@ terraform {
required_providers {
fabric = {
source = "microsoft/fabric"
version = "0.1.0-beta.4"
version = "0.1.0-beta.6"
}
azurerm = {
source = "hashicorp/azurerm"
version = "4.9.0"
version = "4.14.0"
}
azuread = {
source = "hashicorp/azuread"
version = "2.53.1"
}
azapi = {
source = "azure/azapi"
version = "2.0.1"
version = "3.0.2"
}
random = {
source = "hashicorp/random"
Expand Down
Loading