FlexibleEngineCloud / terraform-provider-flexibleengine

Terraform flexibleengine provider
https://www.terraform.io/docs/providers/flexibleengine/
Mozilla Public License 2.0
30 stars 53 forks source link

image_source_url credentials not available #579

Closed abhaysrivastava-orange closed 3 years ago

abhaysrivastava-orange commented 3 years ago

Hi there,

In module "flexibleengine_images_image_v2" if we need to provide credentials for image_source_url url then there is no option to provide it.

ShiChangkuo commented 3 years ago

@abhaysrivastava-orange could you try to set the credentials in a URL, e.g. https://username:password@example.com/file.img?

abhaysrivastava-orange commented 3 years ago

@ShiChangkuo Thanks its working fine for me.

abhaysrivastava-orange commented 3 years ago

@ShiChangkuo From this above solution we are able to create image in glance but its only 12kb size although qcow2 size is 1.5G. That's why from this new image its created faulty instance.

abhaysrivastava-orange commented 3 years ago

As well as I want to inform that I am picking qcow2 image from my flexible engine bucket. So i used accesskey and secret key

ShiChangkuo commented 3 years ago

@abhaysrivastava-orange does huaweicloud_images_image meet your needs?

If yes, I will try to implement a new resource in flexible engine.

abhaysrivastava-orange commented 3 years ago

@ShiChangkuo In huaweicloud_images_image also how can we provide access_key and secret_key of obs bucket There is no option.

ShiChangkuo commented 3 years ago

access_key and secret_key are unnecessary because the bucket belongs to you. for more details, please refer to https://docs.prod-cloud-ocb.orange-business.com/api/ims/en-us_topic_0037131984.html

abhaysrivastava-orange commented 3 years ago

@ShiChangkuo In my case bucket is not belong to me I have to fetch image from other user bucket so I need to provide access_key and secret_key

ShiChangkuo commented 3 years ago

Do you mean you want to fetch the image with others AK/SK?

abhaysrivastava-orange commented 3 years ago

@ShiChangkuo yes other ak/sk and I have those as/sk. But need to insert in terraform

ShiChangkuo commented 3 years ago

can the bucket owner add a policy that allows you to fetch the image file? then you can download it without authorization. I think it's more safer.

abhaysrivastava-orange commented 3 years ago

@ShiChangkuo Yes but if they make it public then it will be public for all. So anyhow we need to pass ak.sk while download. Is it possible to give ak/sk in this terraform module "flexibleengine_images_image_v2" or I will think on different approach.

ShiChangkuo commented 3 years ago

@abhaysrivastava-orange AK/SK is only an authorization method, but we cannot cover all situations where the image file can be obtained through authorization.

Maybe you can download it manually, then try to use local_file_path in "flexibleengine_images_image_v2".

abhaysrivastava-orange commented 3 years ago

@ShiChangkuo Thanks