Quantcast
Channel: Active questions tagged amazon-ec2 - Stack Overflow
Viewing all articles
Browse latest Browse all 29529

Using instance profile to sign API request on AWS

$
0
0

I have created a IAM Role and assigned this to an EC2 Instance. I have a .Net Core application running on this instance and I want the application to access the secrets manager to bring down API keys.

This is my code below:

AmazonSecretsManagerConfig amazonSecretsManagerConfig = new AmazonSecretsManagerConfig();
        amazonSecretsManagerConfig.ServiceURL = "";

        var client = new Amazon.SecretsManager.AmazonSecretsManagerClient(RegionEndpoint.GetBySystemName("eu-west-2"));

        var response = await client.GetSecretValueAsync(new Amazon.SecretsManager.Model.GetSecretValueRequest
        {
            SecretId = "APIKEY"
        });

Error Message: Unable to get IAM security credentials from EC2 Instance Metadata Service.

Can any one help me out? I don't know if i have missed setting something up.


Viewing all articles
Browse latest Browse all 29529

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>