Cloud Development Kit for Terraform (CDKTF) allows you to use familiar programming languages to define and provision infrastructure. This is a simple example of how to use CDKTF to create a Kubernetes cluster on the IONOS Cloud using the Go programming language.
Optional:
You either have to set the IONOS_USERNAME
and IONOS_PASSWORD
or IONOS_TOKEN
environment variables.
ionosctl token create
andionosctl token get --token-id
gives you a token.
Furtheremore, you have to set ACCESS_KEY
, SECRET_KEY
and BUCKET_NAME
environment variables for the Terraform backend.
This can be used in combination with a GitHub Action to deploy the cluster.
The bucket should have versioning enabled.
cdktf deploy
Writing tests for CDKTF is easy with Go.
go test ./...
If you are finished experimenting you can do a simple cdktf destroy
to clean up.