Skip to content

app-sre/er-aws-rds

Repository files navigation

External Resources RDS Module

External Resources module to provision and manage RDS instances in AWS with App-Interface.

Tech stack

  • Terraform
  • AWS provider
  • Random provider
  • Python 3.12
  • Pydantic

Development

Ensure uv is installed.

Prepare local development environment:

make dev

This will auto create a venv, to activate in shell:

source .venv/bin/activate

Debugging

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)

On Host

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

In Container

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages