-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
78 lines (69 loc) · 2.39 KB
/
main.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
73
74
75
76
77
78
/**
* # aws-terraform-codecommit
*
*This module creates a code commit repository.
*
*## Basic Usage
*
*```
module "codecommit_repo" {
source = "[email protected]:rackspace-infrastructure-automation/aws-terraform-codecommit//?ref=v0.0.1"
repository_name = "MyTestRepository"
}
*```
*
* Full working references are available at [examples](examples)
*/
resource "aws_codecommit_repository" "repo" {
repository_name = "${var.repository_name}"
description = "${var.description}"
default_branch = "${var.default_branch}"
}
resource "aws_codecommit_trigger" "trigger_1" {
count = "${var.enable_trigger_1 ? 1 : 0}"
depends_on = ["aws_codecommit_repository.repo"]
repository_name = "${var.repository_name}"
trigger {
name = "${var.trigger_1_name}"
events = "${var.trigger_1_events}"
destination_arn = "${var.trigger_1_destination_arn}"
custom_data = "${var.trigger_1_custom_data}"
branches = "${var.trigger_1_branches}"
}
}
resource "aws_codecommit_trigger" "trigger_2" {
count = "${var.enable_trigger_2 ? 1 : 0}"
depends_on = ["aws_codecommit_repository.repo"]
repository_name = "${var.repository_name}"
trigger {
name = "${var.trigger_2_name}"
events = "${var.trigger_2_events}"
destination_arn = "${var.trigger_2_destination_arn}"
custom_data = "${var.trigger_2_custom_data}"
branches = "${var.trigger_2_branches}"
}
}
resource "aws_codecommit_trigger" "trigger_3" {
count = "${var.enable_trigger_3 ? 1 : 0}"
depends_on = ["aws_codecommit_repository.repo"]
repository_name = "${var.repository_name}"
trigger {
name = "${var.trigger_3_name}"
events = "${var.trigger_3_events}"
destination_arn = "${var.trigger_3_destination_arn}"
custom_data = "${var.trigger_3_custom_data}"
branches = "${var.trigger_3_branches}"
}
}
resource "aws_codecommit_trigger" "trigger_4" {
count = "${var.enable_trigger_4 ? 1 : 0}"
depends_on = ["aws_codecommit_repository.repo"]
repository_name = "${var.repository_name}"
trigger {
name = "${var.trigger_4_name}"
events = "${var.trigger_4_events}"
destination_arn = "${var.trigger_4_destination_arn}"
custom_data = "${var.trigger_4_custom_data}"
branches = "${var.trigger_4_branches}"
}
}