get_compliance_summary
¶
get_compliance_summary(
*,
config_overrides: Optional[ResourceGroupsTaggingAPIClientConfig] = None,
target_id_filters: Optional[TargetIdFilterList] = None,
region_filters: Optional[RegionFilterList] = None,
resource_type_filters: Optional[ResourceTypeFilterList] = None,
tag_key_filters: Optional[TagKeyFilterList] = None,
group_by: Optional[GroupBy] = None,
max_results: Optional[MaxResultsGetComplianceSummary] = None,
pagination_token: Optional[PaginationToken] = None,
) -> GetComplianceSummaryOutput
Returns a table that shows counts of resources that are noncompliant with their tag policies.
For more information on tag policies, see Tag Policies in the Organizations User Guide.
You can call this operation only from the organization's management account and from the us-east-1 Region.
This operation supports pagination, where the response can be sent in multiple pages. You should check the PaginationToken response parameter to determine if there are additional results available to return. Repeat the query, passing the PaginationToken response parameter value as an input to the next request until you recieve a null value. A null value for PaginationToken indicates that there are no more results waiting to be returned.
Parameters:
-
target_id_filters(Optional[TargetIdFilterList], default:None) –Specifies target identifiers (usually, specific account IDs) to limit the output by. If you use this parameter, the count of returned noncompliant resources includes only resources with the specified target IDs.
-
region_filters(Optional[RegionFilterList], default:None) –Specifies a list of Amazon Web Services Regions to limit the output to. If you use this parameter, the count of returned noncompliant resources includes only resources in the specified Regions.
-
resource_type_filters(Optional[ResourceTypeFilterList], default:None) –Specifies that you want the response to include information for only resources of the specified types. The format of each resource type is
service[:resourceType]. For example, specifying a resource type ofec2returns all Amazon EC2 resources (which includes EC2 instances). Specifying a resource type ofec2:instancereturns only EC2 instances.The string for each service name and resource type is the same as that embedded in a resource's Amazon Resource Name (ARN). Consult the Amazon Web Services General Reference for the following:
-
For a list of service name strings, see Amazon Web Services Service Namespaces.
-
For resource type strings, see Example ARNs.
-
For more information about ARNs, see Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces.
For the list of services whose resources you can tag using the Resource Groups Tagging API, see Services that support the Resource Groups Tagging API. If an Amazon Web Services service isn't listed on that page, you might still be able to tag that service's resources by using that service's native tagging operations instead of using Resource Groups Tagging API operations. All tagged resources, whether the tagging used the Resource Groups Tagging API or not, are returned by the
Get*operation.You can specify multiple resource types by using a comma separated array. The array can include up to 100 items. Note that the length constraint requirement applies to each resource type filter.
-
-
tag_key_filters(Optional[TagKeyFilterList], default:None) –Specifies that you want the response to include information for only resources that have tags with the specified tag keys. If you use this parameter, the count of returned noncompliant resources includes only resources that have the specified tag keys.
-
group_by(Optional[GroupBy], default:None) –Specifies a list of attributes to group the counts of noncompliant resources by. If supplied, the counts are sorted by those attributes.
-
max_results(Optional[MaxResultsGetComplianceSummary], default:None) –Specifies the maximum number of results to be returned in each page. A query can return fewer than this maximum, even if there are more results still to return. You should always check the
PaginationTokenresponse value to see if there are more results. You can specify a minimum of 1 and a maximum value of 100. -
pagination_token(Optional[PaginationToken], default:None) –Specifies a
PaginationTokenresponse value from a previous request to indicate that you want the next page of results. Leave this parameter empty in your initial request.
Raises:
-
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
226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 | |