This repository contains a Terragrunt blueprint with a common project structure. The repo includes some example modules for AWS, Azure and STACKIT cloud. It's intended to be used as a starting point for new projects. Over the time it will be extended with more modules, features and best practices.
- local backend
- gitlab remote backend
- override variables in env_local.hcl file
- helm provider
- kubernetes provider
- helm chart module
- AWS provider
- AWS dummy module
- Azure provider
- Azure benchmark module
- STACKIT cloud dummy module
- STACKIT cloud s3 remote backend
- STACKIT ske kubernetes module
- STACKIT benchmark module
- add some
export AWS_PROFILE=aws_dummy
export AWS_ACCOUNT_ID=123456789
# required if you want to use the gitlab backend
export TF_HTTP_PASSWORD=your_gitlab_token
export TF_HTTP_USERNAME=your_gitlab_user_name
cd deployments/terraform/env/dev/aws_dummy
terragrunt apply
Reference: https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs#authentication
Use the recommended "key flow" authentication. You should end up with two files in your home directory:
-
~/.stackit/credentials.json
{ "STACKIT_SERVICE_ACCOUNT_KEY_PATH": "/Users/<username>/.stackit/key.json" }
Note: relative paths like
~/.stackit/key.json
where not working for me. -
~/.stackit/key.json
{ "id": "uuid", "publicKey": "public key", "createdAt": "2023-08-24T14:15:22Z", "validUntil": "2023-08-24T14:15:22Z", "keyType": "USER_MANAGED", "keyOrigin": "USER_PROVIDED", "keyAlgorithm": "RSA_2048", "active": true, "credentials": { "kid": "string", "iss": "my-sa@sa.stackit.cloud", "sub": "uuid", "aud": "string", (optional) "privateKey": "private key when generated by the SA service" } }
you can generate and download this file in the stackit cloud web console
If you like to use the s3 state backend you need to set the bucket credentials as environment variables:
export AWS_ACCESS_KEY_ID=AAAAAAAAAAAAAAAAAAAA
export AWS_SECRET_ACCESS_KEY=BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
cd deployments/terraform/env/stackit_dev/stackit_dummy
terragrunt apply
# cleanup
terragrunt plan -destroy -out=destroy.tfplan
terragrunt apply destroy.tfplan
This repository is a work in progress.
Feel free to contribute by creating a pull request.
This project is licensed under the MIT License - see the LICENSE file for details. Do whatever you want with it.