-
- Create a bucket called, “source12282016” in Northern California.
- Create a bucket called, “destination12282016” in Northern California.
- Create an SNS topic called, “sourcebucket12282016-fanout” in Northern California. Note that you will need the resource name of the topic plus the name of the source bucket.
{
"Version": "2012-10-17"
, "Statement": [
{
"Effect": "Allow"
, "Action": [
"logs:CreateLogGroup"
, "logs:CreateLogStream"
, "logs:PutLogEvents"
]
, "Resource": "arn:aws:logs:*:*:*"
}
, {
"Effect": "Allow"
, "Action": [
"s3:GetObject"
]
, "Resource": [
"arn:aws:s3:::source12282016/*"
]
}
, {
"Effect": "Allow"
, "Action": [
"s3:PutObject"
]
, "Resource": [
"arn:aws:s3:::destination12282016/*"
]
}
]
}
-
- Associate an, “event” with the source bucket.

-
- Create a policy for the Lamda function that will be created in subsequent steps. Use the source and destination bucket names accordingly.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"logs:CreateLogGroup",
"logs:CreateLogStream",
"logs:PutLogEvents"
],
"Resource": "arn:aws:logs:*:*:*"
},
{
"Effect": "Allow",
"Action": [
"s3:GetObject"
],
"Resource": [
"arn:aws:s3:::source12282016/*"
]
},
{
"Effect": "Allow",
"Action": [
"s3:PutObject"
],
"Resource": [
"arn:aws:s3:::destination12282016/*"
]
}
]
}
-
- Create a role and attach the preceding policy to the role.

-
- Create the Lamda function. Note to skip to and select, “Configure Function”. In the next step we will scroll towards the bottom of the page to attach the role.

-
- Still on the page, we will now associate the role to the Lambda funciton.

-
- Subscribe the Lambda function to the SNS topic created previously.

Recent Comments