updating infrastructure container apps environment
This commit is contained in:
11
infrastructure/config/container_app_environment/main.tf
Normal file
11
infrastructure/config/container_app_environment/main.tf
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
locals {
|
||||||
|
name = {
|
||||||
|
test = "noahspan-test"
|
||||||
|
prod = "noahspan-prod"
|
||||||
|
}
|
||||||
|
|
||||||
|
log_analytics_workspace_name = {
|
||||||
|
test = "noahspan-log-analytics-workspace-test"
|
||||||
|
prod = "noahspan-log-analytics-workspace-prod"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
output "name" {
|
||||||
|
value = local.name[var.environment]
|
||||||
|
}
|
||||||
|
|
||||||
|
output "log_analytics_workspace_name" {
|
||||||
|
value = local.log_analytics_workspace_name[var.environment]
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
variable "environment" {}
|
||||||
@@ -1,97 +1,4 @@
|
|||||||
locals {
|
module "container_app_environment" {
|
||||||
container_app_app_name = {
|
source = "./container_app_environment"
|
||||||
test = "root-app-test"
|
environment = var.environment
|
||||||
prod = "root-app-prod"
|
|
||||||
}
|
|
||||||
|
|
||||||
container_app_app_container_image = {
|
|
||||||
test = "noahspan/root-app:v1.0.0"
|
|
||||||
prod = "noahspan/root-app:v1.0.0"
|
|
||||||
}
|
|
||||||
|
|
||||||
container_app_app_container_name = {
|
|
||||||
test = "root-app-test"
|
|
||||||
prod = "root-app-prod"
|
|
||||||
}
|
|
||||||
|
|
||||||
container_app_api_name = {
|
|
||||||
test = "root-api-test"
|
|
||||||
prod = "root-api-prod"
|
|
||||||
}
|
|
||||||
|
|
||||||
container_app_api_container_image = {
|
|
||||||
test = "noahspan/root-api:v1.0.0"
|
|
||||||
prod = "noahspan/root-api:v1.0.0"
|
|
||||||
}
|
|
||||||
|
|
||||||
container_app_api_container_name = {
|
|
||||||
test = "root-api-test"
|
|
||||||
prod = "root-api-prod"
|
|
||||||
}
|
|
||||||
|
|
||||||
container_app_api_dapr_app_id = {
|
|
||||||
test = "rootapitest"
|
|
||||||
prod = "rootpapiprod"
|
|
||||||
}
|
|
||||||
|
|
||||||
container_app_environment_name = {
|
|
||||||
test = "root-test"
|
|
||||||
prod = "root-prod"
|
|
||||||
}
|
|
||||||
|
|
||||||
custom_domain_count = {
|
|
||||||
test = 0
|
|
||||||
prod = 1
|
|
||||||
}
|
|
||||||
|
|
||||||
log_analytics_workspace_name = {
|
|
||||||
test = "root-log-analytics-workspace-test"
|
|
||||||
prod = "root-log-analytics-workspace-prod"
|
|
||||||
}
|
|
||||||
|
|
||||||
static_websites = {
|
|
||||||
test = [
|
|
||||||
{
|
|
||||||
error_404_document = "custom_not_found.html"
|
|
||||||
index_document = "index.html"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
prod = [
|
|
||||||
{
|
|
||||||
error_404_document = "custom_not_found.html"
|
|
||||||
index_document = "index.html"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
storage_account_name = {
|
|
||||||
test = "noahspanroottest"
|
|
||||||
prod = "noahspanrootprod"
|
|
||||||
}
|
|
||||||
|
|
||||||
storage_blobs = {
|
|
||||||
test = [
|
|
||||||
{
|
|
||||||
name = "web"
|
|
||||||
storage_container_name = "$web"
|
|
||||||
type = "Block"
|
|
||||||
content_type = "text/html"
|
|
||||||
source = "index.html"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
prod = [
|
|
||||||
{
|
|
||||||
name = "web"
|
|
||||||
storage_container_name = "$web"
|
|
||||||
type = "Block"
|
|
||||||
content_type = "text/html"
|
|
||||||
source = "index.html"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
storage_tables = {
|
|
||||||
test = ["projects"]
|
|
||||||
prod = ["projects"]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,55 +1,3 @@
|
|||||||
output "container_app_app_name" {
|
output "container_app_environment" {
|
||||||
value = local.container_app_app_name[var.environment]
|
value = module.container_app_environment
|
||||||
}
|
|
||||||
|
|
||||||
output "container_app_app_container_image" {
|
|
||||||
value = local.container_app_app_container_image[var.environment]
|
|
||||||
}
|
|
||||||
|
|
||||||
output "container_app_app_container_name" {
|
|
||||||
value = local.container_app_app_container_name[var.environment]
|
|
||||||
}
|
|
||||||
|
|
||||||
output "container_app_api_name" {
|
|
||||||
value = local.container_app_api_name[var.environment]
|
|
||||||
}
|
|
||||||
|
|
||||||
output "container_app_api_container_image" {
|
|
||||||
value = local.container_app_api_container_image[var.environment]
|
|
||||||
}
|
|
||||||
|
|
||||||
output "container_app_api_container_name" {
|
|
||||||
value = local.container_app_api_container_name[var.environment]
|
|
||||||
}
|
|
||||||
|
|
||||||
output "container_app_api_dapr_app_id" {
|
|
||||||
value = local.container_app_api_dapr_app_id[var.environment]
|
|
||||||
}
|
|
||||||
|
|
||||||
output "container_app_environment_name" {
|
|
||||||
value = local.container_app_environment_name[var.environment]
|
|
||||||
}
|
|
||||||
|
|
||||||
output "custom_domain_count" {
|
|
||||||
value = local.custom_domain_count[var.environment]
|
|
||||||
}
|
|
||||||
|
|
||||||
output "log_analytics_workspace_name" {
|
|
||||||
value = local.log_analytics_workspace_name[var.environment]
|
|
||||||
}
|
|
||||||
|
|
||||||
output "static_websites" {
|
|
||||||
value = local.static_websites[var.environment]
|
|
||||||
}
|
|
||||||
|
|
||||||
output "storage_account_name" {
|
|
||||||
value = local.storage_account_name[var.environment]
|
|
||||||
}
|
|
||||||
|
|
||||||
output "storage_blobs" {
|
|
||||||
value = local.storage_blobs[var.environment]
|
|
||||||
}
|
|
||||||
|
|
||||||
output "storage_tables" {
|
|
||||||
value = local.storage_tables[var.environment]
|
|
||||||
}
|
}
|
||||||
@@ -1,31 +1,40 @@
|
|||||||
module "storage" {
|
# module "storage" {
|
||||||
source = "github.com/noahspannbauer/noahspan-terraform/modules/storage"
|
# source = "github.com/noahspannbauer/noahspan-terraform/modules/storage"
|
||||||
resource_group_name = var.RESOURCE_GROUP_NAME
|
# resource_group_name = var.RESOURCE_GROUP_NAME
|
||||||
static_websites = module.environment.static_websites
|
# static_websites = module.environment.static_websites
|
||||||
storage_account_name = module.environment.storage_account_name
|
# storage_account_name = module.environment.storage_account_name
|
||||||
storage_blobs = module.environment.storage_blobs
|
# storage_blobs = module.environment.storage_blobs
|
||||||
storage_tables = module.environment.storage_tables
|
# storage_tables = module.environment.storage_tables
|
||||||
}
|
# }
|
||||||
|
|
||||||
module "container_app" {
|
# module "container_app" {
|
||||||
source = "github.com/noahspannbauer/noahspan-terraform/modules/container_app"
|
# source = "github.com/noahspannbauer/noahspan-terraform/modules/container_app"
|
||||||
app_subdomain_name = var.APP_SUBDOMAIN_NAME
|
# app_subdomain_name = var.APP_SUBDOMAIN_NAME
|
||||||
client_id = var.CLIENT_ID
|
# client_id = var.CLIENT_ID
|
||||||
client_secret = var.CLIENT_SECRET
|
# client_secret = var.CLIENT_SECRET
|
||||||
container_app_app_name = module.environment.container_app_app_name
|
# container_app_app_name = module.environment.container_app_app_name
|
||||||
container_app_app_container_image = module.environment.container_app_api_container_image
|
# container_app_app_container_image = module.environment.container_app_api_container_image
|
||||||
container_app_app_container_name = module.environment.container_app_api_container_name
|
# container_app_app_container_name = module.environment.container_app_api_container_name
|
||||||
container_app_api_name = module.environment.container_app_api_name
|
# container_app_api_name = module.environment.container_app_api_name
|
||||||
container_app_api_container_image = module.environment.container_app_api_container_image
|
# container_app_api_container_image = module.environment.container_app_api_container_image
|
||||||
container_app_api_container_name = module.environment.container_app_api_container_name
|
# container_app_api_container_name = module.environment.container_app_api_container_name
|
||||||
container_app_environment_name = module.environment.container_app_environment_name
|
# container_app_environment_name = module.environment.container_app_environment_name
|
||||||
custom_domain_count = module.environment.custom_domain_count
|
# custom_domain_count = module.environment.custom_domain_count
|
||||||
dns_zone_resource_group = var.DNS_ZONE_RESOURCE_GROUP
|
# dns_zone_resource_group = var.DNS_ZONE_RESOURCE_GROUP
|
||||||
docker_io_password = var.DOCKER_IO_PASSWORD
|
# docker_io_password = var.DOCKER_IO_PASSWORD
|
||||||
docker_io_username = var.DOCKER_IO_USERNAME
|
# docker_io_username = var.DOCKER_IO_USERNAME
|
||||||
domain_name = var.DOMAIN_NAME
|
# domain_name = var.DOMAIN_NAME
|
||||||
log_analytics_workspace_name = module.environment.log_analytics_workspace_name
|
# log_analytics_workspace_name = module.environment.log_analytics_workspace_name
|
||||||
|
# resource_group_name = var.RESOURCE_GROUP_NAME
|
||||||
|
# storage_account_primary_connection_string = module.storage.storage_account_primary_connection_string
|
||||||
|
# tenant_id = var.TENANT_ID
|
||||||
|
# }
|
||||||
|
|
||||||
|
module "container_app_environment" {
|
||||||
|
source = "github.com/noahspannbauer/noahspan-terraform/modules/container_app_environment"
|
||||||
|
container_app_environment_name = module.environment.container_app_environment.name
|
||||||
|
log_analytics_workspace_name = module.environment.container_app_environment.log_analytics_workspace_name
|
||||||
|
log_analytics_workspace_retention_in_days = 30
|
||||||
|
log_analytics_workspace_sku = "PerGB2018"
|
||||||
resource_group_name = var.RESOURCE_GROUP_NAME
|
resource_group_name = var.RESOURCE_GROUP_NAME
|
||||||
storage_account_primary_connection_string = module.storage.storage_account_primary_connection_string
|
|
||||||
tenant_id = var.TENANT_ID
|
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
terraform {
|
terraform {
|
||||||
required_version = ">= 1.1.0"
|
required_version = ">= 1.13.0"
|
||||||
|
|
||||||
required_providers {
|
required_providers {
|
||||||
azurerm = {
|
azurerm = {
|
||||||
|
|||||||
@@ -1,20 +1,3 @@
|
|||||||
variable "APP_SUBDOMAIN_NAME" {
|
|
||||||
type = string
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "CLIENT_ID" {
|
|
||||||
type = string
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "CLIENT_SECRET" {
|
|
||||||
type = string
|
|
||||||
sensitive = true
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "DNS_ZONE_RESOURCE_GROUP" {
|
|
||||||
type = string
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "DOCKER_IO_PASSWORD" {
|
variable "DOCKER_IO_PASSWORD" {
|
||||||
type = string
|
type = string
|
||||||
sensitive = true
|
sensitive = true
|
||||||
@@ -24,10 +7,6 @@ variable "DOCKER_IO_USERNAME" {
|
|||||||
type = string
|
type = string
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "DOMAIN_NAME" {
|
|
||||||
type = string
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "RESOURCE_GROUP_NAME" {
|
variable "RESOURCE_GROUP_NAME" {
|
||||||
type = string
|
type = string
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user