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

question about limits #1

Closed
polothy opened this issue Mar 5, 2020 · 3 comments
Closed

question about limits #1

polothy opened this issue Mar 5, 2020 · 3 comments

Comments

@polothy
Copy link

polothy commented Mar 5, 2020

Hello - thanks for the example! I had a few questions though:

  1. Using this method to deploy lambdas, do you run into the 50MB zip limit? From what I can tell, the code is uploaded to lambda vs served via S3 on each lambda invoke.

  2. In addition, if you wanted to deploy multiple lambdas (think of a microservice that uses API Gateway and a lambda per endpoint), would you need to make a secondary artifact for each lambda? Otherwise, I think the artifact would group all the lambdas into a single zip?

  3. From what I can gather, right now, the best lambda deploy experience is using from_asset on the lambda definitions and then using cdk deploy. We need to target multiple accounts and regions, so I'm guessing I would make a CodeBuild with a role that assumes different accounts then run AWS_REGION=region cdk deploy. This is likely fine, but the UX is not quite a nice as using CodePipeline with Cloudformation Create ChangeSet > manual approve > Cloudformation Apply ChangeSet.

  4. Lastly, RFC: 0049 Continuous Delivery for CDK Apps aws/aws-cdk#3437 might be the answer we need, but having trouble finding status on it.

Feel free to say "don't ask this here" and point me somewhere else 😄

@polothy
Copy link
Author

polothy commented Mar 6, 2020

Going to close this, sorry. I was scatter brained yesterday and was grasping at straws here. We are going to look into the cdk deploy route and then look forward to the RFC to perhaps improve things later on.

I asked about the RFC in the aws-cdk gitter channel, hopefully I'll get a response there.

@polothy polothy closed this as completed Mar 6, 2020
@skinny85
Copy link
Owner

Hey @polothy ,

thanks for opening the issue. I think your questions make a lot of sense :). Let me try to address them in turn.

#1

Using this method to deploy lambdas, do you run into the 50MB zip limit?

Yes. This example does not do anything to reduce the size of the ZIP.

If I wanted to do it, I would probably use a module bundler like Webpack with tree shaking to reduce the size in the case a JavaScript Lambda like in this example. However, this is specific to the runtime of the Lambda function (for example, a Java Lambda would use something like Proguard to reduce the size of the resulting JAR file).

From what I can tell, the code is uploaded to lambda vs served via S3 on each lambda invoke.

I don't understand this comment. The Lambda is created by pointing the function's code property to an S3 bucket/key combination. That's the usual way to do this (an inline code has a much smaller limit).

#2

There are 2 ways to do it:

  1. Do one build, and a separate output for each Lambda (like I did in the example).
  2. Do a separate build for the CDK code, and a separate one for each Lambda function (like in this example).

#3

The correct way for that is to do a cross-account CloudFormation deployment. Like in this example, just made a tad more complicated by having a role given for the action that belongs to a different account. In the CodePipeline API, it's as simple as passing the account property to the CloudFormation actions.

#4

It's very much in progress :). Take a look at https://github.com/NetaNir/meerkats for our work in progress.


If you have more questions, feel free to re-open the issue!

Thanks,
Adam

@polothy
Copy link
Author

polothy commented Mar 12, 2020

Thanks for taking the time to answer my questions, I really appreciate it!

# 1

I don't understand this comment.

This was me confused on how lambdas are actually deployed. I thought that you needed to make a dedicated S3 bucket for it to constantly serve the code from. Apparently you just need it for deployment then that's it. So my bad.

# 2

Thanks for confirming. With the RFC, it looks like this could be handled for us so we wouldn't have to do something per lambda.

# 3

Thanks.

# 4

Awesome! Really happy to see this and also to get an idea of what to expect so we can plan around it a little. I 100% realize nothing it set in stone and it'll change over time.

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

2 participants