This architecture includes multi-cloud deployment, refer to AWS, Azure and Google architecture for details.
- Install Terraform (MacOS)
$ brew tap hashicorp/tap
$ brew install hashicorp/tap/terraform
$ terraform version
- Install cdktf
$ npm install -g cdktf-cli
$ cdktf --version
You can refer config/default.json to define environment variables.
- Customize common tags for all resources.
{
"Tags": {
"CreateBy": "cdktf",
"Owner": "<your-name>"
}
}
- Customize network subnet with multiple cloud.
{
"Providers": {
"Aws": {
"Regions": ["us-east-1"],
"Vpc": {
"cidr": "10.0.0.0/16",
"privateSubnets": [
"10.0.0.0/21",
"10.0.8.0/21"
],
"publicSubnets": [
"10.0.16.0/21",
"10.0.24.0/21"
],
"Azure": {
"Regions": ["eastus"],
"Network": {
"cidr": "10.0.0.0/16",
"privateSubnets": [
"10.0.0.0/21",
"10.0.8.0/21"
],
"publicSubnets": [
"10.0.16.0/21",
"10.0.24.0/21"
]
}
}
}
}
- Customize kubernetes with multiple cloud.
{
"Providers": {
"Aws": {
"Eks": {
"name": "cdktf",
"instanceType": ["m4.large"],
"instanceCount": 1,
"version": "1.18"
}
},
"Azure": {
"Aks": {
"name": "cdktf",
"instanceType": ["Standard_D2_v2"],
"instanceCount": 1,
"dnsPrefix": "cdktf-kubernetes",
"version": "1.17.11"
}
}
}
}
$ cdktf plan
$ cdktf deploy
If you like the style of terraform output, you can execute make plan && make deploy
. more detail reference Makefile
You can customize environment parameters in config/default.json
Parameters | Description |
---|---|
StackName | The parameter of this stack name. default is cdktf |
Tags | The parameter of this stack common tags. default is { "CreateBy": "cdktf", "SampleFrom": "https://github.com/shazi7804" } |
Providers | The parameter of providers of this stack. |