Skip to content

Can't load init files from S3 in eu-west-1, wrong S3 URL #929

@chadmyers

Description

@chadmyers

Describe the question/issue

When running an ECS task in eu-west-1 (Ireland), using a firelens configuration that uses s3 init from a file in a bucket in eu-west-1, it attempts to pull the file from https://s3.EU.amazonaws.com/...

This is because the init Go process is using GetBucketLocation to get the region where the bucket is located, but for some reason only in eu-west-1, the LocationConstraint is "EU" instead of the region name. Consider the following awscli output:

❯ aws s3api --profile prod --region eu-west-1 get-bucket-location --bucket "(my bucket in eu-west-1)"
{
    "LocationConstraint": "EU"
}
 
❯ aws s3api --profile prod --region eu-west-1 get-bucket-location --bucket "(my bucket in us-west-2)"
{
    "LocationConstraint": "us-west-2"
}

I see in the init process code it has special handling for us-east-1 (whose LocationConstraint is an empty string). I think we need to add special handling for eu-west-1 as well.

UPDATE: I found out that on very old buckets (from around the time the eu-west-1 region was first launched), LocationConstraint is EU, but on newer buckets, it's eu-west-1.

UPDATE 2: This odd behavior is mentioned in the GetBucketLocation docs:

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions