-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmanifest.json
169 lines (169 loc) · 4.65 KB
/
manifest.json
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
{
"v2": {
"transposit": {
"dependencies": [{
"name": "transposit/aws_ecr:v5.*.*",
"alias": "aws_ecr"
}, {
"name": "transposit/aws_ecs:v5.*.*",
"alias": "aws_ecs"
}, {
"name": "transposit/github:v2.*.*",
"alias": "github"
}, {
"name": "transposit/slack:v1.*.*",
"alias": "slack"
}],
"operations": [{
"id": "delete_old_images",
"description": "Returns \"Hello, world\" in different languages",
"function": {
"parameters": [{
"name": "repo",
"type": "STRING"
}, {
"name": "tagFilter",
"type": "STRING"
}, {
"name": "gitRepositoryOwner",
"type": "STRING"
}, {
"name": "gitRepositoryName",
"type": "STRING"
}, {
"name": "channelName",
"type": "STRING"
}],
"js": "hello_world.js"
},
"access": {
"requireUser": true
}
}, {
"id": "get_containers_and_tasks_in_use",
"function": {
"js": "get_containers_and_tasks_in_use.js"
}
}, {
"id": "list_clusters",
"tql": {
"tql": "SELECT * FROM aws_ecs.list_clusters expand by clusterArns"
}
}, {
"id": "delete_old_images_dryrun",
"function": {
"parameters": [{
"name": "repos",
"default": {
"text": "['ECR_repository_name']"
},
"type": "ARRAY"
}, {
"name": "tagFilter",
"type": "STRING"
}, {
"name": "gitRepositoryName",
"type": "STRING"
}, {
"name": "gitRepositoryOwner",
"type": "STRING"
}, {
"name": "channelName",
"type": "STRING"
}],
"js": "delete_old_images_dryrun.js"
}
}, {
"id": "get_commit",
"tql": {
"parameters": [{
"name": "owner",
"type": "STRING"
}, {
"name": "repo",
"type": "STRING"
}, {
"name": "sha",
"type": "STRING"
}],
"tql": "SELECT * FROM github.get_commit\n WHERE owner=@owner\n AND repo=@repo\n AND shaCode=@sha"
}
}, {
"id": "delete_old_tasks",
"function": {
"parameters": [{
"name": "gitRepositoryName",
"type": "STRING"
}, {
"name": "gitRepositoryOwner",
"type": "STRING"
}],
"js": "delete_old_tasks.js"
}
}, {
"id": "delete_old_tasks_dryrun",
"function": {
"parameters": [{
"name": "gitRepositoryName",
"type": "STRING"
}, {
"name": "gitRepositoryOwner",
"type": "STRING"
}],
"js": "delete_old_tasks_dryrun.js"
}
}, {
"id": "get_tasks_in_use",
"function": {
"js": "get_tasks_in_use.js"
}
}, {
"id": "get_images_in_use",
"tql": {
"tql": "SELECT container.image\nFROM aws_ecs.describe_task_definition\nWHERE $body.taskDefinition IN (SELECT * FROM this.get_tasks_in_use)\nEXPAND BY taskDefinition.containerDefinitions AS container\n\n\n--select * from this.get_tasks_in_use\n\n-- SELECT container.image\n-- FROM aws_ecs.describe_task_definition\n-- WHERE taskDefinition IN (SELECT * FROM this.get_tasks_in_use)\n-- EXPAND BY taskDefinition.containerDefinitions AS container\n"
}
}, {
"id": "post_to_slack",
"function": {
"parameters": [{
"name": "channelName",
"type": "STRING"
}, {
"name": "text",
"type": "STRING"
}],
"js": "post_to_slack.js"
}
}],
"dataConnections": [{
"ref": "aws_ecr.raw.aws_basic"
}, {
"ref": "aws_ecs.raw.aws_basic"
}, {
"ref": "github.raw"
}, {
"ref": "aws_ecr",
"overrides": {
"aws": {
"region": "us-west-2",
"executionLimits": {
}
}
}
}, {
"ref": "aws_ecs",
"overrides": {
"aws": {
"region": "us-west-2",
"executionLimits": {
}
}
}
}],
"javascriptAPIVersion": "3",
"source": "src"
},
"description": "Find container images and ECS tasks not being used, verify the creation dates, and safely purge them.",
"displayName": "AWS ECS/ECR Cleanup"
}
}