Closed gelleson closed 5 months ago
Thank you for your participating. I think DoubleDashArg
will be better name for your helper function. Tell me when PR will be ready to merge
Thank you for your participating. I think
DoubleDashArg
will be better name for your helper function. Tell me when PR will be ready to merge
Sure will rename. But could take a look to import part I am not sure.
@aliksend done renamed :)
Also please consider to change alias validation regexp to ^[A-Z_]+$
instead of ...*
. To not accept empty strings as valid aliases.
take a look to import part I am not sure
What import part do you mean?
@aliksend changed regex
@aliksend when will finish review please could to merge it and release a tag. I will use it later :)
You need read current value of alias
in Read
function and set it to state. Then you can revert modifications of ImportState
function.
Can you do it?
@aliksend please could leave some example of some resource link then I will fix based on your example
@aliksend is it possible?)
No, another plan. Please use
PlanModifiers: []planmodifier.String{
stringplanmodifier.RequiresReplace(),
},
to always re-create resource when alias
is modified.
Else you need to implement Update
logic. You can see example of complex Update
here - app_name can't be updated (you can see corresponding PlanModifier in declaration) but other fields can. I don't think it is a good solution in this case.
Using proposed approach you don't need to read alias
because it cannot be updated through modifying terraform configuration.
@aliksend as I remember alias update is not possible to update
alias is not possible to update
So it is better to mark it as non-updatable for terraform (using PlanModifier RequiresReplace) to rule terraform to re-create resource instead of updating it.
@aliksend done updated
Do you think PR is ready to merge?
@aliksend give few minutes to test on local env and then we can merge it. Is it possible to wait few minutes?
Yep. Tell me when it will be ready and I will merge and make a new version
@aliksend I have to go out. Will do it tests later tomorrow or after tomorrow
@aliksend tested on locally. I've done some fixes
Let's merge it.
This commit introduces an alias option into multiple services including Elasticsearch, MongoDB, Clickhouse, and many others. The alias option is optional, validated for an uppercase string, and helper function has been updated to facilitate this change. Furthermore, logic around creating service links have also been modified to account for the possible presence of an alias.