2024/12/18 - AWS Resilience Hub - 4 updated api methods
Changes AWS Resilience Hub now automatically detects already configured CloudWatch alarms and FIS experiments as part of the assessment process and returns the discovered resources in the corresponding list API responses. It also allows you to include or exclude test recommendations for an AppComponent.
{'requestEntries': {'appComponentId': 'string'}}Response
{'successfulEntries': {'appComponentId': 'string'}}
Enables you to include or exclude one or more operational recommendations.
See also: AWS API Documentation
Request Syntax
client.batch_update_recommendation_status( appArn='string', requestEntries=[ { 'appComponentId': 'string', 'entryId': 'string', 'excludeReason': 'AlreadyImplemented'|'NotRelevant'|'ComplexityOfImplementation', 'excluded': True|False, 'item': { 'resourceId': 'string', 'targetAccountId': 'string', 'targetRegion': 'string' }, 'referenceId': 'string' }, ] )
string
[REQUIRED]
Amazon Resource Name (ARN) of the Resilience Hub application. The format for this ARN is: arn: partition:resiliencehub: region: account:app/ app-id. For more information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference guide.
list
[REQUIRED]
Defines the list of operational recommendations that need to be included or excluded.
(dict) --
Defines the operational recommendation item that is to be included or excluded.
appComponentId (string) --
Indicates the identifier of the AppComponent.
entryId (string) -- [REQUIRED]
An identifier for an entry in this batch that is used to communicate the result.
excludeReason (string) --
Indicates the reason for excluding an operational recommendation.
excluded (boolean) -- [REQUIRED]
Indicates if the operational recommendation needs to be excluded. If set to True, the operational recommendation will be excluded.
item (dict) --
The operational recommendation item.
resourceId (string) --
Resource identifier of the operational recommendation item.
targetAccountId (string) --
Identifier of the target Amazon Web Services account.
targetRegion (string) --
Identifier of the target Amazon Web Services Region.
referenceId (string) -- [REQUIRED]
Reference identifier of the operational recommendation item.
dict
Response Syntax
{ 'appArn': 'string', 'failedEntries': [ { 'entryId': 'string', 'errorMessage': 'string' }, ], 'successfulEntries': [ { 'appComponentId': 'string', 'entryId': 'string', 'excludeReason': 'AlreadyImplemented'|'NotRelevant'|'ComplexityOfImplementation', 'excluded': True|False, 'item': { 'resourceId': 'string', 'targetAccountId': 'string', 'targetRegion': 'string' }, 'referenceId': 'string' }, ] }
Response Structure
(dict) --
appArn (string) --
Amazon Resource Name (ARN) of the Resilience Hub application. The format for this ARN is: arn: partition:resiliencehub: region: account:app/ app-id. For more information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference guide.
failedEntries (list) --
A list of items with error details about each item, which could not be included or excluded.
(dict) --
List of operational recommendations that did not get included or excluded.
entryId (string) --
An identifier of an entry in this batch that is used to communicate the result.
errorMessage (string) --
Indicates the error that occurred while excluding an operational recommendation.
successfulEntries (list) --
A list of items that were included or excluded.
(dict) --
List of operational recommendations that were successfully included or excluded.
appComponentId (string) --
Indicates the identifier of an AppComponent.
entryId (string) --
An identifier for an entry in this batch that is used to communicate the result.
excludeReason (string) --
Indicates the reason for excluding an operational recommendation.
excluded (boolean) --
Indicates if the operational recommendation was successfully excluded.
item (dict) --
The operational recommendation item.
resourceId (string) --
Resource identifier of the operational recommendation item.
targetAccountId (string) --
Identifier of the target Amazon Web Services account.
targetRegion (string) --
Identifier of the target Amazon Web Services Region.
referenceId (string) --
Reference identifier of the operational recommendation.
{'alarmRecommendations': {'items': {'discoveredAlarm': {'alarmArn': 'string', 'source': 'string'}, 'latestDiscoveredExperiment': {'experimentArn': 'string', 'experimentTemplateId': 'string'}}}}
Lists the alarm recommendations for an Resilience Hub application.
See also: AWS API Documentation
Request Syntax
client.list_alarm_recommendations( assessmentArn='string', maxResults=123, nextToken='string' )
string
[REQUIRED]
Amazon Resource Name (ARN) of the assessment. The format for this ARN is: arn: partition:resiliencehub: region: account:app-assessment/ app-id. For more information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference guide.
integer
Maximum number of results to include in the response. If more results exist than the specified MaxResults value, a token is included in the response so that the remaining results can be retrieved.
string
Null, or the token from a previous call to get the next set of results.
dict
Response Syntax
{ 'alarmRecommendations': [ { 'appComponentName': 'string', 'appComponentNames': [ 'string', ], 'description': 'string', 'items': [ { 'alreadyImplemented': True|False, 'discoveredAlarm': { 'alarmArn': 'string', 'source': 'string' }, 'excludeReason': 'AlreadyImplemented'|'NotRelevant'|'ComplexityOfImplementation', 'excluded': True|False, 'latestDiscoveredExperiment': { 'experimentArn': 'string', 'experimentTemplateId': 'string' }, 'resourceId': 'string', 'targetAccountId': 'string', 'targetRegion': 'string' }, ], 'name': 'string', 'prerequisite': 'string', 'recommendationId': 'string', 'recommendationStatus': 'Implemented'|'Inactive'|'NotImplemented'|'Excluded', 'referenceId': 'string', 'type': 'Metric'|'Composite'|'Canary'|'Logs'|'Event' }, ], 'nextToken': 'string' }
Response Structure
(dict) --
alarmRecommendations (list) --
The alarm recommendations for an Resilience Hub application, returned as an object. This object includes Application Component names, descriptions, information about whether a recommendation has already been implemented or not, prerequisites, and more.
(dict) --
Defines a recommendation for a CloudWatch alarm.
appComponentName (string) --
Application Component name for the CloudWatch alarm recommendation. This name is saved as the first item in the appComponentNames list.
appComponentNames (list) --
List of Application Component names for the CloudWatch alarm recommendation.
(string) --
description (string) --
Description of the alarm recommendation.
items (list) --
List of CloudWatch alarm recommendations.
(dict) --
Defines a recommendation.
alreadyImplemented (boolean) --
Specifies if the recommendation has already been implemented.
discoveredAlarm (dict) --
Indicates the previously implemented Amazon CloudWatch alarm discovered by Resilience Hub.
alarmArn (string) --
Amazon Resource Name (ARN) of the Amazon CloudWatch alarm.
source (string) --
Indicates the source of the Amazon CloudWatch alarm. That is, it indicates if the alarm was created using Resilience Hub recommendation ( AwsResilienceHub), or if you had created the alarm in Amazon CloudWatch ( Customer).
excludeReason (string) --
Indicates the reason for excluding an operational recommendation.
excluded (boolean) --
Indicates if an operational recommendation item is excluded.
latestDiscoveredExperiment (dict) --
Indicates the experiment created in FIS that was discovered by Resilience Hub, which matches the recommendation.
experimentArn (string) --
Amazon Resource Name (ARN) of the FIS experiment.
experimentTemplateId (string) --
Identifier of the FIS experiment template.
resourceId (string) --
Identifier of the resource.
targetAccountId (string) --
Identifier of the target account.
targetRegion (string) --
The target region.
name (string) --
Name of the alarm recommendation.
prerequisite (string) --
The prerequisite for the alarm recommendation.
recommendationId (string) --
Identifier of the alarm recommendation.
recommendationStatus (string) --
Status of the recommended Amazon CloudWatch alarm.
referenceId (string) --
Reference identifier of the alarm recommendation.
type (string) --
Type of alarm recommendation.
nextToken (string) --
Token for the next set of results, or null if there are no more results.
{'sopRecommendations': {'items': {'discoveredAlarm': {'alarmArn': 'string', 'source': 'string'}, 'latestDiscoveredExperiment': {'experimentArn': 'string', 'experimentTemplateId': 'string'}}}}
Lists the standard operating procedure (SOP) recommendations for the Resilience Hub applications.
See also: AWS API Documentation
Request Syntax
client.list_sop_recommendations( assessmentArn='string', maxResults=123, nextToken='string' )
string
[REQUIRED]
Amazon Resource Name (ARN) of the assessment. The format for this ARN is: arn: partition:resiliencehub: region: account:app-assessment/ app-id. For more information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference guide.
integer
Maximum number of results to include in the response. If more results exist than the specified MaxResults value, a token is included in the response so that the remaining results can be retrieved.
string
Null, or the token from a previous call to get the next set of results.
dict
Response Syntax
{ 'nextToken': 'string', 'sopRecommendations': [ { 'appComponentName': 'string', 'description': 'string', 'items': [ { 'alreadyImplemented': True|False, 'discoveredAlarm': { 'alarmArn': 'string', 'source': 'string' }, 'excludeReason': 'AlreadyImplemented'|'NotRelevant'|'ComplexityOfImplementation', 'excluded': True|False, 'latestDiscoveredExperiment': { 'experimentArn': 'string', 'experimentTemplateId': 'string' }, 'resourceId': 'string', 'targetAccountId': 'string', 'targetRegion': 'string' }, ], 'name': 'string', 'prerequisite': 'string', 'recommendationId': 'string', 'recommendationStatus': 'Implemented'|'Inactive'|'NotImplemented'|'Excluded', 'referenceId': 'string', 'serviceType': 'SSM' }, ] }
Response Structure
(dict) --
nextToken (string) --
Token for the next set of results, or null if there are no more results.
sopRecommendations (list) --
The standard operating procedure (SOP) recommendations for the Resilience Hub applications.
(dict) --
Defines a standard operating procedure (SOP) recommendation.
appComponentName (string) --
Name of the Application Component.
description (string) --
Description of the SOP recommendation.
items (list) --
The recommendation items.
(dict) --
Defines a recommendation.
alreadyImplemented (boolean) --
Specifies if the recommendation has already been implemented.
discoveredAlarm (dict) --
Indicates the previously implemented Amazon CloudWatch alarm discovered by Resilience Hub.
alarmArn (string) --
Amazon Resource Name (ARN) of the Amazon CloudWatch alarm.
source (string) --
Indicates the source of the Amazon CloudWatch alarm. That is, it indicates if the alarm was created using Resilience Hub recommendation ( AwsResilienceHub), or if you had created the alarm in Amazon CloudWatch ( Customer).
excludeReason (string) --
Indicates the reason for excluding an operational recommendation.
excluded (boolean) --
Indicates if an operational recommendation item is excluded.
latestDiscoveredExperiment (dict) --
Indicates the experiment created in FIS that was discovered by Resilience Hub, which matches the recommendation.
experimentArn (string) --
Amazon Resource Name (ARN) of the FIS experiment.
experimentTemplateId (string) --
Identifier of the FIS experiment template.
resourceId (string) --
Identifier of the resource.
targetAccountId (string) --
Identifier of the target account.
targetRegion (string) --
The target region.
name (string) --
Name of the SOP recommendation.
prerequisite (string) --
Prerequisite for the SOP recommendation.
recommendationId (string) --
Identifier for the SOP recommendation.
recommendationStatus (string) --
Status of the recommended standard operating procedure.
referenceId (string) --
Reference identifier for the SOP recommendation.
serviceType (string) --
The service type.
{'testRecommendations': {'appComponentId': 'string', 'items': {'discoveredAlarm': {'alarmArn': 'string', 'source': 'string'}, 'latestDiscoveredExperiment': {'experimentArn': 'string', 'experimentTemplateId': 'string'}}}}
Lists the test recommendations for the Resilience Hub application.
See also: AWS API Documentation
Request Syntax
client.list_test_recommendations( assessmentArn='string', maxResults=123, nextToken='string' )
string
[REQUIRED]
Amazon Resource Name (ARN) of the assessment. The format for this ARN is: arn: partition:resiliencehub: region: account:app-assessment/ app-id. For more information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference guide.
integer
Maximum number of results to include in the response. If more results exist than the specified MaxResults value, a token is included in the response so that the remaining results can be retrieved.
string
Null, or the token from a previous call to get the next set of results.
dict
Response Syntax
{ 'nextToken': 'string', 'testRecommendations': [ { 'appComponentId': 'string', 'appComponentName': 'string', 'dependsOnAlarms': [ 'string', ], 'description': 'string', 'intent': 'string', 'items': [ { 'alreadyImplemented': True|False, 'discoveredAlarm': { 'alarmArn': 'string', 'source': 'string' }, 'excludeReason': 'AlreadyImplemented'|'NotRelevant'|'ComplexityOfImplementation', 'excluded': True|False, 'latestDiscoveredExperiment': { 'experimentArn': 'string', 'experimentTemplateId': 'string' }, 'resourceId': 'string', 'targetAccountId': 'string', 'targetRegion': 'string' }, ], 'name': 'string', 'prerequisite': 'string', 'recommendationId': 'string', 'recommendationStatus': 'Implemented'|'Inactive'|'NotImplemented'|'Excluded', 'referenceId': 'string', 'risk': 'Small'|'Medium'|'High', 'type': 'Software'|'Hardware'|'AZ'|'Region' }, ] }
Response Structure
(dict) --
nextToken (string) --
Token for the next set of results, or null if there are no more results.
testRecommendations (list) --
The test recommendations for the Resilience Hub application.
(dict) --
Defines a test recommendation.
appComponentId (string) --
Indicates the identifier of the AppComponent.
appComponentName (string) --
Name of the Application Component.
dependsOnAlarms (list) --
A list of recommended alarms that are used in the test and must be exported before or with the test.
(string) --
description (string) --
Description for the test recommendation.
intent (string) --
Intent of the test recommendation.
items (list) --
The test recommendation items.
(dict) --
Defines a recommendation.
alreadyImplemented (boolean) --
Specifies if the recommendation has already been implemented.
discoveredAlarm (dict) --
Indicates the previously implemented Amazon CloudWatch alarm discovered by Resilience Hub.
alarmArn (string) --
Amazon Resource Name (ARN) of the Amazon CloudWatch alarm.
source (string) --
Indicates the source of the Amazon CloudWatch alarm. That is, it indicates if the alarm was created using Resilience Hub recommendation ( AwsResilienceHub), or if you had created the alarm in Amazon CloudWatch ( Customer).
excludeReason (string) --
Indicates the reason for excluding an operational recommendation.
excluded (boolean) --
Indicates if an operational recommendation item is excluded.
latestDiscoveredExperiment (dict) --
Indicates the experiment created in FIS that was discovered by Resilience Hub, which matches the recommendation.
experimentArn (string) --
Amazon Resource Name (ARN) of the FIS experiment.
experimentTemplateId (string) --
Identifier of the FIS experiment template.
resourceId (string) --
Identifier of the resource.
targetAccountId (string) --
Identifier of the target account.
targetRegion (string) --
The target region.
name (string) --
Name of the test recommendation.
prerequisite (string) --
Prerequisite of the test recommendation.
recommendationId (string) --
Identifier for the test recommendation.
recommendationStatus (string) --
Status of the recommended test.
referenceId (string) --
Reference identifier for the test recommendation.
risk (string) --
Level of risk for this test recommendation.
type (string) --
Type of test recommendation.