Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions examples/automatic-labelling-from-repository/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,6 @@ resource "null_resource" "configure_repository" {
}
}

data "null_data_source" "main" {
inputs = {
source_repository_url = "https://source.developers.google.com/projects/${var.project_id}/repos/${random_pet.main.id}/moveable-aliases/master/paths/"
}

depends_on = [null_resource.configure_repository]
}

module "event_project_log_entry" {
source = "../../modules/event-project-log-entry"

Expand All @@ -71,11 +63,12 @@ module "repository_function" {
name = random_pet.main.id
project_id = var.project_id
region = var.region
source_repository_url = data.null_data_source.main.outputs["source_repository_url"]
source_repository_url = "https://source.developers.google.com/projects/${var.project_id}/repos/${random_pet.main.id}/moveable-aliases/master/paths/"

timeouts = {
update = "10m"
}
depends_on = [null_resource.configure_repository]
}

resource "null_resource" "wait_for_function" {
Expand Down
16 changes: 3 additions & 13 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,13 @@ resource "null_resource" "dependent_files" {
}
}

data "null_data_source" "wait_for_files" {
inputs = {
# This ensures that this data resource will not be evaluated until
# after the null_resource has been created.
dependent_files_id = null_resource.dependent_files.id

# This value gives us something to implicitly depend on
# in the archive_file below.
source_dir = pathexpand(var.source_directory)
}
}

data "archive_file" "main" {
type = "zip"
output_path = pathexpand("${var.source_directory}.zip")
source_dir = data.null_data_source.wait_for_files.outputs["source_dir"]
source_dir = pathexpand(var.source_directory)
excludes = var.files_to_exclude_in_source_dir

depends_on = [null_resource.dependent_files]
}


Expand Down