colossal-battery-24701
07/05/2021, 11:03 AMType 'Output<string> | undefined' is not assignable to type 'Input<string>'.
How can I add these variables neatly? This example shows only one API and few variable but in actual code, I have many routes and 20+ env variable. Any help is appreciated
export const apiGateway = new awsx.apigateway.API('retool-lambda-api-gw', {
routes: [
{
path: '/oc/d-sup',
authorizers: authorizerAPI,
method: 'POST',
eventHandler: new aws.lambda.CallbackFunction('retool-lambda-delete-supporter', {
callback: async (event: awsx.apigateway.Request) => {
return routes.deleteSupporterHandler(event);
},
environment: {
variables: {
DB_HOST: config.getSecret('DB_HOST'), // this and the below vars throw error
DB_USER: config.getSecret('DB_USER'),
DB_PASSWORD: config.getSecret('DB_PASSWORD'),
DB_NAME: config.getSecret('DB_NAME'),
}
},
role: role,
vpcConfig: {
subnetIds: [awsNetworkingEnvVariables.SUBNET_ID],
securityGroupIds: [lambdaSecurityGroup.id],
}
}),
},
],
});
curved-pharmacist-41509
07/05/2021, 12:28 PMrequireSecret
rather than getSecret
it should work