Skip to content

app-sre/er-aws-elasticache

Repository files navigation

External Resources Elasticache Module

Ruff uv

External Resources module to provision and manage Elasticache clusters in AWS with app-interface.

Tech stack

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

Development

Prepare your local development environment:

make dev

See the Makefile for more details.

Update Terraform modules

To update the Terraform modules used in this project, bump the version in versions.tf and update the Terraform lockfile via:

make providers-lock

Development workflow

  1. Make changes to the code.
  2. Build the image with make build.
  3. Run the image manually with a proper input file and credentials. See the Debugging section below.
  4. Please don't forget to remove (-e ACTION=Destroy) any development AWS resources you create, as they will incur costs.

Debugging

To debug and run the module locally, run the following commands:

# setup the environment
$ export VERSION=$(grep konflux.additional-tags Dockerfile | cut -f2 -d\")
$ export IMAGE=quay.io/redhat-services-prod/app-sre-tenant/er-aws-elasticache-main/er-aws-elasticache-main:$VERSION

# Get the input file from app-interface
qontract-cli --config=<CONFIG_TOML> external-resources --provisioner <AWS_ACCOUNT_NAME> --provider elasticache --identifier <IDENTIFIER> get-input > tmp/input.json

# Get the AWS credentials
$ qontract-cli --config=<CONFIG_TOML> external-resources --provisioner <AWS_ACCOUNT_NAME> --provider elasticache --identifier <IDENTIFIER> get-credentials > tmp/credentials

# Run the stack
$ docker run --rm -it \
    --mount type=bind,source=$PWD/tmp/input.json,target=/inputs/input.json \
    --mount type=bind,source=$PWD/tmp/credentials,target=/credentials \
    --mount type=bind,source=$PWD/tmp/work,target=/work \
    -e DRY_RUN=True \
    -e ACTION=Apply \
    "$IMAGE"

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •