Description
LoginAsNonRoot as part of ECS instance creation controls whether to create instance with unprivileged ecs-user, please refer to https://www.alibabacloud.com/help/en/ecs/developer-reference/api-ecs-2014-05-26-runinstances and https://www.alibabacloud.com/help/en/ecs/user-guide/manage-the-username-used-to-log-on-to-an-ecs-instance#62206fc07eull
Use Case(s)
It would be great for builder to use unprivileged ecs-user as currently only root is supported if instance is provisioned by packer from any of the public images.
Potential configuration
Currently, packer utilizes CreateInstance API, which unfortunately does not support LoginAsNonRoot flag. The equivalent API RunInstances does support it along with other parameters, currently utilized by packer as part of CreateInstance call.
The solution would involve porting CreateInstance to RunInstances and supplying parametrized LoginAsNonRoot flag, which could be exposed in the builder config as login_as_non_root or semantical equivalent.
Potential References
https://www.alibabacloud.com/help/en/ecs/developer-reference/api-ecs-2014-05-26-runinstances
https://www.alibabacloud.com/help/en/ecs/user-guide/manage-the-username-used-to-log-on-to-an-ecs-instance#62206fc07eull
Description
LoginAsNonRootas part of ECS instance creation controls whether to create instance with unprivileged ecs-user, please refer to https://www.alibabacloud.com/help/en/ecs/developer-reference/api-ecs-2014-05-26-runinstances and https://www.alibabacloud.com/help/en/ecs/user-guide/manage-the-username-used-to-log-on-to-an-ecs-instance#62206fc07eullUse Case(s)
It would be great for builder to use unprivileged ecs-user as currently only root is supported if instance is provisioned by packer from any of the public images.
Potential configuration
Currently, packer utilizes
CreateInstanceAPI, which unfortunately does not supportLoginAsNonRootflag. The equivalent APIRunInstancesdoes support it along with other parameters, currently utilized by packer as part ofCreateInstancecall.The solution would involve porting
CreateInstancetoRunInstancesand supplying parametrizedLoginAsNonRootflag, which could be exposed in the builder config aslogin_as_non_rootor semantical equivalent.Potential References
https://www.alibabacloud.com/help/en/ecs/developer-reference/api-ecs-2014-05-26-runinstances
https://www.alibabacloud.com/help/en/ecs/user-guide/manage-the-username-used-to-log-on-to-an-ecs-instance#62206fc07eull