github.com/aquasecurity/trivy-iac@v0.8.1-0.20240127024015-3d8e412cf0ab/pkg/scanners/cloudformation/parser/pseudo_parameters.go (about)

     1  package parser
     2  
     3  import "github.com/aquasecurity/trivy-iac/pkg/scanners/cloudformation/cftypes"
     4  
     5  type pseudoParameter struct {
     6  	t   cftypes.CfType
     7  	val interface{}
     8  	raw interface{}
     9  }
    10  
    11  var pseudoParameters = map[string]pseudoParameter{
    12  	"AWS::AccountId": {t: cftypes.String, val: "123456789012"},
    13  	"AWS::NotificationARNs": {
    14  		t: cftypes.List,
    15  		val: []*Property{
    16  			{
    17  				Inner: PropertyInner{
    18  					Type:  cftypes.String,
    19  					Value: "notification::arn::1",
    20  				},
    21  			},
    22  			{
    23  				Inner: PropertyInner{
    24  					Type:  cftypes.String,
    25  					Value: "notification::arn::2",
    26  				},
    27  			},
    28  		},
    29  		raw: []string{"notification::arn::1", "notification::arn::2"},
    30  	},
    31  	"AWS::NoValue":   {t: cftypes.String, val: ""},
    32  	"AWS::Partition": {t: cftypes.String, val: "aws"},
    33  	"AWS::Region":    {t: cftypes.String, val: "eu-west-1"},
    34  	"AWS::StackId":   {t: cftypes.String, val: "arn:aws:cloudformation:eu-west-1:stack/ID"},
    35  	"AWS::StackName": {t: cftypes.String, val: "cfsec-test-stack"},
    36  	"AWS::URLSuffix": {t: cftypes.String, val: "amazonaws.com"},
    37  }
    38  
    39  func (p pseudoParameter) getRawValue() interface{} {
    40  	switch p.t {
    41  	case cftypes.List:
    42  		return p.raw
    43  	default:
    44  		return p.val
    45  	}
    46  }