View a markdown version of this page

GetWorkloadIdentityProviderResourcePolicy - AWS Identity and Access Management

GetWorkloadIdentityProviderResourcePolicy

Reads the resource policy on a workload identity provider.

NoSuchEntityException covers both a provider that does not exist and a provider that has no resource policy.

Request Parameters

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

WorkloadIdentityProviderArn

The Amazon Resource Name (ARN) of the provider whose resource policy you want to read.

Type: String

Length Constraints: Minimum length of 20. Maximum length of 2048.

Required: Yes

Response Elements

The following elements are returned by the service.

Arn

The provider's Amazon Resource Name (ARN). Note that this element is named Arn, not WorkloadIdentityProviderArn as on the request.

Type: String

Length Constraints: Minimum length of 20. Maximum length of 2048.

PolicyDocument

The resource policy attached to the provider, returned exactly as stored.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 131072.

Pattern: [\u0009\u000A\u000D\u0020-\u00FF]+

Errors

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

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

Example

The following example is formatted with line breaks for legibility.

Sample Request

https://iam.amazonaws.com/?Action=GetWorkloadIdentityProviderResourcePolicy &WorkloadIdentityProviderArn=arn:aws:iam::111122223333:workload-identity-provider/PaymentsProd &Version=2010-05-08 &AUTHPARAMS

Sample Response

<GetWorkloadIdentityProviderResourcePolicyResponse xmlns="https://iam.amazonaws.com/doc/2010-05-08/"> <GetWorkloadIdentityProviderResourcePolicyResult> <Arn>arn:aws:iam::111122223333:workload-identity-provider/PaymentsProd</Arn> <PolicyDocument> {"Version":"2012-10-17","Statement":[{"Effect":"Allow", "Principal":{"AWS":"arn:aws:iam::444455556666:root"}, "Action":["iam:AssociateWorkloadIdentityTemplate"], "Resource":"arn:aws:iam::111122223333:workload-identity-provider/PaymentsProd"}]} </PolicyDocument> </GetWorkloadIdentityProviderResourcePolicyResult> <ResponseMetadata> <RequestId>3b2e9a1c-99ed-11e1-a4c3-270EXAMPLE04</RequestId> </ResponseMetadata> </GetWorkloadIdentityProviderResourcePolicyResponse>

See Also

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