-
-
Notifications
You must be signed in to change notification settings - Fork 274
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Logical resource naming within the template #57
Comments
Thanks for the suggestion @reidca! I've thought previously about some better naming for these resources, perhaps by using some of the primary identifiers returned from !Ref for example. I've also considered a custom templating solution where you could pick your own pattern that suits you. The resource name is indeed probably more appropriate and it's what CDK uses, though I do find that slightly long (they also discuss this same issue). Give me some time to consider good alternatives 🤔 |
Agreed it does lead to long names but I think on the whole this is preferable to a resource with no inferable meaning as it currently stands. Thanks. |
I have just completed my first "Import" of my manually modified template. On the dialog where it asks you for the ids of the resources to import I am not sure how it would have been possible for me to input the correct ids without me having renamed the logical ids prior to this. e.g. for subnets. I name them something like SubnetAPrivate which gives some semantic meaning to the resource and then when fetching the id I can look in the console for the Private subnet in AZ A. If the name was just a hash it would have required more lookups. I know this is not easy to achieve and the naming may in some cases depend on the type of resource being generated such as in this case. given the number of resource types this would be difficult to achieve. Happy to help play around with ideas or test. |
I think that would be very useful. If there is a way of adding overrides through the UI that would also be great although I appreciate that may present a challenge! |
Hi Ian, firstly amazing work this is an awesome tool :) Is it possible to use the Name tag as the logical ID in the generated template? Or, for the benefit of those downloading the template and importing manually the resourceID as the logicalID suffix? This would make it easy to copy paste the resourceID's on the Import page in Cloudformation. NameTag-ResourceID might be ideal. |
Hey @hodgsonsam, Thanks for the suggestion! I think a new naming strategy based on the "Name" tag, where available, would be great. Happy to put this on the roadmap. On importing, many resources do need more than one property value to properly identify the resource, so this may not be a foolproof strategy. There is an import feature available straight from the CloudFormation outputs screen that manages the change set creation (and optionally, deployment) process for you. |
I created a template for our VPC using Former2.
I added all related resources I could think of as well as those suggested by Former2.
This resulted in a large template, over 500 lines long and a lot of resources.
Because all the resources have random logical names it can make identifying them difficult when looking at the template. Although I understand that you could not possibly infer the logical name with anything meaningful, I think it would be useful to put the type of the resource somewhere in the name to at least give some semantic meaning to the resources.
e..g. instead of a resource being called ec26de3980, call it VPCGatewayAttachmentec26de3980
This would help human comprehension of the template, especially when looking at what REF and GetAtt are referring to.
Thanks!
The text was updated successfully, but these errors were encountered: