Skip to content

This module is designed to serve as the definitive source for naming conventions within an organization. If you need to create an entity that will be utilized across multiple accounts, you should employ this module to ensure consistency in naming conventions.

Notifications You must be signed in to change notification settings

fivexl/terraform-aws-naming-convetions

Repository files navigation

Naming Conventions Module

This module is designed to serve as the definitive source for naming conventions within an organization. If you need to create an entity that will be utilized across multiple accounts, you should employ this module to ensure consistency in naming conventions.

Usage:

module "naming_conventions" {
  source = "fivexl/naming-conventions/aws"
}

locals {
  # All those names are already pre-generated by the module.
  terraform_state_bucket_name        = module.naming_conventions.terraform_state_bucket_name
  terraform_lock_dynamodb_table_name = module.naming_conventions.terraform_lock_dynamodb_table_name
  s3_access_logs_bucket_name         = module.naming_conventions.s3_access_logs_bucket_name
  vpc_flow_logs_bucket_name          = module.naming_conventions.vpc_flow_logs_bucket_name
  athena_query_results_bucket_name   = module.naming_conventions.athena_query_results_bucket_name

  # Other more `unique` names that are pre-generated by the module.
  org_info_ssm_parameter_name = module.naming_conventions.org_info_ssm_parameter_name
  org_info_ram_resource_share_name = module.naming_conventions.org_info_ram_resource_share_name
  shared_kms_key_resource_share_name = module.naming_conventions.shared_kms_key_resource_share_name
  default_kms_key_resource_share_name = module.naming_conventions.default_kms_key_resource_share_name
  s3_access_logs_replication_configuration_ssm_parameter_name = module.naming_conventions.s3_access_logs_replication_configuration_ssm_parameter_name
  s3_access_logs_replication_configuration_resource_share_name = module.naming_conventions.s3_access_logs_replication_configuration_resource_share_name
  chat_bot_topic_arn_ssm_parameter_name = module.naming_conventions.chat_bot_topic_arn_ssm_parameter_name
  chat_bot_topic_arn_resource_share_name = module.naming_conventions.chat_bot_topic_arn_resource_share_name
}

Requirements

Name Version
terraform ~> 1.0

Providers

No providers.

Modules

Name Source Version
names ./modules/naming_generator n/a
s3_names ./modules/naming_generator n/a

Resources

No resources.

Inputs

Name Description Type Default Required
delimiter The delimiter to use between the name components string "-" no
environment The environment id that would be used for the name of Chatbot topic ssm parameter ex: /shared/{var.environment}/chat-bot-topic-arn string "development" no
hash_algorithm The hash algorithm that would be used to encode account_id and region. This is uselful to avoid leaking account_id and region in the resource name (for example in public S3 bucket names). Possible values are 'sha1' | null. Defaults to 'sha1' string "sha1" no
max_length The maximum length of the resource name. Defaults to 255 number null no
names The names of the resources to generate list(string) [] no
order The order of the name components list(string)
[
"name",
"region",
"env_id"
]
no
resource_type The type of resource to generate a name for. Possible values are 's3' | 'dynamodb'. string "none" no
with_env_id Whether to include the environment id in the name bool true no
with_region Whether to include the region in the name bool false no

Outputs

Name Description
athena_query_results_bucket_name The name of the S3 bucket for storing Athena query results
chat_bot_topic_arn_resource_share_name Name of the RAM resource share for the Chatbot topic ARN
chat_bot_topic_arn_ssm_parameter_name Name of the SSM parameter for the Chatbot topic ARN
default_kms_key_resource_share_name Name of the RAM resource share for the default KMS key
names The generated names for the resources
org_info_ram_resource_share_name Name of the RAM resource share for the organization information ssm parameter
org_info_ssm_parameter_name Name of the ssm parameter with the organization information
s3_access_logs_bucket_name The name of the S3 bucket for storing access logs
s3_access_logs_replication_configuration_resource_share_name Name of the RAM resource share for the S3 access logs replication configuration
s3_access_logs_replication_configuration_ssm_parameter_name Name of the SSM parameter for the S3 access logs replication configuration
shared_kms_key_resource_share_name Name of the RAM resource share for the shared KMS key
terraform_lock_dynamodb_table_name The name of the DynamoDB table for locking Terraform state
terraform_state_bucket_name The name of the S3 bucket for storing Terraform state
vpc_flow_logs_bucket_name The name of the S3 bucket for storing VPC flow logs

Review links

About

This module is designed to serve as the definitive source for naming conventions within an organization. If you need to create an entity that will be utilized across multiple accounts, you should employ this module to ensure consistency in naming conventions.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages