-
Notifications
You must be signed in to change notification settings - Fork 2.1k
/
pseudo_parameters.go
48 lines (44 loc) · 1.14 KB
/
pseudo_parameters.go
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
package parser
import (
"github.com/aquasecurity/trivy/pkg/iac/scanners/cloudformation/cftypes"
)
type pseudoParameter struct {
t cftypes.CfType
val interface{}
raw interface{}
}
var pseudoParameters = map[string]pseudoParameter{
"AWS::AccountId": {t: cftypes.String, val: "123456789012"},
"AWS::NotificationARNs": {
t: cftypes.List,
val: []*Property{
{
Inner: PropertyInner{
Type: cftypes.String,
Value: "notification::arn::1",
},
},
{
Inner: PropertyInner{
Type: cftypes.String,
Value: "notification::arn::2",
},
},
},
raw: []string{"notification::arn::1", "notification::arn::2"},
},
"AWS::NoValue": {t: cftypes.String, val: ""},
"AWS::Partition": {t: cftypes.String, val: "aws"},
"AWS::Region": {t: cftypes.String, val: "eu-west-1"},
"AWS::StackId": {t: cftypes.String, val: "arn:aws:cloudformation:eu-west-1:stack/ID"},
"AWS::StackName": {t: cftypes.String, val: "cfsec-test-stack"},
"AWS::URLSuffix": {t: cftypes.String, val: "amazonaws.com"},
}
func (p pseudoParameter) getRawValue() interface{} {
switch p.t {
case cftypes.List:
return p.raw
default:
return p.val
}
}