reorganize, add scaffold folder

update readmes

clean up tf provider

add readme and initial templates

add initial pass at readmes

more readme updates

update various quickstarts

finish cleaning up 101s

more updates

lots fo template updates

add remaining

more updates
This commit is contained in:
Joey Lorich
2019-10-15 13:03:36 -06:00
committed by Joey Lorich
parent fa82feccc7
commit 415e3caa97
89 changed files with 7503 additions and 1140 deletions

View File

@ -0,0 +1,13 @@
provider "azurerm" {
version = "=1.36.0"
}
resource "azurerm_resource_group" "default" {
name = "${var.name}-${var.environment}-rg"
location = "westus"
}
locals {
storage_account_name = "${var.dns_prefix}${var.name}${substr(var.environment, 0, 2)}"
}

View File

@ -0,0 +1,147 @@
# Static website hosted on Azure Storage
This template deploys an [Azure Storage Account](https://www.terraform.io/docs/providers/azurerm/r/storage_account.html) with static website hosting enabled. As this feature is not natively supported throuhg the ARM SDK and hence Terraform, a local-provisioner step is used to enable it with the Azure CLI.
## Resources
| Terraform Resource Type | Description |
| - | - |
| `azurerm_resource_group` | The resource group all resources are deployed into |
| `azurerm_storage_account` | The storage account used to host the website |
## Variables
| Name | Description |
|-|-|
| `name` | Name of the deployment |
| `environment` | The depolyment environment name (used for postfixing resource names) |
| `dns_prefix` | A prefix for globally-unique dns-based resources |
| `location` | The Azure Region to deploy these resources in |
## Example
```bash
> terraform plan
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.
------------------------------------------------------------------------
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
# azurerm_resource_group.default will be created
+ resource "azurerm_resource_group" "default" {
+ id = (known after apply)
+ location = "westus"
+ name = "demo-tfquickstart-dev-rg"
+ tags = (known after apply)
}
# azurerm_storage_account.default will be created
+ resource "azurerm_storage_account" "default" {
+ access_tier = (known after apply)
+ account_encryption_source = "Microsoft.Storage"
+ account_kind = "StorageV2"
+ account_replication_type = "LRS"
+ account_tier = "Standard"
+ account_type = (known after apply)
+ enable_advanced_threat_protection = false
+ enable_blob_encryption = true
+ enable_file_encryption = true
+ enable_https_traffic_only = true
+ id = (known after apply)
+ is_hns_enabled = false
+ location = "westus2"
+ name = "tfquickstartdemode"
+ primary_access_key = (sensitive value)
+ primary_blob_connection_string = (sensitive value)
+ primary_blob_endpoint = (known after apply)
+ primary_blob_host = (known after apply)
+ primary_connection_string = (sensitive value)
+ primary_dfs_endpoint = (known after apply)
+ primary_dfs_host = (known after apply)
+ primary_file_endpoint = (known after apply)
+ primary_file_host = (known after apply)
+ primary_location = (known after apply)
+ primary_queue_endpoint = (known after apply)
+ primary_queue_host = (known after apply)
+ primary_table_endpoint = (known after apply)
+ primary_table_host = (known after apply)
+ primary_web_endpoint = (known after apply)
+ primary_web_host = (known after apply)
+ resource_group_name = "demo-dev-rg"
+ secondary_access_key = (sensitive value)
+ secondary_blob_connection_string = (sensitive value)
+ secondary_blob_endpoint = (known after apply)
+ secondary_blob_host = (known after apply)
+ secondary_connection_string = (sensitive value)
+ secondary_dfs_endpoint = (known after apply)
+ secondary_dfs_host = (known after apply)
+ secondary_file_endpoint = (known after apply)
+ secondary_file_host = (known after apply)
+ secondary_location = (known after apply)
+ secondary_queue_endpoint = (known after apply)
+ secondary_queue_host = (known after apply)
+ secondary_table_endpoint = (known after apply)
+ secondary_table_host = (known after apply)
+ secondary_web_endpoint = (known after apply)
+ secondary_web_host = (known after apply)
+ tags = (known after apply)
+ identity {
+ principal_id = (known after apply)
+ tenant_id = (known after apply)
+ type = (known after apply)
}
+ network_rules {
+ bypass = (known after apply)
+ default_action = (known after apply)
+ ip_rules = (known after apply)
+ virtual_network_subnet_ids = (known after apply)
}
+ queue_properties {
+ cors_rule {
+ allowed_headers = (known after apply)
+ allowed_methods = (known after apply)
+ allowed_origins = (known after apply)
+ exposed_headers = (known after apply)
+ max_age_in_seconds = (known after apply)
}
+ hour_metrics {
+ enabled = (known after apply)
+ include_apis = (known after apply)
+ retention_policy_days = (known after apply)
+ version = (known after apply)
}
+ logging {
+ delete = (known after apply)
+ read = (known after apply)
+ retention_policy_days = (known after apply)
+ version = (known after apply)
+ write = (known after apply)
}
+ minute_metrics {
+ enabled = (known after apply)
+ include_apis = (known after apply)
+ retention_policy_days = (known after apply)
+ version = (known after apply)
}
}
}
Plan: 2 to add, 0 to change, 0 to destroy.
------------------------------------------------------------------------
```

View File

@ -0,0 +1,14 @@
resource "azurerm_storage_account" "default" {
name = local.storage_account_name
resource_group_name = azurerm_resource_group.default.name
location = "westus2"
account_kind = "StorageV2"
account_tier = "Standard"
account_replication_type = "LRS"
enable_https_traffic_only = true
provisioner "local-exec" {
command = "az storage blob service-properties update --account-name ${azurerm_storage_account.default.name} --static-website --index-document index.html --404-document 404.html"
}
}

View File

@ -0,0 +1,15 @@
variable "environment" {
default = "dev"
}
variable "name" {
default = "demo-tfquickstart"
}
variable "location" {
default = "West US 2"
}
variable "dns_prefix" {
default = "tfq"
}