diff --git a/quickstart/101-create-resource-group/main.tf b/quickstart/101-create-resource-group/main.tf new file mode 100644 index 00000000..5301f620 --- /dev/null +++ b/quickstart/101-create-resource-group/main.tf @@ -0,0 +1,17 @@ +terraform { + required_providers { + azurerm = { + source = "hashicorp/azurerm" + version = "~>2.0" + } + } +} + +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "rg" { + name = "${var.name}-${var.environment}-rg" + location = "${var.location}" +} \ No newline at end of file diff --git a/quickstart/101-create-resource-group/readme.md b/quickstart/101-create-resource-group/readme.md new file mode 100644 index 00000000..88be91eb --- /dev/null +++ b/quickstart/101-create-resource-group/readme.md @@ -0,0 +1,44 @@ +# Create Azure resource group + +This template deploys an Azure resource group. + +## Resources + +| Terraform Resource Type | Description | +| - | - | +| `azurerm_resource_group` | The resource group all resources are deployed into | + +## Variables + +| Name | Description | +|-|-| +| `name` | Name of the deployment | +| `environment` | The depolyment environment name (used for postfixing resource names) | +| `location` | The Azure Region to deploy these resources in | + +## Example + +```bash +terraform plan -out main.tfplan + +Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols: + + create + +Terraform will perform the following actions: + + # azurerm_resource_group.rg will be created + + resource "azurerm_resource_group" "rg" { + + id = (known after apply) + + location = "eastus" + + name = "sample-dev-rg" + } + +Plan: 1 to add, 0 to change, 0 to destroy. + +──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── + +Saved the plan to: main.tfplan + +To perform exactly these actions, run the following command to apply: + terraform apply "main.tfplan" +``` \ No newline at end of file diff --git a/quickstart/101-create-resource-group/variables.tf b/quickstart/101-create-resource-group/variables.tf new file mode 100644 index 00000000..15e43388 --- /dev/null +++ b/quickstart/101-create-resource-group/variables.tf @@ -0,0 +1,11 @@ +variable "environment" { + default = "dev" +} + +variable "name" { + default = "sample" +} + +variable "location" { + default = "eastus" +} \ No newline at end of file