Skip to content

Commit

Permalink
update service ingress and outputs.
Browse files Browse the repository at this point in the history
  • Loading branch information
tjholm committed Dec 11, 2024
1 parent 7110c09 commit 32ab826
Showing 1 changed file with 57 additions and 1 deletion.
58 changes: 57 additions & 1 deletion cloud/gcp/deploytf/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func (a *NitricGcpTerraformProvider) Init(attributes map[string]interface{}) err
mapstructure.Decode(vpcConfig, a.vpcConfig)
}

serviceIngress, ok := a.RawAttributes["service_ingress"].(bool)
serviceIngress, ok := a.RawAttributes["internal-service-ingress"].(bool)
if ok {
a.serviceIngress = serviceIngress
}
Expand Down Expand Up @@ -207,6 +207,62 @@ func (a *NitricGcpTerraformProvider) Pre(stack cdktf.TerraformStack, resources [
}

func (a *NitricGcpTerraformProvider) Post(stack cdktf.TerraformStack) error {
// write terraform outputs

cdktf.NewTerraformOutput(stack, jsii.Sprintf("stack-output"), &cdktf.TerraformOutputConfig{
Value: a.Stack,
})

// loop over all the resources and create outputs for them
for name, api := range a.Apis {
cdktf.NewTerraformOutput(stack, jsii.Sprintf("%s-api-output", name), &cdktf.TerraformOutputConfig{
Sensitive: jsii.Bool(true),
Value: api,
})
}

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

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

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

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

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

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

return nil
}

Expand Down

0 comments on commit 32ab826

Please sign in to comment.