-
Notifications
You must be signed in to change notification settings - Fork 0
/
1. aws_s3_integration
34 lines (31 loc) · 978 Bytes
/
1. aws_s3_integration
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
-- s3 integration
create storage integration s3_integration
type = external_stage
storage_provider = S3
enabled = true
storage_aws_iam_user_arn = 'arn user'
storage_aws_role_arn = '<iam_role>'
storage_allowed_locations = ('s3://<bucket>/<path>/', 's3://<bucket>/<path>/')
[storage_blocked_locations = ('s3://<bucket>/<path>/', 's3://<bucket>/<path>/') ];
-- create s3 stage --
create or replace stage s3_stage
storage_integration = s3_integration
url = 's3 bucket url';
-- csv file format
create file format csv_header
compression = 'auto'
field_delimiter = ','
record_delimiter = '\n'
skip_header = 1
trim_space = true
error_on_column_count_mismatch = true
date_format = 'auto'
timestamp_format = 'auto' null_if = ('');
-- aws_sns_notification
create or replace notification integration aws_sns_notification
enabled = true
type = queue
notification_provider = aws_sns
direction = outbound
aws_sns_topic_arn = 'aws sns topic'
aws_sns_role_arn = 'aws role';