我的一个脚本中有以下命令:
`aws elb describe-instance-health --region eu-west-1 --load-balancer-name FooBar --instances i-05swhkqp'`
执行此操作或从Rails控制台执行时,我收到以下错误并且脚本中断:
A client error (InvalidClientTokenId) occurred when calling the DescribeInstanceHealth operation: The security token included in the request is invalid.
=> ""
但是当我从bash执行它时,我得到了我期望的响应:
{
"InstanceStates": [
{
"InstanceId": "i-05swhkqp",
"ReasonCode": "N/A",
"State": "InService",
"Description": "N/A"
}
]
}
有没有办法将它包含在我的Ruby脚本或Rails控制台上,以便命令可以执行?