Add trigger to AWS Lambda Function using Java API -


how can add new trigger existing aws lambda function using java api?

i add cloudwatch events - schedule trigger.

it looks should use amazoncloudwatcheventsclient. how can set credentials client?

any examples appreciated.

thanks.

it possible add event sources via aws sdk. faced same issue , please see code below solution using java.  addpermissionrequest addpermissionrequest = new addpermissionrequest();                 addpermissionrequest.setstatementid("12345ff");  //any unique string go                 addpermissionrequest.withsourcearn(rulearn); //cloudwatch rule's arn                 addpermissionrequest.setaction("lambda:invokefunction");                 addpermissionrequest.setprincipal("events.amazonaws.com");                 addpermissionrequest.setfunctionname("name of lambda function");                  awslambdaasyncclient lambdaclient = new awslambdaasyncclient();                 lambdaclient.withregion(regions.us_east_1); //region of lambda's location  lambdaclient.addpermission(addpermissionrequest); 

Comments

Popular posts from this blog

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

jsf - "PropertyNotWritableException: Illegal Syntax for Set Operation" error when setting value in bean -

arrays - Algorithm to find ideal starting spot in a circle -