aws-iot-chat-example icon indicating copy to clipboard operation
aws-iot-chat-example copied to clipboard

Update attachPublicPublish.js

Open iselcuk opened this issue 6 years ago • 0 comments

Issue #, if available: When we use the createPolicy and attachPrincipalPolicy in the same try block like in the example, we can attach a policy only the first time we created it.

Description of changes: According to AttachPrincipalPolicy documentation, 409 status code is not valid. However, in CreatePolicy documentation, it has been noted as "The resource already exists."

When we use the createPolicy and attachPrincipalPolicy in the same try block like in the example, we can attach a policy only the first time we created it. That is why I think "Policy already exists for this cognito identity" is misleading.

https://docs.aws.amazon.com/iot/latest/apireference/API_AttachPrincipalPolicy.html https://docs.aws.amazon.com/iot/latest/apireference/API_CreatePolicy.html

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

iselcuk avatar Apr 10 '19 08:04 iselcuk