Skip to content

Commit

Permalink
Merge pull request #147 from wri/titiler-fixes
Browse files Browse the repository at this point in the history
Titiler fixes
  • Loading branch information
solomon-negusse authored Jul 16, 2024
2 parents 3ee2258 + fb0b2b8 commit aaa91ee
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ module "orchestration" {
security_group_ids = [data.terraform_remote_state.core.outputs.postgresql_security_group_id]
task_role_policies = [
module.lambda_raster_tiler.lambda_invoke_policy_arn,
module.storage.s3_write_tiles_arn
module.storage.s3_write_tiles_arn,
"arn:aws:iam::aws:policy/AmazonS3ReadOnlyAccess"
]
task_execution_role_policies = [
data.terraform_remote_state.core.outputs.secrets_postgresql-reader_policy_arn,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,21 @@ def handler(event, context):
dataset = path_items[1]
if dataset == "cog":
query_params = parse_qs(query_string)
dataset = query_params.get("dataset", [None])[0]
# in the case of cog assets, we look for optional
# `dataset` (if url to external cog isn't specified) in query
# parameter setting the default to "cog" instead of `None` for clarity in later steps
dataset = query_params.get("dataset", ["cog"])[0]
version = query_params.get("version", [None])[0]
else:
version = path_items[2]

latest_versions = get_latest_versions(f"https://{host}/_latest")

for latest_version in latest_versions:
if latest_version["dataset"] == dataset:
if latest_version["dataset"] == dataset or dataset == "cog":

if "cog" in path_items:

if version != "latest":
return request

Expand Down

0 comments on commit aaa91ee

Please sign in to comment.