UNSOLVED

LeslieLim

updated

3 years ago

L

LeslieLim

1 Rookie

•

9 Posts

0

3266

May 22nd, 2021 07:00

Accessing ECS using boto3

Hi,

Does anyone have an example of accessing ECS S3 buckets using python boto3 library? Thanks!

  • LeslieLim

    1 Rookie

    •

    9 Posts

    2345

    0

    Posted May 22nd, 2021 07:00

    Found the examples.

    https://github.com/EMCECS/ecs-samples/tree/master/boto3-python-workshop

    Will be trying these out first.

  • LeslieLim

    1 Rookie

    •

    9 Posts

    2138

    0

    Posted June 11th, 2021 02:00

    I noticed that even with user added in the ACL, I am unable to read/download file from bucket, if user is non-owner of bucket. I would need to apply access to user in the bucket policy as well. Is this a normal behaviour? Thanks.

  • DELL-Sam L

    Community Manager

    •

    8111 Posts

    •

    34595 Points

    2131

    0

    Posted June 11th, 2021 08:00

    Hello LeslieLim,

    Here is a link to a kb that maybe of assistance.

    https://dell.to/3zmXHga

  • 0

    0

    Posted November 20th, 2023 20:11

    I have this problem also, and am curious to read the link (https://www.dell.com/support/kbdoc/en-us/000014295) https://dell.to/3zmXHga

    Unfortunately i get this error: 

    This article is permission based. Find another article.

    Any ideas how to get access?

    DELL-Sam L

    Community Manager

    •

    8111 Posts

    •

    34595 Points

    0

    November 20th, 2023 22:26

    Hello GuyLafleur_ch,

    Here is what the link states.

    ECS: How to configure BOTO for ECS

    Summary: How to configure BOTO for ECS

    Audience Level: Customer

    Article Content


    Instructions

    How to configure BOTO for ECS

    Boto is an AWS (Amazon Web Services) SDK for Pyton, giving developers a way to write object-oriented applications for S3 and EC2 services while allowing for low-level direct service access as necessary.

    To configure the latest version - boto3 - for use with ECS, be sure to use the absolute address of the host system, including the scheme and S3 services port, e.g.

    01.ecs_endpoint=https://dell.to/49Nv0eA 02.ecs_access_key_id = 'ecs_user' 03.ecs_secret_key = 'secret'

    and provide them to the S3 session and resource constructors.

    01.session = Session(aws_access_key_id=ecs_access_key_id, aws_secret_access_key=ecs_secret_key) 02.s3 = session.resource('s3', endpoint_url=ecs_endpoint, verify=False, 03. config=Config(signature_version='s3', s3={'addressing_style': 'path'}))

    Be sure to import Session and Config to avoid any conflicts at runtime:

    01.from boto3.session import Session, Config

    Regarding additional options:

    Specifying s3 as the signature_version implies usage of AWS v2 authentication, which provides better compatibility with ECS than the default authentication version used by boto3.

    Indicating path-style addressing eliminates the need for any particular configuration in place on the ECS or DNS.

    The verify=False option is only necessary when using HTTPS, and may be omitted when using ECS Test Drive (https://dell.to/49Hdg4B) as the target endpoint.

    If using HTTPS, it is recommended that you use the -W command to clean the output (e.g. python -W once boto3_ecs.py ) .