2回答
- 新しい順
- 投票が多い順
- コメントが多い順
0
Hi, it may just be a quote issue: see example of https://awscli.amazonaws.com/v2/documentation/api/latest/reference/sns/get-topic-attributes.html
aws sns get-topic-attributes \
--topic-arn "arn:aws:sns:us-west-2:123456789012:my-topic"
Output:
{
"Attributes": {
"SubscriptionsConfirmed": "1",
"DisplayName": "my-topic",
"SubscriptionsDeleted": "0",
"EffectiveDeliveryPolicy": "{\"http\":{\"defaultHealthyRetryPolicy\":{\"minDelayTarget\":20,\"maxDelayTarget\":20,\"numRetries\":3,\"numMaxDelayRetries\":0,\"numNoDelayRetries\":0,\"numMinDelayRetries\":0,\"backoffFunction\":\"linear\"},\"disableSubscriptionOverrides\":false}}",
"Owner": "123456789012",
"Policy": "{\"Version\":\"2008-10-17\",\"Id\":\"__default_policy_ID\",\"Statement\":[{\"Sid\":\"__default_statement_ID\",\"Effect\":\"Allow\",\"Principal\":{\"AWS\":\"*\"},\"Action\":[\"SNS:Subscribe\",\"SNS:ListSubscriptionsByTopic\",\"SNS:DeleteTopic\",\"SNS:GetTopicAttributes\",\"SNS:Publish\",\"SNS:RemovePermission\",\"SNS:AddPermission\",\"SNS:SetTopicAttributes\"],\"Resource\":\"arn:aws:sns:us-west-2:123456789012:my-topic\",\"Condition\":{\"StringEquals\":{\"AWS:SourceOwner\":\"0123456789012\"}}}]}",
"TopicArn": "arn:aws:sns:us-west-2:123456789012:my-topic",
"SubscriptionsPending": "0"
}
}
Best,
Didier
0
Hi Didier,
Thanks again for looking into this, and apologise for slow response - I'm on Australia time (UTC+10).
Today I tried with one of our own topics and the command works fine. The debug output from trying a topic we don't own points to an authentication issue.
回答済み 10ヶ月前
関連するコンテンツ
- AWS公式更新しました 3年前
- AWS公式更新しました 3年前
Thanks for looking into this but the example doesn't work for me. I copied and pasted the example as you suggest and still get:
I'm using Bash 5 on a Mac, in case this matters:
I also tried with single quotes, still the same error.
It works for me:
aws sns get-topic-attributes --topic-arn "arn:aws:sns:us-west-2:xxxxx:DD-tests"
{ "Attributes": { etc}", "SubscriptionsConfirmed": "0", "D
I am on zsh on macos
Can you run with the cli command with --debug: the additional details may help understand what is going wrong in your case.
A possible case is that your CLI is pointing to another default region than the us-west-2 of your ARN. Can you add --region us-west-2 to your CLI command? (In that case, I would agree that the error message could be better by detailing the fact that current CLI default region does not match ARN region...)