View a markdown version of this page

GetTrustBundles - AWS Security Token Service

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 and GetWebIdentityToken.

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

For information about the parameters that are common to all actions, see Common Parameters.

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

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 objects

Errors

For information about the errors that are common to all actions, see Common Error Types.

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

Example

This example illustrates one usage of GetTrustBundles.

Sample Request

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

Sample Response

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

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: