-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcodebuild.tf
48 lines (40 loc) · 1.39 KB
/
codebuild.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
data "local_file" "account_request_buildspec" {
filename = "${path.module}/buildspecs/ct-aft-customization-invoker.yml"
}
resource "aws_codebuild_project" "account_customization_invoker_pipeline" {
name = "${var.customization_name}-invoker"
description = "Deploys account customizations"
build_timeout = tostring(var.global_codebuild_timeout)
service_role = aws_iam_role.customization_invoker_codepipeline_role.arn
encryption_key = local.kms_key_arn
artifacts {
type = "CODEPIPELINE"
}
environment {
compute_type = "BUILD_GENERAL1_MEDIUM"
image = "aws/codebuild/amazonlinux2-x86_64-standard:5.0"
type = "LINUX_CONTAINER"
image_pull_credentials_type = "CODEBUILD"
environment_variable {
name = "AWS_PARTITION"
value = data.aws_partition.current.partition
type = "PLAINTEXT"
}
}
logs_config {
cloudwatch_logs {
group_name = aws_cloudwatch_log_group.account-customization-invoker.name
}
}
source {
type = "CODEPIPELINE"
buildspec = data.local_file.account_request_buildspec.content
}
lifecycle {
ignore_changes = [project_visibility]
}
}
resource "aws_cloudwatch_log_group" "account-customization-invoker" {
name = "/aws/codebuild/${var.customization_name}-invoker"
retention_in_days = var.log_retention_days
}