在 Amazon CLI 上指定账户
Specifying account on Amazon CLI
所以我正在尝试使用 CloudWatch 在 DynamoDB table 上提取一些指标。这个 doc 有一些关于如何这样做的信息。特别是我在看下面的例子
aws cloudwatch get-metric-statistics
--namespace AWS/DynamoDB --metric-name ThrottledRequests
--dimensions Name=TableName,Value=TestTable Name=Operation,Value=PutItem
--start-time 2014-05-02T00:00:00Z --end-time 2014-05-07T00:00:00Z --period 300 --statistics=Sum example
我不明白的是这个命令如何知道使用哪个帐户(甚至哪个登录名)来访问 DynamoDB table。
对于我的特定设置,我有两个 AWS 账户(暂存账户和生产账户)。每个这些的访问密钥都在我的 C:/.aws/credentials 文件中。如何指定我要指向的环境(每个环境都有一个 table MyTable
),但我想为每个环境提取指标。
这一切都非常清楚地记录在这里:http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html
What I don't understand is how this command knows which account (and
even which login) to use to access the DynamoDB table.
它可能使用凭证文件中的默认配置文件,或者如果 运行 在 EC2 实例上使用 IAM 实例角色。
How can I specify which environment I want to point at (each env has a
table MyTable) that I am looking at but I want to pull metrics for
each.
如果您配置了两个或多个帐户,则您可以通过 --profile
参数指定要使用的帐户。
所以我正在尝试使用 CloudWatch 在 DynamoDB table 上提取一些指标。这个 doc 有一些关于如何这样做的信息。特别是我在看下面的例子
aws cloudwatch get-metric-statistics
--namespace AWS/DynamoDB --metric-name ThrottledRequests
--dimensions Name=TableName,Value=TestTable Name=Operation,Value=PutItem
--start-time 2014-05-02T00:00:00Z --end-time 2014-05-07T00:00:00Z --period 300 --statistics=Sum example
我不明白的是这个命令如何知道使用哪个帐户(甚至哪个登录名)来访问 DynamoDB table。
对于我的特定设置,我有两个 AWS 账户(暂存账户和生产账户)。每个这些的访问密钥都在我的 C:/.aws/credentials 文件中。如何指定我要指向的环境(每个环境都有一个 table MyTable
),但我想为每个环境提取指标。
这一切都非常清楚地记录在这里:http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html
What I don't understand is how this command knows which account (and even which login) to use to access the DynamoDB table.
它可能使用凭证文件中的默认配置文件,或者如果 运行 在 EC2 实例上使用 IAM 实例角色。
How can I specify which environment I want to point at (each env has a table MyTable) that I am looking at but I want to pull metrics for each.
如果您配置了两个或多个帐户,则您可以通过 --profile
参数指定要使用的帐户。