

# GetWorkloadIdentityTemplate

Retrieves a workload identity template, including its tags, addressed by its own ARN rather than by any name.

The attestation policy is deliberately not returned here. It is read through [GetWorkloadIdentityTemplateAttestationPolicy](https://docs.aws.amazon.com/IAM/latest/APIReference/API_GetWorkloadIdentityTemplateAttestationPolicy.html), so a principal that is granted the template read does not thereby learn what the template will attest.

## Request Parameters
<a name="API_GetWorkloadIdentityTemplate_RequestParameters"></a>

 For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

 ** WorkloadIdentityTemplateArn **   
The Amazon Resource Name (ARN) of the template to retrieve.  
Type: String  
Length Constraints: Minimum length of 20. Maximum length of 2048.  
Required: Yes

## Response Elements
<a name="API_GetWorkloadIdentityTemplate_ResponseElements"></a>

The following elements are returned by the service.

 ** Arn **   
The template's own Amazon Resource Name (ARN). For more information about ARNs, see [Amazon Resource Names (ARNs)](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in the * AWS General Reference*.  
For an `ORGANIZATION`-scoped template, the account segment of the ARN is the organization ID, for example `arn:aws:iam::o-abc123def4:workload-identity-template/PaymentsFleet`.  
Type: String  
Length Constraints: Minimum length of 20. Maximum length of 2048.

 ** CreateDate **   
The date and time, in ISO 8601 date-time format, when the template was created.  
Type: Timestamp

 ** Description **   
The description of the template. Omitted when the template carries none.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 1000.  
Pattern: `^[\u0009\u000A\u000D\u0020-\u007E\u00A1-\u00FF]*$` 

 ** Name **   
The name of the template.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 128.  
Pattern: `^[A-Za-z0-9_-]+$` 

 ** PathPattern **   
The pattern that workload identifiers are rendered from.  
Type: String  
Length Constraints: Minimum length of 3. Maximum length of 16384.  
Pattern: `^(?=.*\{)(?:\{[A-Za-z0-9:/._-]+\}|(?!\.{1,2}(?:/|$))[A-Za-z0-9._-]+)(?:/(?:\{[A-Za-z0-9:/._-]+\}|(?!\.{1,2}(?:/|$))[A-Za-z0-9._-]+))*$` 

 ** PathPrefix **   
The namespace the pattern sits under. Omitted when the template carries none.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 64.  
Pattern: `^(?!\.{1,2}(?:/|$))[A-Za-z0-9._-]+(?:/(?!\.{1,2}(?:/|$))[A-Za-z0-9._-]+)*$` 

 ** ResourceScope **   
The scope the template is stored at.  
Type: String  
Valid Values: `ACCOUNT | ORGANIZATION` 

 **Tags.member.N**   
The tags attached to the template. Omitted when the template carries none. For more information about tagging, see [Tagging IAM resources](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_tags.html) in the *IAM User Guide*.  
Type: Array of [Tag](API_Tag.md) objects  
Array Members: Maximum number of 50 items.

 ** TemplateId **   
The template's immutable identifier, which is distinct from its ARN. IAM prefixes it with `AWTA` for an account-scoped template and `AWTO` for an organization-scoped template. A template that is deleted and recreated under the same name keeps the ARN but gets a new identifier.  
Type: String  
Length Constraints: Minimum length of 16. Maximum length of 128.  
Pattern: `[\w]+` 

 ** WorkloadIdentityProviderArn **   
The Amazon Resource Name (ARN) of the provider the template was created under.  
Type: String  
Length Constraints: Minimum length of 20. Maximum length of 2048.

## Errors
<a name="API_GetWorkloadIdentityTemplate_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InvalidInput **   
The request was rejected because an invalid or out-of-range value was supplied for an input parameter.  
HTTP Status Code: 400

 ** NoSuchEntity **   
The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.  
HTTP Status Code: 404

 ** ServiceFailure **   
The request processing has failed because of an unknown error, exception or failure.  
HTTP Status Code: 500

## Examples
<a name="API_GetWorkloadIdentityTemplate_Examples"></a>

### Example
<a name="API_GetWorkloadIdentityTemplate_Example_1"></a>

This example illustrates one usage of GetWorkloadIdentityTemplate.

#### Sample Request
<a name="API_GetWorkloadIdentityTemplate_Example_1_Request"></a>

```
https://iam.amazonaws.com/?Action=GetWorkloadIdentityTemplate
&WorkloadIdentityTemplateArn=arn:aws:iam::111122223333:workload-identity-template/PaymentsFleet
&Version=2010-05-08
&AUTHPARAMS
```

#### Sample Response
<a name="API_GetWorkloadIdentityTemplate_Example_1_Response"></a>

```xml
<GetWorkloadIdentityTemplateResponse xmlns="https://iam.amazonaws.com/doc/2010-05-08/">
  <GetWorkloadIdentityTemplateResult>
    <Name>PaymentsFleet</Name>
    <TemplateId>AWTAI3LGJ4EXAMPLE</TemplateId>
    <Description>Payments fleet workloads attested through EKS</Description>
    <ResourceScope>ACCOUNT</ResourceScope>
    <Arn>arn:aws:iam::111122223333:workload-identity-template/PaymentsFleet</Arn>
    <WorkloadIdentityProviderArn>arn:aws:iam::111122223333:workload-identity-provider/PaymentsProd</WorkloadIdentityProviderArn>
    <PathPrefix>payments</PathPrefix>
    <PathPattern>{aws:WorkloadAttestation/aws/eks/ClusterName}/prod/{aws:WorkloadAttestation/aws/eks/Namespace}</PathPattern>
    <Tags>
      <member>
        <Key>Team</Key>
        <Value>Payments</Value>
      </member>
    </Tags>
    <CreateDate>2012-05-08T23:34:01.495Z</CreateDate>
  </GetWorkloadIdentityTemplateResult>
  <ResponseMetadata>
    <RequestId>20f7279f-99ee-11e1-a4c3-27EXAMPLE804</RequestId>
  </ResponseMetadata>
</GetWorkloadIdentityTemplateResponse>
```

## See Also
<a name="API_GetWorkloadIdentityTemplate_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/iam-2010-05-08/GetWorkloadIdentityTemplate) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/iam-2010-05-08/GetWorkloadIdentityTemplate) 
+  [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/iam-2010-05-08/GetWorkloadIdentityTemplate) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/iam-2010-05-08/GetWorkloadIdentityTemplate) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/iam-2010-05-08/GetWorkloadIdentityTemplate) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/iam-2010-05-08/GetWorkloadIdentityTemplate) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/iam-2010-05-08/GetWorkloadIdentityTemplate) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/iam-2010-05-08/GetWorkloadIdentityTemplate) 
+  [AWS SDK for Python (Boto3)](https://docs.aws.amazon.com/goto/boto3/iam-2010-05-08/GetWorkloadIdentityTemplate) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/iam-2010-05-08/GetWorkloadIdentityTemplate) 