@@ -100,7 +100,7 @@ The template requires four input parameters: availability zone, a security group
100
100
101
101
__ Usage Steps__
102
102
103
- 1 . Create a CloudFormation stack with the deploy.yaml file, or use the table of links below. This stack will include everything needed to set up the autoloader with two exceptions. The KMS key must be created and managed separately, and a RedShift cluster will be required when setting up the autoloader. Note that this stack does not configure the autoloader - it just installs the components required to run the node setup script.
103
+ 1 . Create a CloudFormation stack with the deploy.yaml file, or launch using the table of links below. This stack will include everything needed to set up the autoloader with two exceptions. The KMS key must be created and managed separately, and a RedShift cluster will be required when setting up the autoloader. Note that this stack does not configure the autoloader - it just installs the components required to run the node setup script.
104
104
2 . Log in to the EC2 instance created as part of the stack. It contains all the necessary components set up the autoloader.
105
105
3 . Invoke the ` setup.js ` script on the created EC2 instance to begin configuring the autoloader.
106
106
@@ -133,70 +133,23 @@ __Launch Links__
133
133
| us-west-1 | [ <img src =" https://s3.amazonaws.com/cloudformation-examples/cloudformation-launch-stack.png " target =\”_blank\” >] ( https://console.aws.amazon.com/cloudformation/home?region=us-west-1#/stacks/new?stackName=LambdaRedshiftLoader&templateURL=https://awslabs-code-us-west-1.s3.amazonaws.com/LambdaRedshiftLoader/deploy.yaml ) |
134
134
| us-west-2 | [ <img src =" https://s3.amazonaws.com/cloudformation-examples/cloudformation-launch-stack.png " target =\”_blank\” >] ( https://console.aws.amazon.com/cloudformation/home?region=us-west-2#/stacks/new?stackName=LambdaRedshiftLoader&templateURL=https://awslabs-code-us-west-2.s3.amazonaws.com/LambdaRedshiftLoader/deploy.yaml ) |
135
135
136
+ ### Function Configuration
137
+
138
+ You can set the logging behaviour of the function by adding environment variables:
139
+
140
+ * ` DEBUG ` Sets log level debug and all messages will be shown in CloudWatch Logs
141
+ * ` LOG_LEVEL ` Sets the log level to whatever you require, per [ Winston documentation] ( https://github.com/winstonjs/winston#logging-levels )
142
+
136
143
## Installing Manually
137
144
145
+ This option is not recommended, but can be used if you just want to patch the binaries, etc. Proceed with caution.
146
+
138
147
### Before you deploy - Lambda Execution Role
139
148
140
149
You need to create an IAM policy that AWS Lambda
141
150
uses when it runs, and allows it to call SNS, use DynamoDB, write Manifest
142
151
files to S3, perform encryption with the AWS Key Management Service, and pass STS temporary
143
- credentials to Redshift for the COPY command:
144
-
145
- ```
146
- {
147
- "Version": "2012-10-17",
148
- "Statement": [
149
- {
150
- "Sid": "Stmt1424787824000",
151
- "Effect": "Allow",
152
- "Action": [
153
- "dynamodb:DeleteItem",
154
- "dynamodb:DescribeTable",
155
- "dynamodb:GetItem",
156
- "dynamodb:ListTables",
157
- "dynamodb:PutItem",
158
- "dynamodb:Query",
159
- "dynamodb:Scan",
160
- "dynamodb:UpdateItem"
161
- ],
162
- "Resource": [
163
- "arn:aws:dynamodb:<my region>:<my account>:table/LambdaRedshiftBatches",
164
- "arn:aws:dynamodb:<my region>:<my account>:table/LambdaRedshiftBatchLoadConfig",
165
- "arn:aws:dynamodb:<my region>:<my account>:table/LambdaRedshiftProcessedFiles"
166
- ]
167
- },
168
- {
169
- "Sid": "Stmt1424787824001",
170
- "Effect": "Allow",
171
- "Action": [
172
- "sns:GetEndpointAttributes",
173
- "sns:GetSubscriptionAttributes",
174
- "sns:GetTopicAttributes",
175
- "sns:ListTopics",
176
- "sns:Publish",
177
- "sns:Subscribe",
178
- "sns:Unsubscribe"
179
- ],
180
- "Resource": [
181
- "arn:aws:sns:<my region>:<my account>:<success topic>",
182
- "arn:aws:sns:<my region>:<my account>:<failure topic>"
183
- ]
184
- },
185
- {
186
- "Sid": "Stmt1424787824002",
187
- "Effect": "Allow",
188
- "Action": [
189
- "kms:Decrypt",
190
- "kms:DescribeKey",
191
- "kms:GetKeyPolicy"
192
- ],
193
- "Resource": [
194
- "arn:aws:kms:<my region>:<my account>:key/<key name>"
195
- ]
196
- }
197
- ]
198
- }
199
- ```
152
+ credentials to Redshift for the COPY command. We recommend that you obtain the required permissions from the contents of the deploy.yaml as they will always be up to date.
200
153
201
154
### Deploy the function
202
155
@@ -210,23 +163,23 @@ credentials to Redshift for the COPY command:
210
163
211
164
| Region | Function Code S3 Location |
212
165
| ------ | ---- |
213
- | eu-north-1 | [ s3://awslabs-code-eu-north-1/LambdaRedshiftLoader/AWSLambdaRedshiftLoader-2.7.0 .zip] ( https://s3.eu-north-1.amazonaws.com/awslabs-code-eu-north-1/LambdaRedshiftLoader/AWSLambdaRedshiftLoader-2.7.0 .zip )
214
- | ap-south-1 | [ s3://awslabs-code-ap-south-1/LambdaRedshiftLoader/AWSLambdaRedshiftLoader-2.7.0 .zip] ( https://s3.ap-south-1.amazonaws.com/awslabs-code-ap-south-1/LambdaRedshiftLoader/AWSLambdaRedshiftLoader-2.7.0 .zip )
215
- | eu-west-3 | [ s3://awslabs-code-eu-west-3/LambdaRedshiftLoader/AWSLambdaRedshiftLoader-2.7.0 .zip] ( https://s3.eu-west-3.amazonaws.com/awslabs-code-eu-west-3/LambdaRedshiftLoader/AWSLambdaRedshiftLoader-2.7.0 .zip )
216
- | eu-west-2 | [ s3://awslabs-code-eu-west-2/LambdaRedshiftLoader/AWSLambdaRedshiftLoader-2.7.0 .zip] ( https://s3.eu-west-2.amazonaws.com/awslabs-code-eu-west-2/LambdaRedshiftLoader/AWSLambdaRedshiftLoader-2.7.0 .zip )
217
- | eu-west-1 | [ s3://awslabs-code-eu-west-1/LambdaRedshiftLoader/AWSLambdaRedshiftLoader-2.7.0 .zip] ( https://s3.eu-west-1.amazonaws.com/awslabs-code-eu-west-1/LambdaRedshiftLoader/AWSLambdaRedshiftLoader-2.7.0 .zip )
218
- | ap-northeast-3 | [ s3://awslabs-code-ap-northeast-3/LambdaRedshiftLoader/AWSLambdaRedshiftLoader-2.7.0 .zip] ( https://s3.ap-northeast-3.amazonaws.com/awslabs-code-ap-northeast-3/LambdaRedshiftLoader/AWSLambdaRedshiftLoader-2.7.0 .zip )
219
- | ap-northeast-2 | [ s3://awslabs-code-ap-northeast-2/LambdaRedshiftLoader/AWSLambdaRedshiftLoader-2.7.0 .zip] ( https://s3.ap-northeast-2.amazonaws.com/awslabs-code-ap-northeast-2/LambdaRedshiftLoader/AWSLambdaRedshiftLoader-2.7.0 .zip )
220
- | ap-northeast-1 | [ s3://awslabs-code-ap-northeast-1/LambdaRedshiftLoader/AWSLambdaRedshiftLoader-2.7.0 .zip] ( https://s3.ap-northeast-1.amazonaws.com/awslabs-code-ap-northeast-1/LambdaRedshiftLoader/AWSLambdaRedshiftLoader-2.7.0 .zip )
221
- | sa-east-1 | [ s3://awslabs-code-sa-east-1/LambdaRedshiftLoader/AWSLambdaRedshiftLoader-2.7.0 .zip] ( https://s3.sa-east-1.amazonaws.com/awslabs-code-sa-east-1/LambdaRedshiftLoader/AWSLambdaRedshiftLoader-2.7.0 .zip )
222
- | ca-central-1 | [ s3://awslabs-code-ca-central-1/LambdaRedshiftLoader/AWSLambdaRedshiftLoader-2.7.0 .zip] ( https://s3.ca-central-1.amazonaws.com/awslabs-code-ca-central-1/LambdaRedshiftLoader/AWSLambdaRedshiftLoader-2.7.0 .zip )
223
- | ap-southeast-1 | [ s3://awslabs-code-ap-southeast-1/LambdaRedshiftLoader/AWSLambdaRedshiftLoader-2.7.0 .zip] ( https://s3.ap-southeast-1.amazonaws.com/awslabs-code-ap-southeast-1/LambdaRedshiftLoader/AWSLambdaRedshiftLoader-2.7.0 .zip )
224
- | ap-southeast-2 | [ s3://awslabs-code-ap-southeast-2/LambdaRedshiftLoader/AWSLambdaRedshiftLoader-2.7.0 .zip] ( https://s3.ap-southeast-2.amazonaws.com/awslabs-code-ap-southeast-2/LambdaRedshiftLoader/AWSLambdaRedshiftLoader-2.7.0 .zip )
225
- | eu-central-1 | [ s3://awslabs-code-eu-central-1/LambdaRedshiftLoader/AWSLambdaRedshiftLoader-2.7.0 .zip] ( https://s3.eu-central-1.amazonaws.com/awslabs-code-eu-central-1/LambdaRedshiftLoader/AWSLambdaRedshiftLoader-2.7.0 .zip )
226
- | us-east-1 | [ s3://awslabs-code-us-east-1/LambdaRedshiftLoader/AWSLambdaRedshiftLoader-2.7.0 .zip] ( https://s3.amazonaws.com/awslabs-code-us-east-1/LambdaRedshiftLoader/AWSLambdaRedshiftLoader-2.7.0 .zip )
227
- | us-east-2 | [ s3://awslabs-code-us-east-2/LambdaRedshiftLoader/AWSLambdaRedshiftLoader-2.7.0 .zip] ( https://s3.us-east-2.amazonaws.com/awslabs-code-us-east-2/LambdaRedshiftLoader/AWSLambdaRedshiftLoader-2.7.0 .zip )
228
- | us-west-1 | [ s3://awslabs-code-us-west-1/LambdaRedshiftLoader/AWSLambdaRedshiftLoader-2.7.0 .zip] ( https://s3.us-west-1.amazonaws.com/awslabs-code-us-west-1/LambdaRedshiftLoader/AWSLambdaRedshiftLoader-2.7.0 .zip )
229
- | us-west-2 | [ s3://awslabs-code-us-west-2/LambdaRedshiftLoader/AWSLambdaRedshiftLoader-2.7.0 .zip] ( https://s3.us-west-2.amazonaws.com/awslabs-code-us-west-2/LambdaRedshiftLoader/AWSLambdaRedshiftLoader-2.7.0 .zip )
166
+ | eu-north-1 | [ s3://awslabs-code-eu-north-1/LambdaRedshiftLoader/AWSLambdaRedshiftLoader-2.7.3 .zip] ( https://s3.eu-north-1.amazonaws.com/awslabs-code-eu-north-1/LambdaRedshiftLoader/AWSLambdaRedshiftLoader-2.7.3 .zip )
167
+ | ap-south-1 | [ s3://awslabs-code-ap-south-1/LambdaRedshiftLoader/AWSLambdaRedshiftLoader-2.7.3 .zip] ( https://s3.ap-south-1.amazonaws.com/awslabs-code-ap-south-1/LambdaRedshiftLoader/AWSLambdaRedshiftLoader-2.7.3 .zip )
168
+ | eu-west-3 | [ s3://awslabs-code-eu-west-3/LambdaRedshiftLoader/AWSLambdaRedshiftLoader-2.7.3 .zip] ( https://s3.eu-west-3.amazonaws.com/awslabs-code-eu-west-3/LambdaRedshiftLoader/AWSLambdaRedshiftLoader-2.7.3 .zip )
169
+ | eu-west-2 | [ s3://awslabs-code-eu-west-2/LambdaRedshiftLoader/AWSLambdaRedshiftLoader-2.7.3 .zip] ( https://s3.eu-west-2.amazonaws.com/awslabs-code-eu-west-2/LambdaRedshiftLoader/AWSLambdaRedshiftLoader-2.7.3 .zip )
170
+ | eu-west-1 | [ s3://awslabs-code-eu-west-1/LambdaRedshiftLoader/AWSLambdaRedshiftLoader-2.7.3 .zip] ( https://s3.eu-west-1.amazonaws.com/awslabs-code-eu-west-1/LambdaRedshiftLoader/AWSLambdaRedshiftLoader-2.7.3 .zip )
171
+ | ap-northeast-3 | [ s3://awslabs-code-ap-northeast-3/LambdaRedshiftLoader/AWSLambdaRedshiftLoader-2.7.3 .zip] ( https://s3.ap-northeast-3.amazonaws.com/awslabs-code-ap-northeast-3/LambdaRedshiftLoader/AWSLambdaRedshiftLoader-2.7.3 .zip )
172
+ | ap-northeast-2 | [ s3://awslabs-code-ap-northeast-2/LambdaRedshiftLoader/AWSLambdaRedshiftLoader-2.7.3 .zip] ( https://s3.ap-northeast-2.amazonaws.com/awslabs-code-ap-northeast-2/LambdaRedshiftLoader/AWSLambdaRedshiftLoader-2.7.3 .zip )
173
+ | ap-northeast-1 | [ s3://awslabs-code-ap-northeast-1/LambdaRedshiftLoader/AWSLambdaRedshiftLoader-2.7.3 .zip] ( https://s3.ap-northeast-1.amazonaws.com/awslabs-code-ap-northeast-1/LambdaRedshiftLoader/AWSLambdaRedshiftLoader-2.7.3 .zip )
174
+ | sa-east-1 | [ s3://awslabs-code-sa-east-1/LambdaRedshiftLoader/AWSLambdaRedshiftLoader-2.7.3 .zip] ( https://s3.sa-east-1.amazonaws.com/awslabs-code-sa-east-1/LambdaRedshiftLoader/AWSLambdaRedshiftLoader-2.7.3 .zip )
175
+ | ca-central-1 | [ s3://awslabs-code-ca-central-1/LambdaRedshiftLoader/AWSLambdaRedshiftLoader-2.7.3 .zip] ( https://s3.ca-central-1.amazonaws.com/awslabs-code-ca-central-1/LambdaRedshiftLoader/AWSLambdaRedshiftLoader-2.7.3 .zip )
176
+ | ap-southeast-1 | [ s3://awslabs-code-ap-southeast-1/LambdaRedshiftLoader/AWSLambdaRedshiftLoader-2.7.3 .zip] ( https://s3.ap-southeast-1.amazonaws.com/awslabs-code-ap-southeast-1/LambdaRedshiftLoader/AWSLambdaRedshiftLoader-2.7.3 .zip )
177
+ | ap-southeast-2 | [ s3://awslabs-code-ap-southeast-2/LambdaRedshiftLoader/AWSLambdaRedshiftLoader-2.7.3 .zip] ( https://s3.ap-southeast-2.amazonaws.com/awslabs-code-ap-southeast-2/LambdaRedshiftLoader/AWSLambdaRedshiftLoader-2.7.3 .zip )
178
+ | eu-central-1 | [ s3://awslabs-code-eu-central-1/LambdaRedshiftLoader/AWSLambdaRedshiftLoader-2.7.3 .zip] ( https://s3.eu-central-1.amazonaws.com/awslabs-code-eu-central-1/LambdaRedshiftLoader/AWSLambdaRedshiftLoader-2.7.3 .zip )
179
+ | us-east-1 | [ s3://awslabs-code-us-east-1/LambdaRedshiftLoader/AWSLambdaRedshiftLoader-2.7.3 .zip] ( https://s3.amazonaws.com/awslabs-code-us-east-1/LambdaRedshiftLoader/AWSLambdaRedshiftLoader-2.7.3 .zip )
180
+ | us-east-2 | [ s3://awslabs-code-us-east-2/LambdaRedshiftLoader/AWSLambdaRedshiftLoader-2.7.3 .zip] ( https://s3.us-east-2.amazonaws.com/awslabs-code-us-east-2/LambdaRedshiftLoader/AWSLambdaRedshiftLoader-2.7.3 .zip )
181
+ | us-west-1 | [ s3://awslabs-code-us-west-1/LambdaRedshiftLoader/AWSLambdaRedshiftLoader-2.7.3 .zip] ( https://s3.us-west-1.amazonaws.com/awslabs-code-us-west-1/LambdaRedshiftLoader/AWSLambdaRedshiftLoader-2.7.3 .zip )
182
+ | us-west-2 | [ s3://awslabs-code-us-west-2/LambdaRedshiftLoader/AWSLambdaRedshiftLoader-2.7.3 .zip] ( https://s3.us-west-2.amazonaws.com/awslabs-code-us-west-2/LambdaRedshiftLoader/AWSLambdaRedshiftLoader-2.7.3 .zip )
230
183
231
184
When you're done, you'll see that the AWS Lambda function is deployed and you
232
185
can submit test events and view the CloudWatch Logging log streams.
0 commit comments