-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathpipline.tf
89 lines (81 loc) · 1.86 KB
/
pipline.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
resource "aws_codepipeline" "static_web_pipeline" {
name = "static-web-pipeline"
role_arn = aws_iam_role.pipeline_role.arn
tags = {
Environment = var.env
}
artifact_store {
location = aws_s3_bucket.artifacts_bucket.bucket
type = "S3"
}
stage {
name = "Source"
action {
category = "Source"
configuration = {
"Branch" = var.repository_branch
"Owner" = var.repository_owner
"PollForSourceChanges" = "false"
"Repo" = var.repository_name
OAuthToken = var.github_token
}
input_artifacts = []
name = "Source"
output_artifacts = [
"SourceArtifact",
]
owner = "ThirdParty"
provider = "GitHub"
run_order = 1
version = "1"
}
}
stage {
name = "Build"
action {
category = "Build"
configuration = {
"EnvironmentVariables" = jsonencode(
[
{
name = "environment"
type = "PLAINTEXT"
value = var.env
},
]
)
"ProjectName" = "static-web-build"
}
input_artifacts = [
"SourceArtifact",
]
name = "Build"
output_artifacts = [
"BuildArtifact",
]
owner = "AWS"
provider = "CodeBuild"
run_order = 1
version = "1"
}
}
stage {
name = "Deploy"
action {
category = "Deploy"
configuration = {
"BucketName" = aws_s3_bucket.static_web_bucket.bucket
"Extract" = "true"
}
input_artifacts = [
"BuildArtifact",
]
name = "Deploy"
output_artifacts = []
owner = "AWS"
provider = "S3"
run_order = 1
version = "1"
}
}
}