ModelAgreement class
Manages an AWS Bedrock Foundation Model Agreement.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = aws.bedrockfoundation.getModelAgreementOffers({
modelId: "eu.anthropic.claude-opus-4-5-20251101-v1:0",
offerType: "PUBLIC",
});
const exampleModelAgreement = new aws.bedrockfoundation.ModelAgreement("example", {
modelId: example.then(example => example.modelId),
offerToken: example.then(example => example.offers?.[0]?.offerToken),
}, {
ignoreChanges: ["offerToken"],
});
import pulumi
import pulumi_aws as aws
example = aws.bedrockfoundation.get_model_agreement_offers(model_id="eu.anthropic.claude-opus-4-5-20251101-v1:0",
offer_type="PUBLIC")
example_model_agreement = aws.bedrockfoundation.ModelAgreement("example",
model_id=example.model_id,
offer_token=example.offers[0].offer_token,
opts = pulumi.ResourceOptions(ignore_changes=["offerToken"]))
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = Aws.BedrockFoundation.GetModelAgreementOffers.Invoke(new()
{
ModelId = "eu.anthropic.claude-opus-4-5-20251101-v1:0",
OfferType = "PUBLIC",
});
var exampleModelAgreement = new Aws.BedrockFoundation.ModelAgreement("example", new()
{
ModelId = example.Apply(getModelAgreementOffersResult => getModelAgreementOffersResult.ModelId),
OfferToken = example.Apply(getModelAgreementOffersResult => getModelAgreementOffersResult.Offers[0]?.OfferToken),
}, new CustomResourceOptions
{
IgnoreChanges =
{
"offerToken",
},
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/bedrockfoundation"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := bedrockfoundation.GetModelAgreementOffers(ctx, &bedrockfoundation.GetModelAgreementOffersArgs{
ModelId: "eu.anthropic.claude-opus-4-5-20251101-v1:0",
OfferType: pulumi.StringRef("PUBLIC"),
}, nil)
if err != nil {
return err
}
_, err = bedrockfoundation.NewModelAgreement(ctx, "example", &bedrockfoundation.ModelAgreementArgs{
ModelId: pulumi.String(example.ModelId),
OfferToken: pulumi.String(example.Offers[0].OfferToken),
}, pulumi.IgnoreChanges([]string{
"offerToken",
}))
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
aws = {
source = "pulumi/aws"
}
}
}
data "aws_bedrockfoundation_getmodelagreementoffers" "example" {
model_id = "eu.anthropic.claude-opus-4-5-20251101-v1:0"
offer_type = "PUBLIC"
}
resource "aws_bedrockfoundation_modelagreement" "example" {
lifecycle {
ignore_changes = [offerToken]
}
model_id = data.aws_bedrockfoundation_getmodelagreementoffers.example.model_id
offer_token = data.aws_bedrockfoundation_getmodelagreementoffers.example.offers[0].offer_token
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.bedrockfoundation.BedrockfoundationFunctions;
import com.pulumi.aws.bedrockfoundation.inputs.GetModelAgreementOffersArgs;
import com.pulumi.aws.bedrockfoundation.ModelAgreement;
import com.pulumi.aws.bedrockfoundation.ModelAgreementArgs;
import com.pulumi.resources.CustomResourceOptions;
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 example = BedrockfoundationFunctions.getModelAgreementOffers(GetModelAgreementOffersArgs.builder()
.modelId("eu.anthropic.claude-opus-4-5-20251101-v1:0")
.offerType("PUBLIC")
.build());
var exampleModelAgreement = new ModelAgreement("exampleModelAgreement", ModelAgreementArgs.builder()
.modelId(example.modelId())
.offerToken(example.offers()[0].offerToken())
.build(), CustomResourceOptions.builder()
.ignoreChanges("offerToken")
.build());
}
}
resources:
exampleModelAgreement:
type: aws:bedrockfoundation:ModelAgreement
name: example
properties:
modelId: ${example.modelId}
offerToken: ${example.offers[0].offerToken}
options:
ignoreChanges:
- offerToken
variables:
example:
fn::invoke:
function: aws:bedrockfoundation:getModelAgreementOffers
arguments:
modelId: eu.anthropic.claude-opus-4-5-20251101-v1:0
offerType: PUBLIC
Import
Identity Schema
Required
modelId- Model ID argument of the Foundation Model Agreement.
Optional
accountId(String) AWS Account where this resource is managed.region(String) Region where this resource is managed.
Using pulumi import, import Bedrock Foundation Model Agreement using the modelId. For example:
$ pulumi import aws:bedrockfoundation/modelAgreement:ModelAgreement example eu.anthropic.claude-opus-4-5-20251101-v1:0
Constructors
- ModelAgreement(String name, {ModelAgreementArgs? args, CustomResourceOptions? options})
-
Creates a new ModelAgreement.
nameThe Pulumi resource name.argsArguments used to configure this ModelAgreement. The set of arguments for ModelAgreement.optionsResource options controlling this resource's behavior. - ModelAgreement.reference(String urn)
- Creates a typed reference to an existing ModelAgreement resource.
Properties
-
childResources
→ Set<
Resource> -
finalinherited
-
completionSources
↔ Map<
String, IOutputCompletionSource> -
latefinalinherited
- 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
-
modelId
↔ Output<
String> -
Model ID for the access request.
latefinal
-
offerToken
↔ Output<
String> -
Offer token encapsulates information for an offer.
latefinal
-
region
↔ Output<
String> -
Region where this action should be run. 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
-
timeouts
↔ Output<
ModelAgreementTimeouts?> -
latefinal
-
transformations
→ List<
ResourceTransformation> -
Inherited/explicit legacy transformations.
no setterinherited
-
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, {ModelAgreementState? state, CustomResourceOptions? options}) → ModelAgreement -
Gets an existing ModelAgreement resource's state with the given
nameandid.