Skip to content

Instantly share code, notes, and snippets.

@Kalki5
Created March 19, 2019 06:22
Show Gist options
  • Save Kalki5/250c818027094426f6368047320d858b to your computer and use it in GitHub Desktop.
Save Kalki5/250c818027094426f6368047320d858b to your computer and use it in GitHub Desktop.
Add own policy to a lambda function
import boto3
lamba_client = boto3.client('lambda', region_name='REGION_NAME')
lamba_client.add_permission(
FunctionName='create_lab',
StatementId='AWSEventsRule',
Action='lambda:InvokeFunction',
Principal='events.amazonaws.com',
SourceArn='arn:aws:events:REGION_NAME:ACCOUNT_NUMBER:rule/*',
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment