Cleaning up the OCI Resource Chaos
This week I have removed all my Oracle Cloud Infrastructure lab resources and cleaned up my compartment to start from scratch building environments with the Automation Manager. There were a lot of resources with names like webserver01, vcn-lab-01, block-volume-web-clone-47 and so on. When I have realized this naming chaos, I have decided to spend some minutes today Friday to think about a small naming convention for my future Oracle Cloud Infrastructure projects.
Why having a naming convention? Wikipedia says about Naming Convention:
In computer programming, a naming convention is a set of rules for choosing the character sequence to be used for identifiers which denote variables, types, functions, and other entities in source code and documentation.
Sounds good, this is what I need. There are some proposal docs in the web about naming convention from Azure and TrendMicro – I used them as an inspiration.
- https://docs.microsoft.com/en-us/azure/cloud-adoption-framework/ready/azure-best-practices/resource-naming
- https://www.trendmicro.com/cloudoneconformity/knowledge-base/aws/VPC/vpc-naming-conventions.html
Naming Convention
To identify an OCI resource, tagging is not enough. I like to see it at a glance what a resource is doing, which project and, if required, some additional information. This here is just a idea how it could work. Any other ideas are welcome :-). I have decided to define a resource by:
- A resource type like bv for Block Volumes
- A region key – based on https://docs.oracle.com/en-us/iaas/Content/General/Concepts/regions.htm
- An environment code – like letter t for test, d for development and p for production
- A stack – this could be a project name or a purpose
- A instance – the number of the resource if more than one is created
And in some cases where this information is not enough:
- An additional – like read-only, protected etc.
Examples
Resource Name | Purpose |
vcn-zrh-t-newcrm-001 | VCN, region Zurich, test, NEWCRM project |
sn-prv-fra-p-transfer-001 | Private Subnet, region Frankfurt, production, TRANSFER project |
nsg-zrh-d-ipsec-001 | Network Security Group, region Zurich, development, IPSEC project |
bv-zrh-t-ipsec-olvm-engine-001 | Block Volume, region Zurich, test, IPSEC project, compute instance olvm-engine |
log-ams-p-crm-read-001 | Log Group ,region Amsterdam, production, CRM project, read only |
ci-fra-t-science-ngnix-003 | Compute Instance , region Marseille, test, SCIENCE project, NGINX server |
A first View – Network Visualizer
This looks not so bad.
Summary
If you want to bring an order into your naming chaos, then you have to define a naming convention. There are for sure many other ideas around the world. How do you handle it? Just drop me a message by LinkedIn or Twitter and let me knolw if I can add your idea here in this blog too.