-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAWS_DataPipeline.tf
60 lines (55 loc) · 1.38 KB
/
AWS_DataPipeline.tf
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
resource "aws_datapipeline_pipeline" "data_movement_pipeline" {
name = "madhatter_data_movement_pipeline"
description = "Pipeline for moving data between S3 buckets"
# parameter_objects {
# id = "myS3InputLocation"
# attributes {
# key = "type"
# value = "AWS::S3::ObjectKey"
# }
# attributes {
# key = "description"
# value = "The S3 input location"
# }
# }
# pipeline_objects = [
# {
# id = "Default"
# name = "Default"
# fields = [
# {
# key = "scheduleType"
# value = "cron"
# },
# {
# key = "failureAndRerunMode"
# value = "CASCADE"
# },
# {
# key = "pipelineLogUri"
# value = "s3://${aws_s3_bucket.raw_data_bucket.bucket}/logs"
# }
# ]
# }
# ]
}
# IAM Role for DataPipeline
resource "aws_iam_role" "datapipeline_role" {
name = "datapipeline_role"
assume_role_policy = jsonencode({
Version = "2012-10-17"
Statement = [
{
Action = "sts:AssumeRole"
Effect = "Allow"
Principal = {
Service = "datapipeline.amazonaws.com"
}
}
]
})
}
resource "aws_iam_role_policy_attachment" "datapipeline_policy" {
role = aws_iam_role.datapipeline_role.name
policy_arn = "arn:aws:iam::aws:policy/service-role/AWSDataPipelineRole"
}