-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
40 lines (30 loc) · 972 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package main
import (
"github.com/aws/constructs-go/constructs/v10"
"github.com/aws/jsii-runtime-go"
"github.com/cdktf/cdktf-provider-local-go/local/v10/file"
"github.com/cdktf/cdktf-provider-local-go/local/v10/provider"
"github.com/hashicorp/terraform-cdk-go/cdktf"
)
type config struct {
filename string
}
func NewNoopStack(scope constructs.Construct, id string, cfg *config) cdktf.TerraformStack {
stack := cdktf.NewTerraformStack(scope, jsii.String(id))
provider.NewLocalProvider(stack, jsii.String("local"), &provider.LocalProviderConfig{})
file := file.NewFile(stack, jsii.String("file"), &file.FileConfig{
Content: jsii.String("Hello, World!"),
Filename: jsii.String(cfg.filename),
})
cdktf.NewTerraformOutput(stack, jsii.String("filename"), &cdktf.TerraformOutputConfig{
Value: file.Filename(),
})
return stack
}
func main() {
app := cdktf.NewApp(nil)
NewNoopStack(app, "stack", &config{
filename: "hello.txt",
})
app.Synth()
}