Sets a workload identity template's attestation policy. The operation is an upsert, so any previous policy is superseded.
Parameters:
-
workload_identity_template_arn
(arnType)
–
The Amazon Resource Name (ARN) of the template whose policy is set.
-
attestation_policy
(policyDocumentType)
–
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.
Raises:
-
ConcurrentModificationException
–
The request was rejected because multiple requests to change this object were submitted simultaneously. Wait a few minutes and submit your request again.
-
InvalidInputException
–
The request was rejected because an invalid or out-of-range value was supplied for an input parameter.
-
LimitExceededException
–
The request was rejected because it attempted to create resources beyond the current Amazon Web Services account limits. The error message describes the limit exceeded.
-
MalformedPolicyDocumentException
–
The request was rejected because the policy document was malformed. The error message describes the specific error.
-
NoSuchEntityException
–
The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.
-
ServiceFailureException
–
The request processing has failed because of an unknown error, exception or failure.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Source code in docs_src/capo_iam/_services/async_iam.py
| async def put_workload_identity_template_attestation_policy(
self,
workload_identity_template_arn: "capo_iam.types.arn_type.arnType",
attestation_policy: "capo_iam.types.policy_document_type.policyDocumentType",
*,
config_overrides: Optional[AsyncIAMClientConfig] = None,
) -> "capo_iam.types.put_workload_identity_template_attestation_policy_response.PutWorkloadIdentityTemplateAttestationPolicyResponse":
"""<p>Sets a workload identity template's attestation policy. The operation is an upsert, so any previous policy is superseded.</p>
Args:
workload_identity_template_arn: <p>The Amazon Resource Name (ARN) of the template whose policy is set.</p>
attestation_policy: <p>The attestation policy to set on the template.</p> <p>The policy's conditions must fit the template's stored <code>PathPattern</code>. A policy that does not returns <code>InvalidInputException</code>.</p>
Raises:
capo_iam.errors.concurrent_modification_exception.ConcurrentModificationException: <p>The request was rejected because multiple requests to change this object were submitted simultaneously. Wait a few minutes and submit your request again.</p>
capo_iam.errors.invalid_input_exception.InvalidInputException: <p>The request was rejected because an invalid or out-of-range value was supplied for an input parameter.</p>
capo_iam.errors.limit_exceeded_exception.LimitExceededException: <p>The request was rejected because it attempted to create resources beyond the current Amazon Web Services account limits. The error message describes the limit exceeded.</p>
capo_iam.errors.malformed_policy_document_exception.MalformedPolicyDocumentException: <p>The request was rejected because the policy document was malformed. The error message describes the specific error.</p>
capo_iam.errors.no_such_entity_exception.NoSuchEntityException: <p>The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.</p>
capo_iam.errors.service_failure_exception.ServiceFailureException: <p>The request processing has failed because of an unknown error, exception or failure.</p>
capo_iam.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_iam.types.put_workload_identity_template_attestation_policy_request.PutWorkloadIdentityTemplateAttestationPolicyRequest]",
) -> AsyncOperationResponse[
"capo_iam.types.put_workload_identity_template_attestation_policy_response.PutWorkloadIdentityTemplateAttestationPolicyResponse"
]:
import capo_iam._operations.aws_identity_management_v20100508.put_workload_identity_template_attestation_policy
(
output,
http_response,
) = await capo_iam._operations.aws_identity_management_v20100508.put_workload_identity_template_attestation_policy.async_put_workload_identity_template_attestation_policy(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides,
OperationLogging("PutWorkloadIdentityTemplateAttestationPolicy"),
)
input_: capo_iam.types.put_workload_identity_template_attestation_policy_request.PutWorkloadIdentityTemplateAttestationPolicyRequest = {
"workload_identity_template_arn": workload_identity_template_arn,
"attestation_policy": attestation_policy,
}
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|