Generates a report that lists all tagged resources in the accounts across your organization and tells whether each resource is compliant with the effective tag policy. Compliance data is refreshed daily. The report is generated asynchronously.
The generated report is saved to the following location:
s3://amzn-s3-demo-bucket/AwsTagPolicies/o-exampleorgid/YYYY-MM-ddTHH:mm:ssZ/report.csv
For more information about evaluating resource compliance with tag policies, including the required permissions, review Permissions for evaluating organization-wide compliance in the Tagging Amazon Web Services Resources and Tag Editor user guide.
You can call this operation only from the organization's management account and from the us-east-1 Region.
If the account associated with the identity used to call StartReportCreation is different from the account that owns the Amazon S3 bucket, there must be a bucket policy attached to the bucket to provide access. For more information, review Amazon S3 bucket policy for report storage in the Tagging Amazon Web Services Resources and Tag Editor user guide.
Parameters:
-
s3_bucket
(S3Bucket)
–
The name of the Amazon S3 bucket where the report will be stored; for example:
amzn-s3-demo-bucket
For more information on S3 bucket requirements, including an example bucket policy, see the example Amazon S3 bucket policy on this page.
Raises:
-
ConcurrentModificationException
–
The request failed because the target of the operation is currently being modified by a different request. Try again later.
-
ConstraintViolationException
–
The request failed because performing the operation would violate a constraint.
Some of the reasons in the following list might not apply to this specific operation.
-
You must meet the prerequisites for using tag policies. For information, see Prerequisites and permissions in the Tagging Amazon Web Services resources and Tag Editor user guide.
-
You must enable the tag policies service principal (tagpolicies.tag.amazonaws.com) to integrate with Organizations For information, see EnableAWSServiceAccess.
-
You must have a tag policy attached to the organization root, an OU, or an account.
-
InternalServiceException
–
The request processing failed because of an unknown error, exception, or failure. You can retry the request.
-
InvalidParameterException
–
The request failed because of one of the following reasons:
-
A required parameter is missing.
-
A provided string parameter is malformed.
-
An provided parameter value is out of range.
-
The target ID is invalid, unsupported, or doesn't exist.
-
You can't access the Amazon S3 bucket for report storage. For more information, see Amazon S3 bucket policy for report storage in the Tagging Amazon Web Services resources and Tag Editor user guide.
-
The partition specified in an ARN parameter in the request doesn't match the partition where you invoked the operation. The partition is specified by the second field of the ARN.
-
ThrottledException
–
The request failed because it exceeded the allowed frequency of submitted requests.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Source code in docs_src/capo_resource_groups_tagging_api/_services/resource_groups_tagging_api.py
| def start_report_creation(
self,
s3_bucket: "capo_resource_groups_tagging_api.types.s3_bucket.S3Bucket",
*,
config_overrides: Optional[ResourceGroupsTaggingAPIClientConfig] = None,
) -> "capo_resource_groups_tagging_api.types.start_report_creation_output.StartReportCreationOutput":
"""<p>Generates a report that lists all tagged resources in the accounts across your organization and tells whether each resource is compliant with the effective tag policy. Compliance data is refreshed daily. The report is generated asynchronously.</p> <p>The generated report is saved to the following location:</p> <p> <code>s3://amzn-s3-demo-bucket/AwsTagPolicies/o-exampleorgid/YYYY-MM-ddTHH:mm:ssZ/report.csv</code> </p> <p>For more information about evaluating resource compliance with tag policies, including the required permissions, review <a href="https://docs.aws.amazon.com/tag-editor/latest/userguide/tag-policies-orgs.html#tag-policies-permissions-org">Permissions for evaluating organization-wide compliance</a> in the <i>Tagging Amazon Web Services Resources and Tag Editor</i> user guide. </p> <p>You can call this operation only from the organization's management account and from the us-east-1 Region.</p> <p>If the account associated with the identity used to call <code>StartReportCreation</code> is different from the account that owns the Amazon S3 bucket, there must be a bucket policy attached to the bucket to provide access. For more information, review <a href="https://docs.aws.amazon.com/tag-editor/latest/userguide/tag-policies-orgs.html#bucket-policy">Amazon S3 bucket policy for report storage</a> in the <i>Tagging Amazon Web Services Resources and Tag Editor</i> user guide.</p>
Args:
s3_bucket: <p>The name of the Amazon S3 bucket where the report will be stored; for example:</p> <p> <code>amzn-s3-demo-bucket</code> </p> <p>For more information on S3 bucket requirements, including an example bucket policy, see the example Amazon S3 bucket policy on this page.</p>
Raises:
capo_resource_groups_tagging_api.errors.concurrent_modification_exception.ConcurrentModificationException: <p>The request failed because the target of the operation is currently being modified by a different request. Try again later.</p>
capo_resource_groups_tagging_api.errors.constraint_violation_exception.ConstraintViolationException: <p>The request failed because performing the operation would violate a constraint.</p> <p>Some of the reasons in the following list might not apply to this specific operation.</p> <ul> <li> <p>You must meet the prerequisites for using tag policies. For information, see <a href="https://docs.aws.amazon.com/tag-editor/latest/userguide/tag-policies-orgs.html#tag-policies-prereqs">Prerequisites and permissions</a> in the <i>Tagging Amazon Web Services resources and Tag Editor</i> user guide. </p> </li> <li> <p>You must enable the tag policies service principal (<code>tagpolicies.tag.amazonaws.com</code>) to integrate with Organizations For information, see <a href="https://docs.aws.amazon.com/organizations/latest/APIReference/API_EnableAWSServiceAccess.html">EnableAWSServiceAccess</a>.</p> </li> <li> <p>You must have a tag policy attached to the organization root, an OU, or an account.</p> </li> </ul>
capo_resource_groups_tagging_api.errors.internal_service_exception.InternalServiceException: <p>The request processing failed because of an unknown error, exception, or failure. You can retry the request.</p>
capo_resource_groups_tagging_api.errors.invalid_parameter_exception.InvalidParameterException: <p>The request failed because of one of the following reasons:</p> <ul> <li> <p>A required parameter is missing.</p> </li> <li> <p>A provided string parameter is malformed.</p> </li> <li> <p>An provided parameter value is out of range.</p> </li> <li> <p>The target ID is invalid, unsupported, or doesn't exist.</p> </li> <li> <p>You can't access the Amazon S3 bucket for report storage. For more information, see <a href="https://docs.aws.amazon.com/tag-editor/latest/userguide/tag-policies-orgs.html#bucket-policy">Amazon S3 bucket policy for report storage</a> in the <i>Tagging Amazon Web Services resources and Tag Editor</i> user guide. </p> </li> <li> <p>The partition specified in an ARN parameter in the request doesn't match the partition where you invoked the operation. The partition is specified by the second field of the ARN.</p> </li> </ul>
capo_resource_groups_tagging_api.errors.throttled_exception.ThrottledException: <p>The request failed because it exceeded the allowed frequency of submitted requests.</p>
capo_resource_groups_tagging_api.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_resource_groups_tagging_api.types.start_report_creation_input.StartReportCreationInput]",
) -> OperationResponse[
"capo_resource_groups_tagging_api.types.start_report_creation_output.StartReportCreationOutput"
]:
import capo_resource_groups_tagging_api._operations.resource_groups_tagging_api_20170126.start_report_creation
output, http_response = (
capo_resource_groups_tagging_api._operations.resource_groups_tagging_api_20170126.start_report_creation.start_report_creation(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("StartReportCreation")
)
input_: capo_resource_groups_tagging_api.types.start_report_creation_input.StartReportCreationInput = {
"s3_bucket": s3_bucket
}
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|