Skip to content

Conversation

@Ascendzor
Copy link

No description provided.

@eahefnawy
Copy link
Contributor

Thanks for sharing @Ascendzor ... the build is failing though. Could you regenerate the README?

Also, I took a look at your repo, specifically your note about the aws-sdk lambda version. The following "trick" snippet might be helpful to add to the example. It basically injects the new websockets service into Lambda's aws-sdk. Once you have this in your Lambda code, you won't need to deploy the entire aws-sdk everytime, which reduces deployment time.

// handler.js 'use strict'; const AWS = require('aws-sdk') // the following section injects the new ApiGatewayManagementApi service // into the Lambda AWS SDK, otherwise you'll have to deploy the entire new version of the SDK /* START ApiGatewayManagementApi injection */ const { Service, apiLoader } = AWS apiLoader.services['apigatewaymanagementapi'] = {} const model = { metadata: { apiVersion: '2018-11-29', endpointPrefix: 'execute-api', signingName: 'execute-api', serviceFullName: 'AmazonApiGatewayManagementApi', serviceId: 'ApiGatewayManagementApi', protocol: 'rest-json', jsonVersion: '1.1', uid: 'apigatewaymanagementapi-2018-11-29', signatureVersion: 'v4' }, operations: { PostToConnection: { http: { requestUri: '/@connections/{connectionId}', responseCode: 200 }, input: { type: 'structure', members: { Data: { type: 'blob' }, ConnectionId: { location: 'uri', locationName: 'connectionId' } }, required: ['ConnectionId', 'Data'], payload: 'Data' } } }, paginators: {}, shapes: {} } AWS.ApiGatewayManagementApi = Service.defineService('apigatewaymanagementapi', ['2018-11-29']) Object.defineProperty(apiLoader.services['apigatewaymanagementapi'], '2018-11-29', { // eslint-disable-next-line get: function get() { return model }, enumerable: true, configurable: true }) /* END ApiGatewayManagementApi injection */ module.exports.connect = (event, context, cb) => { cb(null, { statusCode: 200, body: 'Connected.' }); };
@garethmcc
Copy link
Contributor

@Ascendzor Hey there. Thanks again for adding the example. Just checking in to see if you need any assistance with correcting the issues outlined by the CI engine as per Eslam's advice above?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants