Provide chromedriver.exe in AWS Lambda - amazon-web-services

I built a lambda Function in java and Gradle with a Selenium Test. This test needs a chromedriver.exe File. How can I provide this File in the Zip-folder for Lambda?
Or is it the better way to provide it in an S3-Bucket?

I will suggest that you use WebDriverManager, that way you dont need to use the driver.exe anymore. Please refer to my answer in this post on how to do that
WebDriverManager

Related

Reading AWS AppConfig from .NET 6 Lambda Function

I've googled around but with no luck... I need to read some configuration values stored inside a AWS Systems Manager -> AppConfig configuration (stored as text, not flag) but I've not found a C# example...
I've also tried on the AWS Console to add the layer as specified here but with no success.
For now I've used a SecretManager but it's not the correct place to store the config information... can someone help me?
Thanks
Since your question is about C# example for AppConfig, you can take a look on https://github.com/ScottHand/AppConfigNETCoreSample/tree/5f5db8d375e4df92dd7dc1b8a16f42bfb042e645.
There is interesting issue with .NET client though that https://docs.aws.amazon.com/appconfig/2019-10-09/APIReference/API_GetConfiguration.html is deprecated in favor of StartConfigurationSession and GetLatestConfiguration, however .NET client do not have yet support for these methods https://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/appconfig/AmazonAppConfigAsyncClient.html
Recommended approach is though to go with lambda extension, so you can try to open another question with your problem of setting up the extension.
Alternatively you can use SSM Parameter Store which also might be suitable for your Lambda use case.
The Amazon.Extensions.Configuration.SystemsManager package might be helpful with what you are trying to achieve. You need to store your configuration as JSON.
This is how it can be implemented using the .NET Core Configuration mechanism.
builder.Configuration.SetBasePath(Environment.CurrentDirectory)
.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
.AddSystemsManager($"/{builder.Configuration["AwsAppConfig:ApplicationId"]}/", TimeSpan.FromMinutes(5))
.AddAppConfigUsingLambdaExtension(builder.Configuration["AwsAppConfig:ApplicationId"], builder.Configuration["AwsAppConfig:EnvironmentId"], builder.Configuration["AwsAppConfig:ConfigurationProfileId"])
.Build();
For more information, you can check out the documentation here.

How to review code of previously created function in AWS Lambda

i am new to AWS.
I need to create a Lambda function in AWS, but before it i need to review some code of previously created functions. But when i want to review code of function there's a message
The deployment package of your Lambda function "tes-GetInfo" is too large to enable inline code editing. However, you can still invoke your function.
Does anyone know is it possible to some how review it in AWS.
I was looking a lot but still haven't found any ways to do it here.
You can download your function code by exporting it, assuming your function was developed in some interpreted language like JavaScript/Python.
This can be done by doing an export to the function:
Go to your function and in the Actions dropdown select Export function:
Chose Download deployment package.
This will download the deployed function locally and you will be able to investigate your code.

Best practice for using github and AWS lambda?

I'm writing AWS lambda's in the browser and want to improve my version control process from the present setup, which is to copy paste the lambda code into a text file and manually commit to a repository.
Is there a better (and preferably straight-forward) way of using AWS lambda with version control (in my case git/github)?
There is an example in this git repository provided by AWS.
It is a bit too big to retype it here.
You can try this to get your code sync with GitHub
https://npm.io/package/aws-lambda-sync

How to download and edit lambda with AWS explorer

I'm trying to use AWS explorer in PyCharm to download and edit an existing lambda function on my AWS account, but I'm unable to find out how to do that. I've read through all the documentation available on the wiki as well as followed a bunch of tutorials on deploying new lambda functions, but I can't find out how to edit and download existing functions. I can download the AWS lambda using the console, but I'm not sure how to get this to be editable in my PyCharm project, but this also seems like a workaround anyway. Is there a way to do this within the AWS Explorer tool?
No, currently (Oct 2019) you can't download a Lambda Function's source and edit it locally. If you know the name of the S3 object where the code is stored, you could pull that file down adn make changes, re-zip it, re-upload it back to S3, force the Lambda to cold-start (change the memory slider) and it will pick up the new code. but this is extremely brittle.
Have you tried cloud9, I find it the best way to work on lambdas, especially if you are working as a team. but the problem with cloud9 is also it seems it's not actively being developed and you have lots of manual work to update SAM and dev tools in there. Anyhow I still recommend cloud9.

Workaround for AWS SAM with a provided lambda runtime

I would like to stage a larger project with AWS SAM. Sadly a part of this project consists of a lambda function with a custom runtime and SAM does not include a way to set this up.
Does anyone know a workaround for this? If there is no other way I will try to set up the whole project with the wrong runtime and write a little function to change the runtime afterwards.