Skip to content

Commit fb5bf5c

Browse files
rootroot
authored andcommitted
test_static_website
1 parent 1c08e40 commit fb5bf5c

File tree

2 files changed

+52
-1
lines changed

2 files changed

+52
-1
lines changed

README.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ Your output should be similar to the one below:
115115
Run the following command in terminal:
116116
```shell
117117
terrahub component -t google_storage_bucket -n google_storage \
118-
&& terrahub component -t google_cloudfunctions_function -n google_function -o ../google_storage
118+
&& terrahub component -t google_cloudfunctions_function -n google_function -o ../google_storage \
119+
&& terrahub component -t google_storage_bucket -n google_static_website
119120
```
120121

121122
Your output should be similar to the one below:
@@ -208,6 +209,26 @@ Your output should be similar to the one below:
208209
✅ Done
209210
```
210211

212+
## Customize TerraHub Component for Google Cloud Static WebSite
213+
214+
Run the following command in terminal:
215+
```shell
216+
git clone https://github.com/TerraHubCorp/www.git
217+
terrahub configure -i google_static_website -c component.template.terraform.backend.local.path='/tmp/.terrahub/local_backend/google_static_website/terraform.tfstate'
218+
terrahub configure -i google_static_website -c component.template.resource.google_storage_bucket.google_static_website.name="${GOOGLE_STORAGE_BUCKET}_website"
219+
terrahub configure -i google_static_website -c component.template.resource.google_storage_bucket.google_static_website.location='US'
220+
terrahub configure -i google_static_website -c component.template.resource.google_storage_bucket.google_static_website.force_destroy='true'
221+
terrahub configure -i google_static_website -c component.template.resource.google_storage_bucket.google_static_website.project='${local.google_project_id}'
222+
terrahub configure -i google_static_website -c component.template.resource.google_storage_bucket.google_static_website.website.main_page_suffix='index.html'
223+
terrahub configure -i google_static_website -c component.template.resource.google_storage_bucket.google_static_website.website.not_found_page='/404.html'
224+
terrahub configure -i google_static_website -c component.template.variable -D -y
225+
```
226+
227+
Your output should be similar to the one below:
228+
```
229+
✅ Done
230+
```
231+
211232
## Visualize TerraHub Components
212233

213234
Run the following command in terminal:

google_static_website/.terrahub.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
component:
2+
name: google_static_website
3+
mapping:
4+
- .
5+
template:
6+
resource:
7+
google_storage_bucket:
8+
google_static_website:
9+
name: terrahub_bucket_123456_website
10+
location: US
11+
force_destroy: true
12+
project: '${local.google_project_id}'
13+
website:
14+
main_page_suffix: index.html
15+
not_found_page: /404.html
16+
output:
17+
id:
18+
value: '${google_storage_bucket.google_static_website.id}'
19+
thub_id:
20+
value: '${google_storage_bucket.google_static_website.id}'
21+
self_link:
22+
value: '${google_storage_bucket.google_static_website.self_link}'
23+
project:
24+
value: '${google_storage_bucket.google_static_website.project}'
25+
url:
26+
value: '${google_storage_bucket.google_static_website.url}'
27+
terraform:
28+
backend:
29+
local:
30+
path: /tmp/.terrahub/local_backend/google_static_website/terraform.tfstate

0 commit comments

Comments
 (0)