Terraform and AWS resource naming should follow a company standard. Each company has different requirements and the standard should be adjusted.
Best Practice: Terraform Naming Patterns: Name each Terraform variable following a pattern of elements that indicate all the information.
Follow this pattern. Use lowercase and underscores as a separator.
instances_to_db_port
explains the intended usage of the rule. In this case, it is a rule to allow access from the EC2 instances to the RDS Database port.Examples:
The name of each resource should follow a pattern. Use lowercase and a dash as a separator.
It is important to have this unique prefix as external elements (like Monitoring System) will have to be able to differentiate between many clouds.
Example:
name =”ditwl-sn-za-pro-pub-32″
Using a consistent pattern allows the name to include all the needed information to understand its purpose making the description almost unnecessary.
[…] Follow the best practices for naming the resources using a pattern that indicates their intended use. See AWS and Terraform Naming Best Practices. […]