forked from kapicorp/kapitan
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request kapicorp#93 from mumoshu/terraform-readme
README for the terraform example
- Loading branch information
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Using Kapitan to generate Terraform configuration | ||
|
||
kapitan can be used to generate `*.tf.json` with jsonnet and jinja2. | ||
|
||
Running `kapitan compile` in this directory would produce 3 terraform projects named `project1`, `project2`, and `project3`: | ||
|
||
``` | ||
$ docker run -t --rm -v $(pwd):/src:delegated deepmind/kapitan compile | ||
Compiled project3 (0.32s) | ||
Compiled project1 (0.39s) | ||
Compiled project2 (0.41s) | ||
$ tree compiled | ||
compiled | ||
├── project1 | ||
│ └── manifests | ||
│ ├── dns.tf.json | ||
│ ├── output.tf.json | ||
│ └── provider.tf.json | ||
├── project2 | ||
│ └── manifests | ||
│ ├── container.tf.json | ||
│ ├── output.tf.json | ||
│ └── provider.tf.json | ||
└── project3 | ||
└── manifests | ||
├── container.tf.json | ||
├── output.tf.json | ||
└── provider.tf.json | ||
6 directories, 9 files | ||
``` | ||
|
||
You can now run `terraform` commands as usual: | ||
|
||
``` | ||
$ cd compiled/project1/manifests | ||
$ terraform init | ||
$ terraform plan | ||
$ terraform apply | ||
``` |