Merge pull request #69 from TomArcherMsft/UserStory1866077-Code
User Story 1866077 Code
This commit is contained in:
commit
fa0ee0bb58
@ -14,7 +14,11 @@ provider "azurerm" {
|
|||||||
features {}
|
features {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
resource "random_pet" "rg-name" {
|
||||||
|
prefix = var.resource_group_name_prefix
|
||||||
|
}
|
||||||
|
|
||||||
resource "azurerm_resource_group" "rg" {
|
resource "azurerm_resource_group" "rg" {
|
||||||
name = var.resource_group_name
|
name = random_pet.rg-name.id
|
||||||
location = var.resource_group_location
|
location = var.resource_group_location
|
||||||
}
|
}
|
||||||
|
3
quickstart/101-resource-group/output.tf
Normal file
3
quickstart/101-resource-group/output.tf
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
output "resource_group_name" {
|
||||||
|
value = azurerm_resource_group.rg.name
|
||||||
|
}
|
@ -1,20 +1,18 @@
|
|||||||
# Azure resource group
|
# Azure resource group
|
||||||
|
|
||||||
This template deploys an Azure resource group.
|
This template deploys an Azure resource group with a random name beginning with "rg-".
|
||||||
|
|
||||||
## Resources
|
## Terraform resource types
|
||||||
|
|
||||||
| Terraform Resource Type | Description |
|
- [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)
|
||||||
| `azurerm_resource_group` | The resource group all resources are deployed into |
|
|
||||||
|
|
||||||
## Variables
|
## Variables
|
||||||
|
|
||||||
| Name | Description |
|
| Name | Description |
|
||||||
|-|-|
|
|-|-|
|
||||||
| `name` | Name of the deployment |
|
| `resource_group_name_prefix` | (Optional) Prefix of the resource group name that's combined with a random ID so name is unique in your Azure subscription. Value defaults to: rg|
|
||||||
| `environment` | The depolyment environment name (used for postfixing resource names) |
|
| `resource_group_location` | (Optional) Azure Region in which to deploy these resources. Value defaults to: eastus |
|
||||||
| `location` | The Azure Region to deploy these resources in |
|
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
variable "resource_group_name" {
|
variable "resource_group_name_prefix" {
|
||||||
default = "myResourceGroup"
|
default = "rg"
|
||||||
|
description = "Prefix of the resource group name that's combined with a random ID so name is unique in your Azure subscription."
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "resource_group_location" {
|
variable "resource_group_location" {
|
||||||
default = "eastus"
|
default = "eastus"
|
||||||
|
description = "Location of the resource group."
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user