Trigger AWS Lambda function whenever a file is added to AWS FSX - aws-lambda

I would like to trigger an AWS Lambda Function whenever a new file is added to AWS FSX. This is in order to perform an action on the file using to the Lambda function that gets notified.
While considering AWS cloudtrail, Eventbridge and Cloudwatch to trigger the Lambda function; I was unable to find AWS FSX in the data source options for this monitoring resource in AWS. Any suggestion on what tool can be used?

Related

Is there a way to deploy a terraform file via an AWS lambda function?

As the title suggests I am looking for a way to deploy a terraform file via an AWS lambda function. I would like to deploy this file via a time-based event. This is my first time working with terraform and I cannot seem to find anything pertaining to this specific use case.
I am much more versed in CloudFormation so normally what I would do is use the boto3 library to set up a lambda function that would deploy a CloudFormation stack. Does anyone know how to do this with a terraform file?

Check CW log-group of a lambda through CLI

I have only programmatic access to AWS cloud watch and other services. I created a lambda and event source mapping with DynamoDB. It uploaded and ran successfully but I don't know which log group is it logging. Is there a way through the CLI to check which log group a lambda is configured with?

How to deploy a new lambda function from another lambda function

Is it possible for one lambda function to deploy a new lamda function with serverless.yml and handler.py stored in s3 or github?
I am using serverless framework and python
AWS Lambda can deploy another lambda with a s3 trigger. The simple flow is like this.
Bundle project and upload to S3 --> S3 Trigger --> Lambda (Create or
Update function Code)
Here is the complete documentation

Updating a CloudFormation stack if codebase updates

So I have an existing CloudFormation stack up and running. However, I haven't found a solution for my problem, which is that I want my resources, for example EC2 and Lambda, to have up to date code.
It seems that a CloudFormation stack doesn't update if the template doesn't have any changes. I'm holding my code inside a S3 bucket as a zip-file, but if this file gets changed, CloudFormation doesn't notice it.
Is my best bet creating a git hook script that uses AWS CLI and updates the EC2 and Lambda code or is there some 'elegant' way for CloudFormation to notice these changes?
Create a new lambda function to update your existing lambda and ec2 or call the cloud formation to update them. On your S3, create an object Put event and call that new lambda function. So whenever a new file(zip) is put in s3, your ec2 & lambda gets updated.

Granting CloudWatch access to a lambda function deployed using the Serverless framework

My problem
I am writing a Lambda function using the Serverless framework.
The function is invoked by an HTTP request.
It parses the request parameters, fetches some logs from a CloudWatch group and stream according to the parameters and replies with a summary of the logs.
I would like to grant CloudWatch read access to the Lambda function using the serverless configuration file.
Code
The function definition (serverless.yml) is pretty basic:
service: adam-test-sls
provider:
name: aws
runtime: nodejs6.10
region: eu-central-1
functions:
hello:
handler: handler.hello
events:
- http:
path: hello
method: get
What have I tried
Searching the serverless framework forums
Google-fu
AWS CloudFormation documentation (The serverless framework creates CloudFormation files from its YAML configuration)
My question
How do I grant read (and/or write) permissions that will enable this Lambda function to access Specific CloudWatch logs?
Serverless allows you to define a default IAM role for all functions (which should have CloudWatch access by default)
Also by default, your Lambda functions have permission to create and write to CloudWatch logs.
You can also fine tune the IAM role for all functions, or even provide fine-grained permissions for each function using the role attribute.
The reference is here

Resources