diff --git a/terraform/dev/main.tf b/terraform/dev/main.tf index ba01d9cf3..da1df5b10 100644 --- a/terraform/dev/main.tf +++ b/terraform/dev/main.tf @@ -76,3 +76,18 @@ resource "cloudfoundry_service_instance" "datafiles" { service_plan = data.cloudfoundry_service.s3.service_plans["basic-sandbox"] recursive_delete = true } + +### +# Provision Redis for each env +### + +data "cloudfoundry_service" "redis" { + name = "aws-elasticache-redis" +} + +resource "cloudfoundry_service_instance" "redis" { + for_each = toset(var.dev_app_names) + name = "tdp-redis-${each.value}" + space = data.cloudfoundry_space.space.id + service_plan = data.cloudfoundry_service.redis.service_plans["redis-dev"] +} diff --git a/terraform/dev/variables.tf b/terraform/dev/variables.tf index eedbcab1a..58173eaf1 100644 --- a/terraform/dev/variables.tf +++ b/terraform/dev/variables.tf @@ -10,12 +10,22 @@ variable "cf_api_url" { default = "https://api.fr.cloud.gov" } +variable "cf_app_name" { + type = string + description = "name of app" +} + variable "cf_org_name" { type = string description = "cloud.gov organization name" default = "hhs-acf-ofa" } +variable "cf_password" { + type = string + description = "secret; cloud.gov deployer account password" +} + variable "cf_space_name" { type = string description = "cloud.gov space name" @@ -27,12 +37,8 @@ variable "cf_user" { description = "secret; cloud.gov deployer account user" } -variable "cf_password" { - type = string - description = "secret; cloud.gov deployer account password" -} - -variable "cf_app_name" { - type = string - description = "name of app" +variable "dev_app_names" { + type = list(string) + description = "list of app names deployed in the dev environment" + default = ["a11y", "qasp", "raft", "sandbox"] }