diff --git a/aws/aws.ipynb b/aws/aws.ipynb index 44062f2..d149034 100644 --- a/aws/aws.ipynb +++ b/aws/aws.ipynb @@ -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" ]