File tree 5 files changed +14
-36
lines changed
5 files changed +14
-36
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,6 @@ module/.terraform/
3
3
module /.terraform *
4
4
module /* .tftest.hcl
5
5
module /backend.tf
6
- module /tfvars.json
6
+ module /terraform. tfvars.json
7
7
module /plan
8
8
module /plan.json
Original file line number Diff line number Diff line change 1
- AWS_SHARED_CREDENTIALS_FILE =
2
- ER_INPUT_FILE =
1
+ AWS_SHARED_CREDENTIALS_FILE = credentials
2
+ INPUT_FILE = input.json
3
+ PLAN_FILE_JSON = module/plan.json
Original file line number Diff line number Diff line change @@ -166,7 +166,6 @@ cython_debug/
166
166
# MacOS
167
167
.DS_Store
168
168
169
- cdktf.out
170
169
input.json
171
170
credentials
172
171
tmp /
176
175
module /.terraform /
177
176
module /.terraform. *
178
177
module /backend.tf
179
- module /tfvars.json
178
+ module /terraform. tfvars.json
180
179
module /plan
181
180
module /plan.json
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ COPY tests ./tests
44
44
RUN make test
45
45
46
46
FROM base AS prod
47
- # get cdktf providers
47
+ # get terraform providers
48
48
COPY --from=builder ${TF_PLUGIN_CACHE_DIR} ${TF_PLUGIN_CACHE_DIR}
49
49
# get our app with the dependencies
50
50
COPY --from=builder ${APP} ${APP}
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ External Resources module to provision and manage RDS instances in AWS with App-
4
4
5
5
## Tech stack
6
6
7
- * Terraform CDKTF
7
+ * Terraform
8
8
* AWS provider
9
9
* Random provider
10
10
* Python 3.12
@@ -56,32 +56,25 @@ export $(cat .env | xargs)
56
56
57
57
### On Host
58
58
59
- Ensure ` cdktf ` is installed
60
-
61
- ``` shell
62
- npm install --global
[email protected]
63
- ```
64
-
65
59
Generate terraform config.
66
60
67
61
``` shell
68
- ER_INPUT_FILE= " $PWD " /input.json cdktf synth
62
+ generate-tf-config
69
63
```
70
64
71
65
Ensure AWS credentials set in current shell, then use ` terraform ` to verify.
72
66
73
67
``` shell
74
- cd cdktf.out/stakcs/CDKTF
68
+ cd module
75
69
terraform init
76
70
terraform plan -out=plan
77
71
terraform show -json plan > plan.json
78
72
```
79
73
80
- Test validation logic
74
+ Test hooks
81
75
82
76
``` shell
83
- cd ../../..
84
- ER_INPUT_FILE=" $PWD " /input.json python hooks/validate_plan.py cdktf.out/stacks/CDKTF/plan.json
77
+ hooks/post_plan.py
85
78
```
86
79
87
80
### In Container
@@ -100,27 +93,12 @@ docker run --rm -ti \
100
93
-v $PWD /input.json:/inputs/input.json:Z \
101
94
-v $PWD /credentials:/credentials:Z \
102
95
-e AWS_SHARED_CREDENTIALS_FILE=/credentials \
96
+ -e WORK=/tmp/work \
103
97
er-aws-rds:prod
104
98
```
105
99
106
- Generate terraform config.
107
-
108
- ``` shell
109
- cdktf synth
110
- ```
111
-
112
- Use ` terraform ` to verify.
113
-
114
- ``` shell
115
- cd cdktf.out/stakcs/CDKTF
116
- terraform init
117
- terraform plan -out=plan
118
- terraform show -json plan > plan.json
119
- ```
120
-
121
- Test validation logic
100
+ Run the whole process
122
101
123
102
``` shell
124
- cd ../../..
125
- python hooks/validate_plan.py cdktf.out/stacks/CDKTF/plan.json
103
+ ./entrypoint.sh
126
104
```
You can’t perform that action at this time.
0 commit comments