Skip to content

Commit

Permalink
add prefixes
Browse files Browse the repository at this point in the history
  • Loading branch information
morga471 committed May 13, 2025
1 parent 234b863 commit b02a74c
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 8 deletions.
37 changes: 37 additions & 0 deletions lab/_envcommon/prefixes.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
locals {
prefixes = {
"ebs" = "v-ebs-"
"efs" = "v-efs-"
"group" = "g-"
"kms" = "k-kms-"
"policy" = "p-"
"role" = "r-"
"s3" = "v-s3-"
"security-group" = "" # "sg-"
# VPC
"customer-gateway" = "cgw-"
"dhcp-options" = ""
"elastic-ip" = "eip-"
"internet-gateway" = "igw-"
"log-group" = "lg-"
"log-stream" = "lgs-"
"nat-gateway" = "nat-"
"network-acl" = "nacl-"
"route-table" = "route-"
"subnet" = ""
"vpc-endpoint" = "vpce-"
"vpc-peer" = "vpcp-"
"vpc" = ""
"vpn-connection" = "vpn_"
"vpn-gateway" = "vpcg-"
# EKS
"eks-policy" = "p-eks-"
"eks-queue" = "eks-q-"
"eks-role" = "r-eks-"
"eks-s3" = "v-s3-eks-"
"eks-security-group" = "eks-sg-" # "sg-eks-"
"eks-user" = "s-eks-"
"eks" = "eks-"
"eks-event" = "eks-ev-"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ include "root" {
locals {
# Skip this module if disabled
skip = !lookup(include.root.locals.is_module_enabled, basename(get_terragrunt_dir()), true)
artifact_bucket = format("v-s3-eks-%v-artifacts-%v-%v",
include.root.inputs.cluster_name,
include.root.inputs.aws_account_id,
join("", [for c in split("-", include.root.inputs.aws_region) : substr(c, 0, 1)]))
artifact_bucket = format("%v%v-%v-%v-%v",
local.prefixes["eks-s3"],
include.root.inputs.cluster_name,
"artifacts",
include.root.inputs.aws_account_id,
join("", [for c in split("-", include.root.inputs.aws_region) : substr(c, 0, 1)]))
}

exclude {
Expand All @@ -35,7 +37,7 @@ inputs = {

# VPC Configuration
vpc_name = include.root.inputs.vpc_name
subnet_filter = "*-container-*" # or any specific pattern you want to use
subnet_filter = "*-container-*" # or any specific pattern you want to use

is_infrastructure_pipeline = true

Expand All @@ -59,9 +61,9 @@ inputs = {
}

security_scan_configuration = {
compute_type = "BUILD_GENERAL1_MEDIUM"
image = "aws/codebuild/amazonlinux2-x86_64-standard:3.0"
buildspec_path = "security.yml"
compute_type = "BUILD_GENERAL1_MEDIUM"
image = "aws/codebuild/amazonlinux2-x86_64-standard:3.0"
buildspec_path = "security.yml"
}

approval_configuration = {
Expand Down

0 comments on commit b02a74c

Please sign in to comment.