From 74b2510730e4bbbecb271304265ce3cc43bc6bbd Mon Sep 17 00:00:00 2001 From: Rob Gil Date: Thu, 19 Dec 2019 20:12:20 -0500 Subject: [PATCH] 169163334 - Adds Azure Container Registry Adds the ACR. Georeplication disabled for the moment until we add the DR site. --- terraform/modules/container_registry/main.tf | 13 +++++++ .../modules/container_registry/outputs.tf | 0 .../modules/container_registry/variables.tf | 37 +++++++++++++++++++ terraform/providers/dev/container_registry.tf | 8 ++++ terraform/providers/dev/variables.tf | 5 +++ 5 files changed, 63 insertions(+) create mode 100644 terraform/modules/container_registry/main.tf create mode 100644 terraform/modules/container_registry/outputs.tf create mode 100644 terraform/modules/container_registry/variables.tf create mode 100644 terraform/providers/dev/container_registry.tf diff --git a/terraform/modules/container_registry/main.tf b/terraform/modules/container_registry/main.tf new file mode 100644 index 00000000..a22bacf0 --- /dev/null +++ b/terraform/modules/container_registry/main.tf @@ -0,0 +1,13 @@ +resource "azurerm_resource_group" "acr" { + name = "${var.name}-${var.environment}-acr" + location = var.region +} + +resource "azurerm_container_registry" "acr" { + name = "${var.name}${var.environment}registry" # Alpha Numeric Only + resource_group_name = azurerm_resource_group.acr.name + location = azurerm_resource_group.acr.location + sku = var.sku + admin_enabled = var.admin_enabled + #georeplication_locations = [azurerm_resource_group.acr.location, var.backup_region] +} \ No newline at end of file diff --git a/terraform/modules/container_registry/outputs.tf b/terraform/modules/container_registry/outputs.tf new file mode 100644 index 00000000..e69de29b diff --git a/terraform/modules/container_registry/variables.tf b/terraform/modules/container_registry/variables.tf new file mode 100644 index 00000000..6fe16ad5 --- /dev/null +++ b/terraform/modules/container_registry/variables.tf @@ -0,0 +1,37 @@ +variable "region" { + type = string + description = "Region this module and resources will be created in" +} + +variable "name" { + type = string + description = "Unique name for the services in this module" +} + +variable "environment" { + type = string + description = "Environment these resources reside (prod, dev, staging, etc)" +} + +variable "owner" { + type = string + description = "Owner of the environment and resources created in this module" +} + +variable "backup_region" { + type = string + description = "Backup region for georeplicating the container registry" +} + +variable "sku" { + type = string + description = "SKU to use for the container registry service" + default = "Premium" +} + +variable "admin_enabled" { + type = string + description = "Admin enabled? (true/false default: false)" + default = false + +} diff --git a/terraform/providers/dev/container_registry.tf b/terraform/providers/dev/container_registry.tf new file mode 100644 index 00000000..0bbf0901 --- /dev/null +++ b/terraform/providers/dev/container_registry.tf @@ -0,0 +1,8 @@ +module "container_registry" { + source = "../../modules/container_registry" + name = var.name + region = var.region + environment = var.environment + owner = var.owner + backup_region = var.backup_region +} diff --git a/terraform/providers/dev/variables.tf b/terraform/providers/dev/variables.tf index 7a9eea21..0a16e69b 100644 --- a/terraform/providers/dev/variables.tf +++ b/terraform/providers/dev/variables.tf @@ -7,6 +7,11 @@ variable "region" { } +variable "backup_region" { + default = "westus2" +} + + variable "owner" { default = "dev" }