Search code examples
aws-serverlessaws-chime-sdk

Credential should be scoped to a valid region when creating AWS-chime meeting


            let meetingId = null;
            let meeting = null;
            let clientId = 2017;
            meetingId = uuid();
            var region = await getNearestMediaRegion();
            const chime = new AWS.Chime({ region: region });
            chime.endpoint = new AWS.Endpoint('https://service.chime.aws.amazon.com');
            meeting = await chime.createMeeting({
                ClientRequestToken: meetingId,
                MediaRegion: region,
                ExternalMeetingId: meetingId,
            }).promise();
            const attendee = await chime.createAttendee({
                    MeetingId: meeting.Meeting.MeetingId,
                    ExternalUserId: `${uuid().substring(0, 8)}#${clientId}`,
                })
                .promise();
            let res = { meeting, attendee };

I've created meeting using Amazon chime SDK in Serverless refer following example

example

OUTPUT: enter image description here


Solution

  • Remove following line from your code:

    chime.endpoint = new AWS.Endpoint('https://service.chime.aws.amazon.com');