Retrieves information about a version of the specified role template. Role templates define a reusable configuration—including role name and path patterns, trust policy, inline and managed policies, permissions boundary, tags, and maximum session duration—that you use to create IAM roles with AcquireRole.
If you do not specify a minor version, the service returns the template's default minor version.
Parameters:
-
template_arn
(arnType)
–
The Amazon Resource Name (ARN) of the role template whose version you want to retrieve.
For more information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference.
-
minor_version
(Optional[minorVersionType], default:
None
)
–
The minor version of the role template to retrieve. If you do not specify a minor version, the service returns the template's default minor version.
Raises:
-
InvalidInputException
–
The request was rejected because an invalid or out-of-range value was supplied for an input parameter.
-
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 get_role_template_version(
self,
template_arn: "capo_iam.types.arn_type.arnType",
*,
config_overrides: Optional[AsyncIAMClientConfig] = None,
minor_version: Optional[
"capo_iam.types.minor_version_type.minorVersionType"
] = None,
) -> "capo_iam.types.get_role_template_version_response.GetRoleTemplateVersionResponse":
"""<p>Retrieves information about a version of the specified role template. Role templates define a reusable configuration—including role name and path patterns, trust policy, inline and managed policies, permissions boundary, tags, and maximum session duration—that you use to create IAM roles with <a href="https://docs.aws.amazon.com/IAM/latest/APIReference/API_AcquireRole.html">AcquireRole</a>.</p> <p>If you do not specify a minor version, the service returns the template's default minor version.</p>
Args:
template_arn: <p>The Amazon Resource Name (ARN) of the role template whose version you want to retrieve.</p> <p>For more information about ARNs, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs)</a> in the <i>Amazon Web Services General Reference</i>.</p>
minor_version: <p>The minor version of the role template to retrieve. If you do not specify a minor version, the service returns the template's default minor version.</p>
Raises:
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.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.get_role_template_version_request.GetRoleTemplateVersionRequest]",
) -> AsyncOperationResponse[
"capo_iam.types.get_role_template_version_response.GetRoleTemplateVersionResponse"
]:
import capo_iam._operations.aws_identity_management_v20100508.get_role_template_version
(
output,
http_response,
) = await capo_iam._operations.aws_identity_management_v20100508.get_role_template_version.async_get_role_template_version(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("GetRoleTemplateVersion")
)
input_: capo_iam.types.get_role_template_version_request.GetRoleTemplateVersionRequest = {
"template_arn": template_arn
}
if minor_version is not None:
input_["minor_version"] = minor_version
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|