Exemplo n.º 1
0
// see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-blockdev-template.html
var ec2EbsBlockDevice = NestedResource{
	Description: "Elastic Block Store Block Device",
	Properties: Properties{
		"DeleteOnTermination": Schema{
			Type:    ValueBool,
			Default: true,
		},

		"Encrypted": Schema{
			Type: ValueBool,
		},

		"Iops": Schema{
			Type:         ValueNumber,
			Required:     constraints.PropertyIs("VolumeType", "io1"),
			Conflicts:    constraints.PropertyNot("VolumeType", "io1"),
			ValidateFunc: IntegerRangeValidate(100, 2000),
		},

		"SnapshotId": Schema{
			Type: SnapshotID,
			// TODO: Required: Conditional If you specify both SnapshotId and VolumeSize, VolumeSize must be equal or greater than the size of the snapshot.
		},

		"VolumeSize": Schema{
			Type:         ValueNumber,
			ValidateFunc: IntegerRangeValidate(1, 1024),
			// TODO: If the volume type is io1, the minimum value is 10.
			// TODO: Required: Conditional If you specify both SnapshotId and VolumeSize, VolumeSize must be equal or greater than the size of the snapshot.
		},
Exemplo n.º 2
0
			Type: ValueNumber,
		},

		"FullyQualifiedDomainName": Schema{
			Type:     ValueString,
			Required: constraints.PropertyNotExists("IPAddress"),
		},

		"IPAddress": Schema{
			Type:     IPAddress,
			Required: constraints.PropertyNotExists("FullyQualifiedDomainName"),
		},

		"Port": Schema{
			Type:     ValueNumber,
			Required: constraints.PropertyIs("Type", "TCP"),
		},

		"RequestInterval": Schema{
			Type: ValueNumber,
		},

		"ResourcePath": Schema{
			Type: ValueString,
		},

		"SearchString": Schema{
			Type: ValueString,
		},

		"Type": Schema{
Exemplo n.º 3
0
package cloud_front

import (
	"github.com/jagregory/cfval/constraints"
	. "github.com/jagregory/cfval/schema"
)

// see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-forwardedvalues-cookies.html
var cookies = NestedResource{
	Description: "CloudFront ForwardedValues Cookies",

	Properties: Properties{
		"Forward": Schema{
			Type: EnumValue{
				Description: "CloudFront ForwardedValues Cookies Forward",
				Options:     []string{"none", "all", "whitelist"},
			},
			Required: constraints.Always,
		},

		"WhitelistedNames": Schema{
			Type:     Multiple(ValueString),
			Required: constraints.PropertyIs("Forward", "whitelist"),
		},
	},
}
Exemplo n.º 4
0
package cloud_front

import (
	"github.com/jagregory/cfval/constraints"
	"github.com/jagregory/cfval/resources/common"
	. "github.com/jagregory/cfval/schema"
)

// see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distributionconfig-restrictions-georestriction.html
var geoRestriction = NestedResource{
	Description: "CloudFront DistributionConfig Restrictions GeoRestriction",
	Properties: Properties{
		"Locations": Schema{
			Type: Multiple(common.CountryCode),
			Required: constraints.Any{
				constraints.PropertyIs("RestrictionType", "blacklist"),
				constraints.PropertyIs("RestrictionType", "whitelist"),
			},
		},

		"RestrictionType": Schema{
			Type: EnumValue{
				Description: "RestrictionType",
				Options:     []string{"blacklist", "whitelist", "none"},
			},
			Required: constraints.Always,
		},
	},
}
Exemplo n.º 5
0
			Type:         ValueNumber,
			Required:     constraints.Always,
			ValidateFunc: numCacheNodesValidate,
		},

		"Port": Schema{
			Type: ValueNumber,
		},

		"PreferredAvailabilityZone": Schema{
			Type: AvailabilityZone,
		},

		"PreferredAvailabilityZones": Schema{
			Type:     Multiple(AvailabilityZone),
			Required: constraints.PropertyIs("AZMode", "cross-az"),
		},

		"PreferredMaintenanceWindow": Schema{
			Type: ValueString,
		},

		"SnapshotArns": Schema{
			Type: Multiple(ARN),
		},

		"SnapshotName": Schema{
			Type: ValueString,
		},

		"SnapshotRetentionLimit": Schema{
Exemplo n.º 6
0
	},

	Properties: Properties{
		"AdjustmentType": Schema{
			Type:     ValueString,
			Required: constraints.Always,
		},

		"AutoScalingGroupName": Schema{
			Type:     ValueString,
			Required: constraints.Always,
		},

		"Cooldown": Schema{
			Type:      ValueString,
			Conflicts: constraints.PropertyIs("PolicyType", "StepScaling"),
		},

		"EstimatedInstanceWarmup": Schema{
			Type:      ValueNumber,
			Conflicts: constraints.PropertyIs("PolicyType", "SimpleScaling"),
		},

		"MetricAggregationType": Schema{
			Type:      metricAggregationType,
			Default:   "Average",
			Conflicts: constraints.PropertyIs("PolicyType", "SimpleScaling"),
		},

		"MinAdjustmentMagnitude": Schema{
			Type: ValueNumber,
Exemplo n.º 7
0
	},

	Properties: Properties{
		"CidrBlock": Schema{
			Type:     CIDR,
			Required: constraints.Always,
		},

		"Egress": Schema{
			Type:    ValueBool,
			Default: true,
		},

		"Icmp": Schema{
			Type:     icmp,
			Required: constraints.PropertyIs("Protocol", 1), // ICMP
		},

		"NetworkAclId": Schema{
			Type:     NetworkAclID,
			Required: constraints.Always,
		},

		"PortRange": Schema{
			Type: portRange,
			Required: constraints.Any{
				constraints.PropertyIs("Protocol", 6),  // TCP
				constraints.PropertyIs("Protocol", 17), // UDP
			},
		},
Exemplo n.º 8
0
		"AllowMajorVersionUpgrade": Schema{
			Type: ValueBool,
			// TODO: This parameter must be set to true when you specify an
			//       EngineVersion that differs from the DB instance's current
			//       major version.
		},

		"AutoMinorVersionUpgrade": Schema{
			Type:    ValueBool,
			Default: true,
		},

		"AvailabilityZone": Schema{
			Type:      AvailabilityZone,
			Conflicts: constraints.PropertyIs("MultiAZ", true),
		},

		"BackupRetentionPeriod": Schema{
			Type: ValueString,
			Conflicts: constraints.Any{
				constraints.PropertyExists("DBSnapshotIdentifier"),
				constraints.PropertyExists("SourceDBInstanceIdentifier"),
			},
		},

		"CharacterSetName": Schema{
			Type: ValueString,
		},

		"DBClusterIdentifier": Schema{