Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'SSLCertificateARN', Type='String',
Description='ARN for a SSL certificate stored in IAM'
), 'SSLCertificateARN')
self.backward_compat_ssl_certificate_arn = self.add_parameter(
Parameter(
'BackwardCompatSSLCertificateARN', Type='String',
Description='ARN for a SSL certificate stored in IAM'
), 'BackwardCompatSSLCertificateARN')
self.public_subnets = self.add_parameter(Parameter(
'PublicSubnets', Type='CommaDelimitedList',
Description='A list of public subnets'
), 'PublicSubnets')
self.private_subnets = self.add_parameter(Parameter(
'PrivateSubnets', Type='CommaDelimitedList',
Description='A list of private subnets'
), 'PrivateSubnets')
self.public_hosted_zone_name = self.add_parameter(Parameter(
'PublicHostedZoneName', Type='String',
Description='Route 53 public hosted zone name'
), 'PublicHostedZoneName')
self.vpc_id = self.add_parameter(Parameter(
'VpcId', Type='String',
Description='VPC ID'
), 'VpcId')
self.notification_topic_arn = self.add_parameter(Parameter(
'GlobalNotificationsARN', Type='String',
ConstraintDescription="must contain only alphanumberic characters"
))
secondaryIndexHashDataType = template.add_parameter(Parameter(
"SecondaryIndexHashDataType",
Description="Secondary Index: Primary Key Data Type",
Type="String",
Default="S",
AllowedPattern="[S|N|B]",
MinLength="1",
MaxLength="1",
ConstraintDescription="S for string data, N for numeric data, or B for "
"binary data"
))
secondaryIndexRangeName = template.add_parameter(Parameter(
"refreshSecondaryIndexRangeName",
Description="Secondary Index: Range Key Field",
Type="String",
Default="tokenUpdatedTime",
AllowedPattern="[a-zA-Z0-9]*",
MinLength="1",
MaxLength="2048",
ConstraintDescription="must contain only alphanumberic characters"
))
secondaryIndexRangeDataType = template.add_parameter(Parameter(
"SecondaryIndexRangeDataType",
Description="Secondary Index: Range Key Data Type",
Type="String",
Default="S",
AllowedPattern="[S|N|B]",
def main(args):
t = Template()
# ================= Parameters =================
# 0 1 2 3 4 5 6 7
# [shared_dir,fsx_fs_id,storage_capacity,fsx_kms_key_id,imported_file_chunk_size,export_path,import_path,weekly_maintenance_start_time]
fsx_options = t.add_parameter(
Parameter(
"FSXOptions",
Type="CommaDelimitedList",
Description="Comma separated list of fsx related options, 8 parameters in total, [shared_dir,fsx_fs_id,storage_capacity,fsx_kms_key_id,imported_file_chunk_size,export_path,import_path,weekly_maintenance_start_time]",
)
)
compute_security_group = t.add_parameter(
Parameter("ComputeSecurityGroup", Type="String", Description="SecurityGroup for FSx filesystem")
)
subnet_id = t.add_parameter(Parameter("SubnetId", Type="String", Description="SubnetId for FSx filesystem"))
# ================= Conditions =================
create_fsx = t.add_condition(
"CreateFSX",
And(Not(Equals(Select(str(0), Ref(fsx_options)), "NONE")), Equals(Select(str(1), Ref(fsx_options)), "NONE")),
'OfficeCIDR', Type='String', Default=ip_access,
Description='CIDR notation of office IP addresses'
), source='IPAccess')
mesos_follower_ami_param = self.add_parameter(Parameter(
'MesosFollowerAMI', Type='String',
Description='Mesos follower AMI'
), source='MesosFollowerAMI')
mesos_follower_instance_profile_param = self.add_parameter(Parameter(
'MesosFollowerInstanceProfile', Type='String',
Default='MesosFollowerInstanceProfile',
Description='Physical resource ID of an AWS::IAM::Role for the followers'
), source='MesosFollowerInstanceProfile')
mesos_follower_instance_type_param = self.add_parameter(Parameter(
'MesosFollowerInstanceType', Type='String', Default='i2.2xlarge',
Description='Follower EC2 instance type',
AllowedValues=utils.EC2_INSTANCE_TYPES,
ConstraintDescription='must be a valid EC2 instance type.'
), source='MesosFollowerInstanceType')
mesos_follower_subnet_param = self.add_parameter(Parameter(
'MesosSubnet', Type='CommaDelimitedList',
Description='A list of subnets to associate with the Mesos leaders'
), source='MesosSubnet')
mesos_follower_security_group = self.add_resource(ec2.SecurityGroup(
'sgMesosFollower',
GroupDescription='Enables access to the MesosFollower',
VpcId=Ref(vpc_param),
SecurityGroupIngress=[
def define_parameters (t):
t.add_parameter(Parameter("instanceType",
AllowedValues = [
"m4.2xlarge", "m4.4xlarge"
],
ConstraintDescription = "Must be a valid EC2 instance type for BIG-IQ",
Default = "m4.2xlarge",
Description = "Size of the F5 BIG-IQ Virtual Instance",
Type = "String"
))
t.add_parameter(Parameter("licenseKey1",
ConstraintDescription = "Verify your F5 BYOL regkey.",
Description = "F5 BIG-IQ CM license key",
MaxLength = 255,
MinLength = 1,
Type = "String"
))
t.add_parameter(Parameter("licenseKey2",
maximum_instances_param = template.add_parameter(Parameter(
"maximumInstances",
Description="Maximum Number of Auto Scaling Instances (must be larger than min)",
Type="Number",
Default="4"
))
minimum_instances_param = template.add_parameter(Parameter(
"minimumInstances",
Description="Minimum Number of Auto Scaling Instances",
Type="Number",
Default="3"
))
pause_time_param = template.add_parameter(Parameter(
"pauseTime",
Description="Pause time for AutoScalingRollingUpdate e.g PT15M",
Type="String",
Default="PT15M"
))
wait_on_resource_signals_param = template.add_parameter(Parameter(
"waitOnResourceSignals",
Description="Enabling WaitOnResourceSignals allows CloudFormation to wait until you have received a success signal before performing the next scaling action.",
Type="String",
Default="True"
))
###
#
Description="The environment being deployed into",
))
PublicSubnet1 = t.add_parameter(Parameter(
"PublicSubnet1",
Type="String",
Description="A public VPC subnet ID for the api app load balancer.",
))
PublicSubnet2 = t.add_parameter(Parameter(
"PublicSubnet2",
Type="String",
Description="A public VPC subnet ID for the api load balancer.",
))
VPCAvailabilityZone2 = t.add_parameter(Parameter(
"VPCAvailabilityZone2",
MinLength="1",
Type="String",
Description="Second availability zone",
MaxLength="255",
))
VPCAvailabilityZone1 = t.add_parameter(Parameter(
"VPCAvailabilityZone1",
MinLength="1",
Type="String",
Description="First availability zone",
MaxLength="255",
))
RootStackName = t.add_parameter(Parameter(
))
maxsize = template.add_parameter(Parameter(
"MaxScale",
Type="String",
Description="Maximum number of servers to keep in the ASG",
))
signalcount = template.add_parameter(Parameter(
"SignalCount",
Default="1",
Type="String",
Description="No. of signals CF must receive before it sets the status as CREATE_COMPLETE",
))
signaltimeout = template.add_parameter(Parameter(
"SignalTimeout",
Default="PT5M",
Type="String",
Description="Time that CF waits for the number of signals that was specified in Count ",
))
minsuccessfulinstancespercent = template.add_parameter(Parameter(
"MinSuccessfulInstancesPercent",
Default="100",
Type="String",
Description="Specifies the % of instances in an ASG replacement update that must signal "
"success for the update to succeed",
))
environment = template.add_parameter(Parameter(
"Environment",
KeySchema,
AttributeDefinition,
ProvisionedThroughput,
Projection,
Table,
GlobalSecondaryIndex
)
template = Template()
template.set_description("Create a dynamodb table with a global secondary "
"index")
# N.B. If you remove the provisioning section this works for
# LocalSecondaryIndexes aswell.
readunits = template.add_parameter(Parameter(
"ReadCapacityUnits",
Description="Provisioned read throughput",
Type="Number",
Default="10",
MinValue="5",
MaxValue="10000",
ConstraintDescription="should be between 5 and 10000"
))
writeunits = template.add_parameter(Parameter(
"WriteCapacityUnits",
Description="Provisioned write throughput",
Type="Number",
Default="5",
MinValue="5",
MaxValue="10000",
maximum_instances_param = template.add_parameter(Parameter(
"maximumInstances",
Description="Maximum Number of Auto Scaling Instances (must be larger than min)",
Type="Number",
Default="4"
))
minimum_instances_param = template.add_parameter(Parameter(
"minimumInstances",
Description="Minimum Number of Auto Scaling Instances",
Type="Number",
Default="3"
))
pause_time_param = template.add_parameter(Parameter(
"pauseTime",
Description="Pause time for AutoScalingRollingUpdate e.g PT15M",
Type="String",
Default="PT15M"
))
wait_on_resource_signals_param = template.add_parameter(Parameter(
"waitOnResourceSignals",
Description="Enabling WaitOnResourceSignals allows CloudFormation to wait until you have received a success signal before performing the next scaling action.",
Type="String",
Default="True"
))
subnet_id_refs = []
for zone_identifier in range(1, 4):
vpc_subnet_id = template.add_parameter(Parameter(