InferenceProfile class

Resource for managing an AWS Bedrock Inference Profile.

Example Usage

Basic Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const current = aws.getCallerIdentity({});
const example = new aws.bedrock.InferenceProfile("example", {
    modelSource: {
        copyFrom: "arn:aws:bedrock:us-west-2::foundation-model/anthropic.claude-3-5-sonnet-20241022-v2:0",
    },
    name: "Claude Sonnet for Project 123",
    description: "Profile with tag for cost allocation tracking",
    tags: {
        ProjectID: "123",
    },
});
import pulumi
import pulumi_aws as aws

current = aws.get_caller_identity()
example = aws.bedrock.InferenceProfile("example",
    model_source={
        "copy_from": "arn:aws:bedrock:us-west-2::foundation-model/anthropic.claude-3-5-sonnet-20241022-v2:0",
    },
    name="Claude Sonnet for Project 123",
    description="Profile with tag for cost allocation tracking",
    tags={
        "ProjectID": "123",
    })
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() =>
{
    var current = Aws.GetCallerIdentity.Invoke();

    var example = new Aws.Bedrock.InferenceProfile("example", new()
    {
        ModelSource = new Aws.Bedrock.Inputs.InferenceProfileModelSourceArgs
        {
            CopyFrom = "arn:aws:bedrock:us-west-2::foundation-model/anthropic.claude-3-5-sonnet-20241022-v2:0",
        },
        Name = "Claude Sonnet for Project 123",
        Description = "Profile with tag for cost allocation tracking",
        Tags =
        {
            { "ProjectID", "123" },
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws"
	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/bedrock"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := aws.GetCallerIdentity(ctx, &aws.GetCallerIdentityArgs{}, nil)
		if err != nil {
			return err
		}
		_, err = bedrock.NewInferenceProfile(ctx, "example", &bedrock.InferenceProfileArgs{
			ModelSource: &bedrock.InferenceProfileModelSourceArgs{
				CopyFrom: pulumi.String("arn:aws:bedrock:us-west-2::foundation-model/anthropic.claude-3-5-sonnet-20241022-v2:0"),
			},
			Name:        pulumi.String("Claude Sonnet for Project 123"),
			Description: pulumi.String("Profile with tag for cost allocation tracking"),
			Tags: pulumi.StringMap{
				"ProjectID": pulumi.String("123"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

data "aws_getcalleridentity" "current" {
}

resource "aws_bedrock_inferenceprofile" "example" {
  model_source = {
    copy_from = "arn:aws:bedrock:us-west-2::foundation-model/anthropic.claude-3-5-sonnet-20241022-v2:0"
  }
  name        = "Claude Sonnet for Project 123"
  description = "Profile with tag for cost allocation tracking"
  tags = {
    "ProjectID" = "123"
  }
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.AwsFunctions;
import com.pulumi.aws.inputs.GetCallerIdentityArgs;
import com.pulumi.aws.bedrock.InferenceProfile;
import com.pulumi.aws.bedrock.InferenceProfileArgs;
import com.pulumi.aws.bedrock.inputs.InferenceProfileModelSourceArgs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var current = AwsFunctions.getCallerIdentity(GetCallerIdentityArgs.builder()
            .build());

        var example = new InferenceProfile("example", InferenceProfileArgs.builder()
            .modelSource(InferenceProfileModelSourceArgs.builder()
                .copyFrom("arn:aws:bedrock:us-west-2::foundation-model/anthropic.claude-3-5-sonnet-20241022-v2:0")
                .build())
            .name("Claude Sonnet for Project 123")
            .description("Profile with tag for cost allocation tracking")
            .tags(Map.of("ProjectID", "123"))
            .build());

    }
}
resources:
  example:
    type: aws:bedrock:InferenceProfile
    properties:
      modelSource:
        copyFrom: arn:aws:bedrock:us-west-2::foundation-model/anthropic.claude-3-5-sonnet-20241022-v2:0
      name: Claude Sonnet for Project 123
      description: Profile with tag for cost allocation tracking
      tags:
        ProjectID: '123'
variables:
  current:
    fn::invoke:
      function: aws:getCallerIdentity
      arguments: {}

Import

Using pulumi import, import Bedrock Inference Profile using the name. For example:

$ pulumi import aws:bedrock/inferenceProfile:InferenceProfile example inference_profile-id-12345678

Constructors

InferenceProfile(String name, {InferenceProfileArgs? args, CustomResourceOptions? options})
Creates a new InferenceProfile. name The Pulumi resource name. args Arguments used to configure this InferenceProfile. The set of arguments for InferenceProfile. options Resource options controlling this resource's behavior.
InferenceProfile.reference(String urn)
Creates a typed reference to an existing InferenceProfile resource.

Properties

arn ↔ Output<String>
The ARN of the inference profile.
latefinal
childResources → Set<Resource>
finalinherited
completionSources ↔ Map<String, IOutputCompletionSource>
latefinalinherited
createdAt ↔ Output<String>
The time at which the inference profile was created.
latefinal
description ↔ Output<String?>
The description of the inference profile.
latefinal
hashCode → int
The hash code for this object.
no setterinherited
id ↔ Output<String>
getter/setter pairinherited
isCustom → bool
Returns whether this resource is provider-managed.
no setterinherited
isProtected → bool
Returns whether this resource is protected from deletion.
no setterinherited
isRemote → bool
Whether this resource is registered as remote.
no setterinherited
isResourceReference → bool
Whether this instance represents a resource value returned over RPC.
finalinherited
models ↔ Output<List<InferenceProfileModel>>
A list of information about each model in the inference profile. See models.
latefinal
modelSource ↔ Output<InferenceProfileModelSource?>
The source of the model this inference profile will track metrics and cost for. See modelSource.
latefinal
name ↔ Output<String>
The name of the inference profile.
latefinal
region ↔ Output<String>
Region where this resource will be managed. Defaults to the Region set in the provider configuration.
latefinal
resourceTransforms → List<ResourceTransform>
Inherited/explicit async transforms.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
status ↔ Output<String>
The status of the inference profile. ACTIVE means that the inference profile is available to use.
latefinal
tags ↔ Output<Map<String, String>?>
Key-value mapping of resource tags for the inference profile.
latefinal
tagsAll ↔ Output<Map<String, String>>
latefinal
timeouts ↔ Output<InferenceProfileTimeouts?>
latefinal
transformations → List<ResourceTransformation>
Inherited/explicit legacy transformations.
no setterinherited
type ↔ Output<String>
The type of the inference profile. SYSTEM_DEFINED means that the inference profile is defined by Amazon Bedrock. APPLICATION means that the inference profile is defined by the user.
latefinal
updatedAt ↔ Output<String>
The time at which the inference profile was last updated.
latefinal
urn ↔ Output<String>
latefinalinherited

Methods

failId(Object error) → void
Completes this resource ID with an error when registration fails.
inherited
failOutputs(Object error) → void
Completes all output properties with error.
inherited
failUrn(Object error) → void
Completes this resource URN with an error when registration fails.
inherited
getProvider(String moduleMember) → ProviderResource?
Returns provider for moduleMember's package, if configured.
inherited
getResourceName() → String
Returns this resource's logical name.
inherited
getResourceType() → String
Returns this resource's Pulumi type token.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerOutput<T>(String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output<T>
Registers a dynamic output property for this resource.
inherited
resolveId(String? value, {required bool isKnown}) → void
Resolves the provider-assigned ID for this resource.
inherited
resolveOutputs(Struct outputs) → void
Resolves all output properties from a monitor response payload.
inherited
resolveUrn(String value) → void
Resolves this resource's URN once assigned by the engine.
inherited
serializeProperties(Map<String, dynamic> properties) → Future<Struct>
Serializes resource properties for RPC transmission.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

get(String name, Input<String> id, {InferenceProfileState? state, CustomResourceOptions? options}) → InferenceProfile
Gets an existing InferenceProfile resource's state with the given name and id.