list_assessment_outcomes
async
¶
list_assessment_outcomes(
environment_arn: EnvironmentArn,
project: ProjectName,
framework: FrameworkName,
framework_version: FrameworkVersion,
*,
config_overrides: Optional[AsyncAssuranceClientConfig] = None,
control_id: Optional[ControlID] = None,
resource_identifier: Optional[ResourceIdentifier] = None,
aggregation_level: Optional[AggregationLevel] = None,
start_time: Optional[datetime] = None,
end_time: Optional[datetime] = None,
period: Optional[AssessmentOutcomePeriod] = None,
statistic: Optional[AssessmentOutcomeStat] = None,
max_results: Optional[MaxResults] = None,
next_token: Optional[PaginationToken] = None,
) -> ListAssessmentOutcomesOutput
Returns the compliance score of a framework in a project over a time range. You can narrow the score to one control, one resource, or one control on one resource. You can also get one score per control for a resource.
The operation returns either the current score or a history of scores, depending on whether you specify a time range.
-
Current score. If you don't specify
startTimeorendTime, and you use the defaultLASTstatistic, the operation returns the most recent score as a single data point. Itstimestampis the time of the assessment that produced the score. This option isn't available when you get one score per control. -
History. If you specify
startTime,endTime, or both, or you specify theMAX,MIN, orAVGstatistic, the operation divides the time range into buckets of one hour or one day (set byperiod). It returns one data point for each bucket that has a score, newest first. Buckets with no score are left out, so match each data point to its bucket bytimestamp.
Specify times in UTC. The time range includes startTime and excludes endTime.
Parameters:
-
environment_arn(EnvironmentArn) –The ARN of the environment.
-
project(ProjectName) –The project the request is scoped to.
-
framework(FrameworkName) –The name of the framework.
-
framework_version(FrameworkVersion) –The version of the framework.
-
control_id(Optional[ControlID], default:None) –Narrows the series to one control's score over time. Omit for the whole framework's score over time.
-
resource_identifier(Optional[ResourceIdentifier], default:None) –Use this parameter to narrow the series to one resource. Specify the resource identifier that
ListDiscoveredResourcesreturns, which is its ARN if one exists, or its AWS Config resource type and resource ID (separated by a slash) otherwise. If you omit this parameter, the series reports the score for the whole project. -
aggregation_level(Optional[AggregationLevel], default:None) –The level of the scores in each point. Specify one of the following values:
-
FRAMEWORK– One score for the framework. This is the default. -
CONTROL– One score for each control that has a score in the bucket. The controls can differ from one point to the next. Specify a window withstartTimeandendTime, or use theMAX,MIN, orAVGstatistic.
You can specify this parameter only together with
resourceIdentifier, and not together withcontrolId. -
-
start_time(Optional[datetime], default:None) –The start of the window, inclusive, in UTC. The default is 7 days before
endTime. To get the most recent score instead of a series, omit bothstartTimeandendTime. -
end_time(Optional[datetime], default:None) –The end of the window, exclusive, in UTC. The default is the time of the request.
endTimemust be later thanstartTime. To get the most recent score instead of a series, omit bothstartTimeandendTime. -
period(Optional[AssessmentOutcomePeriod], default:None) –The width of each time bucket. Valid values are
ONE_HOURandONE_DAY. The default isONE_DAY. This parameter has no effect when the response is the most recent score. -
statistic(Optional[AssessmentOutcomeStat], default:None) –How AWS Assurance combines the scores of the assessments in a bucket. Specify one of the following values:
-
LAST– The score of the most recent assessment in the bucket. If that assessment has no score, the bucket is left out. This is the default. -
MAX– The highest score in the bucket. -
MIN– The lowest score in the bucket. -
AVG– The average score in the bucket. Each assessment counts once, so assessments that run more often carry more weight.
At
CONTROLaggregation, the statistic is applied to each control separately. -
-
max_results(Optional[MaxResults], default:None) –The maximum number of points to return on one page. If you omit it, the operation uses its default page size.
-
next_token(Optional[PaginationToken], default:None) –The token for the next page of results, from a previous response.
Raises:
-
AccessDeniedException–You do not have sufficient access to perform this action. This error occurs when the request is unauthenticated, or is authenticated but lacks permission to invoke the operation.
-
InternalServerException–An internal server error occurred.
-
ResourceNotFoundException–The requested resource was not found.
-
ThrottlingException–The request was throttled.
-
ValidationException–The request failed validation.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
Daily score history for one control on one S3 bucket Lists how a PCI DSS control has scored a payments bucket day by day, so the team can see whether a remediation took effect.
>>> await client.list_assessment_outcomes(environment_arn='arn:aws:assurance:us-east-1:111122223333:environment/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111', project='payments-prod', framework='AWS:PCI-DSS', framework_version='4', control_id='8.2.1', resource_identifier='arn:aws:s3:::payments-prod-transaction-logs', start_time='2026-03-12T00:00:00Z', end_time='2026-03-15T00:00:00Z', period='ONE_DAY', statistic='LAST')
The current score for a project, with no window named
Reads the score the most recent assessment produced, for a dashboard tile that shows where the project stands now.
>>> await client.list_assessment_outcomes(environment_arn='arn:aws:assurance:us-east-1:111122223333:environment/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111', project='payments-prod', framework='AWS:PCI-DSS', framework_version='4')
Source code in docs_src/capo_assurance/_services/async_assurance.py
3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 | |