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?