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

v7.0.2 sls create_domain fails #573

Closed
CodeZeno opened this issue Apr 26, 2023 · 3 comments · Fixed by #575
Closed

v7.0.2 sls create_domain fails #573

CodeZeno opened this issue Apr 26, 2023 · 3 comments · Fixed by #575
Labels

Comments

@CodeZeno
Copy link

CodeZeno commented Apr 26, 2023

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Bug Report

Error Description
I was receiving an error in v6.4.4 about the stack not being found so updated to v7.0.2, I cleared everything and try to start from scratch. But this plugin is unable to see my certificate which I have created in both us-east-1 and ap-southeast-2.

Command Run
sls create_domain --verbose --aws-profile codezeno (usually the profile is picked up from serverless.yml > provider.profile but I wanted to make sure)

Console Output

C:\work\projects\api>sls create_domain --verbose --aws-profile codezeno
Running "serverless" from node_modules
V2 - 'staging-api.mycustomdomain.com' does not exist.
Searching for a certificate with the '*.mycustomdomain.com' domain
Environment: win32, node 18.14.0, framework 3.30.1 (local) 3.28.1v (global), plugin 6.2.3, SDK 4.3.2
Docs:        docs.serverless.com
Support:     forum.serverless.com
Bugs:        github.com/serverless/serverless/issues

Error:
Error: Unable to create domain 'staging-api.mycustomdomain.com':
Could not find an in-date certificate for '*.mycustomdomain.com'.
    at ServerlessCustomDomain.<anonymous> (C:\work\projects\api\node_modules\serverless-domain-manager\dist\src\index.js:228:23)
    at Generator.throw (<anonymous>)
    at rejected (C:\work\projects\api\node_modules\serverless-domain-manager\dist\src\index.js:6:65)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Domain Manager Configuration

service: codezeno-api
frameworkVersion: '3'

provider:
  name: aws
  profile: codezeno
  runtime: nodejs18.x
  stage: v1
  region: ap-southeast-2
  endpointType: REGIONAL
  memorySize: 256
  timeout: 10

package:
  patterns:
    - '!*.cmd'

functions:
  Codezeno:
    handler: handler.codezeno
    name: Codezeno-API
    description: 'Codezeno API'
    events:
      - http:
          path: v1/auth
          method: post
          cors: true
      - http:
          path: v1/reauth
          method: post
          cors: true
      - http:
          path: v1/user/rewards
          method: get
          cors: true

plugins:
  - serverless-domain-manager

custom:
  customDomain:
    domainName: staging-api.mycustomdomain.com
    basePath: ""
    stage: ${self:provider.stage}
    certificateName: '*.mycustomdomain.com'
    createRoute53Record: true
    createRoute53IPv6Record: true
    endpointType: regional
    securityPolicy: tls_1_2
    apiType: http

Versions

  • Domain Manager version(s): v7.0.2
  • Node/npm version: v18.14.0/v9.4.2
  • Serverless Version: v3.30.1
  • Lambda Code: Javascript

Possible Solution
It certainly seems like credentials or permission issues as the certificates exists and are valid

Additional context/Screenshots
In version 6.4.4 I had errors about the cloud formation stack not being found however it would still work as if it could find it.

@CodeZeno CodeZeno added the bug label Apr 26, 2023
@jakephot
Copy link

I have a similar issue here with version 7.0.2. In my ~/.aws/credentials I added a line region=us-east-1 but this did not resolve the problem. I do not have the environment variable AWS_REGION set in my environment and this could be causing it. A possible similar issue is: aws/aws-sdk-js-v3#3469

% yarn sls create_domain --aws-profile my-profile
yarn run v1.22.19
$ /Users/.../awk-eden-bridge/node_modules/.bin/sls create_domain --aws-profile my-profile
Environment: darwin, node 14.21.3, framework 3.30.1 (local), plugin 6.2.3, SDK 4.3.2
Docs:        docs.serverless.com
Support:     forum.serverless.com
Bugs:        github.com/serverless/serverless/issues

Error:
Error: Region is missing
    at default (/Users/.../awk-eden-bridge/node_modules/@aws-sdk/config-resolver/dist-cjs/regionConfig/config.js:10:15)
    at /Users/.../awk-eden-bridge/node_modules/@aws-sdk/node-config-provider/dist-cjs/fromStatic.js:6:83
    at /Users/.../awk-eden-bridge/node_modules/@aws-sdk/property-provider/dist-cjs/chain.js:11:28
    at async coalesceProvider (/Users/.../awk-eden-bridge/node_modules/@aws-sdk/property-provider/dist-cjs/memoize.js:14:24)
    at async /Users/.../awk-eden-bridge/node_modules/@aws-sdk/property-provider/dist-cjs/memoize.js:26:28

@rddimon
Copy link
Collaborator

rddimon commented May 5, 2023

Hi @CodeZeno

Could you please try the latest 7.0.3 release?

@rddimon rddimon linked a pull request May 9, 2023 that will close this issue
@rddimon
Copy link
Collaborator

rddimon commented May 10, 2023

Hi there

Closing it as the issue was fixed in the release 7.0.3

@rddimon rddimon closed this as completed May 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants