View a markdown version of this page

PutWorkloadIdentityTemplateAttestationPolicy - AWS Identity and Access Management

PutWorkloadIdentityTemplateAttestationPolicy

Sets a workload identity template's attestation policy. The operation is an upsert, so any previous policy is superseded.

Request Parameters

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

AttestationPolicy

The attestation policy to set on the template.

The policy's conditions must fit the template's stored PathPattern. A policy that does not returns InvalidInputException.

Type: String

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

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

Required: Yes

WorkloadIdentityTemplateArn

The Amazon Resource Name (ARN) of the template whose policy is set.

Type: String

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

Required: Yes

Errors

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

ConcurrentModification

The request was rejected because multiple requests to change this object were submitted simultaneously. Wait a few minutes and submit your request again.

HTTP Status Code: 409

InvalidInput

The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

HTTP Status Code: 400

LimitExceeded

The request was rejected because it attempted to create resources beyond the current AWS account limits. The error message describes the limit exceeded.

HTTP Status Code: 409

MalformedPolicyDocument

The request was rejected because the policy document was malformed. The error message describes the specific error.

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=PutWorkloadIdentityTemplateAttestationPolicy &WorkloadIdentityTemplateArn=arn:aws:iam::111122223333:workload-identity-template/PaymentsFleet &AttestationPolicy={"Version":"2012-10-17","Statement":[{"Effect":"Allow", "Principal":{"Service":["eks.amazonaws.com"]}, "Action":["sts:IssueWorkloadIdentityContext"], "Condition":{"StringEquals":{"aws:WorkloadAttestation/aws/eks/ClusterName":"payments-prod"}}}]} &Version=2010-05-08 &AUTHPARAMS

Sample Response

<PutWorkloadIdentityTemplateAttestationPolicyResponse xmlns="https://iam.amazonaws.com/doc/2010-05-08/"> <ResponseMetadata> <RequestId>913e3f37-99ed-11e1-a4c3-270EXAMPLE04</RequestId> </ResponseMetadata> </PutWorkloadIdentityTemplateAttestationPolicyResponse>

See Also

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