forked from wardviaene/terraform-course
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcodepipeline.tf
74 lines (62 loc) · 1.7 KB
/
codepipeline.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
#
# codepipeline - demo
#
resource "aws_codepipeline" "demo" {
name = "demo-docker-pipeline"
role_arn = aws_iam_role.demo-codepipeline.arn
artifact_store {
location = aws_s3_bucket.demo-artifacts.bucket
type = "S3"
encryption_key {
id = aws_kms_alias.demo-artifacts.arn
type = "KMS"
}
}
stage {
name = "Source"
action {
name = "Source"
category = "Source"
owner = "AWS"
provider = "CodeCommit"
version = "1"
output_artifacts = ["demo-docker-source"]
configuration = {
RepositoryName = aws_codecommit_repository.demo.repository_name
BranchName = "master"
}
}
}
stage {
name = "Build"
action {
name = "Build"
category = "Build"
owner = "AWS"
provider = "CodeBuild"
input_artifacts = ["demo-docker-source"]
output_artifacts = ["demo-docker-build"]
version = "1"
configuration = {
ProjectName = aws_codebuild_project.demo.name
}
}
}
stage {
name = "Deploy"
action {
name = "DeployToECS"
category = "Deploy"
owner = "AWS"
provider = "CodeDeployToECS"
input_artifacts = ["demo-docker-build"]
version = "1"
configuration = {
ApplicationName = aws_codedeploy_app.demo.name
DeploymentGroupName = aws_codedeploy_deployment_group.demo.deployment_group_name
TaskDefinitionTemplateArtifact = "demo-docker-build"
AppSpecTemplateArtifact = "demo-docker-build"
}
}
}
}