Skip to content

MosaicJSON on private S3 does not work but cog works #644

Answered by charalamm
charalamm asked this question in Q&A
Discussion options

You must be logged in to vote

After all, seems like one needs to pass a custom client to MosaicTilerFactory because the boto3 client can not read the endpoint s3 from an environment variable.

So, what I did was to create an environment variable with the non-aws endpoint url and the endpoint's protocol like, S3_ENDPOINT_WITH_PROTOCOL=https://mydomainname.com and then add a custom client to the MosaicTilerFactory like:

import os

from boto3.session import Session as boto3_session
from titiler.mosaic.factory import MosaicTilerFactory

mosaic = MosaicTilerFactory(
    router_prefix="/mosaicjson",
    backend_dependency=lambda: {
        "client": boto3_session().client(
            "s3",
            endpoint_url=os.getenv…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@vincentsarago
Comment options

@charalamm
Comment options

@vincentsarago
Comment options

Answer selected by charalamm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants