File tree Expand file tree Collapse file tree 1 file changed +60
-0
lines changed Expand file tree Collapse file tree 1 file changed +60
-0
lines changed Original file line number Diff line number Diff line change
1
+ package resources
2
+
3
+ import (
4
+ "github.com/aws/aws-sdk-go/aws/session"
5
+ "github.com/aws/aws-sdk-go/service/codebuild"
6
+ "github.com/rebuy-de/aws-nuke/v2/pkg/types"
7
+ )
8
+
9
+ type CodeBuildReportGroup struct {
10
+ svc * codebuild.CodeBuild
11
+ Arn * string
12
+ }
13
+
14
+ func init () {
15
+ register ("CodeBuildReportGroup" , ListCodeBuildReportGroup )
16
+ }
17
+
18
+ func ListCodeBuildReportGroup (sess * session.Session ) ([]Resource , error ) {
19
+ svc := codebuild .New (sess )
20
+ resources := []Resource {}
21
+
22
+ params := & codebuild.ListReportGroupsInput {}
23
+
24
+ for {
25
+ resp , err := svc .ListReportGroups (params )
26
+ if err != nil {
27
+ return nil , err
28
+ }
29
+
30
+ for _ , reportGroup := range resp .ReportGroups {
31
+ resources = append (resources , & CodeBuildReportGroup {
32
+ svc : svc ,
33
+ Arn : reportGroup ,
34
+ })
35
+ }
36
+
37
+ if resp .NextToken == nil {
38
+ break
39
+ }
40
+
41
+ params .NextToken = resp .NextToken
42
+ }
43
+
44
+ return resources , nil
45
+ }
46
+
47
+ func (f * CodeBuildReportGroup ) Remove () error {
48
+ _ , err := f .svc .DeleteReportGroup (& codebuild.DeleteReportGroupInput {
49
+ Arn : f .Arn ,
50
+ })
51
+
52
+ return err
53
+ }
54
+
55
+ func (f * CodeBuildReportGroup ) Properties () types.Properties {
56
+ properties := types .NewProperties ()
57
+ properties .
58
+ Set ("Arn" , f .Arn )
59
+ return properties
60
+ }
You can’t perform that action at this time.
0 commit comments