Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IGNORE] Checking a11y #4553

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions terraform/sandbox/.terraform.lock.hcl

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

13 changes: 13 additions & 0 deletions terraform/sandbox/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ terraform {
required_version = "~> 1.0"
required_providers {
cloudfoundry = {
source = "cloudfoundry/cloudfoundry"
version = "1.1.0"
}
cloudfoundry-community = {
source = "cloudfoundry-community/cloudfoundry"
version = "~>0.53.1"
}
Expand All @@ -18,8 +22,17 @@ terraform {
}
}


provider "cloudfoundry" {
api_url = "https://api.fr.cloud.gov"
user = var.cf_user
password = var.cf_password
}

# Backwards compatability provider for all modules < v2.0.0
# https://github.com/GSA-TTS/terraform-cloudgov/blob/main/UPGRADING.md#using-v1-and-v2-together
provider "cloudfoundry-community" {
api_url = "https://api.fr.cloud.gov"
user = var.cf_user
password = var.cf_password
}
2 changes: 2 additions & 0 deletions terraform/shared/modules/sandbox/app.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ module "fac-app" {
}

resource "cloudfoundry_network_policy" "app-network-policy" {
provider = cloudfoundry-community

policy {
source_app = module.fac-app.app_id
destination_app = module.https-proxy.app_id
Expand Down
27 changes: 13 additions & 14 deletions terraform/shared/modules/sandbox/clamav.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,31 @@ data "docker_registry_image" "clamav" {
}

module "clamav" {
source = "github.com/gsa-tts/terraform-cloudgov//clamav?ref=v1.1.0"
source = "github.com/gsa-tts/terraform-cloudgov//clamav?ref=v2.0.0"

# This generates eg "fac-av-staging.apps.internal", avoiding collisions with routes for other projects and spaces
name = local.clam_name
app_name_or_id = "gsa-fac"
name = local.clam_name

cf_org_name = var.cf_org_name
cf_space_name = var.cf_space_name

clamav_image = "ghcr.io/gsa-tts/fac/clamav@${data.docker_registry_image.clamav.sha256_digest}"
clamav_memory = var.clamav_memory
max_file_size = "30M"
instances = var.clamav_instances
clamav_memory = var.clamav_memory

proxy_server = module.https-proxy.domain
proxy_port = module.https-proxy.port
proxy_username = module.https-proxy.username
proxy_password = module.https-proxy.password
# depends_on = [module.fac-app.app_id]
# depends_on = [ module.https-proxy.https_proxy ]
}

# resource "cloudfoundry_network_policy" "clamav-network-policy" {
# policy {
# source_app = module.clamav.app_id
# destination_app = module.https-proxy.app_id
# port = "61443"
# protocol = "tcp"
# }
# }
resource "cloudfoundry_network_policy" "clamav-network-policy" {
provider = cloudfoundry-community
policy {
source_app = module.clamav.app_id
destination_app = module.https-proxy.app_id
port = "61443"
protocol = "tcp"
}
}
1 change: 1 addition & 0 deletions terraform/shared/modules/sandbox/env.tf
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ module "s3-private" {

# Stuff used for apps in this space
data "cloudfoundry_space" "apps" {
provider = cloudfoundry-community
org_name = var.cf_org_name
name = var.cf_space_name
}
Expand Down
2 changes: 2 additions & 0 deletions terraform/shared/modules/sandbox/newrelic.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
resource "cloudfoundry_user_provided_service" "credentials" {
provider = cloudfoundry-community

name = "newrelic-creds"
space = data.cloudfoundry_space.apps.id
credentials = {
Expand Down
6 changes: 6 additions & 0 deletions terraform/shared/modules/sandbox/postgrest.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@ locals {
}

resource "cloudfoundry_route" "postgrest" {
provider = cloudfoundry-community

space = data.cloudfoundry_space.apps.id
domain = data.cloudfoundry_domain.public.id
hostname = "fac-${var.cf_space_name}-${local.postgrest_name}"
}

resource "cloudfoundry_service_key" "postgrest" {
provider = cloudfoundry-community

name = "postgrest"
service_instance = module.database.instance_id
}
Expand All @@ -18,6 +22,8 @@ data "docker_registry_image" "postgrest" {
}

resource "cloudfoundry_app" "postgrest" {
provider = cloudfoundry-community

name = local.postgrest_name
space = data.cloudfoundry_space.apps.id
docker_image = "ghcr.io/gsa-tts/fac/postgrest@${data.docker_registry_image.postgrest.sha256_digest}"
Expand Down
5 changes: 5 additions & 0 deletions terraform/shared/modules/sandbox/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ terraform {
required_version = "~> 1.0"
required_providers {
cloudfoundry = {
source = "cloudfoundry/cloudfoundry"
version = "1.1.0"
}

cloudfoundry-community = {
source = "cloudfoundry-community/cloudfoundry"
version = "~>0.53.1"
}
Expand Down
6 changes: 6 additions & 0 deletions terraform/shared/modules/sandbox/routes.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,24 @@ locals {
}

data "cloudfoundry_space" "client_space" {
provider = cloudfoundry-community

org_name = var.cf_org_name
name = local.client_space
}

data "cloudfoundry_app" "clients" {
provider = cloudfoundry-community

for_each = local.clients
name_or_id = each.key
space = data.cloudfoundry_space.client_space.id
depends_on = [module.fac-app, module.clamav, cloudfoundry_app.postgrest, module.https-proxy]
}

resource "cloudfoundry_network_policy" "client_routing" {
provider = cloudfoundry-community

for_each = local.clients
policy {
source_app = data.cloudfoundry_app.clients[each.key].id
Expand Down
4 changes: 2 additions & 2 deletions terraform/shared/modules/sandbox/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ variable "clamav_fs_instances" {
}

variable "clamav_memory" {
type = number
type = string
description = "memory in MB to allocate to clamav app"
default = 2048
default = "2048M"
}

variable "pgrst_jwt_secret" {
Expand Down
Loading