mirror of
https://github.com/farcasclaudiu/terraform-course.git
synced 2026-06-28 21:01:57 +03:00
codepipeline-demo
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
# code build
|
||||
resource "aws_codebuild_project" "demo" {
|
||||
name = "demo-docker-build"
|
||||
description = "demo docker build"
|
||||
build_timeout = "30"
|
||||
service_role = aws_iam_role.demo-codebuild.arn
|
||||
encryption_key = aws_kms_alias.demo-artifacts.arn
|
||||
|
||||
artifacts {
|
||||
type = "CODEPIPELINE"
|
||||
}
|
||||
|
||||
cache {
|
||||
type = "S3"
|
||||
location = aws_s3_bucket.codebuild-cache.bucket
|
||||
}
|
||||
|
||||
environment {
|
||||
compute_type = "BUILD_GENERAL1_SMALL"
|
||||
image = "aws/codebuild/docker:18.09.0"
|
||||
type = "LINUX_CONTAINER"
|
||||
privileged_mode = true
|
||||
|
||||
environment_variable {
|
||||
name = "AWS_DEFAULT_REGION"
|
||||
value = var.AWS_REGION
|
||||
}
|
||||
environment_variable {
|
||||
name = "AWS_ACCOUNT_ID"
|
||||
value = data.aws_caller_identity.current.account_id
|
||||
}
|
||||
environment_variable {
|
||||
name = "IMAGE_REPO_NAME"
|
||||
value = aws_ecr_repository.demo.name
|
||||
}
|
||||
environment_variable {
|
||||
name = "IMAGE_TAG"
|
||||
value = "latest"
|
||||
}
|
||||
}
|
||||
|
||||
source {
|
||||
type = "CODEPIPELINE"
|
||||
buildspec = "buildspec.yml"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user