Skip to content

Commit

Permalink
fix: Update workflow_basic.tf.erb (hashicorp#8369) (hashicorp#15214)
Browse files Browse the repository at this point in the history
Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
modular-magician authored Jul 18, 2023
1 parent c02b6dc commit 1d483ff
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 18 deletions.
5 changes: 5 additions & 0 deletions .changelog/8369.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
```release-note:none

docs: Update the example for `google_workflows_workflow`

```
19 changes: 10 additions & 9 deletions google/resource_workflows_workflow_generated_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,31 +62,32 @@ resource "google_workflows_workflow" "example" {
description = "Magic"
service_account = google_service_account.test_account.id
source_contents = <<-EOF
# This is a sample workflow, feel free to replace it with your source code
# This is a sample workflow. You can replace it with your source code.
#
# This workflow does the following:
# - reads current time and date information from an external API and stores
# the response in CurrentDateTime variable
# the response in currentTime variable
# - retrieves a list of Wikipedia articles related to the day of the week
# from CurrentDateTime
# from currentTime
# - returns the list of articles as an output of the workflow
# FYI, In terraform you need to escape the $$ or it will cause errors.
#
# Note: In Terraform you need to escape the $$ or it will cause errors.
- getCurrentTime:
call: http.get
args:
url: https://us-central1-workflowsample.cloudfunctions.net/datetime
result: CurrentDateTime
url: https://timeapi.io/api/Time/current/zone?timeZone=Europe/Amsterdam
result: currentTime
- readWikipedia:
call: http.get
args:
url: https://en.wikipedia.org/w/api.php
query:
action: opensearch
search: $${CurrentDateTime.body.dayOfTheWeek}
result: WikiResult
search: $${currentTime.body.dayOfWeek}
result: wikiResult
- returnOutput:
return: $${WikiResult.body[1]}
return: $${wikiResult.body[1]}
EOF
}
`, context)
Expand Down
19 changes: 10 additions & 9 deletions website/docs/r/workflows_workflow.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -48,31 +48,32 @@ resource "google_workflows_workflow" "example" {
description = "Magic"
service_account = google_service_account.test_account.id
source_contents = <<-EOF
# This is a sample workflow, feel free to replace it with your source code
# This is a sample workflow. You can replace it with your source code.
#
# This workflow does the following:
# - reads current time and date information from an external API and stores
# the response in CurrentDateTime variable
# the response in currentTime variable
# - retrieves a list of Wikipedia articles related to the day of the week
# from CurrentDateTime
# from currentTime
# - returns the list of articles as an output of the workflow
# FYI, In terraform you need to escape the $$ or it will cause errors.
#
# Note: In Terraform you need to escape the $$ or it will cause errors.
- getCurrentTime:
call: http.get
args:
url: https://us-central1-workflowsample.cloudfunctions.net/datetime
result: CurrentDateTime
url: https://timeapi.io/api/Time/current/zone?timeZone=Europe/Amsterdam
result: currentTime
- readWikipedia:
call: http.get
args:
url: https://en.wikipedia.org/w/api.php
query:
action: opensearch
search: $${CurrentDateTime.body.dayOfTheWeek}
result: WikiResult
search: $${currentTime.body.dayOfWeek}
result: wikiResult
- returnOutput:
return: $${WikiResult.body[1]}
return: $${wikiResult.body[1]}
EOF
}
```
Expand Down

0 comments on commit 1d483ff

Please sign in to comment.