GithubHelp home page GithubHelp logo

Comments (8)

RuyOliveiraRunaHR avatar RuyOliveiraRunaHR commented on August 24, 2024 1

Hi Otto !
No problem, thanks for all your assistance !

from cloudfront-authorization-at-edge.

ottokruse avatar ottokruse commented on August 24, 2024

Hi @RuyOliveiraRunaHR ! Does this help? https://github.com/aws-samples/cloudfront-authorization-at-edge#deploying-changes-to-the-react-app-or-static-site

from cloudfront-authorization-at-edge.

ottokruse avatar ottokruse commented on August 24, 2024

Increment parameter Version upon redeploying, that makes sure all Lambda@Edge functions get redeployed

from cloudfront-authorization-at-edge.

RuyOliveiraRunaHR avatar RuyOliveiraRunaHR commented on August 24, 2024

Thanks Otto for your help.
Just to clarify, I'm making a change in code of src->lambda-edge->check-auth->index.ts file.
I'm going to take a look at the link above.
Thanks once again.

from cloudfront-authorization-at-edge.

RuyOliveiraRunaHR avatar RuyOliveiraRunaHR commented on August 24, 2024

Opss...I did something wrong:
I've edited the file template.yaml at the root directory as below:

  CheckAuthHandler:
    Type: AWS::Serverless::Function
    Properties:
      CodeUri: src/lambda-edge/check-auth/
      Handler: bundle.handler
      Role: !GetAtt LambdaEdgeExecutionRole.Arn
      Timeout: 5
      Version: 2  # Dummy field, change this to force CloudFormation to deploy this resource if none of the other properties change

and now I'm getting to following error when I run sam build:

samcli.commands.validate.lib.exceptions.InvalidSamDocumentException: [InvalidResourceException('CheckAuthHandler', 'property Version not defined for resource of type AWS::Serverless::Function')] ('CheckAuthHandler', 'property Version not defined for resource of type AWS::Serverless::Function')

any advice ? Thanks.

from cloudfront-authorization-at-edge.

ottokruse avatar ottokruse commented on August 24, 2024

Don't put them on the AWS::Serverless::Function but instead on the custom resources for the code update (they publish the Lambdas to a new version, and inject config into them).

Easiest way: you can just use the parameter overrides when deploying, as Version is a parameter of this template, and passed to the custom resources.

So sam deploy --template-file packaged.yaml --stack-name <Your Stack Name> --capabilities CAPABILITY_IAM --parameter-overrides "Version=<specify a new version here every time you want the Lambda Custom Resources to redeploy>"

from cloudfront-authorization-at-edge.

RuyOliveiraRunaHR avatar RuyOliveiraRunaHR commented on August 24, 2024

Hi Otto,
Thanks for your help, it worked perfectly !
One thing more, have you used samconfig.toml to create multiple environments? did it worked ?
In my case, I'm trying to create develop and prodction envs, but it looks like sam deploy is not reading parameter-overrrides from samconfig.toml.

Thanks once again.

from cloudfront-authorization-at-edge.

ottokruse avatar ottokruse commented on August 24, 2024

it worked perfectly

Awesome! 🎉

One thing more, have you used samconfig.toml to create multiple environments? did it worked ?

Sorry mate I'm not an expert on that. I usually use plain sam deploy statements, just make sure to switch to the s3 deployment bucket in the right account.

from cloudfront-authorization-at-edge.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.