Skip to content

Commit 36fbf06

Browse files
authored
fix: Always pull a value from SSM data source since a computed value cannot be used in conditional logic (#466)
1 parent 5b11067 commit 36fbf06

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

main.tf

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ locals {
55

66
is_t_instance_type = replace(var.instance_type, "/^t(2|3|3a|4g){1}\\..*$/", "1") == "1" ? true : false
77

8-
ami = try(coalesce(var.ami, try(nonsensitive(data.aws_ssm_parameter.this[0].value), null)), null)
8+
ami = try(coalesce(var.ami, try(nonsensitive(data.aws_ssm_parameter.this.value), null)), null)
99

1010
instance_tags = merge(
1111
var.tags,
@@ -29,8 +29,6 @@ locals {
2929
}
3030

3131
data "aws_ssm_parameter" "this" {
32-
count = local.create && var.ami == null ? 1 : 0
33-
3432
region = var.region
3533

3634
name = var.ami_ssm_parameter

0 commit comments

Comments
 (0)