Ajit Goel
Ajit Goel

Reputation: 4388

Blank environment variables in AWS Lambda

I have defined several environment variables in my AWS Lambda but when I try and access them in my .Net code they are coming in as blank.What am I missing?

Source Code:

public void CalculateInterimReviewsToBeCreated(Input input, ILambdaContext context)
{
    var uri = new Uri(getFSRHistoryURL);
    using (var httpClient = new HttpClient { BaseAddress = uri })
    {
        var authenticationHeaderKey = System.Environment.GetEnvironmentVariable("AuthenticationHeaderKey");
        LambdaLogger.Log("CalculateInterimReviewsToBeCreated : authenticationHeaderKey" + authenticationHeaderKey);
        ...
    }
    ...
}

CloudWatch shows blank environment variable: enter image description here

Lambda function configuration shows configured environment variable: enter image description here

Upvotes: 2

Views: 1917

Answers (1)

Manoj Acharya
Manoj Acharya

Reputation: 1479

You have specified Environment Variables in the tag section and hence the problem. You have to specify variables in the Environment Variable section.

Upvotes: 4

Related Questions