Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Service: ResilienceHub #7456

Merged
merged 1 commit into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
61 changes: 60 additions & 1 deletion IMPLEMENTATION_COVERAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6216,6 +6216,66 @@
- [ ] update_stream_processor
</details>

## resiliencehub
<details>
<summary>18% implemented</summary>

- [ ] add_draft_app_version_resource_mappings
- [ ] batch_update_recommendation_status
- [X] create_app
- [ ] create_app_version_app_component
- [ ] create_app_version_resource
- [ ] create_recommendation_template
- [X] create_resiliency_policy
- [ ] delete_app
- [ ] delete_app_assessment
- [ ] delete_app_input_source
- [ ] delete_app_version_app_component
- [ ] delete_app_version_resource
- [ ] delete_recommendation_template
- [ ] delete_resiliency_policy
- [X] describe_app
- [ ] describe_app_assessment
- [ ] describe_app_version
- [ ] describe_app_version_app_component
- [ ] describe_app_version_resource
- [ ] describe_app_version_resources_resolution_status
- [ ] describe_app_version_template
- [ ] describe_draft_app_version_resources_import_status
- [X] describe_resiliency_policy
- [ ] import_resources_to_draft_app_version
- [ ] list_alarm_recommendations
- [ ] list_app_assessment_compliance_drifts
- [X] list_app_assessments
- [ ] list_app_component_compliances
- [ ] list_app_component_recommendations
- [ ] list_app_input_sources
- [ ] list_app_version_app_components
- [ ] list_app_version_resource_mappings
- [ ] list_app_version_resources
- [ ] list_app_versions
- [X] list_apps
- [ ] list_recommendation_templates
- [X] list_resiliency_policies
- [ ] list_sop_recommendations
- [ ] list_suggested_resiliency_policies
- [X] list_tags_for_resource
- [ ] list_test_recommendations
- [ ] list_unsupported_app_version_resources
- [ ] publish_app_version
- [ ] put_draft_app_version_template
- [ ] remove_draft_app_version_resource_mappings
- [ ] resolve_app_version_resources
- [ ] start_app_assessment
- [X] tag_resource
- [X] untag_resource
- [ ] update_app
- [ ] update_app_version
- [ ] update_app_version_app_component
- [ ] update_app_version_resource
- [ ] update_resiliency_policy
</details>

## resource-groups
<details>
<summary>61% implemented</summary>
Expand Down Expand Up @@ -8159,7 +8219,6 @@
- rbin
- redshift-serverless
- repostspace
- resiliencehub
- resource-explorer-2
- rolesanywhere
- route53-recovery-cluster
Expand Down
83 changes: 83 additions & 0 deletions docs/docs/services/resiliencehub.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
.. _implementedservice_resiliencehub:

.. |start-h3| raw:: html

<h3>

.. |end-h3| raw:: html

</h3>

=============
resiliencehub
=============

|start-h3| Implemented features for this service |end-h3|

- [ ] add_draft_app_version_resource_mappings
- [ ] batch_update_recommendation_status
- [X] create_app

The ClientToken-parameter is not yet implemented


- [ ] create_app_version_app_component
- [ ] create_app_version_resource
- [ ] create_recommendation_template
- [X] create_resiliency_policy

The ClientToken-parameter is not yet implemented


- [ ] delete_app
- [ ] delete_app_assessment
- [ ] delete_app_input_source
- [ ] delete_app_version_app_component
- [ ] delete_app_version_resource
- [ ] delete_recommendation_template
- [ ] delete_resiliency_policy
- [X] describe_app
- [ ] describe_app_assessment
- [ ] describe_app_version
- [ ] describe_app_version_app_component
- [ ] describe_app_version_resource
- [ ] describe_app_version_resources_resolution_status
- [ ] describe_app_version_template
- [ ] describe_draft_app_version_resources_import_status
- [X] describe_resiliency_policy
- [ ] import_resources_to_draft_app_version
- [ ] list_alarm_recommendations
- [ ] list_app_assessment_compliance_drifts
- [X] list_app_assessments
- [ ] list_app_component_compliances
- [ ] list_app_component_recommendations
- [ ] list_app_input_sources
- [ ] list_app_version_app_components
- [ ] list_app_version_resource_mappings
- [ ] list_app_version_resources
- [ ] list_app_versions
- [X] list_apps

The FromAssessmentTime/ToAssessmentTime-parameters are not yet implemented


- [ ] list_recommendation_templates
- [X] list_resiliency_policies
- [ ] list_sop_recommendations
- [ ] list_suggested_resiliency_policies
- [X] list_tags_for_resource
- [ ] list_test_recommendations
- [ ] list_unsupported_app_version_resources
- [ ] publish_app_version
- [ ] put_draft_app_version_template
- [ ] remove_draft_app_version_resource_mappings
- [ ] resolve_app_version_resources
- [ ] start_app_assessment
- [X] tag_resource
- [X] untag_resource
- [ ] update_app
- [ ] update_app_version
- [ ] update_app_version_app_component
- [ ] update_app_version_resource
- [ ] update_resiliency_policy

6 changes: 2 additions & 4 deletions moto/backend_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,21 +131,19 @@
("redshift", re.compile("https?://redshift\\.(.+)\\.amazonaws\\.com")),
("redshiftdata", re.compile("https?://redshift-data\\.(.+)\\.amazonaws\\.com")),
("rekognition", re.compile("https?://rekognition\\.(.+)\\.amazonaws\\.com")),
("resiliencehub", re.compile("https?://resiliencehub\\.(.+)\\.amazonaws\\.com")),
(
"resourcegroups",
re.compile("https?://resource-groups(-fips)?\\.(.+)\\.amazonaws.com"),
),
("resourcegroupstaggingapi", re.compile("https?://tagging\\.(.+)\\.amazonaws.com")),
("robomaker", re.compile("https?://robomaker\\.(.+)\\.amazonaws\\.com")),
("route53", re.compile("https?://route53(\\..+)?\\.amazonaws.com")),
("route53domains", re.compile("https?://route53domains\\.(.+)\\.amazonaws\\.com")),
(
"route53resolver",
re.compile("https?://route53resolver\\.(.+)\\.amazonaws\\.com"),
),
(
"route53domains",
re.compile("https?://route53domains\\.(.+)\\.amazonaws\\.com"),
),
("s3", re.compile("https?://s3(?!-control)(.*)\\.amazonaws.com")),
(
"s3",
Expand Down
4 changes: 4 additions & 0 deletions moto/backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
from moto.redshift.models import RedshiftBackend
from moto.redshiftdata.models import RedshiftDataAPIServiceBackend
from moto.rekognition.models import RekognitionBackend
from moto.resiliencehub.models import ResilienceHubBackend
from moto.resourcegroups.models import ResourceGroupsBackend
from moto.resourcegroupstaggingapi.models import ResourceGroupsTaggingAPIBackend
from moto.robomaker.models import RoboMakerBackend
Expand Down Expand Up @@ -262,6 +263,7 @@ def get_service_from_url(url: str) -> Optional[str]:
"Literal['redshift']",
"Literal['redshift-data']",
"Literal['rekognition']",
"Literal['resiliencehub']",
"Literal['resource-groups']",
"Literal['resourcegroupstaggingapi']",
"Literal['robomaker']",
Expand Down Expand Up @@ -498,6 +500,8 @@ def get_backend(name: "Literal['redshift-data']") -> "BackendDict[RedshiftDataAP
@overload
def get_backend(name: "Literal['rekognition']") -> "BackendDict[RekognitionBackend]": ...
@overload
def get_backend(name: "Literal['resiliencehub']") -> "BackendDict[ResilienceHubBackend]": ...
@overload
def get_backend(name: "Literal['resource-groups']") -> "BackendDict[ResourceGroupsBackend]": ...
@overload
def get_backend(name: "Literal['resourcegroupstaggingapi']") -> "BackendDict[ResourceGroupsTaggingAPIBackend]": ...
Expand Down
1 change: 1 addition & 0 deletions moto/resiliencehub/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .models import resiliencehub_backends # noqa: F401
22 changes: 22 additions & 0 deletions moto/resiliencehub/exceptions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
"""Exceptions raised by the resiliencehub service."""
from moto.core.exceptions import JsonRESTError


class ResourceNotFound(JsonRESTError):
def __init__(self, msg: str):
super().__init__("ResourceNotFoundException", msg)


class AppNotFound(ResourceNotFound):
def __init__(self, arn: str):
super().__init__(f"App not found for appArn {arn}")


class ResiliencyPolicyNotFound(ResourceNotFound):
def __init__(self, arn: str):
super().__init__(f"ResiliencyPolicy {arn} not found")


class ValidationException(JsonRESTError):
def __init__(self, msg: str):
super().__init__("ValidationException", msg)