-
Notifications
You must be signed in to change notification settings - Fork 0
/
lambda-vpc-rds.go
62 lines (51 loc) · 1.88 KB
/
lambda-vpc-rds.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package main
import (
"github.com/aws/aws-cdk-go/awscdk/v2"
"lambda-vpc-rds/stacks"
"github.com/aws/jsii-runtime-go"
)
func main() {
defer jsii.Close()
app := awscdk.NewApp(nil)
network := stacks.Network(app, "network-stack", awscdk.StackProps{
Env: env(),
})
storage := stacks.Storage(app, "storage-stack", &stacks.StorageStackProperties{
StackProps: awscdk.StackProps{
Env: env(),
},
NetworkStackData: network,
})
stacks.Application(app, "application-stack", &stacks.ApplicationStackProperties{
StackProps: awscdk.StackProps{
Env: env(),
},
NetworkStackData: network,
StorageStackData: storage,
})
app.Synth(nil)
}
// env determines the AWS environment (account+region) in which our stack is to
// be deployed. For more information see: https://docs.aws.amazon.com/cdk/latest/guide/environments.html
func env() *awscdk.Environment {
// If unspecified, this stack will be "environment-agnostic".
// Account/Region-dependent features and context lookups will not work, but a
// single synthesized template can be deployed anywhere.
//---------------------------------------------------------------------------
return nil
// Uncomment if you know exactly what account and region you want to deploy
// the stack to. This is the recommendation for production stacks.
//---------------------------------------------------------------------------
// return &awscdk.Environment{
// Account: jsii.String("123456789012"),
// Region: jsii.String("us-east-1"),
// }
// Uncomment to specialize this stack for the AWS Account and Region that are
// implied by the current CLI configuration. This is recommended for dev
// stacks.
//---------------------------------------------------------------------------
// return &awscdk.Environment{
// Account: jsii.String(os.Getenv("CDK_DEFAULT_ACCOUNT")),
// Region: jsii.String(os.Getenv("CDK_DEFAULT_REGION")),
// }
}