

# GetTrustBundles

Returns the trust bundles for a workload identity provider. Relying parties use a trust bundle to verify the X509-SVIDs and JWT-SVIDs of the workloads of that provider. For more information, see [GetCertificate](API_GetCertificate.md) and [GetWebIdentityToken](API_GetWebIdentityToken.md).

A trust bundle contains the public keys that the provider currently publishes. AWS STS publishes the key of a new signer before the signer starts signing. After a signer stops signing, AWS STS continues to publish its key for at least as long as any certificate or token that it signed is valid. Get the trust bundle again at the interval in its `spiffe_refresh_hint` value, and trust every key that it contains. If the provider has no signers, the trust bundle contains no keys.

You can get the trust bundles for a provider that your account owns. For a provider that an organization owns, you can get its trust bundles from any account in that organization. If you specify a provider that doesn't exist or that is outside that scope, the request fails with `ResourceNotFoundException`.

You can call `GetTrustBundles` with long-term or temporary credentials. You must have permission for the `sts:GetTrustBundles` action. The action doesn't support resource-level permissions.

**Note**  
The `GetTrustBundles` API is not available on the AWS STS global endpoint. Send requests to an AWS STS endpoint in an AWS Region.

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

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

 ** ProviderArn **   
The Amazon Resource Name (ARN) of the workload identity provider. The ARN of a provider that an account owns contains the account ID, and the ARN of a provider that an organization owns contains the organization ID in place of the account ID. For example:  
+  `arn:aws:iam::444455556666:workload-identity-provider/provider-id` 
+  `arn:aws:iam::o-a1b2c3d4e5:workload-identity-provider/provider-id` 
If the value isn't a valid workload identity provider ARN, the request fails with a validation error.  
Type: String  
Length Constraints: Minimum length of 20. Maximum length of 2048.  
Pattern: `[\u0009\u000A\u000D\u0020-\u007E\u0085\u00A0-\uD7FF\uE000-\uFFFD\u10000-\u10FFFF]+`   
Required: Yes

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

The following element is returned by the service.

 **TrustBundles.member.N**   
The trust bundles for the provider, one for each trust domain. Currently, this list contains one trust bundle, for the trust domain of the provider.  
Type: Array of [TrustBundleEntry](API_TrustBundleEntry.md) objects

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

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

 ** ResourceNotFound **   
The specified resource doesn't exist, or you don't have access to it. Verify that the resource identifier is correct and that you have permission to access the resource.    
 ** ResourceId **   
The identifier of the resource that wasn't found, as you specified it in the request.  
 ** ResourceType **   
The type of the resource that wasn't found.
HTTP Status Code: 404

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

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

This example illustrates one usage of GetTrustBundles.

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

```
               aws sts get-trust-bundles \
               --provider-arn arn:aws:iam::444455556666:workload-identity-provider/provider-id
```

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

```
               {
                   "TrustBundles": [
                       {
                           "TrustDomain": "example.org",
                           "Bundle": "{\"spiffe_refresh_hint\":300,\"keys\":[...]}"
                       }
                   ]
               }
```

## See Also
<a name="API_GetTrustBundles_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/sts-2011-06-15/GetTrustBundles) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/sts-2011-06-15/GetTrustBundles) 
+  [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/sts-2011-06-15/GetTrustBundles) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/sts-2011-06-15/GetTrustBundles) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/sts-2011-06-15/GetTrustBundles) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/sts-2011-06-15/GetTrustBundles) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/sts-2011-06-15/GetTrustBundles) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/sts-2011-06-15/GetTrustBundles) 
+  [AWS SDK for Python (Boto3)](https://docs.aws.amazon.com/goto/boto3/sts-2011-06-15/GetTrustBundles) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/sts-2011-06-15/GetTrustBundles) 