philschmid / terraform-aws-sagemaker-huggingface

MIT License
46 stars 21 forks source link

randomness for resource names #24

Open Nelsi11120 opened 1 year ago

Nelsi11120 commented 1 year ago

Hi @philschmid , thank you for this great module, it works like a charm!

However, I would like to know if it is possible to deactivate the random string that is being concatenated to every resource names? It seems to me that in the current state of the module, we can't control this and every time, my endpoint will be something like "mymodel-preprod-random_stuff" where I would like to simply have "mymodel-preprod".

Am I doing something wrong? And in the case I understood correctly, would it be possible to just add an input variable to activate or not randomness in the resources names?

Thanks.

philschmid commented 1 year ago

Hello @Nelsi11120,

You would need to copy/fork the module and change: https://github.com/philschmid/terraform-aws-sagemaker-huggingface/blob/5e7f1650351dde648bcc04785022a088ccf46e89/main.tf#L120

Nelsi11120 commented 1 year ago

Thank you for your quick answer.

This is what I am actually doing, but I was wondering if that could make sense to directly being able to control that directly on the module itself (by, let's say, adding a var) ?

Do you have a reason to always add random suffix ? Or does it makes sense to deactivate that when user wants it ? (Instead of manually fork and change the code?). If that makes sense, I could try to change the behaviour and open a PR?

cjlpowers commented 12 months ago

I would also like to see this improvement implemented. The randomness creates challenges when deploying endpoints across multiple environments. Ideally, I want to control the endpoint name so that we can have consistent configuration across environments.