-
Notifications
You must be signed in to change notification settings - Fork 0
/
continuous-delivery.tf
67 lines (61 loc) · 1.52 KB
/
continuous-delivery.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
variable "github-user" {
default = "Ingwersaft"
}
variable "github-repo" {
default = "graal-kotlin-lambda"
}
variable "slack-webhook" {
default = "${var.slackhook}"
}
resource "aws_codebuild_project" "build" {
name = "${var.basename}-codebuild-project"
description = "automatic codebuild project for ${var.basename} managed by terraform"
build_timeout = "10"
service_role = "${aws_iam_role.codebuild_role.arn}"
artifacts {
type = "NO_ARTIFACTS"
}
cache {
type = "S3"
location = "${aws_s3_bucket.files.bucket}"
}
environment {
compute_type = "BUILD_GENERAL1_MEDIUM"
image = "aws/codebuild/java:openjdk-8"
type = "LINUX_CONTAINER"
environment_variable {
"name" = "S3_BUCKET"
"value" = "${aws_s3_bucket.files.bucket}"
}
environment_variable {
"name" = "S3_BUCKET_URL"
"value" = "s3://${aws_s3_bucket.files.bucket}"
}
environment_variable {
"name" = "S3_KEY"
"value" = "graal-lambda.zip"
}
environment_variable {
"name" = "FUNCTION_NAME"
"value" = "${aws_lambda_function.test_lambda.function_name}"
}
environment_variable {
"name" = "SLACK_WEBHOOK"
"value" = "${var.slack-webhook}"
}
}
source {
type = "GITHUB"
location = "https://github.com/${var.github-user}/${var.github-repo}"
git_clone_depth = 1
auth {
type = "OAUTH"
}
}
tags {
"type" = "${var.basename}"
}
}
resource "aws_codebuild_webhook" "github-hook" {
project_name = "${aws_codebuild_project.build.name}"
}