mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-05-05 16:38:59 -04:00
Access the API endpiont over internal interfaces
This commit is contained in:
22
terraform/shared/container_networking/main.tf
Normal file
22
terraform/shared/container_networking/main.tf
Normal file
@@ -0,0 +1,22 @@
|
||||
data "cloudfoundry_space" "space" {
|
||||
org_name = var.cf_org_name
|
||||
name = var.cf_space_name
|
||||
}
|
||||
|
||||
data "cloudfoundry_app" "source_app" {
|
||||
name_or_id = var.source_app_name
|
||||
space = data.cloudfoundry_space.space.id
|
||||
}
|
||||
|
||||
data "cloudfoundry_app" "destination_app" {
|
||||
name_or_id = var.destination_app_name
|
||||
space = data.cloudfoundry_space.space.id
|
||||
}
|
||||
|
||||
resource "cloudfoundry_network_policy" "internal_route" {
|
||||
policy {
|
||||
source_app = data.cloudfoundry_app.source_app.id
|
||||
destination_app = data.cloudfoundry_app.destination_app.id
|
||||
port = var.destination_port
|
||||
}
|
||||
}
|
||||
16
terraform/shared/container_networking/providers.tf
Normal file
16
terraform/shared/container_networking/providers.tf
Normal file
@@ -0,0 +1,16 @@
|
||||
terraform {
|
||||
required_version = "~> 1.0"
|
||||
required_providers {
|
||||
cloudfoundry = {
|
||||
source = "cloudfoundry-community/cloudfoundry"
|
||||
version = "~> 0.15"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
provider "cloudfoundry" {
|
||||
api_url = "https://api.fr.cloud.gov"
|
||||
user = var.cf_user
|
||||
password = var.cf_password
|
||||
app_logs_max = 30
|
||||
}
|
||||
13
terraform/shared/container_networking/variables.tf
Normal file
13
terraform/shared/container_networking/variables.tf
Normal file
@@ -0,0 +1,13 @@
|
||||
variable "cf_password" {
|
||||
type = string
|
||||
sensitive = true
|
||||
}
|
||||
variable "cf_user" {}
|
||||
variable "cf_org_name" {}
|
||||
variable "cf_space_name" {}
|
||||
variable "source_app_name" {}
|
||||
variable "destination_app_name" {}
|
||||
variable "destination_port" {
|
||||
type = string
|
||||
default = "61443"
|
||||
}
|
||||
Reference in New Issue
Block a user