4
4
create = var. create && var. putin_khuylo
5
5
6
6
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 )
7
9
}
8
10
9
11
data "aws_ssm_parameter" "this" {
@@ -19,7 +21,7 @@ data "aws_ssm_parameter" "this" {
19
21
resource "aws_instance" "this" {
20
22
count = local. create && ! var. ignore_ami_changes && ! var. create_spot_instance ? 1 : 0
21
23
22
- ami = try ( coalesce (var . ami , nonsensitive (data . aws_ssm_parameter . this [ 0 ] . value )), null )
24
+ ami = local . ami
23
25
instance_type = var. instance_type
24
26
cpu_core_count = var. cpu_core_count
25
27
cpu_threads_per_core = var. cpu_threads_per_core
@@ -187,7 +189,7 @@ resource "aws_instance" "this" {
187
189
resource "aws_instance" "ignore_ami" {
188
190
count = local. create && var. ignore_ami_changes && ! var. create_spot_instance ? 1 : 0
189
191
190
- ami = try ( coalesce (var . ami , nonsensitive (data . aws_ssm_parameter . this [ 0 ] . value )), null )
192
+ ami = local . ami
191
193
instance_type = var. instance_type
192
194
cpu_core_count = var. cpu_core_count
193
195
cpu_threads_per_core = var. cpu_threads_per_core
@@ -361,7 +363,7 @@ resource "aws_instance" "ignore_ami" {
361
363
resource "aws_spot_instance_request" "this" {
362
364
count = local. create && var. create_spot_instance ? 1 : 0
363
365
364
- ami = try ( coalesce (var . ami , nonsensitive (data . aws_ssm_parameter . this [ 0 ] . value )), null )
366
+ ami = local . ami
365
367
instance_type = var. instance_type
366
368
cpu_core_count = var. cpu_core_count
367
369
cpu_threads_per_core = var. cpu_threads_per_core
0 commit comments