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

feat: Add Bedrock Endpoints to AWS Credentials #12254

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
68 changes: 68 additions & 0 deletions packages/nodes-base/credentials/Aws.credentials.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ export type AwsCredentialsType = {
sesEndpoint?: string;
sqsEndpoint?: string;
s3Endpoint?: string;
bedrockEndpoint?: string;
bedrockRuntimeEndpoint?: string;
bedrockAgentEndpoint?: string;
bedrockAgentRuntimeEndpoint?: string;
};

// Some AWS services are global and don't have a region
Expand Down Expand Up @@ -295,6 +299,62 @@ export class Aws implements ICredentialType {
default: '',
placeholder: 'https://s3.{region}.amazonaws.com',
},
{
displayName: 'Bedrock Endpoint',
name: 'bedrockEndpoint',
description:
'If you use Amazon VPC to host n8n, you can establish a connection between your VPC and Bedrock using a VPC endpoint. Leave blank to use the default endpoint.',
type: 'string',
displayOptions: {
show: {
customEndpoints: [true],
},
},
default: '',
placeholder: 'https://{id}.bedrock.{region}.amazonaws.com',
},
{
displayName: 'Bedrock Runtime Endpoint',
name: 'bedrockRuntimeEndpoint',
description:
'If you use Amazon VPC to host n8n, you can establish a connection between your VPC and Bedrock Runtime using a VPC endpoint. Leave blank to use the default endpoint.',
type: 'string',
displayOptions: {
show: {
customEndpoints: [true],
},
},
default: '',
placeholder: 'https://{id}.bedrock-runtime.{region}.amazonaws.com',
},
{
displayName: 'Bedrock Agent Endpoint',
name: 'bedrockAgentEndpoint',
description:
'If you use Amazon VPC to host n8n, you can establish a connection between your VPC and Bedrock Agent using a VPC endpoint. Leave blank to use the default endpoint.',
type: 'string',
displayOptions: {
show: {
customEndpoints: [true],
},
},
default: '',
placeholder: 'https://{id}.bedrock-agent.{region}.amazonaws.com',
},
{
displayName: 'Bedrock Agent Runtime Endpoint',
name: 's3Endpoint',
description:
'If you use Amazon VPC to host n8n, you can establish a connection between your VPC and Bedrock Agent Runtime using a VPC endpoint. Leave blank to use the default endpoint.',
type: 'string',
displayOptions: {
show: {
customEndpoints: [true],
},
},
default: '',
placeholder: 'https://{id}.bedrock-agent-runtime.{region}.amazonaws.com',
},
];

async authenticate(
Expand Down Expand Up @@ -355,6 +415,14 @@ export class Aws implements ICredentialType {
endpointString = credentials.rekognitionEndpoint;
} else if (service === 'sqs' && credentials.sqsEndpoint) {
endpointString = credentials.sqsEndpoint;
} else if (service === 'bedrock' && credentials.bedrockEndpoint) {
endpointString = credentials.bedrockEndpoint;
} else if (service === 'bedrock-runtime' && credentials.bedrockRuntimeEndpoint) {
endpointString = credentials.sesEndpoint;
} else if (service === 'bedrock-agent' && credentials.bedrockAgentEndpoint) {
endpointString = credentials.bedrockAgentEndpoint;
} else if (service === 'bedrock-agent-runtime' && credentials.bedrockAgentRuntimeEndpoint) {
endpointString = credentials.bedrockAgentRuntimeEndpoint;
} else if (service) {
endpointString = `https://${service}.${region}.amazonaws.com`;
}
Expand Down