@@ -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,12 +141,12 @@ 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_99999999 '
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 .force_destroy=' true'
148
- terrahub configure -i demo_storage_bucket -c component.template.resource.google_storage_bucket.demo_storage_bucket .project=' ${local.google_project_id}'
149
- 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=' google_storage_99999999 '
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 .force_destroy=' true'
148
+ terrahub configure -i google_storage -c component.template.resource.google_storage_bucket.google_storage .project=' ${local.google_project_id}'
149
+ terrahub configure -i google_storage -c component.template.variable -D -y
150
150
```
151
151
152
152
Your output should be similar to the one below:
@@ -158,48 +158,48 @@ Your output should be similar to the one below:
158
158
159
159
Run the following command in terminal:
160
160
``` shell
161
- terrahub configure -i demo_function -c component.template.terraform.backend.local.path=' /tmp/.terrahub/local_backend/demo_function /terraform.tfstate'
162
- terrahub configure -i demo_function -c component.template.data.terraform_remote_state.storage.backend=' local'
163
- terrahub configure -i demo_function -c component.template.data.terraform_remote_state.storage.config.path=' /tmp/.terrahub/local_backend/demo_storage_bucket /terraform.tfstate'
164
- terrahub configure -i demo_function -c component.template.resource.google_storage_bucket_object.demo_object .name=' demo.zip'
165
- terrahub configure -i demo_function -c component.template.resource.google_storage_bucket_object.demo_object .bucket=' ${data.terraform_remote_state.storage.thub_id}'
166
- terrahub configure -i demo_function -c component.template.resource.google_storage_bucket_object.demo_object .source=' ./demo.zip'
167
- terrahub configure -i demo_function -c component.template.resource.google_cloudfunctions_function.demo_function .depends_on[0]=' google_storage_bucket_object.demo_object '
168
- terrahub configure -i demo_function -c component.template.resource.google_cloudfunctions_function.demo_function .name=' demofunction${local.project["code"]}'
169
- terrahub configure -i demo_function -c component.template.resource.google_cloudfunctions_function.demo_function .region=' us-central1'
170
- terrahub configure -i demo_function -c component.template.resource.google_cloudfunctions_function.demo_function .runtime=' nodejs8'
171
- terrahub configure -i demo_function -c component.template.resource.google_cloudfunctions_function.demo_function .description=' My demo function'
172
- terrahub configure -i demo_function -c component.template.resource.google_cloudfunctions_function.demo_function .available_memory_mb=128
173
- terrahub configure -i demo_function -c component.template.resource.google_cloudfunctions_function.demo_function .source_archive_bucket=' ${data.terraform_remote_state.storage.thub_id}'
174
- terrahub configure -i demo_function -c component.template.resource.google_cloudfunctions_function.demo_function .source_archive_object=' ${google_storage_bucket_object.demo_object .name}'
175
- terrahub configure -i demo_function -c component.template.resource.google_cloudfunctions_function.demo_function .trigger_http=true
176
- terrahub configure -i demo_function -c component.template.resource.google_cloudfunctions_function.demo_function .timeout=60
177
- terrahub configure -i demo_function -c component.template.resource.google_cloudfunctions_function.demo_function .entry_point=' helloGET'
178
- terrahub configure -i demo_function -c component.template.variable -D -y
179
- terrahub configure -i demo_function -c component.template.output -D -y
180
- terrahub configure -i demo_function -c component.template.output.id.value=' ${google_cloudfunctions_function.demo_function .id}'
181
- terrahub configure -i demo_function -c component.template.output.trigger_url.value=' ${google_cloudfunctions_function.demo_function .https_trigger_url}'
182
- terrahub configure -i demo_function -c build.env.variables.THUB_FUNCTION_ZIP=' demo.zip'
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.COMPONENT_NAME=' demo_function '
185
- terrahub configure -i demo_function -c build.env.variables.OBJECT_NAME=' demo_object '
186
- terrahub configure -i demo_function -c build.env.variables.THUB_BUILD_PATH=' ..'
187
- terrahub configure -i demo_function -c build.env.variables.THUB_BUILD_OK=' false'
188
- terrahub configure -i demo_function -c build.env.variables.THUB_BUCKET_PATH=' gs://demo_storage_bucket_99999999 '
189
- terrahub configure -i demo_function -c build.env.variables.THUB_BUCKET_KEY=' deploy/demo_function '
190
- terrahub configure -i demo_function -c build.phases.pre_build.commands[0]=' echo "BUILD: Running pre_build step"'
191
- terrahub configure -i demo_function -c build.phases.pre_build.commands[1]=' ./scripts/download.sh $THUB_FUNCTION_TXT $THUB_BUCKET_PATH/$THUB_BUCKET_KEY/$THUB_FUNCTION_TXT'
192
- terrahub configure -i demo_function -c build.phases.pre_build.commands[2]=' ./scripts/compare.sh $THUB_FUNCTION_TXT $THUB_BUILD_PATH/*.js'
193
- terrahub configure -i demo_function -c build.phases.pre_build.finally[0]=' echo "BUILD: pre_build step successful"'
194
- terrahub configure -i demo_function -c build.phases.build.commands[0]=' echo "BUILD: Running build step"'
195
- terrahub configure -i demo_function -c build.phases.build.commands[1]=' ./scripts/build.sh $COMPONENT_NAME $OBJECT_NAME $THUB_BUCKET_KEY/'
196
- terrahub configure -i demo_function -c build.phases.build.finally[0]=' echo "BUILD: build step successful"'
197
- terrahub configure -i demo_function -c build.phases.post_build.commands[0]=' echo "BUILD: Running post_build step"'
198
- terrahub configure -i demo_function -c build.phases.post_build.commands[1]=' ./scripts/shasum.sh $THUB_FUNCTION_TXT'
199
- terrahub configure -i demo_function -c build.phases.post_build.commands[2]=' ./scripts/zip.sh $THUB_FUNCTION_ZIP $THUB_BUILD_PATH/*.js'
200
- terrahub configure -i demo_function -c build.phases.post_build.commands[3]=' ./scripts/upload.sh $THUB_FUNCTION_TXT $THUB_BUCKET_PATH/$THUB_BUCKET_KEY/$THUB_FUNCTION_TXT'
201
- terrahub configure -i demo_function -c build.phases.post_build.commands[4]=' rm -f .terrahub_build.env $THUB_FUNCTION_TXT'
202
- terrahub configure -i demo_function -c build.phases.post_build.finally[0]=' echo "BUILD: post_build step successful"'
161
+ terrahub configure -i google_function -c component.template.terraform.backend.local.path=' /tmp/.terrahub/local_backend/google_function /terraform.tfstate'
162
+ terrahub configure -i google_function -c component.template.data.terraform_remote_state.storage.backend=' local'
163
+ terrahub configure -i google_function -c component.template.data.terraform_remote_state.storage.config.path=' /tmp/.terrahub/local_backend/google_storage /terraform.tfstate'
164
+ terrahub configure -i google_function -c component.template.resource.google_storage_bucket_object.google_storage_object .name=' demo.zip'
165
+ terrahub configure -i google_function -c component.template.resource.google_storage_bucket_object.google_storage_object .bucket=' ${data.terraform_remote_state.storage.thub_id}'
166
+ terrahub configure -i google_function -c component.template.resource.google_storage_bucket_object.google_storage_object .source=' ./demo.zip'
167
+ terrahub configure -i google_function -c component.template.resource.google_cloudfunctions_function.google_function .depends_on[0]=' google_storage_bucket_object.google_storage_object '
168
+ terrahub configure -i google_function -c component.template.resource.google_cloudfunctions_function.google_function .name=' demofunction${local.project["code"]}'
169
+ terrahub configure -i google_function -c component.template.resource.google_cloudfunctions_function.google_function .region=' us-central1'
170
+ terrahub configure -i google_function -c component.template.resource.google_cloudfunctions_function.google_function .runtime=' nodejs8'
171
+ terrahub configure -i google_function -c component.template.resource.google_cloudfunctions_function.google_function .description=' My demo function'
172
+ terrahub configure -i google_function -c component.template.resource.google_cloudfunctions_function.google_function .available_memory_mb=128
173
+ terrahub configure -i google_function -c component.template.resource.google_cloudfunctions_function.google_function .source_archive_bucket=' ${data.terraform_remote_state.storage.thub_id}'
174
+ 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}'
175
+ terrahub configure -i google_function -c component.template.resource.google_cloudfunctions_function.google_function .trigger_http=true
176
+ terrahub configure -i google_function -c component.template.resource.google_cloudfunctions_function.google_function .timeout=60
177
+ terrahub configure -i google_function -c component.template.resource.google_cloudfunctions_function.google_function .entry_point=' helloGET'
178
+ terrahub configure -i google_function -c component.template.variable -D -y
179
+ terrahub configure -i google_function -c component.template.output -D -y
180
+ terrahub configure -i google_function -c component.template.output.id.value=' ${google_cloudfunctions_function.google_function .id}'
181
+ terrahub configure -i google_function -c component.template.output.trigger_url.value=' ${google_cloudfunctions_function.google_function .https_trigger_url}'
182
+ terrahub configure -i google_function -c build.env.variables.THUB_FUNCTION_ZIP=' demo.zip'
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.COMPONENT_NAME=' google_function '
185
+ terrahub configure -i google_function -c build.env.variables.OBJECT_NAME=' google_storage_object '
186
+ terrahub configure -i google_function -c build.env.variables.THUB_BUILD_PATH=' ..'
187
+ terrahub configure -i google_function -c build.env.variables.THUB_BUILD_OK=' false'
188
+ terrahub configure -i google_function -c build.env.variables.THUB_BUCKET_PATH=' gs://google_storage_99999999 '
189
+ terrahub configure -i google_function -c build.env.variables.THUB_BUCKET_KEY=' deploy/google_function '
190
+ terrahub configure -i google_function -c build.phases.pre_build.commands[0]=' echo "BUILD: Running pre_build step"'
191
+ terrahub configure -i google_function -c build.phases.pre_build.commands[1]=' ./scripts/download.sh $THUB_FUNCTION_TXT $THUB_BUCKET_PATH/$THUB_BUCKET_KEY/$THUB_FUNCTION_TXT'
192
+ terrahub configure -i google_function -c build.phases.pre_build.commands[2]=' ./scripts/compare.sh $THUB_FUNCTION_TXT $THUB_BUILD_PATH/*.js'
193
+ terrahub configure -i google_function -c build.phases.pre_build.finally[0]=' echo "BUILD: pre_build step successful"'
194
+ terrahub configure -i google_function -c build.phases.build.commands[0]=' echo "BUILD: Running build step"'
195
+ terrahub configure -i google_function -c build.phases.build.commands[1]=' ./scripts/build.sh $COMPONENT_NAME $OBJECT_NAME $THUB_BUCKET_KEY/'
196
+ terrahub configure -i google_function -c build.phases.build.finally[0]=' echo "BUILD: build step successful"'
197
+ terrahub configure -i google_function -c build.phases.post_build.commands[0]=' echo "BUILD: Running post_build step"'
198
+ terrahub configure -i google_function -c build.phases.post_build.commands[1]=' ./scripts/shasum.sh $THUB_FUNCTION_TXT'
199
+ terrahub configure -i google_function -c build.phases.post_build.commands[2]=' ./scripts/zip.sh $THUB_FUNCTION_ZIP $THUB_BUILD_PATH/*.js'
200
+ terrahub configure -i google_function -c build.phases.post_build.commands[3]=' ./scripts/upload.sh $THUB_FUNCTION_TXT $THUB_BUCKET_PATH/$THUB_BUCKET_KEY/$THUB_FUNCTION_TXT'
201
+ terrahub configure -i google_function -c build.phases.post_build.commands[4]=' rm -f .terrahub_build.env $THUB_FUNCTION_TXT'
202
+ terrahub configure -i google_function -c build.phases.post_build.finally[0]=' echo "BUILD: post_build step successful"'
203
203
```
204
204
205
205
Your output should be similar to the one below:
@@ -217,17 +217,17 @@ terrahub graph
217
217
Your output should be similar to the one below:
218
218
```
219
219
Project: demo-terraform-automation-google
220
- └─ demo_storage_bucket_7b3c5d2c [path: ./demo_storage_bucket_7b3c5d2c ]
221
- └─ demo_function_7b3c5d2c [path: ./demo_function_7b3c5d2c ]
220
+ └─ google_storage_7b3c5d2c [path: ./google_storage_7b3c5d2c ]
221
+ └─ google_function_7b3c5d2c [path: ./google_function_7b3c5d2c ]
222
222
```
223
223
224
224
225
225
## Run TerraHub Automation
226
226
227
227
Run the following command in terminal:
228
228
``` shell
229
- terrahub run -a -y -i demo_storage_bucket
230
- terrahub build -i demo_function
229
+ terrahub run -a -y -i google_storage
230
+ terrahub build -i google_function
231
231
terrahub run -a -y
232
232
```
233
233
0 commit comments