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 dev
This will auto create a venv
, to activate in shell:
source .venv/bin/activate
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.json
Get credentials
qontract-cli --config $CONFIG external-resources --provisioner $PROVISIONER --provider $PROVIDER --identifier $IDENTIFIER get-credentials > credentials
Optional config .env
:
cp .env.example .env
Populate .env
values with absolute path
Export to current shell
export $(cat .env | xargs)
Generate terraform config.
generate-tf-config
Ensure AWS credentials set in current shell, then use terraform
to verify.
cd module
terraform init
terraform plan -out=plan
terraform show -json plan > plan.json
Test hooks
hooks/post_plan.py
Build image first
make build
Start 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:prod
Run the whole process
./entrypoint.sh