Skip to content

Commit

Permalink
Update test to include azapi (#153)
Browse files Browse the repository at this point in the history
<!-- Thank you for submitting a Pull Request. Please fill out the
template below.-->
## Overview/Summary

Add azapi to e2e tests

## This PR fixes/adds/changes/removes

N/A

### Breaking Changes

None

## Testing Evidence

Please provide any testing evidence to show that your Pull Request
works/fixes as described and planned (include screenshots, if
appropriate).

## As part of this Pull Request I have

- [x] Checked for duplicate [Pull
Requests](https://github.com/Azure/alz-terraform-accelerator/pulls)
- [x] Associated it with relevant
[issues](https://github.com/Azure/alz-terraform-accelerator/issues), for
tracking and closure.
- [x] Ensured my code/branch is up-to-date with the latest changes in
the `main`
[branch](https://github.com/Azure/alz-terraform-accelerator/tree/main)
- [x] Performed testing and provided evidence.
- [x] Updated relevant and associated documentation.
  • Loading branch information
jaredfholgate authored Jun 28, 2024
1 parent cb71030 commit 897f193
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 3 deletions.
30 changes: 27 additions & 3 deletions templates/test/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,42 @@ resource "azurerm_management_group" "example_child" {

resource "azurerm_resource_group" "management" {
provider = azurerm.management
name = "e2e-test-management-${random_string.example.result}"
name = "e2e-test-management-azurerm-${random_string.example.result}"
location = var.resource_group_location
}

resource "azurerm_resource_group" "connectivity" {
provider = azurerm.connectivity
name = "e2e-test-connectivity-${random_string.example.result}"
name = "e2e-test-connectivity-azurerm-${random_string.example.result}"
location = var.resource_group_location
}

resource "azurerm_resource_group" "identity" {
provider = azurerm.identity
name = "e2e-test-identity-${random_string.example.result}"
name = "e2e-test-identity-azurerm-${random_string.example.result}"
location = var.resource_group_location
}

resource "azapi_resource" "resource_group_management" {
parent_id = "/subscriptions/${var.subscription_id_management}"
type = "Microsoft.Resources/resourceGroups@2021-04-01"
name = "e2e-test-management-azapi-${random_string.example.result}"
location = var.resource_group_location
body = {}
}

resource "azapi_resource" "resource_group_connectivity" {
parent_id = "/subscriptions/${var.subscription_id_connectivity}"
type = "Microsoft.Resources/resourceGroups@2021-04-01"
name = "e2e-test-connectivity-azapi-${random_string.example.result}"
location = var.resource_group_location
body = {}
}

resource "azapi_resource" "resource_group_identity" {
parent_id = "/subscriptions/${var.subscription_id_identity}"
type = "Microsoft.Resources/resourceGroups@2021-04-01"
name = "e2e-test-identity-azapi-${random_string.example.result}"
location = var.resource_group_location
body = {}
}
7 changes: 7 additions & 0 deletions templates/test/providers.tf → templates/test/terraform.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ terraform {
source = "hashicorp/azurerm"
version = "3.61.0"
}
azapi = {
source = "Azure/azapi"
version = "1.13.1"
}
random = {
source = "hashicorp/random"
version = "3.5.1"
Expand Down Expand Up @@ -33,3 +37,6 @@ provider "azurerm" {
subscription_id = var.subscription_id_identity
features {}
}

provider "azapi" {
}

0 comments on commit 897f193

Please sign in to comment.