Using AmazonSimpleSystemsManagementClient GetParameters not working

I have Lambda in C # and am trying to access parameters stored in ECQ parameter storage. Parameters are saved as a string value.

My Lambda is configured to use an existing role. In IAM, I have assigned the following role roles:

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

Lambda starts inside our VPC, and if the parameter value is hard-coded, it runs successfully.

My code to get the parameter:

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 a log before and after calling GetParametersAsync, and it cannot get into the log after calling.

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

+6
2

, Lambda VPC. SSM , NAT Gateway, .

, SSM.

+3

- :

public async Task<Response> ProcessS3ImageResizeAsync(SimpleS3Event input)
{
   var response = await client.DoAsyncWork(input);
   return response;
}

, .

:

[1] http://docs.aws.amazon.com/lambda/latest/dg/dotnet-programming-model-handler-types.html#dot-net-async

+1

All Articles