【问题标题】:unable to set name for route53 healthcheck entry无法为 route53 健康检查条目设置名称
【发布时间】:2016-01-06 10:00:08
【问题描述】:

这就是我设置条目的方式

cat << EOF > /tmp/route53-healthcheck.json
{
  "IPAddress": "10.10.10.10",
  "Port": 80,
  "Type": "HTTP",
  "ResourcePath": "/somefile.txt"
}
EOF
aws route53 create-health-check \
    --caller-reference $(date +'%Y%m%dT%H%M%d') \
    --health-check-config file:///tmp/route53-healthcheck.json > /tmp/route53-healthcheck.log

当我看到route53 条目时,它缺少名称(第一个条目是手动输入,第二个来自上面的 sn-p。我指的是红色污迹。)

docs 中列出的所有选项都不相关。

{
  "IPAddress": "string",
  "Port": integer,
  "Type": "HTTP"|"HTTPS"|"HTTP_STR_MATCH"|"HTTPS_STR_MATCH"|"TCP"|"CALCULATED",
  "ResourcePath": "string",
  "FullyQualifiedDomainName": "string",
  "SearchString": "string",
  "RequestInterval": integer,
  "FailureThreshold": integer,
  "MeasureLatency": true|false,
  "Inverted": true|false,
  "HealthThreshold": integer,
  "ChildHealthChecks": ["string", ...]
}

如果有其他方法可以以其他方式设置名称,有什么想法吗?

解决方案

aws route53 change-tags-for-resource --resource-type healthcheck --resource-id 41633bb1-4adc-4357-983f-767191ff3248 --add-tags Key=Name,Value="new-name"

我犯的一些错误:

  • 我的 aws 版本太旧了。在 ubuntu 上,我必须 apt-get remove awscli 然后使用 pip install awscli 从 pip 安装最新版本。然后可以在~/.local/bin/aws中找到可执行文件
  • 当我更改名称时,我不得不强制重新加载网页,而不是仅仅使用 aws 图标刷新它(想想Ctrl+Shift+R)。

【问题讨论】:

    标签: amazon-route53


    【解决方案1】:

    您需要使用 change-tags-for-resource CLI 选项在资源[1] 上设置标签。

    例子:

    aws route53 change-tags-for-resource --resource-type healthcheck --resource-id <healthcheck guid> --add-tags Key=Name;Value=Value
    
    1. http://docs.aws.amazon.com/cli/latest/reference/route53/change-tags-for-resource.html

    【讨论】:

    • 是的,我们在 AWS 资源中看到的“名称”(无论是 EC2 实例还是运行状况检查)只是一个“名称”标签。
    • 使用 --resource-id 而不是 --resource
    • 我们怎样才能使用名称检索健康检查(除了遍历健康检查列表并识别一个)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-10-02
    • 1970-01-01
    • 2018-06-03
    • 1970-01-01
    • 1970-01-01
    • 2021-02-25
    • 1970-01-01
    相关资源
    最近更新 更多