Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Azure storage account #7

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions azure-storage-account/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
provider "azurerm" {
version = ">=2.0.0"
features {}
alias = "azurerm-provider"
}

module "subscription" {
source = "github.com/Azure-Terraform/terraform-azurerm-subscription-data.git?ref=v1.0.0"
subscription_id = var.subscription_id
providers = {
azurerm = azurerm.azurerm-provider
}
}

module "rules" {
source = "git@github.com:openrba/python-azure-naming.git?ref=tf"
}

module "metadata"{
source = "github.com/Azure-Terraform/terraform-azurerm-metadata.git?ref=v1.1.0"
naming_rules = module.rules.yaml
providers = {
azurerm = azurerm.azurerm-provider
}
market = var.market
project = var.project
location = var.location
sre_team = var.sre_team
environment = var.environment
product_name = var.product_name
business_unit = var.business_unit
product_group = var.product_group
subscription_id = module.subscription.output.subscription_id
subscription_type = "nonprod"
resource_group_type = "app"
}

module "resource_group" {
source = "github.com/Azure-Terraform/terraform-azurerm-resource-group.git?ref=v1.0.0"
providers = {
azurerm = azurerm.azurerm-provider
}
location = module.metadata.location
names = module.metadata.names
tags = module.metadata.tags
}

module "create-storage-account" {
depends_on = [module.resource_group]
source = "git@github.com:openrba/terraform-azurerm-storage-account.git?ref=dev"
providers = {
azurerm = azurerm.azurerm-provider
}
names = module.metadata.names
location = module.metadata.location
account_kind = var.account_kind
account_tier = var.account_tier
replication_type = var.replication_type
access_tier = var.access_tier
allow_blob_public_access = var.allow_blob_public_access
authorized_subnets = var.authorized_subnets
tags = module.metadata.tags
retention_days = var.retention_days
}

output "sa_name" {
value = module.create-storage-account.storage_account_name
}

output "sa_id" {
value = module.create-storage-account.storage_account_id
}
80 changes: 80 additions & 0 deletions azure-storage-account/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
variable "subscription_id" {
type = string
description = "Azure subscription id"
}

variable "location" {
type = string
description = "Azure Geo Location"
}

variable "account_kind" {
type = string
description = "Kind of the storage account - i.e. BlobStorage, BlockBlobStorage, FileStorage, Storage and StorageV2"
}

variable "account_tier" {
type = string
description = "Azure storage account - i.e. Standard or Premium"
}

variable "replication_type" {
type = string
description = "Storage account replication type - i.e. LRS, GRS, RAGRS, ZRS, GZRS, RAGZRS"
}

variable "access_tier" {
type = string
description = "Storage access tier - i.e. Hot or Cool"
}

variable "allow_blob_public_access" {
type = bool
description = "Allow or disallow public access to all blobs or containers in the storage account. Defaults to false"
}

# Note: make sure to include the IP address of the host from where "terraform" command is executed to allow for access to the storage
# Otherwise, creating container inside the storage or any access attempt will be denied.
variable "authorized_subnets" {
type = map(string)
description = "A list of subnets that will be allowed to interact with the Storage Account."
}

variable "retention_days" {
type = number
}

variable "market" {
type = string
description = "Market"
}

variable "project" {
type = string
description = "Name of the project"
}

variable "sre_team" {
type = string
description = "Name of SRE team"
}

variable "environment" {
type = string
description = "Name of the environment - i.e. prod, nonprod, dev, etc.,"
}

variable "product_name" {
type = string
description = "Product name"
}

variable "business_unit" {
type = string
description = "Business unit"
}

variable "product_group" {
type = string
description = "Product group"
}
3 changes: 3 additions & 0 deletions vnets-peering/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
variable "subscription_id" {
type = string
}
Loading