// ec2TagFiltersToMap converts lists of tag filters into a []map[string]interface{}.
177542
func ec2TagFiltersToMap(list []*codedeploy.EC2TagFilter) []map[string]interface{} {
	result := make([]map[string]interface{}, 0, len(list))
	for _, tf := range list {
		l := make(map[string]interface{})
		if tf.Key != nil && *tf.Key != "" {
			l["key"] = *tf.Key
		}
		if tf.Value != nil && *tf.Value != "" {
			l["value"] = *tf.Value
		}
		if tf.Type != nil && *tf.Type != "" {
			l["type"] = *tf.Type
		}
		result = append(result, l)
	}
	return result
}
133300
func ec2TagSetToMap(tagSet *codedeploy.EC2TagSet) []map[string]interface{} {
	var result []map[string]interface{}
	if tagSet == nil {
		result = make([]map[string]interface{}, 0)
	} else {
		result = make([]map[string]interface{}, 0, len(tagSet.Ec2TagSetList))
		for _, filterSet := range tagSet.Ec2TagSetList {
			filters := ec2TagFiltersToMap(filterSet)
			filtersAsIntfSlice := make([]interface{}, 0, len(filters))
			for _, item := range filters {
				filtersAsIntfSlice = append(filtersAsIntfSlice, item)
			}
			tagFilters := map[string]interface{}{
				"ec2_tag_filter": schema.NewSet(resourceAwsCodeDeployTagFilterHash, filtersAsIntfSlice),
			}
			result = append(result, tagFilters)
		}
	}
	return result
}
902094
func tagsToMapEFS(ts []*efs.Tag) map[string]string {
	result := make(map[string]string)
	for _, t := range ts {
		if !tagIgnoredEFS(t) {
			result[*t.Key] = *t.Value
		}
	}

	return result
}
138403
func (e *EC2Metadata) ToStringMap() map[string]string {
	metadata := map[string]string{
		"aws_availability_zone": e.AvailabilityZone,
		"aws_instance_type":     e.InstanceType,
		"aws_instance_id":       e.InstanceID,
		"aws_image_id":          e.ImageID,
		"aws_account_id":        e.AccountID,
		"aws_region":            e.Region,
		"aws_architecture":      e.Architecture,
		"AWSUniqueId":           e.AWSUniqueID,
	}

	return metadata
}
1033790
func tagsFromMapR53(m map[string]interface{}) []*route53.Tag {
	result := make([]*route53.Tag, 0, len(m))
	for k, v := range m {
		t := &route53.Tag{
			Key:   aws.String(k),
			Value: aws.String(v.(string)),
		}
		if !tagIgnoredRoute53(t) {
			result = append(result, t)
		}
	}

	return result
}
912507
func tagsFromMapDax(m map[string]interface{}) []*dax.Tag {
	result := make([]*dax.Tag, 0, len(m))
	for k, v := range m {
		t := &dax.Tag{
			Key:   aws.String(k),
			Value: aws.String(v.(string)),
		}
		if !tagIgnoredDax(t) {
			result = append(result, t)
		}
	}

	return result
}
1173705
func TagsQueryFilter(query ...string) Filter {
	tagQl := strings.Join(query, " AND ")
	return Param("tags", tagQl)
}
743139
func tagsFromMapCloudWatch(m map[string]interface{}) []*cloudwatch.Tag {
	var result []*cloudwatch.Tag
	for k, v := range m {
		t := &cloudwatch.Tag{
			Key:   aws.String(k),
			Value: aws.String(v.(string)),
		}
		if !tagIgnoredCloudWatch(t) {
			result = append(result, t)
		}
	}

	return result
}
1220034
func GetTagMappings(cfg interface{}) (Mappings, error) {
	return getTagMappingsRecursive("", reflect.Indirect(reflect.ValueOf(cfg)))
}
801551
func (s *CreateDeploymentGroupInput) SetEc2TagFilters(v []*EC2TagFilter) *CreateDeploymentGroupInput {
	s.Ec2TagFilters = v
	return s
}
1228391
func tagsFromMapDynamoDb(m map[string]interface{}) []*dynamodb.Tag {
	result := make([]*dynamodb.Tag, 0, len(m))
	for k, v := range m {
		t := &dynamodb.Tag{
			Key:   aws.String(k),
			Value: aws.String(v.(string)),
		}
		result = append(result, t)
	}
	return result
}
119050
func (s *UpdateDeploymentGroupInput) SetEc2TagFilters(v []*EC2TagFilter) *UpdateDeploymentGroupInput {
	s.Ec2TagFilters = v
	return s
}
1224405
func buildEc2Filters(input map[*string]*string) []*ec2.Filter {
	var filters []*ec2.Filter
	for k, v := range input {
		filters = append(filters, &ec2.Filter{
			Name:   k,
			Values: []*string{v},
		})
	}
	return filters
}
639468
func tagsFromMapECR(m map[string]interface{}) []*ecr.Tag {
	result := make([]*ecr.Tag, 0, len(m))
	for k, v := range m {
		t := &ecr.Tag{
			Key:   aws.String(k),
			Value: aws.String(v.(string)),
		}
		if !tagIgnoredECR(t) {
			result = append(result, t)
		}
	}

	return result
}
1106483
func tagsFromMapBeanstalk(m map[string]interface{}) []*elasticbeanstalk.Tag {
	var result []*elasticbeanstalk.Tag
	for k, v := range m {
		t := &elasticbeanstalk.Tag{
			Key:   aws.String(k),
			Value: aws.String(v.(string)),
		}
		if !tagIgnoredBeanstalk(t) {
			result = append(result, t)
		}
	}

	return result
}
975189
func buildEC2TagSet(configured []interface{}) *codedeploy.EC2TagSet {
	filterSets := make([][]*codedeploy.EC2TagFilter, 0)
	for _, raw := range configured {
		m := raw.(map[string]interface{})
		rawFilters := m["ec2_tag_filter"].(*schema.Set)
		filters := buildEC2TagFilters(rawFilters.List())
		filterSets = append(filterSets, filters)
	}
	return &codedeploy.EC2TagSet{Ec2TagSetList: filterSets}
}
379400
func tagsToMapS3(ts []*s3.Tag) map[string]string {
	result := make(map[string]string)
	for _, t := range ts {
		if !tagIgnoredS3(t) {
			result[*t.Key] = *t.Value
		}
	}

	return result
}