Skip to content

Commit

Permalink
Merge pull request #7 from terraform-google-modules/aaron-lane-revert…
Browse files Browse the repository at this point in the history
…-master-merge

Revert direct commits to master
  • Loading branch information
aaron-lane authored Jun 28, 2019
2 parents 29d08b6 + 325793e commit 9ed92cf
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 12 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ You can go to the examples folder, however the usage of the module could be like

```hcl
module "scheduled-function" {
source = "terraform-google-modules/scheduled-function/google"
source = "terraform-google-modules/scheduled-functions/google"
version = "0.1.0"
project_id = "<PROJECT ID>"
job_name="<NAME_OF_JOB>"
schedule="<CRON_SYNTAX_SCHEDULE"
function_entry_point="<NAME_OF_FUNCTION>"
function_source_directory="<DIRECTORY_OF_FUNCTION_SOURCE>"
function_name="<RESOURCE_NAMES>"
name="<RESOURCE_NAMES>"
region="<REGION>"
}
```
Expand Down
10 changes: 1 addition & 9 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,12 @@
* limitations under the License.
*/

locals {
// we append the app hash to the filename as a temporary workaround for https://github.com/terraform-providers/terraform-provider-google/issues/1938
md5_hash = "${lower(replace(base64encode(data.archive_file.main.output_md5), "=", ""))}"
storage_object_name = "event_function-${random_string.random_suffix.result}-${local.md5_hash}.zip"
}

/******************************************
Scheduled Function Definition
*****************************************/

resource "google_cloud_scheduler_job" "job" {
name = "${var.job_name}"
project = "${var.project_id}"
region = "${var.region}"
description = "${var.job_description}"
schedule = "${var.job_schedule}"
time_zone = "${var.time_zone}"
Expand Down Expand Up @@ -100,7 +92,7 @@ resource "google_storage_bucket" "main" {
}

resource "google_storage_bucket_object" "main" {
name = "${local.storage_object_name}"
name = "event_function-${random_string.random_suffix.result}.zip"
bucket = "${google_storage_bucket.main.name}"
source = "${data.archive_file.main.output_path}"
content_disposition = "attachment"
Expand Down
2 changes: 1 addition & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

variable "project_id" {
description = "The ID of the project where the resources will be created"
description = "The ID of the project where this VPC will be created"
}

variable "job_name" {
Expand Down

0 comments on commit 9ed92cf

Please sign in to comment.