Skip to content

Issue with AWS Polly Integration in .net: AmazonServiceException: Unable to get IAM security credentials from EC2 Instance Metadata Service #3321

Answered by ashishdhingra
Johnny850807 asked this question in Q&A
Discussion options

You must be logged in to vote

@Johnny850807 Good afternoon. Your code doesn't appear to be correct. You are creating Amazon.Polly.AmazonPollyClient object and assigning to local variable in the constructor, which gets destroyed once the constructor method finishes execution. Although I do not have access to your code, your AwsPollyAPIClient.SynthesizeSpeech API method doesn't use this object and appears to use a default Amazon.Polly.AmazonPollyClient without any credentials parameter, which results in AWS .NET SDK doing the credential resolution per Credential and profile resolution, ultimately failing at Amazon EC2 instance metadata.

Did you instead intended to assign the Amazon.Polly.AmazonPollyClient that you creat…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by ashishdhingra
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. credentials
2 participants