-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CES-19] Azure DevOps Agent infra moved to core modules (#1163)
- Loading branch information
1 parent
6061558
commit 9c996c8
Showing
13 changed files
with
242 additions
and
108 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
locals { | ||
nonstandard = { | ||
weu = { | ||
rg = "${var.project}-azdoa-rg" | ||
snet = "azure-devops" | ||
li_infra = "${var.project}-azdoa-vmss-li-infra" | ||
li_loadtest = "${var.project}-azdoa-vmss-loadtest-li" | ||
} | ||
} | ||
|
||
image_name = "azdo-agent-ubuntu2204-image-v2" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
resource "azurerm_resource_group" "azdoa_rg" { | ||
name = try(local.nonstandard[var.location_short].rg, "${var.project}-azdoa-rg-01") | ||
location = var.location | ||
|
||
tags = var.tags | ||
} | ||
|
||
module "azdoa_snet" { | ||
source = "github.com/pagopa/terraform-azurerm-v3//subnet?ref=v8.27.0" | ||
|
||
name = try(local.nonstandard[var.location_short].snet, "${var.project}-azdoa-snet-01") | ||
address_prefixes = var.cidr_subnet | ||
resource_group_name = var.resource_groups.common | ||
virtual_network_name = var.vnet_common.name | ||
private_endpoint_network_policies_enabled = false | ||
|
||
service_endpoints = [ | ||
"Microsoft.Web", | ||
] | ||
} | ||
|
||
module "azdoa_li_infra" { | ||
source = "github.com/pagopa/terraform-azurerm-v3//azure_devops_agent?ref=v8.27.0" | ||
name = try(local.nonstandard[var.location_short].li_infra, "${var.project}-azdoa-infra-vmss-01") | ||
resource_group_name = azurerm_resource_group.azdoa_rg.name | ||
subnet_id = module.azdoa_snet.id | ||
subscription_id = var.datasources.azurerm_client_config.subscription_id | ||
location = var.location | ||
source_image_name = local.image_name | ||
vm_sku = "Standard_B2als_v2" | ||
|
||
tags = var.tags | ||
} | ||
|
||
module "azdoa_loadtest_li" { | ||
source = "github.com/pagopa/terraform-azurerm-v3//azure_devops_agent?ref=v8.27.0" | ||
name = try(local.nonstandard[var.location_short].li_loadtest, "${var.project}-azdoa-loadtest-vmss-01") | ||
resource_group_name = azurerm_resource_group.azdoa_rg.name | ||
subnet_id = module.azdoa_snet.id | ||
subscription_id = var.datasources.azurerm_client_config.subscription_id | ||
location = var.location | ||
source_image_name = local.image_name | ||
vm_sku = "Standard_D8ds_v5" | ||
|
||
tags = var.tags | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
output "snet" { | ||
value = { | ||
id = module.azdoa_snet.id | ||
name = module.azdoa_snet.name | ||
address_prefixes = module.azdoa_snet.address_prefixes | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
variable "project" { | ||
type = string | ||
description = "IO prefix, short environment and short location" | ||
} | ||
|
||
variable "location" { | ||
type = string | ||
description = "Azure region" | ||
} | ||
|
||
variable "location_short" { | ||
type = string | ||
description = "Azure region short name" | ||
} | ||
|
||
variable "tags" { | ||
type = map(any) | ||
description = "Resource tags" | ||
} | ||
|
||
variable "resource_group_name" { | ||
type = string | ||
description = "Resource group name for VNet" | ||
} | ||
|
||
variable "cidr_subnet" { | ||
type = list(string) | ||
description = "Azure DevOps agent network address space" | ||
} | ||
|
||
variable "vnet_common" { | ||
type = object({ | ||
id = string | ||
name = string | ||
address_space = list(string) | ||
resource_group_name = string | ||
}) | ||
description = "Information of the common VNet" | ||
} | ||
|
||
variable "resource_groups" { | ||
type = map(string) | ||
description = "Resource group names" | ||
} | ||
|
||
variable "datasources" { | ||
type = map(any) | ||
description = "Common datasources" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.