Skip to content

Commit 0ffb9b2

Browse files
fix: remove null_data_sources (#184)
Signed-off-by: Agustín Díaz <[email protected]> Co-authored-by: Bharath KKB <[email protected]>
1 parent 48c06c9 commit 0ffb9b2

File tree

2 files changed

+5
-22
lines changed

2 files changed

+5
-22
lines changed

examples/automatic-labelling-from-repository/main.tf

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,6 @@ resource "null_resource" "configure_repository" {
3939
}
4040
}
4141

42-
data "null_data_source" "main" {
43-
inputs = {
44-
source_repository_url = "https://source.developers.google.com/projects/${var.project_id}/repos/${random_pet.main.id}/moveable-aliases/master/paths/"
45-
}
46-
47-
depends_on = [null_resource.configure_repository]
48-
}
49-
5042
module "event_project_log_entry" {
5143
source = "../../modules/event-project-log-entry"
5244

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

7668
timeouts = {
7769
update = "10m"
7870
}
71+
depends_on = [null_resource.configure_repository]
7972
}
8073

8174
resource "null_resource" "wait_for_function" {

main.tf

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,23 +39,13 @@ resource "null_resource" "dependent_files" {
3939
}
4040
}
4141

42-
data "null_data_source" "wait_for_files" {
43-
inputs = {
44-
# This ensures that this data resource will not be evaluated until
45-
# after the null_resource has been created.
46-
dependent_files_id = null_resource.dependent_files.id
47-
48-
# This value gives us something to implicitly depend on
49-
# in the archive_file below.
50-
source_dir = pathexpand(var.source_directory)
51-
}
52-
}
53-
5442
data "archive_file" "main" {
5543
type = "zip"
5644
output_path = pathexpand("${var.source_directory}.zip")
57-
source_dir = data.null_data_source.wait_for_files.outputs["source_dir"]
45+
source_dir = pathexpand(var.source_directory)
5846
excludes = var.files_to_exclude_in_source_dir
47+
48+
depends_on = [null_resource.dependent_files]
5949
}
6050

6151

0 commit comments

Comments
 (0)