diff --git a/tools/Dockerfile b/tools/Dockerfile index 1c1e664b..914a23af 100644 --- a/tools/Dockerfile +++ b/tools/Dockerfile @@ -1,7 +1,7 @@ FROM python:slim RUN apt update && \ - apt install -y curl libpq-dev less jq tar unzip + apt install -y curl libpq-dev less jq tar unzip ssh # Adding GitHub public SSH key to known hosts diff --git a/tools/README.md b/tools/README.md index 7eb9367e..ef1f7ae3 100644 --- a/tools/README.md +++ b/tools/README.md @@ -1,6 +1,14 @@ -Run docker file: +# Scaffolding guide +Change directory to where you have checked out. + +```bash cd /dfds/terraform-aws-rds/tools +``` + +## Build container image and create required directory + +Build the container image: ```bash docker build -t scaffold . @@ -12,8 +20,11 @@ Create output folder: mkdir auto-generated ``` -Run docker: +## Run container + +Run newly created image: ```bash -docker run -v /terraform-aws-rds/:/input -v /terraform-aws-rds/tools/auto-generated/:/output scaffold:latest +cd ../.. +docker run -v $PWD/terraform-aws-rds/:/input -v $PWD/terraform-aws-rds/tools/auto-generated/:/output scaffold:latest ``` diff --git a/tools/scaffolding/scripts/generate_tf_module.py b/tools/scaffolding/scripts/generate_tf_module.py index 56b428c9..d51613cb 100644 --- a/tools/scaffolding/scripts/generate_tf_module.py +++ b/tools/scaffolding/scripts/generate_tf_module.py @@ -31,7 +31,7 @@ output_list = [] OUTPUT_TEMPLATE = """output "$out_name" { description = "$output_description" - value = try(module.db_instance_example.$out_value, null) + value = try(module.db_instance.$out_value, null) }""" with open(work_folder, "r", encoding='UTF-8') as f: