Using AmazonSimpleSystemsManagementClient GetParameters fails

Viewed 3750

I have a Lambda in C# and I'm trying to access parameters stored in the ECQ Parameter Store. The parameters are stored as a String Value.

My Lambda is configured to use an existing role. In IAM, I've assigned the following policies to the role:

  • AmazonRedshiftReadOnlyAccess
  • AmazonKinesisReadOnlyAccess
  • AmazonVPCFullAccess
  • AWSLambdaExecute
  • AmazonSSMReadOnlyAccess
  • AWSLambdaVPCAccessExecutionRole

The Lambda runs inside of our VPC and if the parameter value is hard-coded it executes successfully.

My code to get the parameter is:

var client = new AmazonSimpleSystemsManagementClient(RegionEndpoint.APSoutheast2);
var request = new GetParametersRequest
{
   Names = new List<string>{ "ParameterName" }
};
var response = client.GetParametersAsync(request).Result;
var value = response.Parameters.Single().Value;

I have logging before and after the call to GetParametersAsync and it doesn't get to the logging after the call.

What do I need to do to be able to get the parameter value from the Lambda?

2 Answers
Related