Skip to content

Commit 7961250

Browse files
json to hcl
1 parent 7759d01 commit 7961250

File tree

1 file changed

+9
-9
lines changed
  • tutorials/manage-instances-with-terraform-and-functions

1 file changed

+9
-9
lines changed

tutorials/manage-instances-with-terraform-and-functions/index.mdx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ This tutorial will simulate a project with a production environment running all
5757
-- variables.tf
5858
```
5959
4. Edit the `backend.tf` file to enable remote configuration backup:
60-
```json
60+
```hcl
6161
terraform {
6262
backend "s3" {
6363
bucket = "XXXXXXXXX"
@@ -78,7 +78,7 @@ This tutorial will simulate a project with a production environment running all
7878
*/
7979
```
8080
5. Edit the `provider.tf` file and add Scaleway as a provider:
81-
```json
81+
```hcl
8282
terraform {
8383
required_providers {
8484
scaleway = {
@@ -91,7 +91,7 @@ This tutorial will simulate a project with a production environment running all
9191
```
9292

9393
6. Specify the following variables in the `variables.tf` file:
94-
```json
94+
```hcl
9595
variable "zone" {
9696
type = string
9797
}
@@ -115,7 +115,7 @@ This tutorial will simulate a project with a production environment running all
115115
}
116116
```
117117
7. Add the variable values to `terraform.tfvars`:
118-
```bash
118+
```hcl
119119
zone = "fr-par-1"
120120
region = "fr-par"
121121
env = "dev"
@@ -170,7 +170,7 @@ def handle(event, context):
170170
## Configuring your infrastructure
171171

172172
1. Edit the file `main.tf` to add a production Instance using a GP1-S named "Prod":
173-
```json
173+
```hcl
174174
## Configuring Producion environment
175175
resource "scaleway_instance_ip" "public_ip-prod" {
176176
project_id = var.project_id
@@ -193,7 +193,7 @@ def handle(event, context):
193193
}
194194
```
195195
2. Add a development Instance using a DEV1-L named "Dev":
196-
```json
196+
```hcl
197197
## Configuring Development environment that will be automatically turn off on week-ends and turn on monday mornings
198198
resource "scaleway_instance_ip" "public_ip-dev" {
199199
project_id = var.project_id
@@ -215,7 +215,7 @@ def handle(event, context):
215215
}
216216
```
217217
3. Write a function that will run the code you have just written:
218-
```json
218+
```hcl
219219
# Creating function code archive that will then be updated
220220
data "archive_file" "source_zip" {
221221
type = "zip"
@@ -247,7 +247,7 @@ def handle(event, context):
247247
}
248248
```
249249
4. Add a cronjob attached to the function to turn your function off every Friday evening:
250-
```json
250+
```hcl
251251
# Adding a first cron to turn off the Instance every friday evening (11:30 pm)
252252
resource "scaleway_function_cron" "turn-off" {
253253
function_id = scaleway_function.main.id
@@ -261,7 +261,7 @@ def handle(event, context):
261261
}
262262
```
263263
5. Create a cronjob attached to the function to turn your function on every Monday morning:
264-
```json
264+
```hcl
265265
# Adding a second cron to turn on the Instance every monday morning (7:00 am)
266266
resource "scaleway_function_cron" "turn-on" {
267267
function_id = scaleway_function.main.id

0 commit comments

Comments
 (0)