I know there should be a way to create a trigger for AWS Lambda using aws ruby ββsdk (how can this be done using the AWS Management Console).
* Update, I was able to find a way to create a trigger. I am using the following code for this:
@cloudwatchlogs = Aws::CloudWatchLogs::Client.new(region: region, credentials: Aws::Credentials.new(aws_access_key_id, aws_secret_access_key)) @cloudwatchlogs.put_subscription_filter({ log_group_name: "RDSOSMetrics", filter_name: "RDS metrics filter", filter_pattern: "RDS metrics filter pattern", destination_arn: function_arn })
When trying to do the following:
*** Aws::CloudWatchLogs::Errors::InvalidParameterException Exception: Could not execute the lambda function. Make sure you have given CloudWatch Logs permission to execute your function
Just to test it, I have an X role that is bound to a Lambda function, and this role has added AWSLambdaFullAccess policy to it, but I still get this error.
Anything else i'm missing
Thank you Bakir
source share