Skip to content

Automated PR may-2025-testing #18

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

Open
wants to merge 1 commit into
base: main
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
32 changes: 32 additions & 0 deletions may-2025-testing/terraform/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Source: https://github.com/github/gitignore/blob/main/Terraform.gitignore
# Local .terraform directories
**/.terraform/*

# .tfstate files
*.tfstate
*.tfstate.*

# Crash log files
crash.log
crash.*.log

# Ignore override files as they are usually used to override resources locally and so
# are not checked in
override.tf
override.tf.json
*_override.tf
*_override.tf.json

# Ignore transient lock info files created by terraform apply
.terraform.tfstate.lock.info

# Include override files you do wish to add to version control using negated pattern
# !example_override.tf

# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan
# example: *tfplan*

# Ignore CLI configuration files
.terraformrc
terraform.rc

7 changes: 7 additions & 0 deletions may-2025-testing/terraform/.metadata
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"app_stack_name": "azure-may-2025-release",
"iac_type": "Terraform",
"provider": "azure",
"multi_env": false,
"exporter": "terraform"
}
3 changes: 3 additions & 0 deletions may-2025-testing/terraform/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# README
This is a readme file for IaC generated with StackGen.
You can modify your appStack -> [here](http://stage.dev.stackgen.com/appstacks/a85caf2f-04ac-465d-a900-381088edbc23)
41 changes: 41 additions & 0 deletions may-2025-testing/terraform/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
module "stackgen_5f506321-272e-414e-99f6-fd4a254c0bb7" {
source = "./modules/azurerm_subnet_composite"
address_prefixes = []
default_outbound_access_enabled = null
delegations = []
location = var.location
name = "sg-az-subnet-1"
network_security_group_id = ""
resource_group_name = local.resource_group_name
service_endpoint_policy_ids = []
service_endpoints = []
virtual_network_name = module.stackgen_fd99e64e-3b93-4921-a0a3-0f145a636d34.name
}

module "stackgen_d1e95b01-4f45-4753-9e48-dc6be963e22f" {
source = "./modules/azurerm_subnet_composite"
address_prefixes = []
default_outbound_access_enabled = null
delegations = []
location = var.location
name = "sg-az-subnet-2"
network_security_group_id = ""
resource_group_name = local.resource_group_name
service_endpoint_policy_ids = []
service_endpoints = []
virtual_network_name = module.stackgen_fd99e64e-3b93-4921-a0a3-0f145a636d34.name
}

module "stackgen_fd99e64e-3b93-4921-a0a3-0f145a636d34" {
source = "./modules/azurerm_vn"
address_space = []
ddos_protection_name = ""
dns_servers = []
edge_zone = null
flow_timeout_in_minutes = null
location = var.location
name = "sg-az-vnet-1"
resource_group_name = local.resource_group_name
tags = {}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
resource "azurerm_subnet" "this" {
address_prefixes = var.address_prefixes
name = var.name
resource_group_name = var.resource_group_name
virtual_network_name = var.virtual_network_name

dynamic "delegation" {
for_each = var.delegations != null ? var.delegations : []

content {
name = delegation.value.delegation_name
service_delegation {
name = delegation.value.service_name
actions = length(delegation.value.service_actions) == 0 ? null : delegation.value.service_actions
}
}
}

default_outbound_access_enabled = var.default_outbound_access_enabled
service_endpoint_policy_ids = var.service_endpoint_policy_ids
service_endpoints = var.service_endpoints
}

resource "azurerm_subnet_network_security_group_association" "secgroup_association" {
count = var.network_security_group_id != "" ? 1 : 0

depends_on = [azurerm_subnet.this]

subnet_id = azurerm_subnet.this.id
network_security_group_id = var.network_security_group_id
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"output": {
"id": {
"description": "The unique identifier of the subnet.",
"sensitive": false,
"value": "${azurerm_subnet.this.id}"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
variable "location" {
type = string
description = "The Azure region."
}
variable "resource_group_name" {
type = string
description = "The name of the resource group."
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"variable": {
"address_prefixes": [
{
"description": "List of address prefixes for the subnet.",
"nullable": false,
"type": "list(string)"
}
],
"default_outbound_access_enabled": [
{
"description": "Indicates if default outbound access is enabled.",
"nullable": true,
"type": "bool"
}
],
"name": [
{
"description": "Name of the subnet.",
"nullable": false,
"type": "string"
}
],
"service_endpoint_policy_ids": [
{
"description": "Set of service endpoint policy IDs.",
"nullable": true,
"type": "list(string)"
}
],
"service_endpoints": [
{
"description": "Set of service endpoints for the subnet.",
"nullable": true,
"type": "list(string)"
}
],
"virtual_network_name": [
{
"description": "Name of the virtual network.",
"nullable": false,
"type": "string"
}
],
"network_security_group_id": [
{
"type": "string",
"description": "The ID of the Network Security Group which should be associated with the Subnet.",
"nullable": true,
"default": ""
}
],
"delegations": [
{
"type": "list(object({delegation_name: string, service_name: string, service_actions: list(string)}))",
"description": "Delegate actions to services.",
"nullable": true
}
]
}
}
31 changes: 31 additions & 0 deletions may-2025-testing/terraform/modules/azurerm_vn/azurerm_vn.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
locals {
use_ddos_protection = var.ddos_protection_name != ""
}

resource "azurerm_network_ddos_protection_plan" "ddos_protection" {
count = local.use_ddos_protection ? 1 : 0

name = var.ddos_protection_name
location = var.location
resource_group_name = var.resource_group_name
}

resource "azurerm_virtual_network" "this" {
address_space = var.address_space
location = var.location
name = var.name
resource_group_name = var.resource_group_name
edge_zone = var.edge_zone
flow_timeout_in_minutes = var.flow_timeout_in_minutes
tags = var.tags
dns_servers = var.dns_servers

dynamic "ddos_protection_plan" {
for_each = local.use_ddos_protection ? [1] : []

content {
id = azurerm_network_ddos_protection_plan.ddos_protection.id
enable = true
}
}
}
19 changes: 19 additions & 0 deletions may-2025-testing/terraform/modules/azurerm_vn/outputs.tf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"output": {
"guid": {
"description": "Unique GUID of the virtual network.",
"sensitive": false,
"value": "${azurerm_virtual_network.this.guid}"
},
"id": {
"description": "Resource ID of the virtual network.",
"sensitive": false,
"value": "${azurerm_virtual_network.this.id}"
},
"name": {
"description": "Name of the virtual network.",
"sensitive": false,
"value": "${azurerm_virtual_network.this.name}"
}
}
}
8 changes: 8 additions & 0 deletions may-2025-testing/terraform/modules/azurerm_vn/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
variable "location" {
type = string
description = "The Azure region."
}
variable "resource_group_name" {
type = string
description = "The name of the resource group."
}
54 changes: 54 additions & 0 deletions may-2025-testing/terraform/modules/azurerm_vn/variables.tf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"variable": {
"address_space": [
{
"description": "The address space that is used by the virtual network.",
"nullable": false,
"type": "list(string)"
}
],
"edge_zone": [
{
"description": "The edge zone where the virtual network is located.",
"nullable": true,
"type": "string"
}
],
"flow_timeout_in_minutes": [
{
"description": "The flow timeout duration in minutes for the network.",
"nullable": true,
"type": "number"
}
],
"name": [
{
"description": "The name of the virtual network.",
"nullable": false,
"type": "string"
}
],
"tags": [
{
"description": "A map of tags to assign to the virtual network.",
"nullable": true,
"type": "map(string)"
}
],
"dns_servers": [
{
"type": "list(string)",
"description": "List of IP addresses of DNS servers",
"nullable": true
}
],
"ddos_protection_name": [
{
"type": "string",
"description": "Specifies the name of the Network DDoS Protection Plan. If no name is given, DDoS Protection Plan is not used",
"nullable": true,
"default": ""
}
]
}
}
25 changes: 25 additions & 0 deletions may-2025-testing/terraform/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
output "azurerm_subnet_composite_stackgen_5f506321-272e-414e-99f6-fd4a254c0bb7_id" {
value = module.stackgen_5f506321-272e-414e-99f6-fd4a254c0bb7.id
sensitive = false
}

output "azurerm_subnet_composite_stackgen_d1e95b01-4f45-4753-9e48-dc6be963e22f_id" {
value = module.stackgen_d1e95b01-4f45-4753-9e48-dc6be963e22f.id
sensitive = false
}

output "azurerm_vn_stackgen_fd99e64e-3b93-4921-a0a3-0f145a636d34_guid" {
value = module.stackgen_fd99e64e-3b93-4921-a0a3-0f145a636d34.guid
sensitive = false
}

output "azurerm_vn_stackgen_fd99e64e-3b93-4921-a0a3-0f145a636d34_id" {
value = module.stackgen_fd99e64e-3b93-4921-a0a3-0f145a636d34.id
sensitive = false
}

output "azurerm_vn_stackgen_fd99e64e-3b93-4921-a0a3-0f145a636d34_name" {
value = module.stackgen_fd99e64e-3b93-4921-a0a3-0f145a636d34.name
sensitive = false
}

42 changes: 42 additions & 0 deletions may-2025-testing/terraform/provider.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
terraform {
required_version = ">= 1.0.0, < 2.0.0"

required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~> 3.9" // 3.9.0+ required for synapse workspace bugfix
}

azuread = { // Azure Active Directory
source = "hashicorp/azuread"
version = "~> 3.1.0"
}

azurestack = { // Azure Stack
source = "hashicorp/azurestack"
version = ">= 0.10.0"
}
}
}

provider "azurerm" {
features {}
subscription_id = var.subscription_id
}

resource "azurerm_resource_group" "this" {
count = var.create_resource_group ? 1 : 0
location = var.location
name = var.resource_group_name
}

locals {
resource_group_name = var.create_resource_group ? azurerm_resource_group.this[0].name : var.resource_group_name
}

provider "azuread" {}

provider "azurestack" {
features {}
subscription_id = var.subscription_id
}
Loading