External Resources module to provision and manage RDS instances in AWS with App-Interface.
- Terraform
- AWS provider
- Random provider
- Python 3.12
- Pydantic
Ensure uv is installed.
Prepare local development environment:
make devThis will auto create a venv, to activate in shell:
source .venv/bin/activate-
update versions in versions.tf
-
refresh .terraform.lock.hcl with:
make providers-lock
Export input.json via qontract-cli and place it in the current project root dir.
qontract-cli --config $CONFIG external-resources --provisioner $PROVISIONER --provider $PROVIDER --identifier $IDENTIFIER get-input > input.jsonGet credentials
qontract-cli --config $CONFIG external-resources --provisioner $PROVISIONER --provider $PROVIDER --identifier $IDENTIFIER get-credentials > credentialsOptional config .env:
cp .env.example .envPopulate .env values with absolute path
Export to current shell
export $(cat .env | xargs)Generate terraform config.
generate-tf-configEnsure AWS credentials set in current shell, then use terraform to verify.
cd module
terraform init
terraform plan -out=plan
terraform show -json plan > plan.jsonTest hooks
hooks/post_plan.pyBuild image first
make buildStart container
docker run --rm -ti \
--entrypoint /bin/bash \
-v $PWD/input.json:/inputs/input.json:Z \
-v $PWD/credentials:/credentials:Z \
-e AWS_SHARED_CREDENTIALS_FILE=/credentials \
-e WORK=/tmp/work \
er-aws-rds:prodRun the whole process
./entrypoint.sh