Merge pull request #10066 from binkkatal/hotfix/10015-cloud-formation-lint-error

Hotfix/10015 cloud formation lint error
This commit is contained in:
Kubernetes Prow Robot 2020-10-20 21:06:19 -07:00 committed by GitHub
commit ea96bbd768
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 168 additions and 152 deletions

View File

@ -314,21 +314,21 @@ func (b *AutoscalingGroupModelBuilder) buildAutoScalingGroupTask(c *fi.ModelBuil
}, },
} }
minSize := int32(1) minSize := fi.Int64(1)
maxSize := int32(1) maxSize := fi.Int64(1)
if ig.Spec.MinSize != nil { if ig.Spec.MinSize != nil {
minSize = fi.Int32Value(ig.Spec.MinSize) minSize = fi.Int64(int64(*ig.Spec.MinSize))
} else if ig.Spec.Role == kops.InstanceGroupRoleNode { } else if ig.Spec.Role == kops.InstanceGroupRoleNode {
minSize = 2 minSize = fi.Int64(2)
} }
if ig.Spec.MaxSize != nil { if ig.Spec.MaxSize != nil {
maxSize = *ig.Spec.MaxSize maxSize = fi.Int64(int64(*ig.Spec.MaxSize))
} else if ig.Spec.Role == kops.InstanceGroupRoleNode { } else if ig.Spec.Role == kops.InstanceGroupRoleNode {
maxSize = 2 maxSize = fi.Int64(2)
} }
t.MinSize = fi.Int64(int64(minSize)) t.MinSize = minSize
t.MaxSize = fi.Int64(int64(maxSize)) t.MaxSize = maxSize
subnets, err := b.GatherSubnets(ig) subnets, err := b.GatherSubnets(ig)
if err != nil { if err != nil {

View File

@ -15,8 +15,8 @@
] ]
} }
}, },
"MaxSize": 1, "MaxSize": "1",
"MinSize": 1, "MinSize": "1",
"VPCZoneIdentifier": [ "VPCZoneIdentifier": [
{ {
"Ref": "AWSEC2Subnetustest1acomplexexamplecom" "Ref": "AWSEC2Subnetustest1acomplexexamplecom"
@ -96,8 +96,8 @@
] ]
} }
}, },
"MaxSize": 2, "MaxSize": "2",
"MinSize": 2, "MinSize": "2",
"VPCZoneIdentifier": [ "VPCZoneIdentifier": [
{ {
"Ref": "AWSEC2Subnetustest1acomplexexamplecom" "Ref": "AWSEC2Subnetustest1acomplexexamplecom"
@ -1079,9 +1079,9 @@
"LoadBalancerName": "api-complex-example-com-vd3t5n", "LoadBalancerName": "api-complex-example-com-vd3t5n",
"Listeners": [ "Listeners": [
{ {
"InstancePort": 443, "InstancePort": "443",
"InstanceProtocol": "TCP", "InstanceProtocol": "TCP",
"LoadBalancerPort": 443, "LoadBalancerPort": "443",
"Protocol": "TCP" "Protocol": "TCP"
} }
], ],
@ -1099,10 +1099,10 @@
], ],
"HealthCheck": { "HealthCheck": {
"Target": "SSL:443", "Target": "SSL:443",
"HealthyThreshold": 2, "HealthyThreshold": "2",
"UnhealthyThreshold": 2, "UnhealthyThreshold": "2",
"Interval": 10, "Interval": "10",
"Timeout": 5 "Timeout": "5"
}, },
"ConnectionSettings": { "ConnectionSettings": {
"IdleTimeout": 300 "IdleTimeout": 300

View File

@ -15,8 +15,8 @@
] ]
} }
}, },
"MaxSize": 1, "MaxSize": "1",
"MinSize": 1, "MinSize": "1",
"VPCZoneIdentifier": [ "VPCZoneIdentifier": [
{ {
"Ref": "AWSEC2Subnetustest1acontainerdexamplecom" "Ref": "AWSEC2Subnetustest1acontainerdexamplecom"
@ -81,8 +81,8 @@
] ]
} }
}, },
"MaxSize": 2, "MaxSize": "2",
"MinSize": 2, "MinSize": "2",
"VPCZoneIdentifier": [ "VPCZoneIdentifier": [
{ {
"Ref": "AWSEC2Subnetustest1acontainerdexamplecom" "Ref": "AWSEC2Subnetustest1acontainerdexamplecom"

View File

@ -15,8 +15,8 @@
] ]
} }
}, },
"MaxSize": 1, "MaxSize": "1",
"MinSize": 1, "MinSize": "1",
"VPCZoneIdentifier": [ "VPCZoneIdentifier": [
{ {
"Ref": "AWSEC2Subnetustest1aminimalexamplecom" "Ref": "AWSEC2Subnetustest1aminimalexamplecom"
@ -81,8 +81,8 @@
] ]
} }
}, },
"MaxSize": 2, "MaxSize": "2",
"MinSize": 2, "MinSize": "2",
"VPCZoneIdentifier": [ "VPCZoneIdentifier": [
{ {
"Ref": "AWSEC2Subnetustest1aminimalexamplecom" "Ref": "AWSEC2Subnetustest1aminimalexamplecom"

View File

@ -15,8 +15,8 @@
] ]
} }
}, },
"MaxSize": 1, "MaxSize": "1",
"MinSize": 1, "MinSize": "1",
"VPCZoneIdentifier": [ "VPCZoneIdentifier": [
{ {
"Ref": "AWSEC2Subnetustest1aexternallbexamplecom" "Ref": "AWSEC2Subnetustest1aexternallbexamplecom"
@ -87,8 +87,8 @@
] ]
} }
}, },
"MaxSize": 2, "MaxSize": "2",
"MinSize": 2, "MinSize": "2",
"VPCZoneIdentifier": [ "VPCZoneIdentifier": [
{ {
"Ref": "AWSEC2Subnetustest1aexternallbexamplecom" "Ref": "AWSEC2Subnetustest1aexternallbexamplecom"

View File

@ -7,8 +7,8 @@
"LaunchConfigurationName": { "LaunchConfigurationName": {
"Ref": "AWSAutoScalingLaunchConfigurationmasterustest1amasterslaunchtemplatesexamplecom" "Ref": "AWSAutoScalingLaunchConfigurationmasterustest1amasterslaunchtemplatesexamplecom"
}, },
"MaxSize": 1, "MaxSize": "1",
"MinSize": 1, "MinSize": "1",
"VPCZoneIdentifier": [ "VPCZoneIdentifier": [
{ {
"Ref": "AWSEC2Subnetustest1alaunchtemplatesexamplecom" "Ref": "AWSEC2Subnetustest1alaunchtemplatesexamplecom"
@ -65,8 +65,8 @@
"LaunchConfigurationName": { "LaunchConfigurationName": {
"Ref": "AWSAutoScalingLaunchConfigurationmasterustest1bmasterslaunchtemplatesexamplecom" "Ref": "AWSAutoScalingLaunchConfigurationmasterustest1bmasterslaunchtemplatesexamplecom"
}, },
"MaxSize": 1, "MaxSize": "1",
"MinSize": 1, "MinSize": "1",
"VPCZoneIdentifier": [ "VPCZoneIdentifier": [
{ {
"Ref": "AWSEC2Subnetustest1blaunchtemplatesexamplecom" "Ref": "AWSEC2Subnetustest1blaunchtemplatesexamplecom"
@ -123,8 +123,8 @@
"LaunchConfigurationName": { "LaunchConfigurationName": {
"Ref": "AWSAutoScalingLaunchConfigurationmasterustest1cmasterslaunchtemplatesexamplecom" "Ref": "AWSAutoScalingLaunchConfigurationmasterustest1cmasterslaunchtemplatesexamplecom"
}, },
"MaxSize": 1, "MaxSize": "1",
"MinSize": 1, "MinSize": "1",
"VPCZoneIdentifier": [ "VPCZoneIdentifier": [
{ {
"Ref": "AWSEC2Subnetustest1claunchtemplatesexamplecom" "Ref": "AWSEC2Subnetustest1claunchtemplatesexamplecom"
@ -181,8 +181,8 @@
"LaunchConfigurationName": { "LaunchConfigurationName": {
"Ref": "AWSAutoScalingLaunchConfigurationnodeslaunchtemplatesexamplecom" "Ref": "AWSAutoScalingLaunchConfigurationnodeslaunchtemplatesexamplecom"
}, },
"MaxSize": 2, "MaxSize": "2",
"MinSize": 2, "MinSize": "2",
"VPCZoneIdentifier": [ "VPCZoneIdentifier": [
{ {
"Ref": "AWSEC2Subnetustest1blaunchtemplatesexamplecom" "Ref": "AWSEC2Subnetustest1blaunchtemplatesexamplecom"

View File

@ -15,8 +15,8 @@
] ]
} }
}, },
"MaxSize": 1, "MaxSize": "1",
"MinSize": 1, "MinSize": "1",
"VPCZoneIdentifier": [ "VPCZoneIdentifier": [
{ {
"Ref": "AWSEC2Subnetustest1aminimalexamplecom" "Ref": "AWSEC2Subnetustest1aminimalexamplecom"
@ -81,8 +81,8 @@
] ]
} }
}, },
"MaxSize": 2, "MaxSize": "2",
"MinSize": 2, "MinSize": "2",
"VPCZoneIdentifier": [ "VPCZoneIdentifier": [
{ {
"Ref": "AWSEC2Subnetustest1aminimalexamplecom" "Ref": "AWSEC2Subnetustest1aminimalexamplecom"

View File

@ -15,8 +15,8 @@
] ]
} }
}, },
"MaxSize": 1, "MaxSize": "1",
"MinSize": 1, "MinSize": "1",
"VPCZoneIdentifier": [ "VPCZoneIdentifier": [
{ {
"Ref": "AWSEC2Subnetustest1amixedinstancesexamplecom" "Ref": "AWSEC2Subnetustest1amixedinstancesexamplecom"
@ -81,8 +81,8 @@
] ]
} }
}, },
"MaxSize": 1, "MaxSize": "1",
"MinSize": 1, "MinSize": "1",
"VPCZoneIdentifier": [ "VPCZoneIdentifier": [
{ {
"Ref": "AWSEC2Subnetustest1bmixedinstancesexamplecom" "Ref": "AWSEC2Subnetustest1bmixedinstancesexamplecom"
@ -147,8 +147,8 @@
] ]
} }
}, },
"MaxSize": 1, "MaxSize": "1",
"MinSize": 1, "MinSize": "1",
"VPCZoneIdentifier": [ "VPCZoneIdentifier": [
{ {
"Ref": "AWSEC2Subnetustest1cmixedinstancesexamplecom" "Ref": "AWSEC2Subnetustest1cmixedinstancesexamplecom"
@ -202,8 +202,8 @@
"Type": "AWS::AutoScaling::AutoScalingGroup", "Type": "AWS::AutoScaling::AutoScalingGroup",
"Properties": { "Properties": {
"AutoScalingGroupName": "nodes.mixedinstances.example.com", "AutoScalingGroupName": "nodes.mixedinstances.example.com",
"MaxSize": 2, "MaxSize": "2",
"MinSize": 2, "MinSize": "2",
"VPCZoneIdentifier": [ "VPCZoneIdentifier": [
{ {
"Ref": "AWSEC2Subnetustest1bmixedinstancesexamplecom" "Ref": "AWSEC2Subnetustest1bmixedinstancesexamplecom"

View File

@ -15,8 +15,8 @@
] ]
} }
}, },
"MaxSize": 1, "MaxSize": "1",
"MinSize": 1, "MinSize": "1",
"VPCZoneIdentifier": [ "VPCZoneIdentifier": [
{ {
"Ref": "AWSEC2Subnetustest1amixedinstancesexamplecom" "Ref": "AWSEC2Subnetustest1amixedinstancesexamplecom"
@ -81,8 +81,8 @@
] ]
} }
}, },
"MaxSize": 1, "MaxSize": "1",
"MinSize": 1, "MinSize": "1",
"VPCZoneIdentifier": [ "VPCZoneIdentifier": [
{ {
"Ref": "AWSEC2Subnetustest1bmixedinstancesexamplecom" "Ref": "AWSEC2Subnetustest1bmixedinstancesexamplecom"
@ -147,8 +147,8 @@
] ]
} }
}, },
"MaxSize": 1, "MaxSize": "1",
"MinSize": 1, "MinSize": "1",
"VPCZoneIdentifier": [ "VPCZoneIdentifier": [
{ {
"Ref": "AWSEC2Subnetustest1cmixedinstancesexamplecom" "Ref": "AWSEC2Subnetustest1cmixedinstancesexamplecom"
@ -202,8 +202,8 @@
"Type": "AWS::AutoScaling::AutoScalingGroup", "Type": "AWS::AutoScaling::AutoScalingGroup",
"Properties": { "Properties": {
"AutoScalingGroupName": "nodes.mixedinstances.example.com", "AutoScalingGroupName": "nodes.mixedinstances.example.com",
"MaxSize": 2, "MaxSize": "2",
"MinSize": 2, "MinSize": "2",
"VPCZoneIdentifier": [ "VPCZoneIdentifier": [
{ {
"Ref": "AWSEC2Subnetustest1bmixedinstancesexamplecom" "Ref": "AWSEC2Subnetustest1bmixedinstancesexamplecom"

View File

@ -15,8 +15,8 @@
] ]
} }
}, },
"MaxSize": 1, "MaxSize": "1",
"MinSize": 1, "MinSize": "1",
"VPCZoneIdentifier": [ "VPCZoneIdentifier": [
{ {
"Ref": "AWSEC2Subnetutilityustest1aprivatecalicoexamplecom" "Ref": "AWSEC2Subnetutilityustest1aprivatecalicoexamplecom"
@ -86,8 +86,8 @@
] ]
} }
}, },
"MaxSize": 1, "MaxSize": "1",
"MinSize": 1, "MinSize": "1",
"VPCZoneIdentifier": [ "VPCZoneIdentifier": [
{ {
"Ref": "AWSEC2Subnetustest1aprivatecalicoexamplecom" "Ref": "AWSEC2Subnetustest1aprivatecalicoexamplecom"
@ -157,8 +157,8 @@
] ]
} }
}, },
"MaxSize": 2, "MaxSize": "2",
"MinSize": 2, "MinSize": "2",
"VPCZoneIdentifier": [ "VPCZoneIdentifier": [
{ {
"Ref": "AWSEC2Subnetustest1aprivatecalicoexamplecom" "Ref": "AWSEC2Subnetustest1aprivatecalicoexamplecom"
@ -1228,9 +1228,9 @@
"LoadBalancerName": "api-privatecalico-example-0uch4k", "LoadBalancerName": "api-privatecalico-example-0uch4k",
"Listeners": [ "Listeners": [
{ {
"InstancePort": 443, "InstancePort": "443",
"InstanceProtocol": "TCP", "InstanceProtocol": "TCP",
"LoadBalancerPort": 443, "LoadBalancerPort": "443",
"Protocol": "TCP" "Protocol": "TCP"
} }
], ],
@ -1246,10 +1246,10 @@
], ],
"HealthCheck": { "HealthCheck": {
"Target": "SSL:443", "Target": "SSL:443",
"HealthyThreshold": 2, "HealthyThreshold": "2",
"UnhealthyThreshold": 2, "UnhealthyThreshold": "2",
"Interval": 10, "Interval": "10",
"Timeout": 5 "Timeout": "5"
}, },
"ConnectionSettings": { "ConnectionSettings": {
"IdleTimeout": 300 "IdleTimeout": 300
@ -1277,9 +1277,9 @@
"LoadBalancerName": "bastion-privatecalico-exa-hocohm", "LoadBalancerName": "bastion-privatecalico-exa-hocohm",
"Listeners": [ "Listeners": [
{ {
"InstancePort": 22, "InstancePort": "22",
"InstanceProtocol": "TCP", "InstanceProtocol": "TCP",
"LoadBalancerPort": 22, "LoadBalancerPort": "22",
"Protocol": "TCP" "Protocol": "TCP"
} }
], ],
@ -1295,10 +1295,10 @@
], ],
"HealthCheck": { "HealthCheck": {
"Target": "TCP:22", "Target": "TCP:22",
"HealthyThreshold": 2, "HealthyThreshold": "2",
"UnhealthyThreshold": 2, "UnhealthyThreshold": "2",
"Interval": 10, "Interval": "10",
"Timeout": 5 "Timeout": "5"
}, },
"ConnectionSettings": { "ConnectionSettings": {
"IdleTimeout": 300 "IdleTimeout": 300

View File

@ -15,8 +15,8 @@
] ]
} }
}, },
"MaxSize": 1, "MaxSize": "1",
"MinSize": 1, "MinSize": "1",
"VPCZoneIdentifier": [ "VPCZoneIdentifier": [
{ {
"Ref": "AWSEC2Subnetutilityustest1aprivateciliumexamplecom" "Ref": "AWSEC2Subnetutilityustest1aprivateciliumexamplecom"
@ -86,8 +86,8 @@
] ]
} }
}, },
"MaxSize": 1, "MaxSize": "1",
"MinSize": 1, "MinSize": "1",
"VPCZoneIdentifier": [ "VPCZoneIdentifier": [
{ {
"Ref": "AWSEC2Subnetustest1aprivateciliumexamplecom" "Ref": "AWSEC2Subnetustest1aprivateciliumexamplecom"
@ -157,8 +157,8 @@
] ]
} }
}, },
"MaxSize": 2, "MaxSize": "2",
"MinSize": 2, "MinSize": "2",
"VPCZoneIdentifier": [ "VPCZoneIdentifier": [
{ {
"Ref": "AWSEC2Subnetustest1aprivateciliumexamplecom" "Ref": "AWSEC2Subnetustest1aprivateciliumexamplecom"
@ -1214,9 +1214,9 @@
"LoadBalancerName": "api-privatecilium-example-fnt793", "LoadBalancerName": "api-privatecilium-example-fnt793",
"Listeners": [ "Listeners": [
{ {
"InstancePort": 443, "InstancePort": "443",
"InstanceProtocol": "TCP", "InstanceProtocol": "TCP",
"LoadBalancerPort": 443, "LoadBalancerPort": "443",
"Protocol": "TCP" "Protocol": "TCP"
} }
], ],
@ -1232,10 +1232,10 @@
], ],
"HealthCheck": { "HealthCheck": {
"Target": "SSL:443", "Target": "SSL:443",
"HealthyThreshold": 2, "HealthyThreshold": "2",
"UnhealthyThreshold": 2, "UnhealthyThreshold": "2",
"Interval": 10, "Interval": "10",
"Timeout": 5 "Timeout": "5"
}, },
"ConnectionSettings": { "ConnectionSettings": {
"IdleTimeout": 300 "IdleTimeout": 300
@ -1263,9 +1263,9 @@
"LoadBalancerName": "bastion-privatecilium-exa-l2ms01", "LoadBalancerName": "bastion-privatecilium-exa-l2ms01",
"Listeners": [ "Listeners": [
{ {
"InstancePort": 22, "InstancePort": "22",
"InstanceProtocol": "TCP", "InstanceProtocol": "TCP",
"LoadBalancerPort": 22, "LoadBalancerPort": "22",
"Protocol": "TCP" "Protocol": "TCP"
} }
], ],
@ -1281,10 +1281,10 @@
], ],
"HealthCheck": { "HealthCheck": {
"Target": "TCP:22", "Target": "TCP:22",
"HealthyThreshold": 2, "HealthyThreshold": "2",
"UnhealthyThreshold": 2, "UnhealthyThreshold": "2",
"Interval": 10, "Interval": "10",
"Timeout": 5 "Timeout": "5"
}, },
"ConnectionSettings": { "ConnectionSettings": {
"IdleTimeout": 300 "IdleTimeout": 300

View File

@ -15,8 +15,8 @@
] ]
} }
}, },
"MaxSize": 1, "MaxSize": "1",
"MinSize": 1, "MinSize": "1",
"VPCZoneIdentifier": [ "VPCZoneIdentifier": [
{ {
"Ref": "AWSEC2Subnetutilityustest1aprivateciliumexamplecom" "Ref": "AWSEC2Subnetutilityustest1aprivateciliumexamplecom"
@ -86,8 +86,8 @@
] ]
} }
}, },
"MaxSize": 1, "MaxSize": "1",
"MinSize": 1, "MinSize": "1",
"VPCZoneIdentifier": [ "VPCZoneIdentifier": [
{ {
"Ref": "AWSEC2Subnetustest1aprivateciliumexamplecom" "Ref": "AWSEC2Subnetustest1aprivateciliumexamplecom"
@ -157,8 +157,8 @@
] ]
} }
}, },
"MaxSize": 2, "MaxSize": "2",
"MinSize": 2, "MinSize": "2",
"VPCZoneIdentifier": [ "VPCZoneIdentifier": [
{ {
"Ref": "AWSEC2Subnetustest1aprivateciliumexamplecom" "Ref": "AWSEC2Subnetustest1aprivateciliumexamplecom"
@ -1214,9 +1214,9 @@
"LoadBalancerName": "api-privatecilium-example-fnt793", "LoadBalancerName": "api-privatecilium-example-fnt793",
"Listeners": [ "Listeners": [
{ {
"InstancePort": 443, "InstancePort": "443",
"InstanceProtocol": "TCP", "InstanceProtocol": "TCP",
"LoadBalancerPort": 443, "LoadBalancerPort": "443",
"Protocol": "TCP" "Protocol": "TCP"
} }
], ],
@ -1232,10 +1232,10 @@
], ],
"HealthCheck": { "HealthCheck": {
"Target": "SSL:443", "Target": "SSL:443",
"HealthyThreshold": 2, "HealthyThreshold": "2",
"UnhealthyThreshold": 2, "UnhealthyThreshold": "2",
"Interval": 10, "Interval": "10",
"Timeout": 5 "Timeout": "5"
}, },
"ConnectionSettings": { "ConnectionSettings": {
"IdleTimeout": 300 "IdleTimeout": 300
@ -1263,9 +1263,9 @@
"LoadBalancerName": "bastion-privatecilium-exa-l2ms01", "LoadBalancerName": "bastion-privatecilium-exa-l2ms01",
"Listeners": [ "Listeners": [
{ {
"InstancePort": 22, "InstancePort": "22",
"InstanceProtocol": "TCP", "InstanceProtocol": "TCP",
"LoadBalancerPort": 22, "LoadBalancerPort": "22",
"Protocol": "TCP" "Protocol": "TCP"
} }
], ],
@ -1281,10 +1281,10 @@
], ],
"HealthCheck": { "HealthCheck": {
"Target": "TCP:22", "Target": "TCP:22",
"HealthyThreshold": 2, "HealthyThreshold": "2",
"UnhealthyThreshold": 2, "UnhealthyThreshold": "2",
"Interval": 10, "Interval": "10",
"Timeout": 5 "Timeout": "5"
}, },
"ConnectionSettings": { "ConnectionSettings": {
"IdleTimeout": 300 "IdleTimeout": 300

View File

@ -15,8 +15,8 @@
] ]
} }
}, },
"MaxSize": 1, "MaxSize": "1",
"MinSize": 1, "MinSize": "1",
"VPCZoneIdentifier": [ "VPCZoneIdentifier": [
{ {
"Ref": "AWSEC2Subnetutilityustest1aprivateciliumadvancedexamplecom" "Ref": "AWSEC2Subnetutilityustest1aprivateciliumadvancedexamplecom"
@ -86,8 +86,8 @@
] ]
} }
}, },
"MaxSize": 1, "MaxSize": "1",
"MinSize": 1, "MinSize": "1",
"VPCZoneIdentifier": [ "VPCZoneIdentifier": [
{ {
"Ref": "AWSEC2Subnetustest1aprivateciliumadvancedexamplecom" "Ref": "AWSEC2Subnetustest1aprivateciliumadvancedexamplecom"
@ -157,8 +157,8 @@
] ]
} }
}, },
"MaxSize": 2, "MaxSize": "2",
"MinSize": 2, "MinSize": "2",
"VPCZoneIdentifier": [ "VPCZoneIdentifier": [
{ {
"Ref": "AWSEC2Subnetustest1aprivateciliumadvancedexamplecom" "Ref": "AWSEC2Subnetustest1aprivateciliumadvancedexamplecom"
@ -1245,9 +1245,9 @@
"LoadBalancerName": "api-privateciliumadvanced-0cffmm", "LoadBalancerName": "api-privateciliumadvanced-0cffmm",
"Listeners": [ "Listeners": [
{ {
"InstancePort": 443, "InstancePort": "443",
"InstanceProtocol": "TCP", "InstanceProtocol": "TCP",
"LoadBalancerPort": 443, "LoadBalancerPort": "443",
"Protocol": "TCP" "Protocol": "TCP"
} }
], ],
@ -1263,10 +1263,10 @@
], ],
"HealthCheck": { "HealthCheck": {
"Target": "SSL:443", "Target": "SSL:443",
"HealthyThreshold": 2, "HealthyThreshold": "2",
"UnhealthyThreshold": 2, "UnhealthyThreshold": "2",
"Interval": 10, "Interval": "10",
"Timeout": 5 "Timeout": "5"
}, },
"ConnectionSettings": { "ConnectionSettings": {
"IdleTimeout": 300 "IdleTimeout": 300
@ -1294,9 +1294,9 @@
"LoadBalancerName": "bastion-privateciliumadva-0jni40", "LoadBalancerName": "bastion-privateciliumadva-0jni40",
"Listeners": [ "Listeners": [
{ {
"InstancePort": 22, "InstancePort": "22",
"InstanceProtocol": "TCP", "InstanceProtocol": "TCP",
"LoadBalancerPort": 22, "LoadBalancerPort": "22",
"Protocol": "TCP" "Protocol": "TCP"
} }
], ],
@ -1312,10 +1312,10 @@
], ],
"HealthCheck": { "HealthCheck": {
"Target": "TCP:22", "Target": "TCP:22",
"HealthyThreshold": 2, "HealthyThreshold": "2",
"UnhealthyThreshold": 2, "UnhealthyThreshold": "2",
"Interval": 10, "Interval": "10",
"Timeout": 5 "Timeout": "5"
}, },
"ConnectionSettings": { "ConnectionSettings": {
"IdleTimeout": 300 "IdleTimeout": 300

View File

@ -862,8 +862,8 @@ type cloudformationAutoscalingGroup struct {
Name *string `json:"AutoScalingGroupName,omitempty"` Name *string `json:"AutoScalingGroupName,omitempty"`
LaunchConfigurationName *cloudformation.Literal `json:"LaunchConfigurationName,omitempty"` LaunchConfigurationName *cloudformation.Literal `json:"LaunchConfigurationName,omitempty"`
LaunchTemplate *cloudformationAutoscalingLaunchTemplateSpecification `json:"LaunchTemplate,omitempty"` LaunchTemplate *cloudformationAutoscalingLaunchTemplateSpecification `json:"LaunchTemplate,omitempty"`
MaxSize *int64 `json:"MaxSize,omitempty"` MaxSize *string `json:"MaxSize,omitempty"`
MinSize *int64 `json:"MinSize,omitempty"` MinSize *string `json:"MinSize,omitempty"`
VPCZoneIdentifier []*cloudformation.Literal `json:"VPCZoneIdentifier,omitempty"` VPCZoneIdentifier []*cloudformation.Literal `json:"VPCZoneIdentifier,omitempty"`
Tags []*cloudformationASGTag `json:"Tags,omitempty"` Tags []*cloudformationASGTag `json:"Tags,omitempty"`
MetricsCollection []*cloudformationASGMetricsCollection `json:"MetricsCollection,omitempty"` MetricsCollection []*cloudformationASGMetricsCollection `json:"MetricsCollection,omitempty"`
@ -876,8 +876,8 @@ type cloudformationAutoscalingGroup struct {
func (_ *AutoscalingGroup) RenderCloudformation(t *cloudformation.CloudformationTarget, a, e, changes *AutoscalingGroup) error { func (_ *AutoscalingGroup) RenderCloudformation(t *cloudformation.CloudformationTarget, a, e, changes *AutoscalingGroup) error {
cf := &cloudformationAutoscalingGroup{ cf := &cloudformationAutoscalingGroup{
Name: e.Name, Name: e.Name,
MinSize: e.MinSize, MinSize: fi.ToString(e.MinSize),
MaxSize: e.MaxSize, MaxSize: fi.ToString(e.MaxSize),
MetricsCollection: []*cloudformationASGMetricsCollection{ MetricsCollection: []*cloudformationASGMetricsCollection{
{ {
Granularity: e.Granularity, Granularity: e.Granularity,

View File

@ -349,8 +349,8 @@ func TestAutoscalingGroupCloudformationRender(t *testing.T) {
"Type": "AWS::AutoScaling::AutoScalingGroup", "Type": "AWS::AutoScaling::AutoScalingGroup",
"Properties": { "Properties": {
"AutoScalingGroupName": "test1", "AutoScalingGroupName": "test1",
"MaxSize": 10, "MaxSize": "10",
"MinSize": 5, "MinSize": "5",
"VPCZoneIdentifier": [ "VPCZoneIdentifier": [
{ {
"Ref": "AWSEC2Subnettestsg" "Ref": "AWSEC2Subnettestsg"

View File

@ -805,18 +805,18 @@ type cloudformationLoadBalancer struct {
} }
type cloudformationLoadBalancerListener struct { type cloudformationLoadBalancerListener struct {
InstancePort int `json:"InstancePort"` InstancePort string `json:"InstancePort"`
InstanceProtocol string `json:"InstanceProtocol"` InstanceProtocol string `json:"InstanceProtocol"`
LoadBalancerPort int64 `json:"LoadBalancerPort"` LoadBalancerPort string `json:"LoadBalancerPort"`
LoadBalancerProtocol string `json:"Protocol"` LoadBalancerProtocol string `json:"Protocol"`
} }
type cloudformationLoadBalancerHealthCheck struct { type cloudformationLoadBalancerHealthCheck struct {
Target *string `json:"Target"` Target *string `json:"Target"`
HealthyThreshold *int64 `json:"HealthyThreshold"` HealthyThreshold *string `json:"HealthyThreshold"`
UnhealthyThreshold *int64 `json:"UnhealthyThreshold"` UnhealthyThreshold *string `json:"UnhealthyThreshold"`
Interval *int64 `json:"Interval"` Interval *string `json:"Interval"`
Timeout *int64 `json:"Timeout"` Timeout *string `json:"Timeout"`
} }
type cloudformationConnectionDrainingPolicy struct { type cloudformationConnectionDrainingPolicy struct {
@ -853,15 +853,11 @@ func (_ *LoadBalancer) RenderCloudformation(t *cloudformation.CloudformationTarg
} }
for loadBalancerPort, listener := range e.Listeners { for loadBalancerPort, listener := range e.Listeners {
loadBalancerPortInt, err := strconv.ParseInt(loadBalancerPort, 10, 64)
if err != nil {
return fmt.Errorf("error parsing load balancer listener port: %q", loadBalancerPort)
}
tf.Listener = append(tf.Listener, &cloudformationLoadBalancerListener{ tf.Listener = append(tf.Listener, &cloudformationLoadBalancerListener{
InstanceProtocol: "TCP", InstanceProtocol: "TCP",
InstancePort: listener.InstancePort, InstancePort: strconv.Itoa(listener.InstancePort),
LoadBalancerPort: loadBalancerPortInt, LoadBalancerPort: loadBalancerPort,
LoadBalancerProtocol: "TCP", LoadBalancerProtocol: "TCP",
}) })
} }
@ -869,10 +865,10 @@ func (_ *LoadBalancer) RenderCloudformation(t *cloudformation.CloudformationTarg
if e.HealthCheck != nil { if e.HealthCheck != nil {
tf.HealthCheck = &cloudformationLoadBalancerHealthCheck{ tf.HealthCheck = &cloudformationLoadBalancerHealthCheck{
Target: e.HealthCheck.Target, Target: e.HealthCheck.Target,
HealthyThreshold: e.HealthCheck.HealthyThreshold, HealthyThreshold: fi.ToString(e.HealthCheck.HealthyThreshold),
UnhealthyThreshold: e.HealthCheck.UnhealthyThreshold, UnhealthyThreshold: fi.ToString(e.HealthCheck.UnhealthyThreshold),
Interval: e.HealthCheck.Interval, Interval: fi.ToString(e.HealthCheck.Interval),
Timeout: e.HealthCheck.Timeout, Timeout: fi.ToString(e.HealthCheck.Timeout),
} }
} }

View File

@ -20,6 +20,7 @@ import (
"encoding/json" "encoding/json"
"fmt" "fmt"
"reflect" "reflect"
"strconv"
) )
func StringValue(s *string) string { func StringValue(s *string) string {
@ -202,3 +203,22 @@ func DebugAsJsonStringIndent(v interface{}) string {
} }
return string(data) return string(data)
} }
func ToInt64(s *string) *int64 {
if s == nil {
return nil
}
v, err := strconv.ParseInt(*s, 10, 64)
if err != nil {
return nil
}
return &v
}
func ToString(v *int64) *string {
if v == nil {
return nil
}
s := strconv.FormatInt(*v, 10)
return &s
}