Skip to content

Commit

Permalink
re-order deployment units
Browse files Browse the repository at this point in the history
  • Loading branch information
paullatzelsperger committed Oct 2, 2024
1 parent 03c938a commit 508d9df
Show file tree
Hide file tree
Showing 10 changed files with 243 additions and 190 deletions.
87 changes: 87 additions & 0 deletions mxd/alice.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# First connector
module "alice-connector" {
depends_on = [module.azurite]
source = "./modules/connector"
humanReadableName = var.alice-humanReadableName
participantId = var.alice-bpn
database-host = local.alice-postgres.database-host
database-name = local.databases.alice.database-name
database-credentials = {
user = local.databases.alice.database-username
password = local.databases.alice.database-password
}
dcp-config = {
id = var.alice-did
sts_token_url = "http://${var.alice-identityhub-host}:7084/api/credentials/token"
sts_client_id = var.alice-did
sts_clientsecret_alias = "participant-alice-sts-client-secret"
}
dataplane = {
privatekey-alias = "${var.alice-did}#signing-key-1"
publickey-alias = "${var.alice-did}#signing-key-1"
}

azure-account-name = var.alice-azure-account-name
azure-account-key = local.alice-azure-key-base64
azure-account-key-sas = var.alice-azure-key-sas
azure-url = module.azurite.azurite-url

ingress-host = var.alice-ingress-host

minio-config = {
username = module.alice-minio.minio-username
password = module.alice-minio.minio-password
url = module.alice-minio.minio-url
}
}

module "alice-identityhub" {
depends_on = [module.alice-connector]

source = "./modules/identity-hub"
database = {
user = local.databases.alice.database-username
password = local.databases.alice.database-password
url = "jdbc:postgresql://${local.alice-postgres.database-host}/${local.databases.alice.database-name}"
}
humanReadableName = var.alice-identityhub-host
namespace = kubernetes_namespace.mxd-ns.metadata.0.name
participantId = var.alice-did
vault-url = "http://alice-vault:8200"
url-path = var.alice-identityhub-host
}

# alice's catalog server
module "alice-catalog-server" {
depends_on = [module.alice-connector]

source = "./modules/catalog-server"
humanReadableName = "alice-catalogserver"
serviceName = var.alice-catalogserver-host
namespace = kubernetes_namespace.mxd-ns.metadata.0.name
participantId = var.alice-bpn
vault-url = "http://alice-vault:8200"
bdrs-url = "http://bdrs-server:8082/api/directory"
database = {
user = local.databases.alice-catalogserver.database-username
password = local.databases.alice-catalogserver.database-password
url = "jdbc:postgresql://${local.catalogserver-postgres.database-host}/${local.databases.alice-catalogserver.database-name}"
}
dcp-config = {
id = var.alice-did
sts_token_url = "http://${var.alice-identityhub-host}:7084/api/credentials/token"
sts_client_id = var.alice-did
sts_clientsecret_alias = "participant-alice-sts-client-secret"
}
}

module "alice-minio" {
source = "./modules/minio"
humanReadableName = lower(var.alice-humanReadableName)
minio-username = "aliceawsclient"
minio-password = "aliceawssecret"
}

locals {
alice-azure-key-base64 = base64encode(var.alice-azure-account-key)
}
43 changes: 43 additions & 0 deletions mxd/alice_variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
variable "alice-bpn" {
default = "BPNL000000000001"
}

variable "alice-humanReadableName" {
default = "alice"
}

variable "alice-identityhub-host" {
description = "Kubernetes service name of the IdentityHub"
default = "alice-ih"
}

variable "alice-catalogserver-host" {
description = "Kubernetes service name (=Host) for Alice's Catalog Server"
default = "alice-cs"
}

variable "alice-did" {
default = "did:web:alice-ih%3A7083:alice"
}

variable "alice-azure-account-name" {
default = "aliceazureaccount"
}

variable "alice-azure-account-key" {
default = "aliceazurekey"
}

variable "alice-azure-key-sas" {
default = "sv=2023-01-03&ss=btqf&srt=sco&st=2023-11-23T13%3A17%3A09Z&se=2030-01-01T00%3A00%3A00Z&sp=rwdxftlacup&sig=uvPcqmLj7%2FMuadAKXMCA7SvWCnClQ9EA1b15OB0m1bc%3D"
}

variable "alice-ingress-host" {
default = "localhost"
}

variable "alice-namespace" {
type = string
description = "Kubernetes namespace to use"
default = "mxd"
}
61 changes: 61 additions & 0 deletions mxd/bob.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Second connector
module "bob-connector" {
depends_on = [module.azurite]
source = "./modules/connector"
humanReadableName = var.bob-humanReadableName
namespace = kubernetes_namespace.mxd-ns.metadata.0.name
participantId = var.bob-bpn
database-host = local.bob-postgres.database-host
database-name = local.databases.bob.database-name
database-credentials = {
user = local.databases.bob.database-username
password = local.databases.bob.database-password
}
dcp-config = {
id = var.bob-did
sts_token_url = "http://${var.bob-identityhub-host}:7084/api/credentials/token"
sts_client_id = var.bob-did
sts_clientsecret_alias = "participant-bob-sts-client-secret"
}
dataplane = {
privatekey-alias = "${var.bob-did}#signing-key-1"
publickey-alias = "${var.bob-did}#signing-key-1"
}

azure-account-name = var.bob-azure-account-name
azure-account-key = local.bob-azure-key-base64
azure-account-key-sas = var.bob-azure-key-sas
azure-url = module.azurite.azurite-url
ingress-host = var.bob-ingress-host
minio-config = {
username = module.bob-minio.minio-username
password = module.bob-minio.minio-password
url = module.bob-minio.minio-url
}
}

module "bob-identityhub" {
depends_on = [module.bob-connector]
source = "./modules/identity-hub"
database = {
user = local.databases.bob.database-username
password = local.databases.bob.database-password
url = "jdbc:postgresql://${local.bob-postgres.database-host}/${local.databases.bob.database-name}"
}
humanReadableName = var.bob-identityhub-host
namespace = kubernetes_namespace.mxd-ns.metadata.0.name
participantId = var.bob-did
vault-url = "http://bob-vault:8200"
url-path = var.bob-identityhub-host
}

module "bob-minio" {
source = "./modules/minio"
humanReadableName = lower(var.bob-humanReadableName)
minio-username = "bobawsclient"
minio-password = "bobawssecret"
}

locals {
bob-azure-key-base64 = base64encode(var.bob-azure-account-key)
}
38 changes: 38 additions & 0 deletions mxd/bob_variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
variable "bob-bpn" {
default = "BPNL000000000002"
}

variable "bob-did" {
default = "did:web:bob-ih%3A7083:bob"
}


variable "bob-azure-account-name" {
default = "bobazureaccount"
}

variable "bob-azure-account-key" {
default = "bobazurekey"
}

variable "bob-azure-key-sas" {
default = "sv=2023-01-03&ss=btqf&srt=sco&st=2023-11-23T13%3A18%3A49Z&se=2030-01-01T00%3A00%3A00Z&sp=rwdftlacup&sig=Xki%2B2nHBT2V8oe%2BMmS%2BI%2FHzcAsTFCYWDv6t6zT%2FWXFM%3D"
}

variable "bob-ingress-host" {
default = "localhost"
}

variable "bob-humanReadableName" {
default = "bob"
}

variable "bob-identityhub-host" {
description = "Kubernetes service name of the IdentityHub"
default = "bob-ih"
}

variable "bob-catalogserver-host" {
description = "Kubernetes service name (=Host) for Bob's Catalog Server"
default = "bob-cs"
}
122 changes: 0 additions & 122 deletions mxd/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -42,135 +42,13 @@ provider "helm" {
}
}

# First connector
module "alice-connector" {
depends_on = [module.azurite]
source = "./modules/connector"
humanReadableName = "alice"
participantId = var.alice-bpn
database-host = local.alice-postgres.database-host
database-name = local.databases.alice.database-name
database-credentials = {
user = local.databases.alice.database-username
password = local.databases.alice.database-password
}
dcp-config = {
id = var.alice-did
sts_token_url = "http://alice-ih:7084/api/credentials/token"
sts_client_id = var.alice-did
sts_clientsecret_alias = "participant-alice-sts-client-secret"
}
dataplane = {
privatekey-alias = "${var.alice-did}#signing-key-1"
publickey-alias = "${var.alice-did}#signing-key-1"
}

azure-account-name = var.alice-azure-account-name
azure-account-key = local.alice-azure-key-base64
azure-account-key-sas = var.alice-azure-key-sas
azure-url = module.azurite.azurite-url
minio-config = {
minio-username = "aliceawsclient"
minio-password = "aliceawssecret"
}
ingress-host = var.alice-ingress-host
}

module "alice-identityhub" {
source = "./modules/identity-hub"
database = {
user = local.databases.alice.database-username
password = local.databases.alice.database-password
url = "jdbc:postgresql://${local.alice-postgres.database-host}/${local.databases.alice.database-name}"
}
humanReadableName = "alice-ih"
namespace = kubernetes_namespace.mxd-ns.metadata.0.name
participantId = var.alice-did
vault-url = "http://alice-vault:8200"
url-path = "alice-ih"
}

# alice's catalog server
module "alice-catalog-server" {
source = "./modules/catalog-server"
humanReadableName = "alice-catalogserver"
serviceName = "alice-cs"
namespace = kubernetes_namespace.mxd-ns.metadata.0.name
participantId = var.alice-bpn
vault-url = "http://alice-vault:8200"
bdrs-url = "http://bdrs-server:8082/api/directory"
database = {
user = local.databases.alice-catalogserver.database-username
password = local.databases.alice-catalogserver.database-password
url = "jdbc:postgresql://${local.catalogserver-postgres.database-host}/${local.databases.alice-catalogserver.database-name}"
}
dcp-config = {
id = var.alice-did
sts_token_url = "http://alice-ih:7084/api/credentials/token"
sts_client_id = var.alice-did
sts_clientsecret_alias = "participant-alice-sts-client-secret"
}
}


# Second connector
module "bob-connector" {
depends_on = [module.azurite]
source = "./modules/connector"
humanReadableName = "bob"
namespace = kubernetes_namespace.mxd-ns.metadata.0.name
participantId = var.bob-bpn
database-host = local.bob-postgres.database-host
database-name = local.databases.bob.database-name
database-credentials = {
user = local.databases.bob.database-username
password = local.databases.bob.database-password
}
dcp-config = {
id = var.bob-did
sts_token_url = "http://bob-ih:7084/api/credentials/token"
sts_client_id = var.bob-did
sts_clientsecret_alias = "participant-bob-sts-client-secret"
}
dataplane = {
privatekey-alias = "${var.bob-did}#signing-key-1"
publickey-alias = "${var.bob-did}#signing-key-1"
}

azure-account-name = var.bob-azure-account-name
azure-account-key = local.bob-azure-key-base64
azure-account-key-sas = var.bob-azure-key-sas
azure-url = module.azurite.azurite-url
minio-config = {
minio-username = "bobawsclient"
minio-password = "bobawssecret"
}
ingress-host = var.bob-ingress-host
}

module "bob-identityhub" {
source = "./modules/identity-hub"
database = {
user = local.databases.bob.database-username
password = local.databases.bob.database-password
url = "jdbc:postgresql://${local.bob-postgres.database-host}/${local.databases.bob.database-name}"
}
humanReadableName = "bob-ih"
namespace = kubernetes_namespace.mxd-ns.metadata.0.name
participantId = var.bob-did
vault-url = "http://bob-vault:8200"
url-path = "bob-ih"
}

module "azurite" {
source = "./modules/azurite"
namespace = kubernetes_namespace.mxd-ns.metadata.0.name
azurite-accounts = "${var.alice-azure-account-name}:${local.alice-azure-key-base64};${var.bob-azure-account-name}:${local.bob-azure-key-base64};${var.trudy-azure-account-name}:${local.trudy-azure-key-base64};"
}

locals {
alice-azure-key-base64 = base64encode(var.alice-azure-account-key)
bob-azure-key-base64 = base64encode(var.bob-azure-account-key)
trudy-azure-key-base64 = base64encode(var.trudy-azure-account-key)
}

Expand Down
Loading

0 comments on commit 508d9df

Please sign in to comment.