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

[v1.30.2] aws-cdk-lib.aws_cloudfront_origins.S3Origin is deprecated #407

Open
shengslogar opened this issue Sep 13, 2024 · 4 comments
Open
Labels
bug Something isn't working

Comments

@shengslogar
Copy link

Description

Low priority "bug".

When deploying a Serverless v3 app with this plugin installed, multiple duplicate console warnings are displayed:

[WARNING] aws-cdk-lib.aws_cloudfront_origins.S3Origin is deprecated.
  Use `S3BucketOrigin` or `S3StaticWebsiteOrigin` instead.
  This API will be removed in the next major release.

I only use server-side-website asset splitting, which would require S3Origin to be replaced with S3BucketOrigin. Not sure about all the other possible use cases.

How to Reproduce

Set up a project following the "Server-side website" README and run sls package or sls deploy.

Additional Information

  • Serverless Framework v3.39.0
  • Lift v1.30.2
@shengslogar shengslogar added the bug Something isn't working label Sep 13, 2024
@seriquynh
Copy link

I'm using v1.30.3 and see the following deprecations.

[WARNING] aws-cdk-lib.aws_cloudfront_origins.S3Origin is deprecated.
  Use `S3BucketOrigin` or `S3StaticWebsiteOrigin` instead.
  This API will be removed in the next major release.
[WARNING] aws-cdk-lib.aws_cloudfront_origins.S3Origin is deprecated.
  Use `S3BucketOrigin` or `S3StaticWebsiteOrigin` instead.
  This API will be removed in the next major release.
[WARNING] aws-cdk-lib.aws_cloudfront_origins.S3Origin is deprecated.
  Use `S3BucketOrigin` or `S3StaticWebsiteOrigin` instead.
  This API will be removed in the next major release.
[WARNING] aws-cdk-lib.aws_cloudfront_origins.S3Origin#bind is deprecated.
  Use `S3BucketOrigin` or `S3StaticWebsiteOrigin` instead.
  This API will be removed in the next major release.
[WARNING] aws-cdk-lib.aws_cloudfront_origins.S3Origin#bind is deprecated.
  Use `S3BucketOrigin` or `S3StaticWebsiteOrigin` instead.
  This API will be removed in the next major release.
[WARNING] aws-cdk-lib.aws_cloudfront_origins.S3Origin#bind is deprecated.
  Use `S3BucketOrigin` or `S3StaticWebsiteOrigin` instead.
  This API will be removed in the next major release.

Are there any updates about resolving these deprecations?

@mnapoli
Copy link
Member

mnapoli commented Jan 7, 2025

@seriquynh a pull request would be welcome 👍

@seriquynh
Copy link

@mnapoli I'm sorry for the late reply.

I don't have much experience working with AWS or Serverless. I'm also completely new to Bref and the Serverless Lift plugin. I tried researching ways I might be able to help, but unfortunately, I couldn't find anything.

First, I noticed that the repository or the plugin page doesn't have a CONTRIBUTING section. Next, I looked at the CI workflow to understand how the tests were executed. It didn't seem to have any special configurations. If the Serverless version was 2, we would need to use @serverless/test@8. Otherwise, it could be left as is.

Here is my environment:

  • OS: Windows 11 Pro
  • Node: v20.17.0
  • NPM: 10.9.2

After cloning the repository, I ran npm install, followed by npm run test. But, many tests failed due to errors I have no idea for now.

Image
Image

Depending on deprecations, I guess replacing S3Origin with S3BucketOrigin like this file.

Image
Image

The key is I don't know how to verify if it works after replacing.

So, could you guide me how to run tests, how it works, please? Or point me to the right CONTRIBUTING place?

@mnapoli
Copy link
Member

mnapoli commented Jan 23, 2025

@seriquynh thank you for looking into this.

I think it's perfectly fine to wait for someone with more experience with the CDK to dive into this to be honest. The class is deprecated but nothing is broken, we have more time until this becomes more urgent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants