|
| 1 | +/** |
| 2 | + * Copyright 2019 Google LLC |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + * you may not use this file except in compliance with the License. |
| 6 | + * You may obtain a copy of the License at |
| 7 | + * |
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + * |
| 10 | + * Unless required by applicable law or agreed to in writing, software |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + * See the License for the specific language governing permissions and |
| 14 | + * limitations under the License. |
| 15 | + */ |
| 16 | + |
| 17 | +terraform { |
| 18 | + required_version = ">= 0.12" |
| 19 | +} |
| 20 | + |
| 21 | +provider "google-beta" { |
| 22 | + version = "~> 2.5" |
| 23 | + project = var.project_id |
| 24 | + region = var.region |
| 25 | +} |
| 26 | + |
| 27 | +module "pubsub_scheduled_1" { |
| 28 | + source = "../../" |
| 29 | + project_id = var.project_id |
| 30 | + job_name = "pubsub-example" |
| 31 | + job_schedule = "*/5 * * * *" |
| 32 | + function_entry_point = "doSomething" |
| 33 | + function_source_directory = "${path.module}/function_source" |
| 34 | + function_name = "testfunction-1" |
| 35 | + region = var.region |
| 36 | + topic_name = "pubsub-1" |
| 37 | +} |
| 38 | + |
| 39 | +module "pubsub_scheduled_2" { |
| 40 | + source = "../../" |
| 41 | + project_id = var.project_id |
| 42 | + function_entry_point = "doSomething2" |
| 43 | + function_source_directory = "${path.module}/function_source_2" |
| 44 | + function_name = "testfunction-2" |
| 45 | + region = var.region |
| 46 | + topic_name = module.pubsub_scheduled_1.pubsub_topic_name |
| 47 | + scheduler_job = module.pubsub_scheduled_1.scheduler_job |
| 48 | +} |
0 commit comments