Initial out
This commit is contained in:
parent
7579e9323c
commit
d425200e96
19
quickstart/101-azure-container-registry/README.md
Normal file
19
quickstart/101-azure-container-registry/README.md
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
# Azure Container Registry
|
||||||
|
|
||||||
|
Deploy an Azure Container Registry.
|
||||||
|
|
||||||
|
## Terraform resource types
|
||||||
|
|
||||||
|
- [random_pet](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/pet)
|
||||||
|
- [azurerm_resource_group](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/resource_group)
|
||||||
|
- [random_string](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/string)
|
||||||
|
- [azurerm_container_registry](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/container_registry)
|
||||||
|
|
||||||
|
## Variables
|
||||||
|
|
||||||
|
| Name | Description | Default |
|
||||||
|
|-|-|-|
|
||||||
|
| `resource_group_name_prefix` | Prefix of the resource group name that's combined with a random ID so name is unique in your Azure subscription. | rg |
|
||||||
|
| `resource_group_location` | Location of the resource group. | eastus |
|
||||||
|
|
||||||
|
## Example
|
23
quickstart/101-azure-container-registry/main.tf
Normal file
23
quickstart/101-azure-container-registry/main.tf
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
resource "random_pet" "rg_name" {
|
||||||
|
prefix = var.resource_group_name_prefix
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "azurerm_resource_group" "rg" {
|
||||||
|
location = var.resource_group_location
|
||||||
|
name = random_pet.rg_name.id
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "random_string" "acr_name" {
|
||||||
|
length = 5
|
||||||
|
lower = true
|
||||||
|
numeric = false
|
||||||
|
special = false
|
||||||
|
upper = false
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "azurerm_container_registry" "example" {
|
||||||
|
name = "${random_string.acr_name.result}registry"
|
||||||
|
resource_group_name = azurerm_resource_group.rg.name
|
||||||
|
location = azurerm_resource_group.rg.location
|
||||||
|
sku = "Standard"
|
||||||
|
}
|
11
quickstart/101-azure-container-registry/outputs.tf
Normal file
11
quickstart/101-azure-container-registry/outputs.tf
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
output "resource_group_name" {
|
||||||
|
value = azurerm_resource_group.rg.name
|
||||||
|
}
|
||||||
|
|
||||||
|
output "container_registry_name" {
|
||||||
|
value = azurerm_container_registry.example.name
|
||||||
|
}
|
||||||
|
|
||||||
|
output "container_registry_login_server" {
|
||||||
|
value = azurerm_container_registry.example.login_server
|
||||||
|
}
|
18
quickstart/101-azure-container-registry/providers.tf
Normal file
18
quickstart/101-azure-container-registry/providers.tf
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
terraform {
|
||||||
|
required_version = ">=1.0"
|
||||||
|
|
||||||
|
required_providers {
|
||||||
|
azurerm = {
|
||||||
|
source = "hashicorp/azurerm"
|
||||||
|
version = "~>3.0"
|
||||||
|
}
|
||||||
|
random = {
|
||||||
|
source = "hashicorp/random"
|
||||||
|
version = "~>3.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
provider "azurerm" {
|
||||||
|
features {}
|
||||||
|
}
|
11
quickstart/101-azure-container-registry/variables.tf
Normal file
11
quickstart/101-azure-container-registry/variables.tf
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
variable "resource_group_location" {
|
||||||
|
type = string
|
||||||
|
default = "eastus"
|
||||||
|
description = "Location of the resource group."
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "resource_group_name_prefix" {
|
||||||
|
type = string
|
||||||
|
default = "rg"
|
||||||
|
description = "Prefix of the resource group name that's combined with a random ID so name is unique in your Azure subscription."
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user