本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
第 6 步:进行第一次弹性测试(可选)
弹性测试通过使用 AWS Fault Injection Service ()AWS FIS注入受控故障,帮助验证您的服务是否按预期运行和恢复。在此步骤中,您将选择测试模板,为您的服务创建测试,然后开始测试运行。
控制台
-
导航到您的服务并选择 “测试” 选项卡。您将看到根据您的服务架构和弹性政策推荐的弹性测试。
-
选择测试模板(例如,可用区:恢复)。选择 “查看详细信息” 以了解有关推荐测试的更多信息。
-
选择 “编辑测试配置”,提供所有必需的参数,然后保存。这将根据模板创建您的测试——您的配置将被保存并重复使用以备将来运行。您可以随时编辑测试配置。
-
选择 “开始测试” 以开始测试运行。
-
监控运行情况,查看恢复目标是否已实现。
AWS CLI
# List the available test templates aws resiliencehubv2 list-test-templates --region us-east-1 # Create a test for your service from a template aws resiliencehubv2 create-test \ --test-template-arn "arn:aws:resiliencehub:us-east-1:aws:test-template/aws-az-recovery:rtaz001" \ --target-identifier "arn:aws:resiliencehub:us-east-1:123456789012:service/api-service:def456" \ --parameters '{"availabilityZone": ["us-east-1a"]}' # Start a test run aws resiliencehubv2 start-test-run --test-id "test-id" # Check the status and results of the test run aws resiliencehubv2 get-test-run --test-run-id "test-run-id"
有关更多信息,请参阅 弹性测试。