AWS Secret Value - C# .NET Framework 4.8 - Unable to get IAM security credentials from EC2 Instance Metadata Service

0

Hello, I'm trying to retrieve AWS Secret Value inside my .NET C# (.NET Framework 4.8) Application hosted on IIS in a EC2 instance like in the example showed here: https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieving-secrets_cache-net.html

The exception I receive is the following: Exception Details: Amazon.Runtime.AmazonServiceException: Unable to get IAM security credentials from EC2 Instance Metadata Service.

If I try to execute the command from CLI, the secret's are retrieved successfully.

Can someone help please ?

asked 2 years ago11082 views
1 Answer
0

The following GitHub and Stack Overflow sites describe similar errors and may be helpful. [1] [2]

[1] How to troubleshoot "Unable to get IAM security credentials from EC2 Instance Metadata Service."? · Issue #1699 · aws/aws-sdk-net
https://github.com/aws/aws-sdk-net/issues/1699

[2] .net - AWS DotNet SDK Error: Unable to get IAM security credentials from EC2 Instance Metadata Service - Stack Overflow
https://stackoverflow.com/questions/60815037/aws-dotnet-sdk-error-unable-to-get-iam-security-credentials-from-ec2-instance-m

profile picture
mn87
answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions