Skip to content

Commit

Permalink
Merge pull request #5 from kumarvna/develop
Browse files Browse the repository at this point in the history
removing provider configuration dependency
  • Loading branch information
kumarvna authored Jul 18, 2021
2 parents ad26dbf + 378a04a commit f792bbe
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 47 deletions.
62 changes: 15 additions & 47 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@

Terraform Module to create an Azure storage account with a set of containers (and access level), set of file shares (and quota), tables, queues, Network policies and Blob lifecycle management.

To defines the kind of account, set the argument to `account_kind = "StorageV2"`. Account kind defaults to `StorageV2`. If you want to change this value to other storage accounts kind, then this module automatically computes the appropriate values for `account_tier`, `account_replication_type`. The valid options are `BlobStorage`, `BlockBlobStorage`, `FileStorage`, `Storage` and `StorageV2`.
To defines the kind of account, set the argument to `account_kind = "StorageV2"`. Account kind defaults to `StorageV2`. If you want to change this value to other storage accounts kind, then this module automatically computes the appropriate values for `account_tier`, `account_replication_type`. The valid options are `BlobStorage`, `BlockBlobStorage`, `FileStorage`, `Storage` and `StorageV2`. `static_website` can only be set when the account_kind is set to `StorageV2`.

>Note: *static_website can only be set when the account_kind is set to `StorageV2`.*
> **[NOTE]**
> **This module now supports the meta arguments including `providers`, `depends_on`, `count`, and `for_each`.**
These types of resources are supported:
## resources are supported:

* [Storage Account](https://www.terraform.io/docs/providers/azurerm/r/storage_account.html)
* [Storage Advanced Threat Protection](https://www.terraform.io/docs/providers/azurerm/r/advanced_threat_protection.html)
Expand All @@ -20,6 +21,11 @@ These types of resources are supported:
## Module Usage

```hcl
# Azure Provider configuration
provider "azurerm" {
features {}
}
module "storage" {
source = "kumarvna/storage/azurerm"
version = "2.2.0"
Expand Down Expand Up @@ -65,11 +71,11 @@ module "storage" {
}
```

## Create resource group
### Resource Group

By default, this module will not create a resource group and the name of an existing resource group to be given in an argument `resource_group_name`. If you want to create a new resource group, set the argument `create_resource_group = true`.

>*If you are using an existing resource group, then this module uses the same resource group location to create all resources in this module.*
*If you are using an existing resource group, then this module uses the same resource group location to create all resources in this module.*

## BlockBlobStorage accounts

Expand Down Expand Up @@ -176,52 +182,14 @@ module "storage" {

## Recommended naming and tagging conventions

Well-defined naming and metadata tagging conventions help to quickly locate and manage resources. These conventions also help associate cloud usage costs with business teams via chargeback and show back accounting mechanisms.
Applying tags to your Azure resources, resource groups, and subscriptions to logically organize them into a taxonomy. Each tag consists of a name and a value pair. For example, you can apply the name `Environment` and the value `Production` to all the resources in production.
For recommendations on how to implement a tagging strategy, see Resource naming and tagging decision guide.

> ### Resource naming
>**Important** :
Tag names are case-insensitive for operations. A tag with a tag name, regardless of the casing, is updated or retrieved. However, the resource provider might keep the casing you provide for the tag name. You'll see that casing in cost reports. **Tag values are case-sensitive.**

An effective naming convention assembles resource names by using important resource information as parts of a resource's name. For example, using these [recommended naming conventions](https://docs.microsoft.com/en-us/azure/cloud-adoption-framework/ready/azure-best-practices/naming-and-tagging#example-names), a public IP resource for a production SharePoint workload is named like this: `pip-sharepoint-prod-westus-001`.

> ### Metadata tags
When applying metadata tags to the cloud resources, you can include information about those assets that couldn't be included in the resource name. You can use that information to perform more sophisticated filtering and reporting on resources. This information can be used by IT or business teams to find resources or generate reports about resource usage and billing.

The following list provides the recommended common tags that capture important context and information about resources. Use this list as a starting point to establish your tagging conventions.

Tag Name|Description|Key|Example Value|Required?
--------|-----------|---|-------------|---------|
Project Name|Name of the Project for the infra is created. This is mandatory to create a resource names.|ProjectName|{Project name}|Yes
Application Name|Name of the application, service, or workload the resource is associated with.|ApplicationName|{app name}|Yes
Approver|Name Person responsible for approving costs related to this resource.|Approver|{email}|Yes
Business Unit|Top-level division of your company that owns the subscription or workload the resource belongs to. In smaller organizations, this may represent a single corporate or shared top-level organizational element.|BusinessUnit|FINANCE, MARKETING,{Product Name},CORP,SHARED|Yes
Cost Center|Accounting cost center associated with this resource.|CostCenter|{number}|Yes
Disaster Recovery|Business criticality of this application, workload, or service.|DR|Mission Critical, Critical, Essential|Yes
Environment|Deployment environment of this application, workload, or service.|Env|Prod, Dev, QA, Stage, Test|Yes
Owner Name|Owner of the application, workload, or service.|Owner|{email}|Yes
Requester Name|User that requested the creation of this application.|Requestor| {email}|Yes
Service Class|Service Level Agreement level of this application, workload, or service.|ServiceClass|Dev, Bronze, Silver, Gold|Yes
Start Date of the project|Date when this application, workload, or service was first deployed.|StartDate|{date}|No
End Date of the Project|Date when this application, workload, or service is planned to be retired.|EndDate|{date}|No

> This module allows you to manage the above metadata tags directly or as a variable using `variables.tf`. All Azure resources which support tagging can be tagged by specifying key-values in argument `tags`. Tag `ResourceName` is added automatically to all resources.
```hcl
module "key-vault" {
source = "kumarvna/storage/azurerm"
version = "2.2.0"
# ... omitted
tags = {
ProjectName = "demo-project"
Env = "dev"
Owner = "[email protected]"
BusinessUnit = "CORP"
ServiceClass = "Gold"
}
}
```

## Requirements

| Name | Version |
Expand Down
15 changes: 15 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ Terraform Module to create an Azure storage account with a set of containers (an
### Storage account with Containers

```hcl
# Azure Provider configuration
provider "azurerm" {
features {}
}
module "storage" {
source = "kumarvna/storage/azurerm"
version = "2.2.0"
Expand Down Expand Up @@ -42,6 +47,11 @@ module "storage" {
### Storage account with SMB File Shares

```hcl
# Azure Provider configuration
provider "azurerm" {
features {}
}
module "storage" {
source = "kumarvna/storage/azurerm"
version = "2.2.0"
Expand Down Expand Up @@ -77,6 +87,11 @@ module "storage" {
### Storage Account with all additional features

```hcl
# Azure Provider configuration
provider "azurerm" {
features {}
}
module "storage" {
source = "kumarvna/storage/azurerm"
version = "2.2.0"
Expand Down
5 changes: 5 additions & 0 deletions examples/complete/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
This example is to create a storage account with containers, SMB file shares, tables, queues, lifecycle management and other additional features.

```hcl
# Azure Provider configuration
provider "azurerm" {
features {}
}
module "storage" {
source = "kumarvna/storage/azurerm"
version = "2.2.0"
Expand Down
5 changes: 5 additions & 0 deletions examples/complete/main.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Azure Provider configuration
provider "azurerm" {
features {}
}

module "storage" {
source = "kumarvna/storage/azurerm"
version = "2.2.0"
Expand Down
5 changes: 5 additions & 0 deletions examples/storage_account_with_containers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ Simple configuration to create a Azure storage account with Containers.
## Module Usage

```hcl
# Azure Provider configuration
provider "azurerm" {
features {}
}
module "storage" {
source = "kumarvna/storage/azurerm"
version = "2.2.0"
Expand Down
5 changes: 5 additions & 0 deletions examples/storage_account_with_containers/main.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Azure Provider configuration
provider "azurerm" {
features {}
}

module "storage" {
source = "kumarvna/storage/azurerm"
version = "2.2.0"
Expand Down
5 changes: 5 additions & 0 deletions examples/storage_account_with_fileshares/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ Simple configuration to create a Azure storage account with SMB file shares.
## Module Usage

```hcl
# Azure Provider configuration
provider "azurerm" {
features {}
}
module "storage" {
source = "kumarvna/storage/azurerm"
version = "2.1.0"
Expand Down
5 changes: 5 additions & 0 deletions examples/storage_account_with_fileshares/main.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Azure Provider configuration
provider "azurerm" {
features {}
}

module "storage" {
source = "kumarvna/storage/azurerm"
version = "2.2.0"
Expand Down

0 comments on commit f792bbe

Please sign in to comment.