// SecurityGroupName returns the security group name for the specific role
185216
func (b *KopsModelContext) SecurityGroupName(role kops.InstanceGroupRole) string {
	switch role {
	case kops.InstanceGroupRoleBastion:
		return "bastion." + b.ClusterName()
	case kops.InstanceGroupRoleNode:
		return "nodes." + b.ClusterName()
	case kops.InstanceGroupRoleMaster:
		return "masters." + b.ClusterName()
	default:
		glog.Fatalf("unknown role: %v", role)
		return ""
	}
}
399851
func (s *CreateClusterSecurityGroupInput) SetClusterSecurityGroupName(v string) *CreateClusterSecurityGroupInput {
	s.ClusterSecurityGroupName = &v
	return s
}
1305979
func (s *CreateMountTargetInput) SetSecurityGroups(v []*string) *CreateMountTargetInput {
	s.SecurityGroups = v
	return s
}
970027
func (s *CreateCacheSecurityGroupInput) SetCacheSecurityGroupName(v string) *CreateCacheSecurityGroupInput {
	s.CacheSecurityGroupName = &v
	return s
}
939247
func (api *SystemAPI) SetSecurityGroups(securityGroups *SecurityGroupsSpec) (task *Task, err error) {
	body, err := json.Marshal(securityGroups)
	if err != nil {
		return
	}
	url := api.getEndpointUrl("set-security-groups")
	res, err := api.client.restClient.Post(
		url,
		"application/json",
		bytes.NewReader(body),
		api.client.options.TokenOptions)
	if err != nil {
		return
	}
	defer res.Body.Close()
	task, err = getTask(getError(res))
	return
}
984902
func (t *Template) GetAWSElastiCacheSecurityGroupWithName(name string) (*resources.AWSElastiCacheSecurityGroup, error) {
	if untyped, ok := t.Resources[name]; ok {
		switch resource := untyped.(type) {
		case *resources.AWSElastiCacheSecurityGroup:
			return resource, nil
		}
	}
	return nil, fmt.Errorf("resource %q of type AWSElastiCacheSecurityGroup not found", name)
}
403769
func (s *ComposeEnvironmentsInput) SetGroupName(v string) *ComposeEnvironmentsInput {
	s.GroupName = &v
	return s
}
653379
func (s *CreateReplicationGroupInput) SetCacheSecurityGroupNames(v []*string) *CreateReplicationGroupInput {
	s.CacheSecurityGroupNames = v
	return s
}
1126278
func (s *DBSecurityGroup) SetDBSecurityGroupName(v string) *DBSecurityGroup {
	s.DBSecurityGroupName = &v
	return s
}
830119
func (s *SourceSecurityGroup) SetGroupName(v string) *SourceSecurityGroup {
	s.GroupName = &v
	return s
}
640061
func (s *DirectoryVpcSettingsDescription) SetSecurityGroupId(v string) *DirectoryVpcSettingsDescription {
	s.SecurityGroupId = &v
	return s
}
1041221
func (s *RevokeClusterSecurityGroupIngressInput) SetClusterSecurityGroupName(v string) *RevokeClusterSecurityGroupIngressInput {
	s.ClusterSecurityGroupName = &v
	return s
}
1364370
func (s *DBSecurityGroupMembership) SetDBSecurityGroupName(v string) *DBSecurityGroupMembership {
	s.DBSecurityGroupName = &v
	return s
}
1044485
func (e *environ) controllerSecurityGroups(ctx context.ProviderCallContext, controllerUUID string) ([]ec2.SecurityGroup, error) {
	filter := ec2.NewFilter()
	e.addControllerFilter(filter, controllerUUID)
	resp, err := e.ec2.SecurityGroups(nil, filter)
	if err != nil {
		return nil, errors.Annotate(maybeConvertCredentialError(err, ctx), "listing security groups")
	}
	groups := make([]ec2.SecurityGroup, len(resp.Groups))
	for i, info := range resp.Groups {
		groups[i] = ec2.SecurityGroup{Id: info.Id, Name: info.Name}
	}
	return groups, nil
}
1329432
func (s *CacheSecurityGroup) SetCacheSecurityGroupName(v string) *CacheSecurityGroup {
	s.CacheSecurityGroupName = &v
	return s
}
349296
func (c *Cloud) findSecurityGroup(securityGroupID string) (*ec2.SecurityGroup, error) {
	describeSecurityGroupsRequest := &ec2.DescribeSecurityGroupsInput{
		GroupIds: []*string{&securityGroupID},
	}
	// We don't apply our tag filters because we are retrieving by ID

	groups, err := c.ec2.DescribeSecurityGroups(describeSecurityGroupsRequest)
	if err != nil {
		glog.Warningf("Error retrieving security group: %q", err)
		return nil, err
	}

	if len(groups) == 0 {
		return nil, nil
	}
	if len(groups) != 1 {
		// This should not be possible - ids should be unique
		return nil, fmt.Errorf("multiple security groups found with same id %q", securityGroupID)
	}
	group := groups[0]
	return group, nil
}
530643
func (s *GetTimeSeriesServiceStatisticsInput) SetGroupName(v string) *GetTimeSeriesServiceStatisticsInput {
	s.GroupName = &v
	return s
}