Skip to content

Commit 10cb265

Browse files
committed
move data from the provider to here so I can use the value in other instances without duplication errors
1 parent e82afc6 commit 10cb265

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

nbc.tf

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,6 @@ resource "aws_iam_instance_profile" "nbc_instance_profile" {
3636
role = aws_iam_role.nbc_instance_role.name
3737
}
3838

39-
data "aws_ssm_parameter" "al2023_ami_arm64" {
40-
name = "/aws/service/ami-amazon-linux-latest/al2023-ami-kernel-default-arm64"
41-
}
42-
4339
resource "aws_instance" "nbc_instance" {
4440
ami = data.aws_ssm_parameter.al2023_ami_arm64.value
4541
instance_type = "t4g.xlarge"

nbe.tf

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,6 @@ resource "aws_iam_instance_profile" "nbe_instance_profile" {
4444
role = aws_iam_role.nbe_instance_role.name
4545
}
4646

47-
data "aws_ssm_parameter" "al2023_ami_x86-64" {
48-
name = "/aws/service/ami-amazon-linux-latest/al2023-ami-kernel-default-x86_64"
49-
}
50-
5147
resource "aws_instance" "nbe_instance" {
5248
ami = data.aws_ssm_parameter.al2023_ami_x86-64.value
5349
instance_type = "t3a.2xlarge"

providers.tf

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,12 @@ provider "aws" {
1818
Owner = data.external.whoami.result.username
1919
}
2020
}
21-
}
21+
}
22+
23+
data "aws_ssm_parameter" "al2023_ami_arm64" {
24+
name = "/aws/service/ami-amazon-linux-latest/al2023-ami-kernel-default-arm64"
25+
}
26+
27+
data "aws_ssm_parameter" "al2023_ami_x86-64" {
28+
name = "/aws/service/ami-amazon-linux-latest/al2023-ami-kernel-default-x86_64"
29+
}

0 commit comments

Comments
 (0)