mirror of
https://github.com/donnemartin/data-science-ipython-notebooks.git
synced 2024-03-22 13:30:56 +08:00
Added lambda functions to update a function config, add permissions, and to check policy permissions. Some lambda cleanup.
This commit is contained in:
parent
2902438c43
commit
3aee2e1703
|
@ -961,6 +961,27 @@
|
|||
" --debug"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"Update a function:"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"collapsed": true
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"!aws lambda update-function-configuration \\\n",
|
||||
" --function-name foo \\\n",
|
||||
" --region us-east-1 \\\n",
|
||||
" --timeout timeout-in-seconds \\"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
|
@ -977,7 +998,7 @@
|
|||
"outputs": [],
|
||||
"source": [
|
||||
"!aws lambda get-function-configuration \\\n",
|
||||
" --function-name helloworld \\\n",
|
||||
" --function-name foo \\\n",
|
||||
" --region us-east-1 \\\n",
|
||||
" --debug"
|
||||
]
|
||||
|
@ -998,7 +1019,7 @@
|
|||
"outputs": [],
|
||||
"source": [
|
||||
"!aws lambda get-function \\\n",
|
||||
" --function-name helloworld \\\n",
|
||||
" --function-name foo \\\n",
|
||||
" --region us-east-1 \\\n",
|
||||
" --debug"
|
||||
]
|
||||
|
@ -1023,8 +1044,51 @@
|
|||
" --function-name ProcessKinesisRecords \\\n",
|
||||
" --role invocation-role-arn \\\n",
|
||||
" --event-source kinesis-stream-arn \\\n",
|
||||
" --batch-size 100 \\\n",
|
||||
" --profile adminuser"
|
||||
" --batch-size 100"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"Add permissions:"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"collapsed": true
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"!aws lambda add-permission \\\n",
|
||||
" --function-name CreateThumbnail \\\n",
|
||||
" --region us-west-2 \\\n",
|
||||
" --statement-id some-unique-id \\\n",
|
||||
" --action \"lambda:InvokeFunction\" \\\n",
|
||||
" --principal s3.amazonaws.com \\\n",
|
||||
" --source-arn arn:aws:s3:::sourcebucket \\\n",
|
||||
" --source-account bucket-owner-account-id"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"Check policy permissions:"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"collapsed": true
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"!aws lambda get-policy \\\n",
|
||||
" --function-name function-name"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -1043,7 +1107,7 @@
|
|||
"outputs": [],
|
||||
"source": [
|
||||
"!aws lambda delete-function \\\n",
|
||||
" --function-name helloworld \\\n",
|
||||
" --function-name foo \\\n",
|
||||
" --region us-east-1 \\\n",
|
||||
" --debug"
|
||||
]
|
||||
|
|
Loading…
Reference in New Issue
Block a user