Skip to content

Commit

Permalink
Merge pull request #76 from dfds/bugfix/cloudplatform-2480
Browse files Browse the repository at this point in the history
Fix bug with outputs in scaffolding and improve scaffolding documentation
  • Loading branch information
avnes authored Jan 18, 2024
2 parents aa42e3a + 5b68dd3 commit e4224a6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tools/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
17 changes: 14 additions & 3 deletions tools/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
Run docker file:
# Scaffolding guide

Change directory to where you have <https://github.com/dfds/terraform-aws-rds> 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 .
Expand All @@ -12,8 +20,11 @@ Create output folder:
mkdir auto-generated
```

Run docker:
## Run container

Run newly created image:

```bash
docker run -v <absolute-path>/terraform-aws-rds/:/input -v <absolute-path>/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
```
2 changes: 1 addition & 1 deletion tools/scaffolding/scripts/generate_tf_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit e4224a6

Please sign in to comment.