Skip to content

Commit

Permalink
Merge pull request #13 from kumarvna/develop
Browse files Browse the repository at this point in the history
adding terraform v0.15 support
  • Loading branch information
kumarvna authored May 30, 2021
2 parents 9733018 + 541ecc9 commit eaf1955
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 20 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# .tfstate files
*.tfstate
*.tfstate.*
*.terraform.lock.hcl

# Crash log files
crash.log
Expand Down
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ These types of resources are supported
```hcl
module "static-website-cdn" {
source = "kumarvna/static-website-cdn/azurerm"
version = "2.1.0"
version = "2.2.0"
# Resource Group, location, and Storage account details
create_resource_group = true
Expand All @@ -39,6 +39,7 @@ module "static-website-cdn" {
# Custom domain for CDN endpoint
custom_domain_name = "web.example.com"
friendly_name = "mywebapp"
# Adding TAG's to your Azure resources (Required)
tags = {
Expand Down Expand Up @@ -101,7 +102,7 @@ End Date of the Project|Date when this application, workload, or service is plan
```hcl
module "static-website-cdn" {
source = "kumarvna/static-website-cdn/azurerm"
version = "2.1.0"
version = "2.2.0"
# ... omitted
Expand All @@ -121,13 +122,13 @@ module "static-website-cdn" {
| Name | Version |
|------|---------|
| terraform | >= 0.13 |
| azurerm | ~> 2.27.0 |
| azurerm | >= 2.59.0 |

## Providers

| Name | Version |
|------|---------|
| azurerm | ~> 2.27.0 |
| azurerm | >= 2.59.0 |
| null | n/a |
| random | n/a |

Expand All @@ -137,7 +138,7 @@ module "static-website-cdn" {
|------|-------------|------|---------|:--------:|
| access\_tier | The access tier of the storage account. | `string` | `"Hot"` | no |
| account\_kind | The kind of storage account. | `string` | `"StorageV2"` | no |
| allowed\_headers | A list of headers that are allowed to be a part of the cross-origin request. | `list(string)` | `[]` | no |
| allowed\_headers | A list of headers that are allowed to be a part of the cross-origin request. | `list(string)` | `["*"]` | no |
| allowed\_methods | A list of http headers that are allowed to be executed by the origin. Valid options are `DELETE`, `GET`, `HEAD`, `MERGE`, `POST`, `OPTIONS`, `PUT` or `PATCH`. | `list(string)` | <pre>[<br> "GET",<br> "HEAD"<br>]</pre> | no |
| allowed\_origins | A list of origin domains that will be allowed by CORS. | `list(string)` | <pre>[<br> "*"<br>]</pre> | no |
| assign\_identity | Specifies the identity type of the Storage Account. At this time the only allowed value is SystemAssigned. | `bool` | `true` | no |
Expand All @@ -150,7 +151,7 @@ module "static-website-cdn" {
| enable\_cdn\_profile | Controls the creation of CDN profile and endpoint for static website. Possible values are `true` or `false` | `bool` | `false` | no |
| enable\_https\_traffic | Configure the storage account to accept requests from secure connections only. Possible values are `true` or `false` | `bool` | `true` | no |
| enable\_static\_website | Controls if static website to be enabled on the storage account. Possible values are `true` or `false` | `bool` | `true` | no |
| exposed\_headers | A list of response headers that are exposed to CORS clients. | `list(string)` | `[]` | no |
| exposed\_headers | A list of response headers that are exposed to CORS clients. | `list(string)` | `["*"]` | no |
| friendly\_name | The friendly name of your custom domain in the Azure Portal | `string` | n/a | yes |
| index\_path | path from your repo root to index.html | `string` | `"index.html"` | no |
| location | The location of the resource group in which resources are created | `string` | `""` | no |
Expand Down Expand Up @@ -181,7 +182,7 @@ module "static-website-cdn" {

## Authors

Module is maintained by [Kumaraswamy Vithanala](mailto:[email protected]) with the help from other awesome contributors.
Originally created by [Kumaraswamy Vithanala](mailto:[email protected]) and maintained with the help from [icornett](https://github.com/icornett)

## Other resources

Expand Down
5 changes: 3 additions & 2 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Following example to create a storage account with static website.
```hcl
module "static-website-cdn" {
source = "kumarvna/static-website-cdn/azurerm"
version = "2.1.0"
version = "2.2.0"
# Resource Group, location, and Storage account details
resource_group_name = "rg-demo-westeurope-01"
Expand Down Expand Up @@ -40,7 +40,7 @@ Following example to create a storage account, static website with CDN endpoint.
```hcl
module "static-website-cdn" {
source = "kumarvna/static-website-cdn/azurerm"
version = "2.1.0"
version = "2.2.0"
# Resource Group, location, and Storage account details
create_resource_group = true
Expand All @@ -61,6 +61,7 @@ module "static-website-cdn" {
# Custom domain for CDN endpoint
custom_domain_name = "web.example.com"
friendly_name = "mywebapp"
# Adding TAG's to your Azure resources (Required)
tags = {
Expand Down
3 changes: 2 additions & 1 deletion examples/complete/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Configuration in this directory creates Azure storage account and enable the sta
```hcl
module "static-website-cdn" {
source = "kumarvna/static-website-cdn/azurerm"
version = "2.1.0"
version = "2.2.0"
# Resource Group, location, and Storage account details
create_resource_group = true
Expand All @@ -28,6 +28,7 @@ module "static-website-cdn" {
# Custom domain for CDN endpoint
custom_domain_name = "web.example.com"
friendly_name = "mywebapp"
# Adding TAG's to your Azure resources (Required)
tags = {
Expand Down
6 changes: 4 additions & 2 deletions examples/complete/main.tf
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
module "static-website-cdn" {
source = "kumarvna/static-website-cdn/azurerm"
version = "2.1.0"
version = "2.2.0"


# Resource Group, location, and Storage account details
create_resource_group = true
resource_group_name = "rg-demo-westeurope-01"
location = "westeurope"
storage_account_name = "storageaccwesteupore01"
storage_account_name = "demostoraccwesteupore01"

# Static Website createion set to true by default
# account_kind should set to StorageV2 or BlockBlobStorage
Expand All @@ -21,6 +22,7 @@ module "static-website-cdn" {

# Custom domain for CDN endpoint
custom_domain_name = "web.example.com"
friendly_name = "mywebapp"

# Adding TAG's to your Azure resources (Required)
tags = {
Expand Down
2 changes: 1 addition & 1 deletion examples/simple/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Configuration in this directory creates Azure storage account and enable the sta
```hcl
module "static-website-cdn" {
source = "kumarvna/static-website-cdn/azurerm"
version = "2.1.0"
version = "2.2.0"
# Resource Group, location, and Storage account details
resource_group_name = "rg-demo-westeurope-01"
Expand Down
2 changes: 1 addition & 1 deletion examples/simple/main.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module "static-website-cdn" {
source = "kumarvna/static-website-cdn/azurerm"
version = "2.1.0"
version = "2.2.0"

# Resource Group, location, and Storage account details
resource_group_name = "rg-demo-westeurope-01"
Expand Down
Binary file modified graph.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ resource "azurerm_storage_account" "storeacc" {
account_tier = local.account_tier
account_replication_type = local.account_replication_type
enable_https_traffic_only = var.enable_https_traffic
min_tls_version = var.min_tls_version
tags = merge({ "Name" = format("%s", var.storage_account_name) }, var.tags, )

dynamic "static_website" {
Expand Down
9 changes: 7 additions & 2 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ variable "enable_https_traffic" {
default = true
}

variable "min_tls_version" {
description = "The minimum supported TLS version for the storage account"
default = "TLS1_2"
}

variable "enable_static_website" {
description = "Controls if static website to be enabled on the storage account. Possible values are `true` or `false`"
default = true
Expand Down Expand Up @@ -107,13 +112,13 @@ variable "allowed_origins" {
variable "allowed_headers" {
type = list(string)
description = "A list of headers that are allowed to be a part of the cross-origin request."
default = []
default = ["*"]
}

variable "exposed_headers" {
type = list(string)
description = "A list of response headers that are exposed to CORS clients."
default = []
default = ["*"]
}

variable "max_age_in_seconds" {
Expand Down
8 changes: 4 additions & 4 deletions versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~> 2.27.0"
}
null = {
source = "hashicorp/null"
version = ">= 2.59.0"
}
random = {
source = "hashicorp/random"
}
null = {
source = "hashicorp/null"
}
}
required_version = ">= 0.13"
}
Expand Down

0 comments on commit eaf1955

Please sign in to comment.