-
Notifications
You must be signed in to change notification settings - Fork 19
feat: Adding Submodule for Standalone Workflow for ADC #54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
aecc2c0
0a5caf0
3970cfc
4dfc1ba
ee20c52
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| <!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK --> | ||
| ## Inputs | ||
|
|
||
| | Name | Description | Type | Default | Required | | ||
| |------|-------------|------|---------|:--------:| | ||
| | project\_id | The ID of the project in which to provision resources. | `string` | n/a | yes | | ||
|
|
||
| ## Outputs | ||
|
|
||
| | Name | Description | | ||
| |------|-------------| | ||
| | workflow\_id | The id of the workflow. | | ||
| | workflow\_region | The id of the workflow. | | ||
| | workflow\_revision\_id | The revision\_id of the workflow. | | ||
|
|
||
| <!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK --> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| /** | ||
| * Copyright 2025 Google LLC | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| module "service_account" { | ||
| source = "terraform-google-modules/service-accounts/google" | ||
| version = "~> 4.1.1" | ||
| project_id = var.project_id | ||
| prefix = "simple-workflow" | ||
| names = ["simple"] | ||
| project_roles = ["${var.project_id}=>roles/workflows.invoker"] | ||
| } | ||
|
|
||
| module "standalone_workflow" { | ||
| source = "../../modules/simple_workflow" | ||
|
|
||
| project_id = var.project_id | ||
| workflow_name = "standalone-workflow" | ||
| region = "us-central1" | ||
| service_account_email = module.service_account.email | ||
| service_account_create = true | ||
|
||
| workflow_source = <<-EOF | ||
| # This is a sample workflow that simply reads wikipedia | ||
| # Note that $$ is needed for Terraform | ||
|
|
||
| main: | ||
| steps: | ||
| - readWikipedia: | ||
| call: http.get | ||
| args: | ||
| url: https://en.wikipedia.org/w/api.php | ||
| query: | ||
| action: opensearch | ||
| search: GoogleCloudPlatform | ||
| result: wikiResult | ||
| - returnOutput: | ||
| return: $${wikiResult.body[1]} | ||
| EOF | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| /** | ||
| * Copyright 2025 Google LLC | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| output "workflow_id" { | ||
| description = "The id of the workflow." | ||
| value = module.standalone_workflow.workflow_id | ||
| } | ||
|
|
||
| output "workflow_region" { | ||
| description = "The id of the workflow." | ||
| value = module.standalone_workflow.workflow_region | ||
| } | ||
|
|
||
| output "workflow_revision_id" { | ||
| description = "The revision_id of the workflow." | ||
| value = module.standalone_workflow.workflow_revision_id | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| /** | ||
| * Copyright 2025 Google LLC | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| variable "project_id" { | ||
| description = "The ID of the project in which to provision resources." | ||
| type = string | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| /** | ||
| * Copyright 2025 Google LLC | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| terraform { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can omit this for examples |
||
| required_providers { | ||
| google = { | ||
| source = "hashicorp/google" | ||
| version = "~> 4.0" | ||
| } | ||
| } | ||
| required_version = ">= 0.13" | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| # Copyright 2025 Google LLC | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| apiVersion: blueprints.cloud.google.com/v1alpha1 | ||
| kind: BlueprintMetadata | ||
| metadata: | ||
| name: terraform-google-cloud-workflow-display | ||
| annotations: | ||
| config.kubernetes.io/local-config: "true" | ||
| spec: | ||
| info: | ||
| title: terraform-google-cloud-workflow | ||
| source: | ||
| repo: https://github.com/GoogleCloudPlatform/terraform-google-cloud-workflows.git | ||
| sourceType: git | ||
| ui: | ||
| input: | ||
| variables: | ||
| project_id: | ||
| name: project_id | ||
| title: Project Id | ||
| region: | ||
| name: region | ||
| title: Region | ||
| service_account_create: | ||
| name: service_account_create | ||
| title: Service Account Create | ||
| service_account_email: | ||
| name: service_account_email | ||
| title: Service Account Email | ||
| workflow_description: | ||
| name: workflow_description | ||
| title: Workflow Description | ||
| workflow_labels: | ||
| name: workflow_labels | ||
| title: Workflow Labels | ||
| workflow_name: | ||
| name: workflow_name | ||
| title: Workflow Name | ||
| workflow_source: | ||
| name: workflow_source | ||
| title: Workflow Source | ||
| workflow_trigger: | ||
| name: workflow_trigger | ||
| title: Workflow Trigger |
Uh oh!
There was an error while loading. Please reload this page.