44 create = var. create && var. putin_khuylo
55
66 is_t_instance_type = replace (var. instance_type , " /^t(2|3|3a|4g){1}\\ ..*$/" , " 1" ) == " 1" ? true : false
7+
8+ ami = try (coalesce (var. ami , try (nonsensitive (data. aws_ssm_parameter . this [0 ]. value ), null )), null )
79}
810
911data "aws_ssm_parameter" "this" {
@@ -19,7 +21,7 @@ data "aws_ssm_parameter" "this" {
1921resource "aws_instance" "this" {
2022 count = local. create && ! var. ignore_ami_changes && ! var. create_spot_instance ? 1 : 0
2123
22- ami = try ( coalesce (var . ami , nonsensitive (data . aws_ssm_parameter . this [ 0 ] . value )), null )
24+ ami = local . ami
2325 instance_type = var. instance_type
2426 cpu_core_count = var. cpu_core_count
2527 cpu_threads_per_core = var. cpu_threads_per_core
@@ -187,7 +189,7 @@ resource "aws_instance" "this" {
187189resource "aws_instance" "ignore_ami" {
188190 count = local. create && var. ignore_ami_changes && ! var. create_spot_instance ? 1 : 0
189191
190- ami = try ( coalesce (var . ami , nonsensitive (data . aws_ssm_parameter . this [ 0 ] . value )), null )
192+ ami = local . ami
191193 instance_type = var. instance_type
192194 cpu_core_count = var. cpu_core_count
193195 cpu_threads_per_core = var. cpu_threads_per_core
@@ -361,7 +363,7 @@ resource "aws_instance" "ignore_ami" {
361363resource "aws_spot_instance_request" "this" {
362364 count = local. create && var. create_spot_instance ? 1 : 0
363365
364- ami = try ( coalesce (var . ami , nonsensitive (data . aws_ssm_parameter . this [ 0 ] . value )), null )
366+ ami = local . ami
365367 instance_type = var. instance_type
366368 cpu_core_count = var. cpu_core_count
367369 cpu_threads_per_core = var. cpu_threads_per_core
0 commit comments