mirror of
https://github.com/farcasclaudiu/terraform-course.git
synced 2026-06-29 03:02:04 +03:00
codepipeline-demo
This commit is contained in:
@@ -0,0 +1,74 @@
|
||||
#
|
||||
# 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 = "Deploy"
|
||||
category = "Deploy"
|
||||
owner = "AWS"
|
||||
provider = "ECS"
|
||||
input_artifacts = ["demo-docker-build"]
|
||||
version = "1"
|
||||
|
||||
configuration = {
|
||||
ClusterName = "demo" # name of cluster
|
||||
ServiceName = "demo" # name of service
|
||||
}
|
||||
|
||||
role_arn = aws_iam_role.demo-codepipeline.arn
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user