question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add full support for stages

See original GitHub issue

Right now, the stages feature needs more work to be feature complete. The proposed idea is:

  • chalice deploy prod - Will create a new API gateway stage if necessary
  • The lambda function code is zipped up and sent to lambda. A new function version is created
  • A lambda alias for the the stage name points to the new function version updated.

I also need to update the API gateway integration request to forward to the appropriate lambda function based on the stage name. I’ll need to add a context variable with the stage name.

I’d also like to add an optimization to just update lambda aliases when you go from dev->prod where the lambda code has not changed. In that case we can just flip the alias.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:14
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

7reactions
garnaatcommented, Jul 11, 2016

What is the stage in API Gateway buying us in this scenario? This isn’t really a Chalice-specific question. This is a general question about Lambda and API Gateway although I think it’s important that the approach we build into Chalice make sense.

Stages seem to be an attempt to provide some sort of resource isolation but I think accounts are really a much better way to accomplish isolation because they can be applied to all resource types, not just API Gateway endpoints.

So, if we are using accounts for isolation it seems like we would just deploy new versions of functions within the appropriate account, move aliases around as necessary and stages would be superfluous.

Thoughts?

5reactions
jameslscommented, Mar 29, 2017

There’s a PR with a first attempt at this approach: https://github.com/awslabs/chalice/pull/264 Hopefully this is a reasonable compromise of the suggested approaches so far:

  • API Gateway “stages” are no longer used.
  • A “chalice stage” is a completely separate set of AWS resources (APIG, Lambda function, IAM role, etc).
  • You can still use separate accounts for isolation (in this case you’d specify a --profile to a different account if you were deploying locally)
  • You can have multiple chalice stages in the same account if you want. Also allows for nice integration with CodePipelines.

So for example, running:

$ chalice deploy dev
...
$ chalice deploy prod

Will result in 2 APIG APIs, 2 lambda functions, 2 roles, etc. I’m also adding lambda env var integration so if you had other resources such as DDB tables, you could configure a separate table per stage and specify the table names vie environment variables that are passed to the lambda function.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Use Stage Manager to organize apps and windows on Mac
Add Stage Manager to the menu bar by dragging it from Control Center to the menu bar. Or choose Apple menu > System...
Read more >
Add a phase, stage or task to the work breakdown
Add phases to group stages together. To add a phase: Click on the ellipsis and select 'Enable phases'. You will see the stage...
Read more >
Stage Manager on iPad: How it works in iPadOS 16 - 9to5Mac
This detailed guide with screenshots and in-depth video cover how the new Stage Manager on iPad feature works in iPadOS 16.
Read more >
How To Add Opportunity Stages To Outreach
Opportunity Stages must be added to the stage options in Outreach prior to configuring Opportunity Stages in the CRM plugin.
Read more >
Stages Link Support
Stages Link Support. Search our support articles or create a support ticket to speak with someone at Stages. Support Home.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found