Skip to content

Commit

Permalink
remove console_access access entry
Browse files Browse the repository at this point in the history
  • Loading branch information
dhoucgitter committed Oct 14, 2024
1 parent 0d2f59a commit 86b321b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 27 deletions.
17 changes: 1 addition & 16 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -170,22 +170,7 @@ module "eks" {
enable_cluster_creator_admin_permissions = true

access_entries = {
# access entries with a policy associated
console_access = {
kubernetes_groups = []
principal_arn = "arn:aws:iam::203918876413:role/aws-reserved/sso.amazonaws.com/AWSReservedSSO_AdministratorAccess_7a114f4a1db191fc"
user_name = local.aws_caller_identity_user_name
type = "STANDARD"

policy_associations = {
console_policy_assoc = {
policy_arn = "arn:aws:eks::aws:cluster-access-policy/AmazonEKSClusterAdminPolicy"
access_scope = {
type = "cluster"
}
}
}
},
# access entry with cluster and namespace scoped policies
cluster_creator = {
kubernetes_groups = ["rbac.authorization.k8s.io"]
principal_arn = data.aws_caller_identity.terraform.arn
Expand Down
2 changes: 1 addition & 1 deletion modules/aws_autoscaling/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ data "aws_iam_policy_document" "worker_autoscaling" {
"autoscaling:SetDesiredCapacity",
"autoscaling:TerminateInstanceInAutoScalingGroup",
"autoscaling:UpdateAutoScalingGroup"

]

resources = ["*"]
Expand Down
12 changes: 6 additions & 6 deletions modules/aws_vm/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,12 @@ resource "aws_instance" "vm" {
delete_on_termination = var.os_disk_delete_on_termination
iops = var.os_disk_iops
encrypted = var.enable_ebs_encryption
tags = merge(
{
Name : "${var.name}-root-vol"
},
var.tags
)
tags = merge(
{
Name : "${var.name}-root-vol"
},
var.tags
)
}

tags = merge(var.tags, tomap({ Name : "${var.name}-vm" }))
Expand Down
8 changes: 4 additions & 4 deletions modules/aws_vpc/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ locals {
vpc_id = var.vpc_id == null ? aws_vpc.vpc[0].id : data.aws_vpc.vpc[0].id
existing_subnets = length(var.existing_subnet_ids) > 0 ? true : false

existing_public_subnets = local.existing_subnets && contains(keys(var.existing_subnet_ids), "public") ? (length(var.existing_subnet_ids["public"]) > 0 ? true : false) : false
existing_private_subnets = local.existing_subnets && contains(keys(var.existing_subnet_ids), "private") ? (length(var.existing_subnet_ids["private"]) > 0 ? true : false) : false
existing_database_subnets = local.existing_subnets && contains(keys(var.existing_subnet_ids), "database") ? (length(var.existing_subnet_ids["database"]) > 0 ? true : false) : false
existing_public_subnets = local.existing_subnets && contains(keys(var.existing_subnet_ids), "public") ? (length(var.existing_subnet_ids["public"]) > 0 ? true : false) : false
existing_private_subnets = local.existing_subnets && contains(keys(var.existing_subnet_ids), "private") ? (length(var.existing_subnet_ids["private"]) > 0 ? true : false) : false
existing_database_subnets = local.existing_subnets && contains(keys(var.existing_subnet_ids), "database") ? (length(var.existing_subnet_ids["database"]) > 0 ? true : false) : false
existing_control_plane_subnets = local.existing_subnets && contains(keys(var.existing_subnet_ids), "control_plane") ? (length(var.existing_subnet_ids["control_plane"]) > 0 ? true : false) : false

# public_subnets = local.existing_public_subnets ? data.aws_subnet.public : aws_subnet.public # not used keeping for ref
private_subnets = local.existing_private_subnets ? data.aws_subnet.private : aws_subnet.private
private_subnets = local.existing_private_subnets ? data.aws_subnet.private : aws_subnet.private
control_plane_subnets = local.existing_control_plane_subnets ? data.aws_subnet.control_plane : aws_subnet.control_plane

# Use private subnets if we are not creating db subnets and there are no existing db subnets
Expand Down

0 comments on commit 86b321b

Please sign in to comment.