Retrieves the policy that was generated using StartPolicyGeneration.
Parameters:
-
job_id
(JobId)
–
The JobId that is returned by the StartPolicyGeneration operation. The JobId can be used with GetGeneratedPolicy to retrieve the generated policies or used with CancelPolicyGeneration to cancel the policy generation request.
-
include_resource_placeholders
(Optional[bool], default:
None
)
–
The level of detail that you want to generate. You can specify whether to generate policies with placeholders for resource ARNs for actions that support resource level granularity in policies.
For example, in the resource section of a policy, you can receive a placeholder such as "Resource":"arn:aws:s3:::${BucketName}" instead of "*".
-
include_service_level_template
(Optional[bool], default:
None
)
–
The level of detail that you want to generate. You can specify whether to generate service-level policies.
IAM Access Analyzer uses iam:servicelastaccessed to identify services that have been used recently to create this service-level template.
Raises:
Source code in docs_src/capo_accessanalyzer/_services/async_access_analyzer.py
| async def get_generated_policy(
self,
job_id: "capo_accessanalyzer.types.job_id.JobId",
*,
config_overrides: Optional[AsyncAccessAnalyzerClientConfig] = None,
include_resource_placeholders: Optional[bool] = None,
include_service_level_template: Optional[bool] = None,
) -> "capo_accessanalyzer.types.get_generated_policy_response.GetGeneratedPolicyResponse":
"""<p>Retrieves the policy that was generated using <code>StartPolicyGeneration</code>. </p>
Args:
job_id: <p>The <code>JobId</code> that is returned by the <code>StartPolicyGeneration</code> operation. The <code>JobId</code> can be used with <code>GetGeneratedPolicy</code> to retrieve the generated policies or used with <code>CancelPolicyGeneration</code> to cancel the policy generation request.</p>
include_resource_placeholders: <p>The level of detail that you want to generate. You can specify whether to generate policies with placeholders for resource ARNs for actions that support resource level granularity in policies.</p> <p>For example, in the resource section of a policy, you can receive a placeholder such as <code>"Resource":"arn:aws:s3:::${BucketName}"</code> instead of <code>"*"</code>.</p>
include_service_level_template: <p>The level of detail that you want to generate. You can specify whether to generate service-level policies. </p> <p>IAM Access Analyzer uses <code>iam:servicelastaccessed</code> to identify services that have been used recently to create this service-level template.</p>
Raises:
capo_accessanalyzer.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
capo_accessanalyzer.errors.internal_server_exception.InternalServerException: <p>Internal server error.</p>
capo_accessanalyzer.errors.throttling_exception.ThrottlingException: <p>Throttling limit exceeded error.</p>
capo_accessanalyzer.errors.validation_exception.ValidationException: <p>Validation exception error.</p>
capo_accessanalyzer.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_accessanalyzer.types.get_generated_policy_request.GetGeneratedPolicyRequest]",
) -> AsyncOperationResponse[
"capo_accessanalyzer.types.get_generated_policy_response.GetGeneratedPolicyResponse"
]:
import capo_accessanalyzer._operations.access_analyzer.get_generated_policy
(
output,
http_response,
) = await capo_accessanalyzer._operations.access_analyzer.get_generated_policy.async_get_generated_policy(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("GetGeneratedPolicy")
)
input_: capo_accessanalyzer.types.get_generated_policy_request.GetGeneratedPolicyRequest = {
"job_id": job_id
}
if include_resource_placeholders is not None:
input_["include_resource_placeholders"] = include_resource_placeholders
if include_service_level_template is not None:
input_["include_service_level_template"] = include_service_level_template
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|