A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources with infrastructure-as-code.
—
Quality
Pending
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Amazon Bedrock is a fully managed service for building generative AI applications with foundation models.
import * as aws from "@pulumi/aws";Amazon Bedrock provides access to foundation models from leading AI companies through a single API.
// Example IAM policy for Bedrock access
const bedrockPolicy = new aws.iam.Policy("bedrock-access", {
policy: JSON.stringify({
Version: "2012-10-17",
Statement: [{
Effect: "Allow",
Action: [
"bedrock:InvokeModel",
"bedrock:InvokeModelWithResponseStream",
],
Resource: "arn:aws:bedrock:*::foundation-model/*",
}],
}),
});Fine-tune foundation models with your own data.
const customizationRole = new aws.iam.Role("bedrock-customization", {
assumeRolePolicy: JSON.stringify({
Version: "2012-10-17",
Statement: [{
Action: "sts:AssumeRole",
Effect: "Allow",
Principal: {
Service: "bedrock.amazonaws.com",
},
}],
}),
});
new aws.iam.RolePolicy("bedrock-s3-access", {
role: customizationRole.id,
policy: JSON.stringify({
Version: "2012-10-17",
Statement: [{
Effect: "Allow",
Action: ["s3:GetObject", "s3:ListBucket"],
Resource: [bucket.arn, pulumi.interpolate`${bucket.arn}/*`],
}],
}),
});Create RAG (Retrieval-Augmented Generation) applications.
const knowledgeBaseRole = new aws.iam.Role("kb-role", {
assumeRolePolicy: JSON.stringify({
Version: "2012-10-17",
Statement: [{
Action: "sts:AssumeRole",
Effect: "Allow",
Principal: {
Service: "bedrock.amazonaws.com",
},
}],
}),
});Build AI agents that can take actions.
const agentRole = new aws.iam.Role("agent-role", {
assumeRolePolicy: JSON.stringify({
Version: "2012-10-17",
Statement: [{
Action: "sts:AssumeRole",
Effect: "Allow",
Principal: {
Service: "bedrock.amazonaws.com",
},
}],
}),
});Install with Tessl CLI
npx tessl i tessl/npm-pulumi--aws