@@ -113,8 +113,8 @@ Your output should be similar to the one below:
113
113
114
114
Run the following command in terminal:
115
115
``` shell
116
- terrahub component -t google_storage_bucket -n demo_storage_bucket \
117
- && terrahub component -t google_cloudfunctions_function -n demo_function -o ../demo_storage_bucket
116
+ terrahub component -t google_storage_bucket -n google_storage \
117
+ && terrahub component -t google_cloudfunctions_function -n google_function -o ../google_storage
118
118
```
119
119
120
120
Your output should be similar to the one below:
@@ -141,11 +141,11 @@ Your output should be similar to the one below:
141
141
142
142
Run the following command in terminal:
143
143
``` shell
144
- terrahub configure -i demo_storage_bucket -c component.template.terraform.backend.local.path=' /tmp/.terrahub/local_backend/demo_storage_bucket /terraform.tfstate'
145
- terrahub configure -i demo_storage_bucket -c component.template.resource.google_storage_bucket.demo_storage_bucket .name=' demo_storage_bucket_ ${local.project["code"]}'
146
- terrahub configure -i demo_storage_bucket -c component.template.resource.google_storage_bucket.demo_storage_bucket .location=' US'
147
- terrahub configure -i demo_storage_bucket -c component.template.resource.google_storage_bucket.demo_storage_bucket .project=' ${local.google_project_id}'
148
- terrahub configure -i demo_storage_bucket -c component.template.variable -D -y
144
+ terrahub configure -i google_storage -c component.template.terraform.backend.local.path=' /tmp/.terrahub/local_backend/google_storage /terraform.tfstate'
145
+ terrahub configure -i google_storage -c component.template.resource.google_storage_bucket.google_storage .name=' demo_terraform_automation_ ${local.project["code"]}'
146
+ terrahub configure -i google_storage -c component.template.resource.google_storage_bucket.google_storage .location=' US'
147
+ terrahub configure -i google_storage -c component.template.resource.google_storage_bucket.google_storage .project=' ${local.google_project_id}'
148
+ terrahub configure -i google_storage -c component.template.variable -D -y
149
149
```
150
150
151
151
Your output should be similar to the one below:
@@ -157,41 +157,41 @@ Your output should be similar to the one below:
157
157
158
158
Run the following command in terminal:
159
159
``` shell
160
- terrahub configure -i demo_function -c component.template.terraform.backend.local.path=' /tmp/.terrahub/local_backend/demo_function /terraform.tfstate'
161
- terrahub configure -i demo_function -c component.template.data.terraform_remote_state.storage.backend=' local'
162
- terrahub configure -i demo_function -c component.template.data.terraform_remote_state.storage.config.path=' /tmp/.terrahub/local_backend/demo_storage_bucket /terraform.tfstate'
163
- terrahub configure -i demo_function -c component.template.resource.google_storage_bucket_object.demo_object .name=' demo.zip'
164
- terrahub configure -i demo_function -c component.template.resource.google_storage_bucket_object.demo_object .bucket=' ${data.terraform_remote_state.storage.thub_id}'
165
- terrahub configure -i demo_function -c component.template.resource.google_storage_bucket_object.demo_object .source=' ./demo.zip'
166
- terrahub configure -i demo_function -c component.template.resource.google_cloudfunctions_function.demo_function .depends_on[0]=' google_storage_bucket_object.demo_object '
167
- terrahub configure -i demo_function -c component.template.resource.google_cloudfunctions_function.demo_function .name=' demofunction${local.project["code"]}'
168
- terrahub configure -i demo_function -c component.template.resource.google_cloudfunctions_function.demo_function .region=' us-central1'
169
- terrahub configure -i demo_function -c component.template.resource.google_cloudfunctions_function.demo_function .runtime=' nodejs8'
170
- terrahub configure -i demo_function -c component.template.resource.google_cloudfunctions_function.demo_function .description=' My demo function'
171
- terrahub configure -i demo_function -c component.template.resource.google_cloudfunctions_function.demo_function .available_memory_mb=128
172
- terrahub configure -i demo_function -c component.template.resource.google_cloudfunctions_function.demo_function .source_archive_bucket=' ${data.terraform_remote_state.storage.thub_id}'
173
- terrahub configure -i demo_function -c component.template.resource.google_cloudfunctions_function.demo_function .source_archive_object=' ${google_storage_bucket_object.demo_object .name}'
174
- terrahub configure -i demo_function -c component.template.resource.google_cloudfunctions_function.demo_function .trigger_http=true
175
- terrahub configure -i demo_function -c component.template.resource.google_cloudfunctions_function.demo_function .timeout=60
176
- terrahub configure -i demo_function -c component.template.resource.google_cloudfunctions_function.demo_function .entry_point=' helloGET'
177
- terrahub configure -i demo_function -c component.template.variable -D -y
178
- terrahub configure -i demo_function -c component.template.output -D -y
179
- terrahub configure -i demo_function -c component.template.output.id.value=' ${google_cloudfunctions_function.demo_function .id}'
180
- terrahub configure -i demo_function -c component.template.output.trigger_url.value=' ${google_cloudfunctions_function.demo_function .https_trigger_url}'
181
- terrahub configure -i demo_function -c build.env.variables.THUB_FUNCTION_ZIP=' demo.zip'
182
- terrahub configure -i demo_function -c build.env.variables.THUB_BUILD_PATH=' ..'
183
- terrahub configure -i demo_function -c build.env.variables.THUB_FUNCTION_TXT=' demo.txt'
184
- terrahub configure -i demo_function -c build.env.variables.THUB_BUILD_OK=' true'
185
- terrahub configure -i demo_function -c build.phases.pre_build.commands[0]=' echo "BUILD: Running pre_build step"'
186
- terrahub configure -i demo_function -c build.phases.pre_build.commands[1]=' if [ ! -e "$THUB_FUNCTION_TXT" ]; then touch "$THUB_FUNCTION_TXT"; fi'
187
- terrahub configure -i demo_function -c build.phases.pre_build.finally[0]=' echo "BUILD: pre_build step successful"'
188
- terrahub configure -i demo_function -c build.phases.build.commands[0]=' echo "BUILD: Running build step"'
189
- terrahub configure -i demo_function -c build.phases.build.commands[1]=' if [ "$(head -n 1 "$THUB_FUNCTION_TXT")" != "$(stat -c %y "${THUB_BUILD_PATH}/index .js")" ]; then zip -j ${THUB_FUNCTION_ZIP} ${THUB_BUILD_PATH}/index .js; fi'
190
- terrahub configure -i demo_function -c build.phases.build.commands[2]=' if [ "$(head -n 1 "$THUB_FUNCTION_TXT")" != "$(stat -c %y "${THUB_BUILD_PATH}/index .js")" ]; then terrahub configure -i demo_function -c component.template.resource.google_storage_bucket_object.demo_object .name=$(date +%s).zip; fi'
191
- terrahub configure -i demo_function -c build.phases.build.finally[0]=' echo "BUILD: build step successful"'
192
- terrahub configure -i demo_function -c build.phases.post_build.commands[0]=' echo "BUILD: Running post_build step"'
193
- terrahub configure -i demo_function -c build.phases.post_build.commands[1]=' echo $(stat -c %y "${THUB_BUILD_PATH}/index .js") > "$THUB_FUNCTION_TXT"'
194
- terrahub configure -i demo_function -c build.phases.post_build.finally[0]=' echo "BUILD: post_build step successful"'
160
+ terrahub configure -i google_function -c component.template.terraform.backend.local.path=' /tmp/.terrahub/local_backend/google_function /terraform.tfstate'
161
+ terrahub configure -i google_function -c component.template.data.terraform_remote_state.storage.backend=' local'
162
+ terrahub configure -i google_function -c component.template.data.terraform_remote_state.storage.config.path=' /tmp/.terrahub/local_backend/google_storage /terraform.tfstate'
163
+ terrahub configure -i google_function -c component.template.resource.google_storage_bucket_object.google_storage_object .name=' demo.zip'
164
+ terrahub configure -i google_function -c component.template.resource.google_storage_bucket_object.google_storage_object .bucket=' ${data.terraform_remote_state.storage.thub_id}'
165
+ terrahub configure -i google_function -c component.template.resource.google_storage_bucket_object.google_storage_object .source=' ./demo.zip'
166
+ terrahub configure -i google_function -c component.template.resource.google_cloudfunctions_function.google_function .depends_on[0]=' google_storage_bucket_object.google_storage_object '
167
+ terrahub configure -i google_function -c component.template.resource.google_cloudfunctions_function.google_function .name=' demofunction${local.project["code"]}'
168
+ terrahub configure -i google_function -c component.template.resource.google_cloudfunctions_function.google_function .region=' us-central1'
169
+ terrahub configure -i google_function -c component.template.resource.google_cloudfunctions_function.google_function .runtime=' nodejs8'
170
+ terrahub configure -i google_function -c component.template.resource.google_cloudfunctions_function.google_function .description=' My demo function'
171
+ terrahub configure -i google_function -c component.template.resource.google_cloudfunctions_function.google_function .available_memory_mb=128
172
+ terrahub configure -i google_function -c component.template.resource.google_cloudfunctions_function.google_function .source_archive_bucket=' ${data.terraform_remote_state.storage.thub_id}'
173
+ terrahub configure -i google_function -c component.template.resource.google_cloudfunctions_function.google_function .source_archive_object=' ${google_storage_bucket_object.google_storage_object .name}'
174
+ terrahub configure -i google_function -c component.template.resource.google_cloudfunctions_function.google_function .trigger_http=true
175
+ terrahub configure -i google_function -c component.template.resource.google_cloudfunctions_function.google_function .timeout=60
176
+ terrahub configure -i google_function -c component.template.resource.google_cloudfunctions_function.google_function .entry_point=' helloGET'
177
+ terrahub configure -i google_function -c component.template.variable -D -y
178
+ terrahub configure -i google_function -c component.template.output -D -y
179
+ terrahub configure -i google_function -c component.template.output.id.value=' ${google_cloudfunctions_function.google_function .id}'
180
+ terrahub configure -i google_function -c component.template.output.trigger_url.value=' ${google_cloudfunctions_function.google_function .https_trigger_url}'
181
+ terrahub configure -i google_function -c build.env.variables.THUB_FUNCTION_ZIP=' demo.zip'
182
+ terrahub configure -i google_function -c build.env.variables.THUB_BUILD_PATH=' ..'
183
+ terrahub configure -i google_function -c build.env.variables.THUB_FUNCTION_TXT=' demo.txt'
184
+ terrahub configure -i google_function -c build.env.variables.THUB_BUILD_OK=' true'
185
+ terrahub configure -i google_function -c build.phases.pre_build.commands[0]=' echo "BUILD: Running pre_build step"'
186
+ terrahub configure -i google_function -c build.phases.pre_build.commands[1]=' if [ ! -e "$THUB_FUNCTION_TXT" ]; then touch "$THUB_FUNCTION_TXT"; fi'
187
+ terrahub configure -i google_function -c build.phases.pre_build.finally[0]=' echo "BUILD: pre_build step successful"'
188
+ terrahub configure -i google_function -c build.phases.build.commands[0]=' echo "BUILD: Running build step"'
189
+ terrahub configure -i google_function -c build.phases.build.commands[1]=' if [ "$(head -n 1 "$THUB_FUNCTION_TXT")" != "$(stat -c %y "${THUB_BUILD_PATH}/demo .js")" ]; then zip -j ${THUB_FUNCTION_ZIP} ${THUB_BUILD_PATH}/demo .js; fi'
190
+ terrahub configure -i google_function -c build.phases.build.commands[2]=' if [ "$(head -n 1 "$THUB_FUNCTION_TXT")" != "$(stat -c %y "${THUB_BUILD_PATH}/demo .js")" ]; then terrahub configure -i google_function -c component.template.resource.google_storage_bucket_object.google_storage_object .name=$(date +%s).zip; fi'
191
+ terrahub configure -i google_function -c build.phases.build.finally[0]=' echo "BUILD: build step successful"'
192
+ terrahub configure -i google_function -c build.phases.post_build.commands[0]=' echo "BUILD: Running post_build step"'
193
+ terrahub configure -i google_function -c build.phases.post_build.commands[1]=' echo $(stat -c %y "${THUB_BUILD_PATH}/demo .js") > "$THUB_FUNCTION_TXT"'
194
+ terrahub configure -i google_function -c build.phases.post_build.finally[0]=' echo "BUILD: post_build step successful"'
195
195
```
196
196
197
197
Your output should be similar to the one below:
@@ -209,16 +209,16 @@ terrahub graph
209
209
Your output should be similar to the one below:
210
210
```
211
211
Project: demo-terraform-automation-google
212
- └─ demo_storage_bucket_7b3c5d2c [path: ./demo_storage_bucket_7b3c5d2c ]
213
- └─ demo_function_7b3c5d2c [path: ./demo_function_7b3c5d2c ]
212
+ └─ google_storage [path: ./google_storage ]
213
+ └─ google_function [path: ./google_function ]
214
214
```
215
215
216
216
217
217
## Run TerraHub Automation
218
218
219
219
Run the following command in terminal:
220
220
``` shell
221
- terrahub build -i demo_function
221
+ terrahub build -i google_function
222
222
terrahub run -a -y
223
223
```
224
224
0 commit comments