在哪里可以找到 AWS Systems Manager (SSM) 文档 ARN?
Where to find AWS Systems Manager (SSM) Document ARNs?
我想要 运行 我的 EC2 实例上的 SSM 文档,AWSFIS-Run-CPU-Stress
。
它通过 AWS 故障注入模拟器 (FIS) 执行,这需要指定一个 documentARN,具体格式如下:
arn:aws:ssm:us-east-1::document/AWSFIS-Run-CPU-Stress
。
我也试过 arn:aws:ssm:us-west-2:aws-account-ID:document/AWSFIS-Run-CPU-Stress
,用我的 AWS 账户 ID 替换 'aws-account-ID'。
这是声明您必须提供 SSM 文档 ARN 的 AWS FIS 文档:https://docs.aws.amazon.com/fis/latest/userguide/actions-ssm-agent.html#awsfis-run-cpu-stress
但是,当我尝试 运行 我使用上述 ARN 进行故障注入实验时(我尝试了很多不同的区域),找不到文档。
此外,我尝试在Document上使用aws ssm describe-document
,但是没有返回ARN,所以我不知道我需要使用什么。它甚至看起来不像 SSM 文档是特定于区域的。
这是 aws ssm describe-document
返回的内容:
{
"Document": {
"Hash": "f2b00b4471e7236ddb11654c4e076473f5e493e916f09840abb229d5a07822b1",
"HashType": "Sha256",
"Name": "Test-AWSFIS-Run-CPU-Stress",
"Owner": "703381282345",
"CreatedDate": "2021-05-10T21:08:14.781000+01:00",
"Status": "Active",
"DocumentVersion": "1",
"Description": "Command Document Example JSON Template",
"Parameters": [
{
"Name": "Message",
"Type": "String",
"Description": "Example",
"DefaultValue": "Hello World"
}
],
"PlatformTypes": [
"Windows",
"Linux",
"MacOS"
],
"DocumentType": "Command",
"SchemaVersion": "2.2",
"LatestVersion": "1",
"DefaultVersion": "1",
"DocumentFormat": "JSON",
"Tags": []
}
}
在哪里可以找到文档 ARN?
您可以使用以下命令执行指定文档aws ssm send-command --document-name "AWSFIS-Run-CPU-Stress" --document-version "4" --parameters '{"CPU":["0"],"InstallDependencies":["True"]}' --timeout-seconds 600 --max-concurrency "50" --max-errors "0" --region us-east-1
从这里填写参数即可得到上述命令行linkhttps://console.aws.amazon.com/systems-manager/run-command/send-command?region=us-east-1#
显然 Systems Manager 控制台不显示文件 ARN。同时,您可以按照以下格式构建 ARN:
"arn:<partition>:ssm:<region>:<account_id>:document/<document_name>"
这是 public FIS SSM“运行 命令”文档的有效示例(可从 us-east-1 区域的任何帐户获取),不确定在您的案例中失败的原因.不需要帐户 ID,因为它是 public 文档:
"arn:aws:ssm:us-east-1::document/AWSFIS-Run-CPU-Stress"
这是一个私人文档的示例(即您拥有它),请注意它确实有帐户 ID:
"arn:aws:ssm:us-east-1:012345678912:document/MyFISFaultDocument"
我想要 运行 我的 EC2 实例上的 SSM 文档,AWSFIS-Run-CPU-Stress
。
它通过 AWS 故障注入模拟器 (FIS) 执行,这需要指定一个 documentARN,具体格式如下:
arn:aws:ssm:us-east-1::document/AWSFIS-Run-CPU-Stress
。
我也试过 arn:aws:ssm:us-west-2:aws-account-ID:document/AWSFIS-Run-CPU-Stress
,用我的 AWS 账户 ID 替换 'aws-account-ID'。
这是声明您必须提供 SSM 文档 ARN 的 AWS FIS 文档:https://docs.aws.amazon.com/fis/latest/userguide/actions-ssm-agent.html#awsfis-run-cpu-stress
但是,当我尝试 运行 我使用上述 ARN 进行故障注入实验时(我尝试了很多不同的区域),找不到文档。
此外,我尝试在Document上使用aws ssm describe-document
,但是没有返回ARN,所以我不知道我需要使用什么。它甚至看起来不像 SSM 文档是特定于区域的。
这是 aws ssm describe-document
返回的内容:
{
"Document": {
"Hash": "f2b00b4471e7236ddb11654c4e076473f5e493e916f09840abb229d5a07822b1",
"HashType": "Sha256",
"Name": "Test-AWSFIS-Run-CPU-Stress",
"Owner": "703381282345",
"CreatedDate": "2021-05-10T21:08:14.781000+01:00",
"Status": "Active",
"DocumentVersion": "1",
"Description": "Command Document Example JSON Template",
"Parameters": [
{
"Name": "Message",
"Type": "String",
"Description": "Example",
"DefaultValue": "Hello World"
}
],
"PlatformTypes": [
"Windows",
"Linux",
"MacOS"
],
"DocumentType": "Command",
"SchemaVersion": "2.2",
"LatestVersion": "1",
"DefaultVersion": "1",
"DocumentFormat": "JSON",
"Tags": []
}
}
在哪里可以找到文档 ARN?
您可以使用以下命令执行指定文档aws ssm send-command --document-name "AWSFIS-Run-CPU-Stress" --document-version "4" --parameters '{"CPU":["0"],"InstallDependencies":["True"]}' --timeout-seconds 600 --max-concurrency "50" --max-errors "0" --region us-east-1
从这里填写参数即可得到上述命令行linkhttps://console.aws.amazon.com/systems-manager/run-command/send-command?region=us-east-1#
显然 Systems Manager 控制台不显示文件 ARN。同时,您可以按照以下格式构建 ARN:
"arn:<partition>:ssm:<region>:<account_id>:document/<document_name>"
这是 public FIS SSM“运行 命令”文档的有效示例(可从 us-east-1 区域的任何帐户获取),不确定在您的案例中失败的原因.不需要帐户 ID,因为它是 public 文档:
"arn:aws:ssm:us-east-1::document/AWSFIS-Run-CPU-Stress"
这是一个私人文档的示例(即您拥有它),请注意它确实有帐户 ID:
"arn:aws:ssm:us-east-1:012345678912:document/MyFISFaultDocument"