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

Function URLs get deleted (or won't get created) when provisioned capacity is set on Lambdas for AWS #12387

Open
4 tasks done
ahmednuaman opened this issue Mar 13, 2024 · 0 comments

Comments

@ahmednuaman
Copy link

Are you certain it's a bug?

  • Yes, it looks like a bug

Is the issue caused by a plugin?

  • It is not a plugin issue

Are you using the latest v3 release?

  • Yes, I'm using the latest v3 release

Is there an existing issue for this?

  • I have searched existing issues, it hasn't been reported yet

Issue description

A funny one. I was experimenting with adding provisioned capacity to the Lambda URL function. On deployment everything looks good:

endpoints:
  GET - https://xxx.execute-api.us-east-1.amazonaws.com/api/{proxy+}
  POST - https://xxx.execute-api.us-east-1.amazonaws.com/api/{proxy+}
  backendURL: https://xxx.lambda-url.us-east-1.on.aws/

However in the console there's no Lambda URL configured. In the Cloudformation stack I can see that the Lambda URL was deleted:

image

When I comment out provisioned capacity, the Lambda URL is then created.

Service configuration (serverless.yml) content

service: apis
frameworkVersion: '3'

provider:
  name: aws
  runtime: nodejs20.x
  architecture: arm64
  stage: ${env:BUILD_STAGE, 'development'}
  region: ${env:AWS_REGION, 'us-east-1'}
  timeout: 29
  role: ${ssm:/xxx/lambda_role_arn}
  deploymentBucket:
    name: ${ssm:/xxx/s3_serverless}
    serverSideEncryption: aws:kms
  httpApi:
    id: ${ssm:/xxx/api_gateway_rest_api_id}

functions:
  backendURL:
    name: backendURL
    handler: streaming.handler
    timeout: 120
    # provisionedConcurrency: 10
    environment:
      ACCOUNT_ID: ${ssm:/${self:custom.service}/${self:provider.stage}/account_id}
      ORIGIN: https://${ssm:/xxx/cloudfront_site_domain}
    url:
      authorizer: aws_iam
      invokeMode: RESPONSE_STREAM
      cors:
        allowedOrigins:
          - https://${ssm:/xxx/cloudfront_site_domain}
          - https://localhost:4000
        allowedHeaders:
          - Content-Type
          - Authorization
          - X-Amz-Date
          - X-Api-Key
          - X-Amz-Security-Token
          - x-amz-content-sha256
        allowedMethods:
          - '*'
        allowCredentials: true

package:
  individually: false
  exclude:
    - node_modules/**
  excludeDevDependencies: true

custom:
  service: xxx
  name: ${self:custom.service}-backendAPIs

  serverless-offline:
    noPrependStageInUrl: true
    noAuth: true
    ignoreJWTSignature: true

  webpack:
    webpackConfig: webpack.config.js
    includeModules:
      packagePath: './build/server/service/package.json'

plugins:
  - serverless-better-credentials
  - serverless-deployment-bucket
  - serverless-webpack
  - serverless-offline

Command name and used flags

N/A

Command output

Using deployment bucket 'xxx'

✔ Service deployed to stack xxx (190s)

endpoints:
  GET - https://xxxx.execute-api.us-east-1.amazonaws.com/api/{proxy+}
  POST - https://xxxx.execute-api.us-east-1.amazonaws.com/api/{proxy+}
  backendURL: https://xxxx.lambda-url.us-east-1.on.aws/
functions:
  backend: xxx-APIs (5.7 MB)
  backendURL: xxx-APIs_url (5.7 MB)

2 deprecations found: run 'serverless doctor' for more details

Need a faster logging experience than CloudWatch? Try our Dev Mode in Console: run "serverless dev"

Environment information

Framework Core: 3.38.0 (local)
Plugin: 7.2.0
SDK: 4.5.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant