Created
March 19, 2019 06:22
-
-
Save Kalki5/250c818027094426f6368047320d858b to your computer and use it in GitHub Desktop.
Add own policy to a lambda function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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