Skip to content

Commit

Permalink
TF changes to get inital build going
Browse files Browse the repository at this point in the history
  • Loading branch information
Iain-Stanger committed Jun 18, 2024
1 parent f15d4cc commit 6845b17
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 138 deletions.
28 changes: 26 additions & 2 deletions terraform/container-app/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

69 changes: 0 additions & 69 deletions terraform/container-app/key-vault.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,73 +36,4 @@ resource "azurerm_key_vault_access_policy" "vault_access_policy_mi" {

secret_permissions = ["List", "Get"]
key_permissions = ["List", "Get", "WrapKey", "UnwrapKey"]
}


resource "azurerm_key_vault_secret" "vault_secret_contentful_deliveryapikey" {
key_vault_id = azurerm_key_vault.vault.id
name = "contentful--deliveryapikey"
value = local.contentful_deliveryapikey

lifecycle {
ignore_changes = [
value,
expiration_date
]
}
}

resource "azurerm_key_vault_secret" "vault_secret_contentful_previewapikey" {
key_vault_id = azurerm_key_vault.vault.id
name = "contentful--previewapikey"
value = local.contentful_previewapikey

lifecycle {
ignore_changes = [
value,
expiration_date
]
}
}

resource "azurerm_key_vault_secret" "vault_secret_contentful_spaceid" {
key_vault_id = azurerm_key_vault.vault.id
name = "contentful--spaceid"
value = local.contentful_spaceid

lifecycle {
ignore_changes = [
value,
expiration_date
]
}
}

resource "azurerm_key_vault_secret" "vault_secret_contentful_environment" {
key_vault_id = azurerm_key_vault.vault.id
name = "contentful--environment"
value = local.contentful_environment

lifecycle {
ignore_changes = [
value,
expiration_date
]
}
}


resource "azurerm_key_vault_key" "data_protection_key" {
name = "dataprotection"
key_vault_id = azurerm_key_vault.vault.id

key_type = var.key_type
key_size = var.key_size
key_opts = var.key_ops

tags = local.tags

lifecycle {
ignore_changes = all
}
}
10 changes: 1 addition & 9 deletions terraform/container-app/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ locals {
azure_location = var.azure_location
resource_prefix = "${local.environment}${local.project_name}"
resource_group_name = module.main_hosting.azurerm_resource_group_default.name
registry_server = var.registry_server
registry_username = var.registry_username
registry_password = var.registry_password


tags = {
Expand All @@ -31,16 +28,11 @@ locals {
####################
user_identity_name = "${local.resource_prefix}-mi"



##################
# Azure KeyVault #
##################
kv_name = "${local.environment}cands-kv"
contentful_deliveryapikey = var.contentful_deliveryapikey
contentful_previewapikey = var.contentful_previewapikey
contentful_spaceid = var.contentful_spaceid
contentful_environment = var.contentful_environment

##################
# CDN/Front Door #
##################
Expand Down
7 changes: 0 additions & 7 deletions terraform/container-app/main-hosting.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,4 @@ module "main_hosting" {
##############
container_apps_infra_subnet_service_endpoints = ["Microsoft.KeyVault"]

#############################
# Github Container Registry #
#############################
registry_server = local.registry_server
registry_username = local.registry_username
registry_password = local.registry_password

}
52 changes: 1 addition & 51 deletions terraform/container-app/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -62,31 +62,6 @@ variable "key_size" {
default = 2048
}


variable "contentful_deliveryapikey" {
description = "Contentful delivery key"
type = string
}

variable "contentful_previewapikey" {
description = "Contentful preview key"
type = string
}

variable "contentful_environment" {
description = "Contentful environment"
type = string
}

variable "contentful_spaceid" {
description = "Contentful space id"
type = string
}





#######################
# Azure App Container #
#######################
Expand All @@ -109,29 +84,4 @@ variable "cdn_create_custom_domain" {
description = "A flag to create the A and TXT records for the container app as part of setting up the cdn"
type = bool
default = false
}


###################
# Github Registry #
###################

variable "registry_server" {
description = "Container registry server"
type = string
default = "ghcr.io"
}

variable "registry_username" {
description = "Container registry username"
type = string
default = ""
}

variable "registry_password" {
description = "Container registry password"
type = string
default = ""
}


}

0 comments on commit 6845b17

Please sign in to comment.