101-create-resource-group
This commit is contained in:
		
							
								
								
									
										17
									
								
								quickstart/101-create-resource-group/main.tf
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								quickstart/101-create-resource-group/main.tf
									
									
									
									
									
										Normal file
									
								
							@@ -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}"
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										44
									
								
								quickstart/101-create-resource-group/readme.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										44
									
								
								quickstart/101-create-resource-group/readme.md
									
									
									
									
									
										Normal file
									
								
							@@ -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"
 | 
			
		||||
```
 | 
			
		||||
							
								
								
									
										11
									
								
								quickstart/101-create-resource-group/variables.tf
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								quickstart/101-create-resource-group/variables.tf
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,11 @@
 | 
			
		||||
variable "environment" {
 | 
			
		||||
  default = "dev"
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
variable "name" {
 | 
			
		||||
  default = "sample"
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
variable "location" {
 | 
			
		||||
  default = "eastus"
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user