Amazon Bedrock is a fully managed service provided by AWS that offers developers access to foundation models (FMs) and the tools to customize them for specific applications. It allows developers to build and scale generative AI applications using FMs through an API, without managing infrastructure. You can choose from various FMs from Amazon and leading AI startups such as AI21 Labs, Anthropic, Cohere, and Stability AI to find the model that’s best suited for your use case. With the Amazon Bedrock serverless experience, you can quickly get started, easily experiment with FMs, privately customize them with your own data, and seamlessly integrate and deploy them into your applications using AWS tools and capabilities.
Customers are building innovative generative AI applications using Amazon Bedrock APIs using their own proprietary data. When accessing Amazon Bedrock APIs, customers are looking for mechanism to set up a data perimeter without exposing their data to internet so they can mitigate potential threat vectors from internet exposure. The Amazon Bedrock VPC endpoint powered by AWS PrivateLink allows you to establish a private connection between the VPC in your account and the Amazon Bedrock service account. It enables VPC instances to communicate with service resources without the need for public IP addresses.
In this post, we demonstrate how to set up private access on your AWS account to access Amazon Bedrock APIs over VPC endpoints powered by PrivateLink to help you build generative AI applications securely with your own data.
You can use generative AI to develop a diverse range of applications, such as text summarization, content moderation, and other capabilities. When building such generative AI applications using FMs or base models, customers want to generate a response without going over the public internet or based on their proprietary data that may reside in their enterprise databases.
In the following diagram, we depict an architecture to set up your infrastructure to read your proprietary data residing in Amazon Relational Database Service (Amazon RDS) and augment the Amazon Bedrock API request with product information when answering product-related queries from your generative AI application. Although we use Amazon RDS in this diagram for illustration purposes, you can test the private access of the Amazon Bedrock APIs end to end using the instructions provided in this post.
The workflow steps are as follows:
Before you get started, make sure you have the following prerequisites:
us-east-1
RegionIn this section, we set up the infrastructure such as VPC, private subnets, security groups, and Lambda function using an AWS CloudFormation template.
Use the following template to create the infrastructure stack Bedrock-GenAI-Stack
in your AWS account.
The CloudFormation template creates the following resources on your behalf:
In this section, we use Amazon Virtual Private Cloud (Amazon VPC) to set up the VPC endpoint for Amazon Bedrock to facilitate private connectivity from your VPC to Amazon Bedrock.
bedrock-vpce
.com.amazonaws.<region>.bedrock-runtime
.Bedrock-GenAI-Project-vpc
that you created through the CloudFormation stack in the previous section.Bedrock-GenAI-Stack-VPCEndpointSecurityGroup-
and description Allow TLS for VPC Endpoint
.A security group acts as a virtual firewall for your instance to control inbound and outbound traffic. Note that this VPC endpoint security group only allows traffic originating from the security group attached to your VPC private subnets, adding a layer of protection.
arn:aws:bedrock:*::foundation-model/anthropic.claude-instant-v1
for a given principal (such as Lambda function IAM role). It may take up to 2 minutes until the interface endpoint is created and the status changes to Available. You can refresh the page to check the latest status.
Complete the following steps to configure the Lambda function:
gen-ai-lambda-stack-BedrockTestLambdaFunction-XXXXXXXXXXXX
.gen-ai-lambda-stack-BedrockTestLambdaFunctionRole-XXXXXXXXXXXX
.You’re redirected to the IAM console.
enivpce-policy
.Bedrock-GenAI-Project-vpc
.gen-ai-lambda-stack-SecurityGroup-
(the security group for the Amazon Bedrock workload in private subnets).Now you can test the private access controls (Amazon Bedrock APIs over VPC endpoints).
gen-ai-lambda-stack-BedrockTestLambdaFunction-XXXXXXXXXXXX
.You should see the following response from the Amazon Bedrock API call (Status: Succeeded).
Currently, the VPC endpoint policy is set to Allow
.
Allow
to Deny
and choose Save.It may take up to 2 minutes for the policy for the VPC endpoint to update.
As shown in the following screenshot, the access request to Amazon Bedrock over the VPC endpoint was denied (Status: Failed).
Through this testing process, we demonstrated how traffic from your VPC to the Amazon Bedrock API endpoint is traversing over the PrivateLink connection and not through the internet connection.
Follow these steps to avoid incurring future charges:
In this post, we demonstrated how to set up and operationalize a private connection between a generative AI workload deployed on your customer VPC and Amazon Bedrock using an interface VPC endpoint powered by PrivateLink. When using the architecture discussed in this post, the traffic between your customer VPC and Amazon Bedrock will not leave the Amazon network, ensuring your data is not exposed to the public internet and thereby helping with your compliance requirements.
As a next step, try the solution out in your account and share your feedback.
Jasper Research Lab’s new shadow generation research and model enable brands to create more photorealistic…
We’re announcing new updates to Gemini 2.0 Flash, plus introducing Gemini 2.0 Flash-Lite and Gemini…
Interactive digital agents (IDAs) leverage APIs of stateful digital environments to perform tasks in response…
This post is co-written with Martin Holste from Trellix. Security teams are dealing with an…
As AI continues to unlock new opportunities for business growth and societal benefits, we’re working…
An internal email obtained by WIRED shows that NOAA workers received orders to pause “ALL…