Update attachPublicPublish.js
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.