sparse-intern-71089
01/07/2021, 2:32 PMbrave-planet-10645
01/07/2021, 2:33 PMrhythmic-student-36708
01/07/2021, 2:34 PMrhythmic-student-36708
01/07/2021, 2:34 PMrhythmic-student-36708
01/07/2021, 2:38 PMexport async function writeOnTopic(
event: APIGatewayProxyEvent
): Promise<APIGatewayProxyResult> {
return {
statusCode: 200,
body: JSON.stringify(event)
};
}
rhythmic-student-36708
01/07/2021, 2:41 PMnumberOfNatGateways: 2
in the vpc configrhythmic-student-36708
01/07/2021, 2:42 PMbrave-planet-10645
01/07/2021, 2:51 PMbrave-planet-10645
01/07/2021, 2:53 PMAPIGatewayProxyEvent
is the correct input type for this type of messagebrave-planet-10645
01/07/2021, 2:53 PMany
for nowrhythmic-student-36708
01/07/2021, 2:59 PMrhythmic-student-36708
01/07/2021, 3:01 PMexport async function writeOnTopic(
event: any
): Promise<any> {
return {
statusCode: 200,
body: JSON.stringify(event)
};
}
rhythmic-student-36708
01/07/2021, 3:10 PMPROBLEM: Lambda internal error. Please contact Lambda customer support.
brave-planet-10645
01/07/2021, 3:26 PMrhythmic-student-36708
01/07/2021, 3:27 PMbrave-planet-10645
01/07/2021, 3:30 PMrhythmic-student-36708
01/07/2021, 3:31 PMconst securityGroup = new aws.ec2.SecurityGroup('ciii-kafka-sg-2', {
vpcId: vpc,
ingress: [
{
fromPort: 0,
toPort: 0,
protocol: '-1',
cidrBlocks: ['0.0.0.0/0']
}
],
egress: [
{
fromPort: 0,
toPort: 0,
protocol: '-1',
cidrBlocks: ['0.0.0.0/0']
}
]
});
rhythmic-student-36708
01/07/2021, 3:32 PMbrave-planet-10645
01/07/2021, 3:33 PMrhythmic-student-36708
01/07/2021, 3:33 PMconst lambdaConsumerRole = new aws.iam.Role('development-ciii-kafka-lambda-consumer-role-2', {
assumeRolePolicy: aws.iam.assumeRolePolicyForPrincipal({
Service: '<http://lambda.amazonaws.com|lambda.amazonaws.com>'
})
});
const policyAttachment = new aws.iam.PolicyAttachment('development-ciii-kafka-policy-attachment=2', {
roles: [lambdaConsumerRole.name],
policyArn: 'arn:aws:iam::aws:policy/service-role/AWSLambdaMSKExecutionRole'
});
rhythmic-student-36708
01/07/2021, 3:34 PMAWSLambdaMSKExecutionRole
should be enoughrhythmic-student-36708
01/07/2021, 3:34 PMconst consumerLambda = new aws.lambda.CallbackFunction('ciii-development-consumer-lambda-5', {
runtime: aws.lambda.NodeJS12dXRuntime,
role: lambdaConsumerRole,
callback: writeOnTopic,
vpcConfig: {
securityGroupIds: [securityGroup.id],
subnetIds: privateSubnets.apply(s => s.map((x: {id: string}) => x.id))
}
});
brave-planet-10645
01/07/2021, 3:35 PMrhythmic-student-36708
01/07/2021, 3:36 PMbrave-planet-10645
01/07/2021, 3:36 PMbrave-planet-10645
01/07/2021, 3:37 PMbrave-planet-10645
01/07/2021, 3:38 PMvpcConfig: {
securityGroupIds: [securityGroup.id],
subnetIds: privateSubnets.apply(s => s.map((x: {id: string}) => x.id))
}
from the lambda to remove it from the vpc. I don't know if it can't be in a vpc for it to work or it just doesn't need to berhythmic-student-36708
01/07/2021, 3:39 PMbrave-planet-10645
01/07/2021, 3:43 PMrhythmic-student-36708
01/07/2021, 3:44 PMbrave-planet-10645
01/07/2021, 3:45 PMbrave-planet-10645
01/07/2021, 3:45 PMconst policyAttachment2 = new aws.iam.PolicyAttachment('development-ciii-kafka-policy-attachment=3', {
roles: [lambdaConsumerRole.name],
policyArn: aws.iam.ManagedPolicies.AWSLambdaFullAccess
});
when I'm doing testing I use the full access one like abovebrave-planet-10645
01/07/2021, 3:45 PMbrave-planet-10645
01/07/2021, 3:46 PMbrave-planet-10645
01/07/2021, 3:49 PMrhythmic-student-36708
01/07/2021, 3:49 PMrhythmic-student-36708
01/07/2021, 3:49 PMrhythmic-student-36708
01/07/2021, 3:50 PMbrave-planet-10645
01/07/2021, 3:52 PMaws.iam.ManagedPolicy.AWSLambdaFullAccess
(singular ManagedPolicy
)brave-planet-10645
01/07/2021, 3:52 PMbrave-planet-10645
01/07/2021, 3:52 PMrhythmic-student-36708
01/07/2021, 3:54 PMrhythmic-student-36708
01/07/2021, 3:58 PMCallbackFunction
just remove it?brave-planet-10645
01/07/2021, 3:59 PMrhythmic-student-36708
01/07/2021, 3:59 PMrhythmic-student-36708
01/07/2021, 4:00 PMbrave-planet-10645
01/07/2021, 4:03 PMbrave-planet-10645
01/07/2021, 4:03 PMrhythmic-student-36708
01/07/2021, 4:03 PMrhythmic-student-36708
01/07/2021, 4:19 PMbrave-planet-10645
01/07/2021, 4:24 PMbrave-planet-10645
01/07/2021, 4:25 PMrhythmic-student-36708
01/07/2021, 4:26 PMrhythmic-student-36708
01/07/2021, 5:07 PMbrave-planet-10645
01/07/2021, 5:31 PMbrave-planet-10645
01/07/2021, 5:32 PM