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

Deploy hook not firing #5

Open
jwerre opened this issue Jul 23, 2020 · 1 comment
Open

Deploy hook not firing #5

jwerre opened this issue Jul 23, 2020 · 1 comment

Comments

@jwerre
Copy link

jwerre commented Jul 23, 2020

Not sure whats happening but when I deploy CloudFront trigger is not attached. It appears the after:aws:deploy:finalize:cleanup hook is not triggering. Here's my yaml if that helps:

---
service: my-lambda-edge

provider:
  name: aws
  region: us-east-1
  stage: ${opt:stage, 'staging'}
  runtime: nodejs12.x
  timeout: 120
  stackName: ${self:service}-${self:provider.stage}
  logRetentionInDays: 90
  deploymentBucket:
    name: my-lambda-edge-bucket
  role: my-iam-role
  environment:
    NODE_ENV: ${self:provider.stage}

custom:
  distributions:
    staging: -------------
    production: -------------
  lambdaEdgePreExistingCloudFront:
    validStages:
      - staging
      - production

package:
  exclude:
    - ./**
  include:
    - functions/*.js

functions:

  request:
    handler: functions/request.handler
    events:
      - preExistingCloudFront:
          distributionId: ${self:custom.distributions.${opt:stage, self:provider.stage}}
          eventType: origin-request
          pathPattern: '*'
          includeBody: false


  response:
    handler: functions/response.handler
    events:
      - preExistingCloudFront:
          distributionId: ${self:custom.distributions.${opt:stage, self:provider.stage}}
          eventType: origin-response
          pathPattern: '*'
          includeBody: false


plugins:
  - serverless-lambda-edge-pre-existing-cloudfront
sls --version
Framework Core: 1.76.1
Plugin: 3.6.17
SDK: 2.3.1
Components: 2.32.0
@jwerre jwerre changed the title Lambda does not deploy to edge Deploy hook not fireing Jul 23, 2020
@jwerre jwerre changed the title Deploy hook not fireing Deploy hook not firing Jul 23, 2020
@jwerre
Copy link
Author

jwerre commented Jul 23, 2020

I figured out the issue. If you deploy with the default stage and don't supply --stage flag the deployment hook is not triggered.

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