AYS | AWS İsimlendirme Standartları (Naming Conventions)

AYS | AWS İsimlendirme Standartları (Naming Conventions)


AWS-Marketplace-Logo-PNG-to-svg-1-2.svg İsimlendirme Standartları için Uygulanan İlkeler

  1. Anlamlı ve Okunaklı: Kaynak isimleri, ilgili proje veya ortamı ve işlevlerini açıkça belirtmeli, anlaşılır olmalıdır.

  2. Kısa ve Tutarlı: Uzunluk sınırlamalarına dikkat edilerek, mümkün olduğunca kısa ve standart bir yapı tercih edilmelidir.

  3. Ortam Belirleyici: İsimlerde kullanılan etiketler, ortam bilgisini (ör. dev, test, prod) açıkça yansıtmalıdır.

  4. Versiyonlama: Gerekli durumlarda, kaynak isimlerinde versiyonlama yapılmalıdır (ör. v1, v2).

  5. Standart Kısaltmalar: AWS kaynak türlerine uygun standart kısaltmalar kullanılmalıdır (ör. vpc, ec2, alb).

Organizations

Organizational Units (OUs)

Naming Format UPPER CASE

Example

Naming Format UPPER CASE

Example

{{ENVIRONMENT}} OU

TEST OU

TEST OU - Tag Kullanımları

Naming Format PascalCase

Example

Naming Format PascalCase

Example

{{Key}}

Environment

{{Value}}

Test

Var Olan Tagler

Test

Key

Value

Test

Key

Value

 

Environment

Test

Production

Key

Value

 

Environment

Production

https://docs.aws.amazon.com/organizations/latest/userguide/orgs_tagging.html?icmpid=docs_orgs_console

Tag Policy

AWS ortamındaki kaynakların düzenli, tutarlı ve yönetilebilir olması için belirlenen isimlendirme ve kullanım kurallarını tanımlar. Bu politika, kaynak sınıflandırmasını, erişim kontrolünü, maliyet yönetimini, güvenliği ve uyumluluğu kolaylaştırmak amacıyla oluşturulmuştur.

İsimlendirme Standardı (Pascal Case)

Örnek

İsimlendirme Standardı (Pascal Case)

Örnek

{{TagKeyTagValue}}Policy

EnvironmentTestPolicy


VPC

VPC Name Tag Auto-Generation

VPC Name Tag Auto-Generation, VPC’lerin sistematik ve standart bir şekilde adlandırılmasını sağlayan bir otomasyon sürecidir.

  • Not: VPC kurulum aşamasında istenilen prefix’ten sonra; Subnet, Route Table, Network Connections (sadece Interget Gateway ve S3 Gateway) kaynaklarının başında bahsi geçen prefix’i otomatik olarak AWS kendisi tanımlayarak isimlendirme yapmaktadır.


CIDR Standartları

AWS'de Virtual Private Cloud (VPC) için kullanılan IP adres bloklarının belirli bir formatta tanımlanmasını sağlayan standarttır.

  • VPC IP CIDR Standart: 10.0.0.0/16

Public CIDR Block

Public CIDR Block

Region ve AZ

Public CIDR Block

Region ve AZ

10.0.1.0/24

eu-central-1a

10.0.2.0/24

eu-central-1b

10.0.3.0/24

eu-central-1c

Private CIDR Blocks

  • Proje özelinde, RDS haricindeki kaynakların kullanımı için ayrılmıştır.

Private CIDR Block

Region ve AZ

Private CIDR Block

Region ve AZ

10.0.11.0/24

eu-central-1a

10.0.12.0/24

eu-central-1b

10.0.13.0/24

eu-central-1c

  • Proje özelinde, Database kaynakları için ayrılmıştır.

Private CIDR Block

Region ve AZ

Private CIDR Block

Region ve AZ

10.0.21.0/24

eu-central-1a

10.0.22.0/24

eu-central-1b

10.0.23.0/24

eu-central-1c

Security Groups

İsimlendirme Standardı kebab-case

Örnek

İsimlendirme Standardı kebab-case

Örnek

{{resource-name}}-sg

production-rds-aurora-mysql-backend-001-sg

 

production-monitoring-alb-sg

 

production-rds-aurora-mysql-backend-001-sg

Inbound Rules

İsimlendirme Standardı kebab-case

Örnek

İsimlendirme Standardı kebab-case

Örnek

{{protocol}}-{{port}}-from-{{source}}

tcp-22-from-anywhere

tcp-3000-from-production-monitoring-alb-sg

NAT Gateway

İsimlendirme Standardı kebab-case

Örnek

İsimlendirme Standardı kebab-case

Örnek

  • {{environmonet-name}}-ngw{{region-name}}

  • production-ngw-eu-central-1a


RDS

DB instance identifier

İsimlendirme Standardı kebab-case

Örnek

İsimlendirme Standardı kebab-case

Örnek

{{environment}}-{{service-name}}-{{type}}-{{name}}-{{id}}-{{instance}}-{{number}}

production-rds-aurora-mysql-backend-001-instance-1

Reader'lar {{number}} takip ederek ilerlemelidir.

RDS Cluster İsimlendirmesi

İsimlendirme Standardı kebab-case

Örnek

İsimlendirme Standardı kebab-case

Örnek

  • {{environment}}-{{service-name}}-{{type}}-{{name}}-{{id}}

production-rds-aurora-mysql-backend-001

Master username

İsimlendirme Standardı snake_case

Örnek

İsimlendirme Standardı snake_case

Örnek

  • {{environment}}_admin

  • production_admin

  • test_admin

RDS Subnet Groups

İsimlendirme Standardı kebab-case

Örnek

İsimlendirme Standardı kebab-case

Örnek

{{environment}}-{{service-name}}-subnet-{{name}}-{{id}}-subg

production-rds-aurora-mysql-backend-001-subg

RDS Parameter Groups

İsimlendirme Standardı kebab-case

Örnek

İsimlendirme Standardı kebab-case

Örnek

{{rds-cluster-name}}-pg

production-rds-aurora-mysql-backend-001-pg


EC2

İsimlendirme Standardı kebab-case

Örnek

İsimlendirme Standardı kebab-case

Örnek

{{environment}}-{{service-name}}-{{type}}-{{name}}-{{id}}

production-ec2-ubuntu-ssh-tunnel-001

Key Pair

İsimlendirme Standardı kebab-case

Örnek

İsimlendirme Standardı kebab-case

Örnek

{{ec2-name}}-kp

production-ec2-ubuntu-ssh-tunnel-001

Elastic IP

İsimlendirme Standardı kebab-case

Örnek

İsimlendirme Standardı kebab-case

Örnek

  • {{ec2-name}}-kp

  • production-ec2-ubuntu-ssh-tunnel-001-eip

  • production-ngw-eu-central-1a-eip


ALB

Load Balancer isimlendirilmesinde 32 karakter sınırlaması bulunmaktadır.
Dolayısıyla kısa ve anlaşılır bir isim seçilmelidir.
Yani {{environment}}+{{alb-name}}-tg ismi için 32 karakter sınırlaması mevcuttur.
{{alb-name}} maximum 29 karakter olarak yapılırsa tg için bir problem yaşanmayacaktır.

Naming Convention kebab-case

Example

Naming Convention kebab-case

Example

{{environment}}-{{short-descriptive-function/attached service}}-{{alb/nlb}}

production-ecs-service-alb

production-monitoring-alb

ALB Rule

Naming Convention kebab-case

Example

Naming Convention kebab-case

Example

{{alb-full-name}}-{{attached-service}}-rule

production-monitoring-alb-kibana-rule

production-monitoring-alb-grafana-rule


IAM

User

İsimlendirme Standardı dot.case

Örnek

İsimlendirme Standardı dot.case

Örnek

{{environment}}.{{platform}}.{{subservice-if-applicable}}

production.github.actions

{{environment}}.{{firstname}}.{{lastname}}

production.yusuf.kaya

{{environment}}.{{serviceabrevation}}.{{name}}

production.ec2.monitoring

User Group

İsimlendirme Standardı PascalCase

Örnek

İsimlendirme Standardı PascalCase

Örnek

AYS{{Environment}}UserGroup{{Name}}

AYSProductionUserGroupAdmin

AYSProductionUserGroupCommon

Policy

İsimlendirme Standardı (Pascal Case)

Örnek

İsimlendirme Standardı (Pascal Case)

Örnek

AYS{{Environment}}Policy{{Name}}{{Action}}

AYSProductionPolicyGithubActionsPushImagesToAllRepo

AYSProductionPolicyGithubActionsPushImageBackendRepo

Role

İsimlendirme Standardı (Pascal Case)

Örnek

İsimlendirme Standardı (Pascal Case)

Örnek

AYS{{Environment}}Role{{ServiceName}}{{ServiceType}}{{Action}}

AYSProductionRoleKinesisDataFirehoseBackendAuditLogToS3

AYSProductionRoleECSFargateBackendTaskExecution

MFA

İsimlendirme Standardı

Örnek

İsimlendirme Standardı

Örnek

  • AYS{{Environment}}{{UserFullName}}{{AuthenticatorCompany}}{{AuthenticationType}}

 

  • AYSProductionAgitRubarDemirGoogleAuthenticator

  • AYSProductionAgitRubarDemirApplePasskey


Kinesis Data Streams

Naming Format kebab-case

Example

Naming Format kebab-case

Example

{{environment}}-kinesis-data-streams-{{type}}-{{name}}-{{id}}

production-kinesis-data-streams-backend-audit-log-001


Amazon Data Firehose

Naming Format kebab-case

Example

Naming Format kebab-case

Example

{{environment}}-kinesis-data-firehose-{{type}}-{{name}}

production-kinesis-data-firehose-backend-audit-log


S3

Standard

Naming Format kebab-case

Example

Naming Format kebab-case

Example

ays-{{environment}}-{{service-name}}-{{name}}

ays-production-athena-query-log

ays-production-backend-audit-log

Servis Alt Kırılımları

İsimlendirme Standardı (Kebab Case)

Örnek

İsimlendirme Standardı (Kebab Case)

Örnek

ays-{{environment}}-{{type}}-{{service-name}}-{{purpose}}

ays-production-monitoring-ec2-container-backups


ECR

İsimlendirme Standardı (Slash Case)

Örnek

İsimlendirme Standardı (Slash Case)

Örnek

{{environment}}/{{github-repository-name}}

production/ays-be


ECS

Cluster

İsimlendirme Standartı (Kebab Case)

Örnek

İsimlendirme Standartı (Kebab Case)

Örnek

{{environment}}-{{service}}-{{type}}-{{name}}-{{id}}

production-ecs-fargate-backend-001

Service

İsimlendirme Standardı (Kebab Case)

Örnek

İsimlendirme Standardı (Kebab Case)

Örnek

{{environment}}-{{service}}-{{type}}-{{name}}-{{id}}-service

production-ecs-fargate-backend-001-service

Task Definition

İsimlendirme Standardı (Kebab Case)

Örnek

İsimlendirme Standardı (Kebab Case)

Örnek

{{environment}}-{{service}}-{{type}}-{{name}}-{{id}}-service-td

production-ecs-fargate-backend-001-service-td

Port Mappings

Container Port Protocol Name

İsimlendirme Standardı (Kebab Case)

Örnek

İsimlendirme Standardı (Kebab Case)

Örnek

  • {{environment}}-{{service}}-{{type}}-{{name}}-{{id}}-service-td-{{port}}-{{protocol}}

  • production-ecs-fargate-backend-001-service-td-9790-tcp


CloudWatch

Log Group

İsimlendirme Standardı (Kebab Case)

Örnek

İsimlendirme Standardı (Kebab Case)

Örnek

  • {{environment}}-{{service}}-{{type}}-{{name}}-{{id}}-log-group

  • /ecs/production-ecs-fargate-backend-001-log-group

Subscription Filter

İsimlendirme Standardı (Kebab Case)

Örnek

İsimlendirme Standardı (Kebab Case)

Örnek

  • AYS{{Environment}}SubscriptionFilter{{LogName}}To{{TargetService}}

  • AYSProductionSubscriptionFilterBackendApplicationLogToKinesisDataFirehose


Secrets Manager

İsimlendirme Standardı (Kebab Case)

Örnek

İsimlendirme Standardı (Kebab Case)

Örnek

{{environment}}-{{service-name-that-will-use-secrets}}-secret

  • production-ecs-fargate-backend-001-service-td-secret


GitHub

Secrets

Variables


GitHub Secret Key Naming

{{ENVIRONMENT}}_{{SECRET_KEY}}

  • PRODUCTION_AWS_ACCESS_KEY_ID

  • GitHub'da environment (ortam) tanımlama özelliği var. Bu sayede ortam bilgilerini oradan alıp farklı işlemler için ayırt edebiliyoruz.

GitHub Secret ve Variable

  • İsimlendirme Std:

    • AWS_ACCESS_KEY_ID

    • AWS_REGION

    • AWS_SECRET_ACCESS_KEY

    • GH_USER_ACCESS_TOKEN

    • SONAR_TOKEN


KAYNAKLAR

https://docs.aws.amazon.com/organizations/latest/userguide/orgs_tagging.html?icmpid=docs_orgs_console