Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using 'endpoint_url' param makes mapproxy s3.py fail when using 'cloudfront' #673

Open
JoseSanchezMoralesIDOX opened this issue May 9, 2023 · 0 comments

Comments

@JoseSanchezMoralesIDOX
Copy link

JoseSanchezMoralesIDOX commented May 9, 2023

I'm using mapproxy 1.12.0, and s3 buckets for caching. Mapproxy is running in Docker and the AWS credentials are passed as variables to docker, i.e.:
-e AWS_ACCESS_KEY_ID=
-e AWS_SECRET_ACCESS_KEY=
-e AWS_DEFAULT_REGION=

The above system works okay, however, after having implemented a CloudFront distribution in AWS around the s3 bucket, even though I have explicitly set up the endpoint_url value under globals.cache.s3 in the mapproxy.yaml file, and replacing
client = session.client('s3', region_name=self.region_name, endpoint_url=self.endpoint_url)
by
client = session.client('cloudfront', region_name=self.region_name, endpoint_url=self.endpoint_url)
in the s3.py file within the cache folder in mapproxy, I got the following error:

AttributeError: 'CloudFront' object has no attribute 'head_bucket'

This is my configuration in the mapproxy.yaml:

 os_productxx_27700:
    grids: [uk_bng_abc]
    sources: ['os_xx:os_productxx']
    meta_size: [4, 4]
    meta_buffer: 0
    cache:
      type: s3
      directory: /cache/os_productxx/27700/
      bucket_name: mapproxy-s3-testing

globals:
  cache:
    s3:
      profile_name: default
      region_name: eu-west-1
      endpoint_url: https://xxxxxxxxxxxxx.cloudfront.net

what am I missing? or is there any further configuration?

Thanks,
Jose.

@JoseSanchezMoralesIDOX JoseSanchezMoralesIDOX changed the title 'endpoint_url' param is ignored at connecting to s3 Using 'endpoint_url' param makes mapproxy s3.py fail when using 'cloudfront' May 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant