169163334 - Adds TF bucket module
Basic bucket module to create a bucket
This commit is contained in:
parent
8f1cd95236
commit
62a02234a4
18
terraform/modules/bucket/main.tf
Normal file
18
terraform/modules/bucket/main.tf
Normal file
@ -0,0 +1,18 @@
|
||||
resource "azurerm_resource_group" "bucket" {
|
||||
name = "${var.name}-${var.environment}-${var.service_name}"
|
||||
location = var.region
|
||||
}
|
||||
|
||||
resource "azurerm_storage_account" "bucket" {
|
||||
name = var.service_name
|
||||
resource_group_name = azurerm_resource_group.bucket.name
|
||||
location = azurerm_resource_group.bucket.location
|
||||
account_tier = "Standard"
|
||||
account_replication_type = "LRS"
|
||||
}
|
||||
|
||||
resource "azurerm_storage_container" "bucket" {
|
||||
name = "content"
|
||||
storage_account_name = azurerm_storage_account.bucket.name
|
||||
container_access_type = var.container_access_type
|
||||
}
|
0
terraform/modules/bucket/outputs.tf
Normal file
0
terraform/modules/bucket/outputs.tf
Normal file
31
terraform/modules/bucket/variables.tf
Normal file
31
terraform/modules/bucket/variables.tf
Normal file
@ -0,0 +1,31 @@
|
||||
variable "region" {
|
||||
type = string
|
||||
description = "Region this module and resources will be created in"
|
||||
}
|
||||
|
||||
variable "name" {
|
||||
type = string
|
||||
description = "Unique name for the services in this module"
|
||||
}
|
||||
|
||||
variable "environment" {
|
||||
type = string
|
||||
description = "Environment these resources reside (prod, dev, staging, etc)"
|
||||
}
|
||||
|
||||
variable "owner" {
|
||||
type = string
|
||||
description = "Owner of the environment and resources created in this module"
|
||||
}
|
||||
|
||||
variable "container_access_type" {
|
||||
default = "private"
|
||||
description = "Access type for the container (Default: private)"
|
||||
type = string
|
||||
|
||||
}
|
||||
|
||||
variable "service_name" {
|
||||
description = "Name of the service using this bucket"
|
||||
type = string
|
||||
}
|
8
terraform/providers/dev/buckets.tf
Normal file
8
terraform/providers/dev/buckets.tf
Normal file
@ -0,0 +1,8 @@
|
||||
module "task_order_bucket" {
|
||||
source = "../../modules/bucket"
|
||||
service_name = "tasksatat"
|
||||
owner = var.owner
|
||||
name = var.name
|
||||
environment = var.environment
|
||||
region = var.region
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user