Sample modules are essentially just solution modules which test a certain combination of Infrastructure Catalog features, and which can be copy-pasted into external projects.
To export a sample solution to an external project, follow these steps:
- Create a folder called
infra
in the root the directory of your project, and then paste the desired sample as a subfolder within theinfra
directory. - Create a new file in the parent folder called
infra-config.yml
following the example here. - Create a folder called
.secrets
at the root of your project.- IMPORTANT: Make sure you add .secrets to the top of your
.gitignore
fire.
- IMPORTANT: Make sure you add .secrets to the top of your
- For AWS projects, create a file in
.secrets
calledaws-credentials
and then paste in your AWS credentials following the guidelines here. - Within each of the
.tf
files copy into your project, replacesource = "../../catalog/{...}"
at the top of the file withsource = "git::https://github.com/slalom-ggp/dataops-infra.git///catalog/{...}?ref=master"
. (This changes the source from a local module reference to a remote git reference.)
In order to receive automated testing, each sample folder needs to registered in the file .github/workflows/onpush.yml. To do this, simply open the onpush.yml
file, search for the text sample-id:
and add the name of the sample folder to the list.