Skip to content

Commit 7c3a4cb

Browse files
committed
fix aws changes
1 parent f80f9b3 commit 7c3a4cb

File tree

3 files changed

+21
-15
lines changed

3 files changed

+21
-15
lines changed

aws/irsa.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ resource "aws_iam_role_policy_attachment" "irsa_role_attachment" {
3737

3838
resource "aws_iam_policy" "secret_manager" {
3939
name_prefix = "secret-manager"
40-
description = "EKS secret manager policy for cluster ${module.eks.cluster_id}"
40+
description = "EKS secret manager policy for cluster ${module.eks.cluster_name}"
4141
policy = data.aws_iam_policy_document.secret_manager.json
4242
}
4343

aws/main.tf

+14-14
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
terraform {
22
# Set your region and bucket name (output from shared state) in the placeholder below
33
# Then uncomment and apply!
4-
# backend "s3" {
5-
# region = "eu-west-1" # Change if desired
6-
# bucket = "" # Put your bucket name here
7-
# key = "wrongsecrets/terraform.tfstate" # Change if desired
8-
# }
4+
backend "s3" {
5+
region = "eu-west-1" # Change if desired
6+
bucket = "terraform-20230102231352749300000001" # Put your bucket name here
7+
key = "wrongsecrets/terraform.tfstate" # Change if desired
8+
}
99
}
1010

1111
locals {
@@ -72,6 +72,7 @@ module "eks" {
7272

7373

7474
cluster_endpoint_private_access = true
75+
cluster_endpoint_public_access = true
7576

7677
cluster_endpoint_public_access_cidrs = compact(concat(["${data.http.ip.response_body}/32"], var.extra_allowed_ip_ranges))
7778

@@ -89,19 +90,18 @@ module "eks" {
8990
disk_iops = 3000
9091
instance_types = ["t3a.medium"]
9192

92-
iam_role_additional_policies = [
93-
"arn:aws:iam::aws:policy/AmazonEKSWorkerNodePolicy",
94-
"arn:aws:iam::aws:policy/AmazonEKS_CNI_Policy",
95-
"arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly",
96-
"arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore",
97-
"arn:aws:iam::aws:policy/AmazonEKSVPCResourceController"
98-
]
93+
iam_role_additional_policies = {
94+
AmazonEKSWorkerNodePolicy: "arn:aws:iam::aws:policy/AmazonEKSWorkerNodePolicy",
95+
AmazonEKS_CNI_Policy: "arn:aws:iam::aws:policy/AmazonEKS_CNI_Policy",
96+
AmazonEC2ContainerRegistryReadOnly: "arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly",
97+
AmazonSSMManagedInstanceCore: "arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore",
98+
AmazonEKSVPCResourceController: "arn:aws:iam::aws:policy/AmazonEKSVPCResourceController"
99+
}
99100
}
100101

101102
eks_managed_node_groups = {
102103
bottlerocket_default = {
103-
create_launch_template = false
104-
launch_template_name = ""
104+
use_custom_launch_template = false
105105
min_size = 3
106106
max_size = 50
107107
desired_size = 3

aws/outputs.tf

+6
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,9 @@ output "secrets_manager_secret_name" {
1717
description = "The name of the secrets manager secret"
1818
value = aws_secretsmanager_secret.secret.name
1919
}
20+
21+
22+
output "cluster_id" {
23+
description = "The id of the cluster"
24+
value = module.eks.cluster_id
25+
}

0 commit comments

Comments
 (0)