-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstructs.go
More file actions
81 lines (70 loc) · 2.41 KB
/
structs.go
File metadata and controls
81 lines (70 loc) · 2.41 KB
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
package main
import (
cwe "github.com/aws/aws-sdk-go/service/cloudwatchevents"
)
// Rules is for store unmarshalized configuration yaml
type Rules struct {
Rules []Rule
}
// Rule is for expression CloudWatch Events Rule
type Rule struct {
Description string `yaml:"description"`
EventPattern string `yaml:"event_pattern"`
Name string `yaml:"name"`
RoleArn string `yaml:"role_arn"`
ScheduleExpression string `yaml:"schedule_expression"`
State string `yaml:"state"`
Targets []Target `yaml:"targets"`
ActualRule cwe.Rule
NeedUpdate bool
NeedDelete bool
}
// Target is for expression CloudWatch Events Target
type Target struct {
Arn string `yaml:"arn"`
ID string `yaml:"id"`
Input string `yaml:"input"`
InputPath string `yaml:"input_path"`
EcsParameters EcsParameters `yaml:"ecs_parameters"`
KinesisParameters KinesisParameters `yaml:"kinesis_parameters"`
RoleArn string `yaml:"role_arn"`
ActualTarget cwe.Target
NeedUpdate bool
NeedDelete bool
}
// EcsParameters is a part of the Target
type EcsParameters struct {
TaskCount int64 `yaml:"task_count"`
TaskDefinitionArn string `yaml:"task_definition_arn"`
}
// KinesisParameters is a part of the Target
type KinesisParameters struct {
PartitionKeyPath string `yaml:"partition_key_path"`
}
// LambdaPolicy is for JSON that return from Lambda.GetPolicy
type LambdaPolicy struct {
Version string `json:"Version"`
ID string `json:"Id"`
Statement *[]PolicyStatement `json:"Statement"`
}
// PolicyStatement is a part of the LambdaPolicy
type PolicyStatement struct {
Resource string `json:"Resource"`
Condition *PolicyCondition `json:"Condition"`
StatementID string `json:"Sid"`
Effect string `json:"Effect"`
Principal *PolicyPrincipal `json:"Principal"`
Action string `json:"Action"`
}
// PolicyCondition is a part of the LambdaPolicy
type PolicyCondition struct {
ArnLike *PolicyArnLike `json:"ArnLike"`
}
// PolicyArnLike is a part of the LambdaPolicy
type PolicyArnLike struct {
AwsSourceArn string `json:"AWS:SourceArn"`
}
// PolicyPrincipal is a part of the LambdaPolicy
type PolicyPrincipal struct {
Service string `json:"Service"`
}