// GetAWSGuardDutyIPSetWithName retrieves all AWSGuardDutyIPSet items from an AWS CloudFormation template
// whose logical ID matches the provided name. Returns an error if not found.
501342
func (t *Template) GetAWSGuardDutyIPSetWithName(name string) (*resources.AWSGuardDutyIPSet, error) {
	if untyped, ok := t.Resources[name]; ok {
		switch resource := untyped.(type) {
		case *resources.AWSGuardDutyIPSet:
			return resource, nil
		}
	}
	return nil, fmt.Errorf("resource %q of type AWSGuardDutyIPSet not found", name)
}
48046
func (t *Template) GetAWSAppSyncApiKeyWithName(name string) (*resources.AWSAppSyncApiKey, error) {
	if untyped, ok := t.Resources[name]; ok {
		switch resource := untyped.(type) {
		case *resources.AWSAppSyncApiKey:
			return resource, nil
		}
	}
	return nil, fmt.Errorf("resource %q of type AWSAppSyncApiKey not found", name)
}
1288303
func (t *Template) GetAWSSESConfigurationSetWithName(name string) (*resources.AWSSESConfigurationSet, error) {
	if untyped, ok := t.Resources[name]; ok {
		switch resource := untyped.(type) {
		case *resources.AWSSESConfigurationSet:
			return resource, nil
		}
	}
	return nil, fmt.Errorf("resource %q of type AWSSESConfigurationSet not found", name)
}
1209738
func (t *Template) GetAWSLambdaPermissionWithName(name string) (*resources.AWSLambdaPermission, error) {
	if untyped, ok := t.Resources[name]; ok {
		switch resource := untyped.(type) {
		case *resources.AWSLambdaPermission:
			return resource, nil
		}
	}
	return nil, fmt.Errorf("resource %q of type AWSLambdaPermission not found", name)
}
1096572
func (t *Template) GetAWSEMRSecurityConfigurationWithName(name string) (*resources.AWSEMRSecurityConfiguration, error) {
	if untyped, ok := t.Resources[name]; ok {
		switch resource := untyped.(type) {
		case *resources.AWSEMRSecurityConfiguration:
			return resource, nil
		}
	}
	return nil, fmt.Errorf("resource %q of type AWSEMRSecurityConfiguration not found", name)
}
1098797
func (t *Template) GetAWSEC2NetworkAclEntryWithName(name string) (*resources.AWSEC2NetworkAclEntry, error) {
	if untyped, ok := t.Resources[name]; ok {
		switch resource := untyped.(type) {
		case *resources.AWSEC2NetworkAclEntry:
			return resource, nil
		}
	}
	return nil, fmt.Errorf("resource %q of type AWSEC2NetworkAclEntry not found", name)
}
39463
func (t *Template) GetAWSOpsWorksElasticLoadBalancerAttachmentWithName(name string) (*resources.AWSOpsWorksElasticLoadBalancerAttachment, error) {
	if untyped, ok := t.Resources[name]; ok {
		switch resource := untyped.(type) {
		case *resources.AWSOpsWorksElasticLoadBalancerAttachment:
			return resource, nil
		}
	}
	return nil, fmt.Errorf("resource %q of type AWSOpsWorksElasticLoadBalancerAttachment not found", name)
}
822200
func (t *Template) GetAWSWAFSqlInjectionMatchSetWithName(name string) (*resources.AWSWAFSqlInjectionMatchSet, error) {
	if untyped, ok := t.Resources[name]; ok {
		switch resource := untyped.(type) {
		case *resources.AWSWAFSqlInjectionMatchSet:
			return resource, nil
		}
	}
	return nil, fmt.Errorf("resource %q of type AWSWAFSqlInjectionMatchSet not found", name)
}
148722
func (t *Template) GetAWSOpsWorksStackWithName(name string) (*resources.AWSOpsWorksStack, error) {
	if untyped, ok := t.Resources[name]; ok {
		switch resource := untyped.(type) {
		case *resources.AWSOpsWorksStack:
			return resource, nil
		}
	}
	return nil, fmt.Errorf("resource %q of type AWSOpsWorksStack not found", name)
}
974395
func (t *Template) GetAWSRoute53RecordSetGroupWithName(name string) (*resources.AWSRoute53RecordSetGroup, error) {
	if untyped, ok := t.Resources[name]; ok {
		switch resource := untyped.(type) {
		case *resources.AWSRoute53RecordSetGroup:
			return resource, nil
		}
	}
	return nil, fmt.Errorf("resource %q of type AWSRoute53RecordSetGroup not found", name)
}
110714
func (t *Template) GetAWSWAFWebACLWithName(name string) (*resources.AWSWAFWebACL, error) {
	if untyped, ok := t.Resources[name]; ok {
		switch resource := untyped.(type) {
		case *resources.AWSWAFWebACL:
			return resource, nil
		}
	}
	return nil, fmt.Errorf("resource %q of type AWSWAFWebACL not found", name)
}
625985
func (t *Template) GetAWSCloudTrailTrailWithName(name string) (*resources.AWSCloudTrailTrail, error) {
	if untyped, ok := t.Resources[name]; ok {
		switch resource := untyped.(type) {
		case *resources.AWSCloudTrailTrail:
			return resource, nil
		}
	}
	return nil, fmt.Errorf("resource %q of type AWSCloudTrailTrail not found", name)
}
591498
func (t *Template) GetAllAWSGuardDutyThreatIntelSetResources() map[string]*resources.AWSGuardDutyThreatIntelSet {
	results := map[string]*resources.AWSGuardDutyThreatIntelSet{}
	for name, untyped := range t.Resources {
		switch resource := untyped.(type) {
		case *resources.AWSGuardDutyThreatIntelSet:
			results[name] = resource
		}
	}
	return results
}
1212898
func (t *Template) GetAWSEC2SubnetWithName(name string) (*resources.AWSEC2Subnet, error) {
	if untyped, ok := t.Resources[name]; ok {
		switch resource := untyped.(type) {
		case *resources.AWSEC2Subnet:
			return resource, nil
		}
	}
	return nil, fmt.Errorf("resource %q of type AWSEC2Subnet not found", name)
}
675521
func (t *Template) GetAWSAppSyncResolverWithName(name string) (*resources.AWSAppSyncResolver, error) {
	if untyped, ok := t.Resources[name]; ok {
		switch resource := untyped.(type) {
		case *resources.AWSAppSyncResolver:
			return resource, nil
		}
	}
	return nil, fmt.Errorf("resource %q of type AWSAppSyncResolver not found", name)
}
421885
func (as *availabilitySet) GetIPByNodeName(name string) (string, string, error) {
	nic, err := as.GetPrimaryInterface(name)
	if err != nil {
		return "", "", err
	}

	ipConfig, err := getPrimaryIPConfig(nic)
	if err != nil {
		klog.Errorf("as.GetIPByNodeName(%s) failed: getPrimaryIPConfig(%v), err=%v", name, nic, err)
		return "", "", err
	}

	privateIP := *ipConfig.PrivateIPAddress
	publicIP := ""
	if ipConfig.PublicIPAddress != nil && ipConfig.PublicIPAddress.ID != nil {
		pipID := *ipConfig.PublicIPAddress.ID
		pipName, err := getLastSegment(pipID)
		if err != nil {
			return "", "", fmt.Errorf("failed to publicIP name for node %q with pipID %q", name, pipID)
		}
		pip, existsPip, err := as.getPublicIPAddress(as.ResourceGroup, pipName)
		if err != nil {
			return "", "", err
		}
		if existsPip {
			publicIP = *pip.IPAddress
		}
	}

	return privateIP, publicIP, nil
}
1283732
func (t *Template) GetAWSCognitoIdentityPoolWithName(name string) (*resources.AWSCognitoIdentityPool, error) {
	if untyped, ok := t.Resources[name]; ok {
		switch resource := untyped.(type) {
		case *resources.AWSCognitoIdentityPool:
			return resource, nil
		}
	}
	return nil, fmt.Errorf("resource %q of type AWSCognitoIdentityPool not found", name)
}