Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix endpoint override for demo deployment #2823

Merged
merged 1 commit into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions demos/browser/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ const indexPage = fs.readFileSync(indexPagePath);

const currentRegion = process.env.REGION || 'us-east-1';

const chimeSDKMediaPipelines = new ChimeSDKMediaPipelines({ region: 'us-east-1' });
chimeSDKMediaPipelines.endpoint = process.env.CHIME_SDK_MEDIA_PIPELINES_ENDPOINT || "https://media-pipelines-chime.us-east-1.amazonaws.com"
const chimeSDKMediaPipelines = new ChimeSDKMediaPipelines({
region: 'us-east-1',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we use currentRegion her as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think SDK media pipeline is currently hard-coded to us-east-1 by default. Thought about fixing it but decided not to as it is not related to this PR which is just to fix endpoint syntax for the SDK client.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, thanks!

endpoint: process.env.CHIME_SDK_MEDIA_PIPELINES_ENDPOINT || "https://media-pipelines-chime.us-east-1.amazonaws.com" });

const chimeSDKMeetings = new ChimeSDKMeetings({ region: currentRegion });
if (process.env.ENDPOINT) {
chimeSDKMeetings.endpoint = process.env.ENDPOINT
}
const chimeSDKMeetings = new ChimeSDKMeetings({
region: currentRegion,
...(process.env.ENDPOINT && { endpoint: process.env.ENDPOINT }) });

const sts = new STS({ region: 'us-east-1' });

Expand Down
2 changes: 1 addition & 1 deletion demos/serverless/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ let app = `meetingV2`;
let useEventBridge = false;
let enableTerminationProtection = false;
let disablePrintingLogs = false;
let chimeSDKMeetingsEndpoint = 'https://service.chime.aws.amazon.com';
let chimeSDKMeetingsEndpoint = 'https://meetings-chime.us-east-1.amazonaws.com';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we generate the endpoint based on region?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally yes but these values are default value and the default region value is us-east-1 so it does not make any difference.

let chimeMediaPipelinesServicePrincipal = 'mediapipelines.chime.amazonaws.com'
let captureOutputPrefix = ''
let mediaCaptureRegions = [
Expand Down
10 changes: 3 additions & 7 deletions demos/serverless/src/handlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,14 @@ const ivs = new Ivs({
apiVersion: '2020-07-14',
});

const chimeSDKMeetings = new ChimeSDKMeetings({
region: currentRegion,
});
if (chimeSDKMeetingsEndpoint) {
chimeSDKMeetings.endpoint = chimeSDKMeetingsEndpoint;
}

const chimeSDKMeetings = new ChimeSDKMeetings({ region: currentRegion, endpoint: chimeSDKMeetingsEndpoint });

// Create an AWS SDK Media Pipelines object.
const chimeSdkMediaPipelines = new ChimeSDKMediaPipelines({
region: mediaPipelinesControlRegion,
endpoint: chimeSDKMediaPipelinesEndpoint
});
chimeSdkMediaPipelines.endpoint = chimeSDKMediaPipelinesEndpoint;

// Read resource names from the environment
const {
Expand Down
Loading