-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
terraform_data resource only shifts the problem, use null_data_source…
… instead
- Loading branch information
1 parent
1f6d436
commit 3ef5507
Showing
2 changed files
with
12 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,15 @@ | ||
data "ionoscloud_mongo_template" "mongo_template" { | ||
count = var.resource_template == null ? 0 : 1 | ||
name = var.resource_template | ||
} | ||
|
||
# Workaround | ||
# There's probably a bug in the IONOS Provider: The DataSource ionoscloud_mongo_template doesn't define id | ||
# as computed, leading to an inconsistent final plan (id is null instead of unknown in the initial plan) | ||
# This null_data_source is in between and the output is unknown in the initial plan, solving the problem. | ||
data "null_data_source" "template_workaround" { | ||
inputs = { | ||
mongo_template_id = var.resource_template == null ? null : data.ionoscloud_mongo_template.mongo_template[0].id | ||
} | ||
depends_on = [ data.ionoscloud_mongo_template.mongo_template ] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters