Skip to content

Commit

Permalink
updated terraform to add redis service instances (#2787)
Browse files Browse the repository at this point in the history
Co-authored-by: George Hudson <ghudson@teamraft.com>
Co-authored-by: raftmsohani <97037188+raftmsohani@users.noreply.github.com>
  • Loading branch information
3 people authored Dec 20, 2023
1 parent f32607c commit d626eb6
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 8 deletions.
15 changes: 15 additions & 0 deletions terraform/dev/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
}
22 changes: 14 additions & 8 deletions terraform/dev/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"]
}

0 comments on commit d626eb6

Please sign in to comment.