Skip to content

Commit

Permalink
fix kv output handling and add endpoint outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
tjholm committed Dec 12, 2024
1 parent 32ab826 commit 182f4ce
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cloud/gcp/deploytf/.nitric/modules/stack/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ output "kms_key_iam_binding" {
}

output "firestore_database_id" {
value = google_firestore_database.database[0] != null ? google_firestore_database.database[0].name : "(default)"
value = one(google_firestore_database.database) != null ? google_firestore_database.database[0].name : "(default)"
description = "Firestore database for stack"
}
9 changes: 9 additions & 0 deletions cloud/gcp/deploytf/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,11 +214,20 @@ func (a *NitricGcpTerraformProvider) Post(stack cdktf.TerraformStack) error {
})

// loop over all the resources and create outputs for them
allEndpoints := map[string]*string{}

for name, api := range a.Apis {
cdktf.NewTerraformOutput(stack, jsii.Sprintf("%s-api-output", name), &cdktf.TerraformOutputConfig{
Sensitive: jsii.Bool(true),
Value: api,
})
allEndpoints[name] = api.EndpointOutput()
}

if len(allEndpoints) > 0 {
cdktf.NewTerraformOutput(stack, jsii.String("endpoints"), &cdktf.TerraformOutputConfig{
Value: allEndpoints,
})
}

for name, bucket := range a.Buckets {
Expand Down

0 comments on commit 182f4ce

Please sign in to comment.