Skip to content
This repository was archived by the owner on Mar 17, 2026. It is now read-only.

Commit debdd1d

Browse files
committed
fix(cli): add default outputs
1 parent 9a504a1 commit debdd1d

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

engines/terraform/outputs.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package terraform
2+
3+
import (
4+
"github.com/aws/jsii-runtime-go"
5+
"github.com/hashicorp/terraform-cdk-go/cdktf"
6+
)
7+
8+
func (td *TerraformDeployment) createOutputs() {
9+
for name, module := range td.terraformResources {
10+
td.createOutputsForModule(name, module)
11+
}
12+
13+
for name, module := range td.terraformInfraResources {
14+
td.createOutputsForModule(name, module)
15+
}
16+
}
17+
18+
func (td *TerraformDeployment) createOutputsForModule(name string, module cdktf.TerraformHclModule) {
19+
cdktf.NewTerraformOutput(td.stack, jsii.Sprintf("%s_outputs", name), &cdktf.TerraformOutputConfig{
20+
Value: module,
21+
})
22+
}

engines/terraform/terraform.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,9 @@ func (e *TerraformEngine) Apply(appSpec *app_spec_schema.Application) (result st
231231
}
232232
}
233233

234+
// Create outputs for all resources
235+
tfDeployment.createOutputs()
236+
234237
tfDeployment.Synth()
235238

236239
return filepath.Join(e.outputDir, "stacks", appSpec.Name), nil

0 commit comments

Comments
 (0)