Skip to content
This repository has been archived by the owner on Jan 2, 2025. It is now read-only.

Custom s3 configuration bucket names not supported #515

Open
mbruning24 opened this issue Apr 7, 2022 · 4 comments
Open

Custom s3 configuration bucket names not supported #515

mbruning24 opened this issue Apr 7, 2022 · 4 comments

Comments

@mbruning24
Copy link

I have a serverless configuration that uses the v3 custom bucket configuration for s3 events shown here.

provider:
  s3:
    myBucket:
      name: 'some-custom-name-here'
      # etc...

functions:
  myFunction:
    events:
      - s3:
          bucket: myBucket
          event: s3:ObjectCreated:*

When the buckets() function is called in the start handler (here) to create the resources for s3rver, it just returns the string myBucket as the bucket name, which obviously in this case it is not.

Can we get some additional logic to check for bucket configurations at this.service.provider.s3[key] before just defaulting to the identifier?

@mbruning24
Copy link
Author

For additional reproduction info, you can set up your serverless yml as above and run aws --endpoint http://localhost:8001 --profile <your_local_profile> s3api list-buckets and get the response

{
    "Owner": {
        "DisplayName": "S3rver", 
        "ID": "123456789000"
    }, 
    "Buckets": [
        {
            "CreationDate": "2022-04-07T15:16:47.737Z", 
            "Name": "myBucket" // should be "some-custom-name-here"
        }
    ]
}

@mbruning24
Copy link
Author

Although, I just found an undocumented option that can work around this

custom:
  s3:
    # other config
    buckets: some-custom-name-here

This will work when you don't need the extra configuration (like cors, website, etc)

Still, it would be great just to pass along the configuration.

@ar90n
Copy link
Owner

ar90n commented Apr 8, 2022

@mbruning24
Thanks for your report! And I'm sorry for the poor documentation. I added the specification about buckets you said to README.md.

@bitsofinfo
Copy link

@mbruning24 @so... you can only define ONE custom bucket via "buckets:" option? is this a comma delimited list? array? just a single string?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants