Hi, I am a new user of pulumi and it is a great to...
# general
g
Hi, I am a new user of pulumi and it is a great tool. But I wanted to ask: do you please know anyone some nice example of how to use websocket api? From the documentation https://www.pulumi.com/docs/reference/pkg/aws/apigatewayv2/api/ I'm not very wise, so I would like to ask for inspiration. Thank you very much.
b
Hey @green-dentist-53234 I read an article on being able to use this type of architecture for things like chat applications https://www.enlabsoftware.com/development/how-to-create-real-time-chat-applications-using-websocket-apis-in-api-gateway.html
g
Hi @broad-dog-22463, thank you for the link, I have been reading these articles for the last few days. I can even click the application in the AWS console, but I can't programing pulumi correctly to create what I want. Specifically, I don't know how to connect websocket api with integration now. I'm trying something similar:
Copy code
new aws.apigatewayv2.Integration ('lambdaDefaultIntegration', {
    apiId: apigw.id,
    integrationType: 'AWS',
    integrationUri: lambda.arn
});
But it doesn't work at all (it doesn't even go deploy, it ends in Invalid function ARN or invalid uri) But when I try this
Copy code
new aws.apigatewayv2.Integration ('lambdaDefaultIntegration'), {
    apiId: apigw.id,
    integrationType: 'AWS_PROXY',
    integrationUri: lambda.arn
});
deploy will work, but I don't see the link between integration and lambda in the AWS console (you can see in image).
c
The following aws api gateway is a guide that can help you out.
g
Thank you gentlemen for the advice. In the end, my problem was that I lacked permission to invoke lambda for the api gateway 🤦
b
Glad it was something small!! Sorry I missed your response earlier
g
perfectly fine, personal experience is non-transferable