-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[Tracking Issue] SAM CLI + CDK Beta release feedback #3242
Comments
It looks like the homebrew tap for |
Thanks for reporting this @sonya ! We have recreated this tag and updated our homebrew config. Can you please try downloading the source, or installing it with homebrew Please find the new release tag here: https://github.com/aws/aws-sam-cli/releases/tag/v1.29.0.dev202108311500 |
Thanks @wchengru, i was able to install directly with I recently tried out the high level PythonFunction construct in CDK and was impressed by how easily it packaged up all my dependencies. Very excited about the potential of adding SAM to making local testing easier! I just tried running
|
I've found it unusable at the moment. The CDK L2 constructs sometimes create 'helper' lambdas for configuration, and sam-beta-cdk tries to compile these during the build process. For example, adding a CloudWatch log group as the target of an EventBridge rule in CDK creates a Lambda that creates a Custom::CloudwatchLogResourcePolicy, and SAM attempts to build this Lambda, which fails. Have raised issue #3192 |
Hey team, overall I'm pretty impressed with the implementation so far. The only thing I find lacking is multiple stages. With sam, using samconfig.toml, I'd setup different stages: [staging]
[staging.deploy]
[staging.deploy.parameters]
stack_name = "project-staging"
parameter_overrides = "Environment=\"staging\""
[prod]
[prod.deploy]
[prod.deploy.parameters]
stack_name = "project-prod"
parameter_overrides = "Environment=\"prod\"" And use conditional logic in my template using parameter_overrides. for example: Parameters:
Environment:
Type: String
AllowedValues:
- staging
- prod Deployments are then easy by specifying the stage e.g This workflow is impossible now since cdk is synthed before SAM evaluates these parameters. |
Why does a Python CDK project initialized with SAM not reference a Virtual Environment like is when initializing a Python CDK project with the CDK cli? Does the |
I just created a bug for Also, related and compounding the problem is the fact that if the environment variables are used to initialize the stack account and region, and the default profile config is empty, the region in the config is never set to unknown-region. So I created a bug for that as well. |
Hey, I'm using M1 Pro on Monterey,
Any advice is greatly appreciated, thanks |
@matthewthomasgb can try |
@iRoachie thanks for getting back to me, unfortunately I get the same result - |
@matthewthomasgb .. thanks for raising this issue .. There is already a requested feature asking for M1 Mac homebrew bottle. This will fix the SAM CLI installation in M1 mac. Please +1 this issue to prioritize it. |
@sonya .. thanks for sharing your feedback .. can I ask you to give us more info about the |
First - I absolutely love this and sincerely appreciate the addition of this integration. I am currently running into an issue that appears to have been resolved for the released versions. I suspect that this beta may be outdated compared to release, but I'm not sure. The referenced issue is #3243. Secondly, I noticed something interesting. The CDK cli and SAM cli use two different .cdk-out folders. If possible, it would be great if sam-cli would check for a .cdk-out that is in the current working directory before creating its .sam-cli/.cdk-out directory (at least for cdk projects). Third, I am wondering how well this will play together with CDK deployed apps. I was noticing in my testing that I was getting an invalid ARN for the KMS service (and possibly others, though I didn't check). The setup is this:
The workaround would be to develop the lambda functionality with sam deploy then use cdk in the pipelines. That is a valid solution for us, though I think having the two CLI's play nicely would be extremely helpful in a number of scenarios. Thanks again for pushing something like this forward! |
Hey @cdanhowell , thank you so much for the feedback! I would love to get on a call and understand your use cases better, please reach out to me via DM and I will set up a call! |
same |
Same, does anyone have a temp solution instead of deploying to aws for each code change? 😓😭 |
@Kelvijn .. is you issue related to install the CDK beta version on M1 Mac? .. I do not get your question about a deploying to aws for each code change? |
@jcaito .. thanks for your help. I verified that it is working on Big Sur mac with the following details
I just did as explained by @jcaito
@Kelvijn @wazcov @matthewthomasdev .. could you please confirm if this fixes your issue, or you still have installation issue. |
Is I get the following error:
Which makes sense, seeing as there is no Makefile required like when using custom runtimes with SAM CLI. Adding a Makefile next to the Go source also does not work, because EDIT: Seems the runtime does not matter, then just complains about missing Go files. |
Thanks very much to the team for the efforts on SAM+CDK local testing integration to date. My team and I are hoping to migrate from Severless Framework to AWS CDK. Whilst CDK doesn't natively provide local development testing functionality whereas Serverless Framework does, I was hoping to be able to use sam-beta-cdk to fill the gaps for our Lambda deployments. Something I came across during testing however is that presently sam-beta-cdk only supports local testing of Lambda functions created with the aws_lambda CDK construct: During refactoring some of our Lambda apps from Serverless Framework -> AWS CDK, I decided that ideally we would use the aws_lambda_nodejs construct as it allows for much simpler dependency management and project structuring of nodejs functions. I was wondering if anyone would be able to point me in the right direction regarding the reasons for the current limitation and if providing support for other Lambda L2 constructs is on the roadmap? Thanks in advance! |
|
I'm receiving the error I tried both the How do I provide the credentials? I was able to get it to work by clearing out the existing .aws-sam folder content. Though only the environment variable credentials work, the |
Is there anyway to update the sam-cli version? Seems sam-beta-cdk is stuck on 1.29.0 |
Hey @praneetap I just saw release 1.37.0. Does this mean that aws-sam-cli-beta-cdk is no longer needed? |
Yes! You should be able to get it on mainline! Let us know what you think :) |
Thanks all for your feedback on the beta version. The CDK support got released in version 1.37.0. Please check the CDK support documentation for the updated information about the CDK support usage. If you have any questions, features, or issue, please do not hesitate to open a github issue. |
I can run my CDK stack locally using SAM by using this guide My APIgateway need to use Lambda Authorizer. Is that anyway to to test the APIgateway locally which have Authorizer using SAM? If can, please provide me a guide. Thanks |
Same issue here, cdk and sam are setup and working properly, but when invoking local-api (which calls lambda from another stack), it throws me error of function not found. |
Thanks @mikelxc for your feedback. Unfortunately SAM CLI currently does not support testing multiple stacks. So, the API gateway resources and Lambda functions have to be in the same stack so |
Sorry @kenchoong, unfortunately |
Can you inform on your planning wrt
That would be great. |
We recently announced the public preview of SAM CLI support for local development and testing of CDK projects.
With this preview release, you can use AWS SAM CLI to build, test, and in the future, package applications defined using the AWS CDK.
To install this beta release, follow instructions here.
We would love your feedback on the feature! Please feel free to leave your thoughts/ideas in the comments.
The text was updated successfully, but these errors were encountered: