-
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
[RFC] SAM Accelerate (Cloud based development) #3264
Comments
If you would like to try these features out in Beta, here are the instructions to get it running! Please give it a spin and give us feedback on how we can improve this feature. |
@praneetap I have seen the sam accelerate demo in serverless office hours and I see it will great addition to sam cli. But I have a doubt, If team members who are working on same lambda function they cannot use |
That is the case today, sam sync is tightly bound with the account and stack name. Typically one would use |
@praneetap I am a huge fan of AWS SAM (cli) and I am exited to test this feature! I followed the instructions but I am stuck now on the following error: The command {'StackId': 'arn:aws:cloudformation:eu-west-1:732279076585:stack/eventbroker-app-stack-dev/9b6359f0-2378-11ec-8628-0acbb15b3ae5', 'ResponseMetadata': {'RequestId': 'ba23507c-a9cf-42f9-a412-2cba397f59e0', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': 'ba23507c-a9cf-42f9-a412-2cba397f59e0', 'content-type': 'text/xml', 'content-length': '395', 'date': 'Mon, 11 Oct 2021 14:13:28 GMT'}, 'RetryAttempts': 0}} but then I immediately got the error' |
Hi @ben-elsen! Thanks for your feedback. While we are taking a look at this, could you please confirm the profile exists locally and is valid? |
@praneetap thanks for the fast response! I have just checked the profile and it exists and is valid. |
Hi @praneetap , I just tried sync command with a clean app and the same problem arises. I created a new sam app with sam-init and I chose the Hello World one. I haven't changed anything, sam deploy goes well but with the samdev sync command, the same error shows. |
Hi @ben-elsen , thanks for reporting this issue. We find out that |
Thanks @mndeveci ok thanks for the update! Do you have an estimate about when the fix will be ready? Changing the default problem will cause me a bit too much work I think and I am just in the testing phase with sam sync.. |
@ben-elsen The PR for the fix is already open, can you give it a try? #3368 |
Hi @mndeveci , I am sorry that I wasn't able to respond earlier but illness was my part.. |
@ben-elsen no worries at all. Is this happening when you run |
@mndeveci Yes it is, I will add the output. I cannot add the template as it is not supported. It is a basic stack with a nested api stack. The api stack is a AWS::Serverless::Api resource with one resource that is connected to a simple lambda via an open api spec. The lambda only outputs a json response. That response is what I chance to test the samdev sync command. |
Facing the same issue, I checked the source code, it seems the watcher/observer isn't ignoring the PS: Currently on MacOS Big Sur amd64 with SAM 1.34.1. |
Sorry for the inconvenience @cayter, this is a known issue that we will be prioritizing soon. For a workaround, I would recommend to have a separate folder for function code, and update your resource's @ben-elsen, sorry for the late response, but we released Accelerate features withing regular SAM CLI. Can you install current version and give it a try? And please let us know if the use-case is different than what @cayter described above. |
@mndeveci No problem, thanks for confirming. |
@mndeveci, I can understand that totally! I just updated to version 1.35 but the problem remains. I don't know if I understand your workaround because I already have my lambda code in a handler.py file in a subfolder 'ingestion' but still, whenever I update code in the handler.py, the whole infra stack starts syncing. |
@ben-elsen can you provide us steps to re-produce so we can take a closer look at it? You may consider to create a new GH issue so that we can follow-up the conversation separately there. |
I loved this feature! The only thing I missed was a way to run builds within a container as I have some C-deps and SAM Accelerate doesn't work as it tries to build it locally for speed -- Workaround was to build a layer first then run sam sync |
Accelerate is GA as of v1.53.0. Closing |
We are working on adding a new set of features of the SAM CLI (Serverless Application Model Command Line Interface) that allows you to test against your application in AWS cloud in a production like environment, which you can quickly and iteratively build . Using the
sam sync --watch
capability lets SAM CLI monitor for any changes to AWS resources defined in your application and automatically sync them in your developer account in AWS cloud so you don't have to run manual deployments. We are also adding the ability to tail aggregated AWS CloudWatch logs and AWS X-Ray traces in real time.To summarize, we are working on the following features:
Want to try out these features in Beta? Instructions are here.
As an enhancement we are considering implementing development environments in a SAM application, tied to an AWS profile and AWS CloudFormation stack.
We would love your feedback/thoughts on this feature! Please feel free to add comments in this issue.
sam sync --watch
command?Features in development
Project synchronization
The sync command will first check that the CloudFormation Stack exists and then run UpdateStack. After this one-off, initial update of the infrastructure, the SAM CLI will start monitoring local files. Specifically, the SAM CLI will monitor the infrastructure definition files such as CloudFormation template; and the source code for API definitions, State Machine templates, Lambda functions and Layers. Whenever the SAM CLI detects a change, it automatically synchronizes the changes with the AWS cloud using the service APIs and notifies the developer through a message in the console.
Fetching logs
We are improving
sam logs
to fetch aggregated logs across multiple AWS services for a CloudFormation stack, and--tail
option to fetch them in real time.Traces
Use SAM CLI to pull X-ray traces using
sam traces
. You can optionally include a trace-id and use the--tail
option to get traces in real time. There is also a--include-traces
option withsam logs
command to aggregate traces with logs.Features in design
Environment configuration
This is a proposed design for
sam env
which will manage environment configuration on SAM CLI.Developers can define a “dev” environment for the SAM CLI to operate against. A development environment can be in any account that the developer’s local AWS credentials have access to, however SAM CLI will have guardrails against using “prod” environment. The SAM CLI will first attempt to use the AWS credentials and CloudFormation stack active for the project; if no AWS credentials or CloudFormation stack are configured the SAM CLI asks developers to select an AWS profile, and a CloudFormation stack or create a new one.
The text was updated successfully, but these errors were encountered: