// GetAllAWSAutoScalingAutoScalingGroupResources retrieves all AWSAutoScalingAutoScalingGroup items from an AWS CloudFormation template
975999
func (t *Template) GetAllAWSAutoScalingAutoScalingGroupResources() map[string]*resources.AWSAutoScalingAutoScalingGroup {
	results := map[string]*resources.AWSAutoScalingAutoScalingGroup{}
	for name, untyped := range t.Resources {
		switch resource := untyped.(type) {
		case *resources.AWSAutoScalingAutoScalingGroup:
			results[name] = resource
		}
	}
	return results
}
360180
func (t *Template) GetAllAWSEC2SecurityGroupResources() map[string]*resources.AWSEC2SecurityGroup {
	results := map[string]*resources.AWSEC2SecurityGroup{}
	for name, untyped := range t.Resources {
		switch resource := untyped.(type) {
		case *resources.AWSEC2SecurityGroup:
			results[name] = resource
		}
	}
	return results
}
776961
func (t *Template) GetAWSElastiCacheParameterGroupWithName(name string) (*resources.AWSElastiCacheParameterGroup, error) {
	if untyped, ok := t.Resources[name]; ok {
		switch resource := untyped.(type) {
		case *resources.AWSElastiCacheParameterGroup:
			return resource, nil
		}
	}
	return nil, fmt.Errorf("resource %q of type AWSElastiCacheParameterGroup not found", name)
}
54139
func (t *Template) GetAllAWSAutoScalingLaunchConfigurationResources() map[string]*resources.AWSAutoScalingLaunchConfiguration {
	results := map[string]*resources.AWSAutoScalingLaunchConfiguration{}
	for name, untyped := range t.Resources {
		switch resource := untyped.(type) {
		case *resources.AWSAutoScalingLaunchConfiguration:
			results[name] = resource
		}
	}
	return results
}
578032
func (t *Template) GetAllAWSWAFSizeConstraintSetResources() map[string]*resources.AWSWAFSizeConstraintSet {
	results := map[string]*resources.AWSWAFSizeConstraintSet{}
	for name, untyped := range t.Resources {
		switch resource := untyped.(type) {
		case *resources.AWSWAFSizeConstraintSet:
			results[name] = resource
		}
	}
	return results
}
1273003
func (t *Template) GetAllAWSElasticLoadBalancingV2ListenerResources() map[string]*resources.AWSElasticLoadBalancingV2Listener {
	results := map[string]*resources.AWSElasticLoadBalancingV2Listener{}
	for name, untyped := range t.Resources {
		switch resource := untyped.(type) {
		case *resources.AWSElasticLoadBalancingV2Listener:
			results[name] = resource
		}
	}
	return results
}
986324
func (t *Template) GetAllAWSDMSReplicationSubnetGroupResources() map[string]*resources.AWSDMSReplicationSubnetGroup {
	results := map[string]*resources.AWSDMSReplicationSubnetGroup{}
	for name, untyped := range t.Resources {
		switch resource := untyped.(type) {
		case *resources.AWSDMSReplicationSubnetGroup:
			results[name] = resource
		}
	}
	return results
}
692997
func (t *Template) GetAllAWSIoTThingResources() map[string]*resources.AWSIoTThing {
	results := map[string]*resources.AWSIoTThing{}
	for name, untyped := range t.Resources {
		switch resource := untyped.(type) {
		case *resources.AWSIoTThing:
			results[name] = resource
		}
	}
	return results
}
827276
func (t *Template) GetAllAWSElasticLoadBalancingV2TargetGroupResources() map[string]*resources.AWSElasticLoadBalancingV2TargetGroup {
	results := map[string]*resources.AWSElasticLoadBalancingV2TargetGroup{}
	for name, untyped := range t.Resources {
		switch resource := untyped.(type) {
		case *resources.AWSElasticLoadBalancingV2TargetGroup:
			results[name] = resource
		}
	}
	return results
}
984647
func (t *Template) GetAllAWSServiceCatalogPortfolioShareResources() map[string]*resources.AWSServiceCatalogPortfolioShare {
	results := map[string]*resources.AWSServiceCatalogPortfolioShare{}
	for name, untyped := range t.Resources {
		switch resource := untyped.(type) {
		case *resources.AWSServiceCatalogPortfolioShare:
			results[name] = resource
		}
	}
	return results
}
1134444
func (s *DeploymentGroupInfo) SetAutoScalingGroups(v []*AutoScalingGroup) *DeploymentGroupInfo {
	s.AutoScalingGroups = v
	return s
}
992574
func (s *SetDesiredCapacityInput) SetAutoScalingGroupName(v string) *SetDesiredCapacityInput {
	s.AutoScalingGroupName = &v
	return s
}
195960
func (t *Template) GetAllAWSServerlessSimpleTableResources() map[string]*resources.AWSServerlessSimpleTable {
	results := map[string]*resources.AWSServerlessSimpleTable{}
	for name, untyped := range t.Resources {
		switch resource := untyped.(type) {
		case *resources.AWSServerlessSimpleTable:
			results[name] = resource
		}
	}
	return results
}
340221
func (t *Template) GetAllAWSElastiCacheReplicationGroupResources() map[string]*resources.AWSElastiCacheReplicationGroup {
	results := map[string]*resources.AWSElastiCacheReplicationGroup{}
	for name, untyped := range t.Resources {
		switch resource := untyped.(type) {
		case *resources.AWSElastiCacheReplicationGroup:
			results[name] = resource
		}
	}
	return results
}
916164
func findAutoscalingGroupLaunchConfiguration(g *autoscaling.Group) (string, error) {
	name := aws.StringValue(g.LaunchConfigurationName)
	if name != "" {
		return name, nil
	}

	// @check the launch template then
	if g.LaunchTemplate != nil {
		name = aws.StringValue(g.LaunchTemplate.LaunchTemplateName)
		version := aws.StringValue(g.LaunchTemplate.Version)
		if name != "" {
			launchTemplate := name + ":" + version
			return launchTemplate, nil
		}
	}

	// @check: ok, lets check the mixed instance policy
	if g.MixedInstancesPolicy != nil {
		if g.MixedInstancesPolicy.LaunchTemplate != nil {
			if g.MixedInstancesPolicy.LaunchTemplate.LaunchTemplateSpecification != nil {
				// honestly!!
				name = aws.StringValue(g.MixedInstancesPolicy.LaunchTemplate.LaunchTemplateSpecification.LaunchTemplateName)
				version := aws.StringValue(g.MixedInstancesPolicy.LaunchTemplate.LaunchTemplateSpecification.Version)
				if name != "" {
					launchTemplate := name + ":" + version
					return launchTemplate, nil
				}
			}
		}
	}

	return "", fmt.Errorf("error finding launch template or configuration for autoscaling group: %s", aws.StringValue(g.AutoScalingGroupName))
}
755913
func (s *FindingFilter) SetAutoScalingGroups(v []*string) *FindingFilter {
	s.AutoScalingGroups = v
	return s
}
197992
func (t *Template) GetAllAWSStepFunctionsStateMachineResources() map[string]*resources.AWSStepFunctionsStateMachine {
	results := map[string]*resources.AWSStepFunctionsStateMachine{}
	for name, untyped := range t.Resources {
		switch resource := untyped.(type) {
		case *resources.AWSStepFunctionsStateMachine:
			results[name] = resource
		}
	}
	return results
}