github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/bedrock/provisionedModelThroughput.go (about)

     1  // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
     2  // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
     3  
     4  package bedrock
     5  
     6  import (
     7  	"context"
     8  	"reflect"
     9  
    10  	"errors"
    11  	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
    12  	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    13  )
    14  
    15  // Manages [Provisioned Throughput](https://docs.aws.amazon.com/bedrock/latest/userguide/prov-throughput.html) for an Amazon Bedrock model.
    16  //
    17  // ## Example Usage
    18  //
    19  // <!--Start PulumiCodeChooser -->
    20  // ```go
    21  // package main
    22  //
    23  // import (
    24  //
    25  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/bedrock"
    26  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    27  //
    28  // )
    29  //
    30  //	func main() {
    31  //		pulumi.Run(func(ctx *pulumi.Context) error {
    32  //			_, err := bedrock.NewProvisionedModelThroughput(ctx, "example", &bedrock.ProvisionedModelThroughputArgs{
    33  //				ProvisionedModelName: pulumi.String("example-model"),
    34  //				ModelArn:             pulumi.String("arn:aws:bedrock:us-east-1::foundation-model/anthropic.claude-v2"),
    35  //				CommitmentDuration:   pulumi.String("SixMonths"),
    36  //				ModelUnits:           pulumi.Int(1),
    37  //			})
    38  //			if err != nil {
    39  //				return err
    40  //			}
    41  //			return nil
    42  //		})
    43  //	}
    44  //
    45  // ```
    46  // <!--End PulumiCodeChooser -->
    47  //
    48  // ## Import
    49  //
    50  // Using `pulumi import`, import Provisioned Throughput using the `provisioned_model_arn`. For example:
    51  //
    52  // ```sh
    53  // $ pulumi import aws:bedrock/provisionedModelThroughput:ProvisionedModelThroughput example arn:aws:bedrock:us-west-2:123456789012:provisioned-model/1y5n57gh5y2e
    54  // ```
    55  type ProvisionedModelThroughput struct {
    56  	pulumi.CustomResourceState
    57  
    58  	// Commitment duration requested for the Provisioned Throughput. For custom models, you can purchase on-demand Provisioned Throughput by omitting this argument. Valid values: `OneMonth`, `SixMonths`.
    59  	CommitmentDuration pulumi.StringPtrOutput `pulumi:"commitmentDuration"`
    60  	// ARN of the model to associate with this Provisioned Throughput.
    61  	ModelArn pulumi.StringOutput `pulumi:"modelArn"`
    62  	// Number of model units to allocate. A model unit delivers a specific throughput level for the specified model.
    63  	ModelUnits pulumi.IntOutput `pulumi:"modelUnits"`
    64  	// The ARN of the Provisioned Throughput.
    65  	ProvisionedModelArn pulumi.StringOutput `pulumi:"provisionedModelArn"`
    66  	// Unique name for this Provisioned Throughput.
    67  	ProvisionedModelName pulumi.StringOutput `pulumi:"provisionedModelName"`
    68  	// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    69  	Tags pulumi.StringMapOutput `pulumi:"tags"`
    70  	// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
    71  	//
    72  	// Deprecated: Please use `tags` instead.
    73  	TagsAll  pulumi.StringMapOutput                      `pulumi:"tagsAll"`
    74  	Timeouts ProvisionedModelThroughputTimeoutsPtrOutput `pulumi:"timeouts"`
    75  }
    76  
    77  // NewProvisionedModelThroughput registers a new resource with the given unique name, arguments, and options.
    78  func NewProvisionedModelThroughput(ctx *pulumi.Context,
    79  	name string, args *ProvisionedModelThroughputArgs, opts ...pulumi.ResourceOption) (*ProvisionedModelThroughput, error) {
    80  	if args == nil {
    81  		return nil, errors.New("missing one or more required arguments")
    82  	}
    83  
    84  	if args.ModelArn == nil {
    85  		return nil, errors.New("invalid value for required argument 'ModelArn'")
    86  	}
    87  	if args.ModelUnits == nil {
    88  		return nil, errors.New("invalid value for required argument 'ModelUnits'")
    89  	}
    90  	if args.ProvisionedModelName == nil {
    91  		return nil, errors.New("invalid value for required argument 'ProvisionedModelName'")
    92  	}
    93  	opts = internal.PkgResourceDefaultOpts(opts)
    94  	var resource ProvisionedModelThroughput
    95  	err := ctx.RegisterResource("aws:bedrock/provisionedModelThroughput:ProvisionedModelThroughput", name, args, &resource, opts...)
    96  	if err != nil {
    97  		return nil, err
    98  	}
    99  	return &resource, nil
   100  }
   101  
   102  // GetProvisionedModelThroughput gets an existing ProvisionedModelThroughput resource's state with the given name, ID, and optional
   103  // state properties that are used to uniquely qualify the lookup (nil if not required).
   104  func GetProvisionedModelThroughput(ctx *pulumi.Context,
   105  	name string, id pulumi.IDInput, state *ProvisionedModelThroughputState, opts ...pulumi.ResourceOption) (*ProvisionedModelThroughput, error) {
   106  	var resource ProvisionedModelThroughput
   107  	err := ctx.ReadResource("aws:bedrock/provisionedModelThroughput:ProvisionedModelThroughput", name, id, state, &resource, opts...)
   108  	if err != nil {
   109  		return nil, err
   110  	}
   111  	return &resource, nil
   112  }
   113  
   114  // Input properties used for looking up and filtering ProvisionedModelThroughput resources.
   115  type provisionedModelThroughputState struct {
   116  	// Commitment duration requested for the Provisioned Throughput. For custom models, you can purchase on-demand Provisioned Throughput by omitting this argument. Valid values: `OneMonth`, `SixMonths`.
   117  	CommitmentDuration *string `pulumi:"commitmentDuration"`
   118  	// ARN of the model to associate with this Provisioned Throughput.
   119  	ModelArn *string `pulumi:"modelArn"`
   120  	// Number of model units to allocate. A model unit delivers a specific throughput level for the specified model.
   121  	ModelUnits *int `pulumi:"modelUnits"`
   122  	// The ARN of the Provisioned Throughput.
   123  	ProvisionedModelArn *string `pulumi:"provisionedModelArn"`
   124  	// Unique name for this Provisioned Throughput.
   125  	ProvisionedModelName *string `pulumi:"provisionedModelName"`
   126  	// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   127  	Tags map[string]string `pulumi:"tags"`
   128  	// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   129  	//
   130  	// Deprecated: Please use `tags` instead.
   131  	TagsAll  map[string]string                   `pulumi:"tagsAll"`
   132  	Timeouts *ProvisionedModelThroughputTimeouts `pulumi:"timeouts"`
   133  }
   134  
   135  type ProvisionedModelThroughputState struct {
   136  	// Commitment duration requested for the Provisioned Throughput. For custom models, you can purchase on-demand Provisioned Throughput by omitting this argument. Valid values: `OneMonth`, `SixMonths`.
   137  	CommitmentDuration pulumi.StringPtrInput
   138  	// ARN of the model to associate with this Provisioned Throughput.
   139  	ModelArn pulumi.StringPtrInput
   140  	// Number of model units to allocate. A model unit delivers a specific throughput level for the specified model.
   141  	ModelUnits pulumi.IntPtrInput
   142  	// The ARN of the Provisioned Throughput.
   143  	ProvisionedModelArn pulumi.StringPtrInput
   144  	// Unique name for this Provisioned Throughput.
   145  	ProvisionedModelName pulumi.StringPtrInput
   146  	// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   147  	Tags pulumi.StringMapInput
   148  	// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   149  	//
   150  	// Deprecated: Please use `tags` instead.
   151  	TagsAll  pulumi.StringMapInput
   152  	Timeouts ProvisionedModelThroughputTimeoutsPtrInput
   153  }
   154  
   155  func (ProvisionedModelThroughputState) ElementType() reflect.Type {
   156  	return reflect.TypeOf((*provisionedModelThroughputState)(nil)).Elem()
   157  }
   158  
   159  type provisionedModelThroughputArgs struct {
   160  	// Commitment duration requested for the Provisioned Throughput. For custom models, you can purchase on-demand Provisioned Throughput by omitting this argument. Valid values: `OneMonth`, `SixMonths`.
   161  	CommitmentDuration *string `pulumi:"commitmentDuration"`
   162  	// ARN of the model to associate with this Provisioned Throughput.
   163  	ModelArn string `pulumi:"modelArn"`
   164  	// Number of model units to allocate. A model unit delivers a specific throughput level for the specified model.
   165  	ModelUnits int `pulumi:"modelUnits"`
   166  	// Unique name for this Provisioned Throughput.
   167  	ProvisionedModelName string `pulumi:"provisionedModelName"`
   168  	// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   169  	Tags     map[string]string                   `pulumi:"tags"`
   170  	Timeouts *ProvisionedModelThroughputTimeouts `pulumi:"timeouts"`
   171  }
   172  
   173  // The set of arguments for constructing a ProvisionedModelThroughput resource.
   174  type ProvisionedModelThroughputArgs struct {
   175  	// Commitment duration requested for the Provisioned Throughput. For custom models, you can purchase on-demand Provisioned Throughput by omitting this argument. Valid values: `OneMonth`, `SixMonths`.
   176  	CommitmentDuration pulumi.StringPtrInput
   177  	// ARN of the model to associate with this Provisioned Throughput.
   178  	ModelArn pulumi.StringInput
   179  	// Number of model units to allocate. A model unit delivers a specific throughput level for the specified model.
   180  	ModelUnits pulumi.IntInput
   181  	// Unique name for this Provisioned Throughput.
   182  	ProvisionedModelName pulumi.StringInput
   183  	// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   184  	Tags     pulumi.StringMapInput
   185  	Timeouts ProvisionedModelThroughputTimeoutsPtrInput
   186  }
   187  
   188  func (ProvisionedModelThroughputArgs) ElementType() reflect.Type {
   189  	return reflect.TypeOf((*provisionedModelThroughputArgs)(nil)).Elem()
   190  }
   191  
   192  type ProvisionedModelThroughputInput interface {
   193  	pulumi.Input
   194  
   195  	ToProvisionedModelThroughputOutput() ProvisionedModelThroughputOutput
   196  	ToProvisionedModelThroughputOutputWithContext(ctx context.Context) ProvisionedModelThroughputOutput
   197  }
   198  
   199  func (*ProvisionedModelThroughput) ElementType() reflect.Type {
   200  	return reflect.TypeOf((**ProvisionedModelThroughput)(nil)).Elem()
   201  }
   202  
   203  func (i *ProvisionedModelThroughput) ToProvisionedModelThroughputOutput() ProvisionedModelThroughputOutput {
   204  	return i.ToProvisionedModelThroughputOutputWithContext(context.Background())
   205  }
   206  
   207  func (i *ProvisionedModelThroughput) ToProvisionedModelThroughputOutputWithContext(ctx context.Context) ProvisionedModelThroughputOutput {
   208  	return pulumi.ToOutputWithContext(ctx, i).(ProvisionedModelThroughputOutput)
   209  }
   210  
   211  // ProvisionedModelThroughputArrayInput is an input type that accepts ProvisionedModelThroughputArray and ProvisionedModelThroughputArrayOutput values.
   212  // You can construct a concrete instance of `ProvisionedModelThroughputArrayInput` via:
   213  //
   214  //	ProvisionedModelThroughputArray{ ProvisionedModelThroughputArgs{...} }
   215  type ProvisionedModelThroughputArrayInput interface {
   216  	pulumi.Input
   217  
   218  	ToProvisionedModelThroughputArrayOutput() ProvisionedModelThroughputArrayOutput
   219  	ToProvisionedModelThroughputArrayOutputWithContext(context.Context) ProvisionedModelThroughputArrayOutput
   220  }
   221  
   222  type ProvisionedModelThroughputArray []ProvisionedModelThroughputInput
   223  
   224  func (ProvisionedModelThroughputArray) ElementType() reflect.Type {
   225  	return reflect.TypeOf((*[]*ProvisionedModelThroughput)(nil)).Elem()
   226  }
   227  
   228  func (i ProvisionedModelThroughputArray) ToProvisionedModelThroughputArrayOutput() ProvisionedModelThroughputArrayOutput {
   229  	return i.ToProvisionedModelThroughputArrayOutputWithContext(context.Background())
   230  }
   231  
   232  func (i ProvisionedModelThroughputArray) ToProvisionedModelThroughputArrayOutputWithContext(ctx context.Context) ProvisionedModelThroughputArrayOutput {
   233  	return pulumi.ToOutputWithContext(ctx, i).(ProvisionedModelThroughputArrayOutput)
   234  }
   235  
   236  // ProvisionedModelThroughputMapInput is an input type that accepts ProvisionedModelThroughputMap and ProvisionedModelThroughputMapOutput values.
   237  // You can construct a concrete instance of `ProvisionedModelThroughputMapInput` via:
   238  //
   239  //	ProvisionedModelThroughputMap{ "key": ProvisionedModelThroughputArgs{...} }
   240  type ProvisionedModelThroughputMapInput interface {
   241  	pulumi.Input
   242  
   243  	ToProvisionedModelThroughputMapOutput() ProvisionedModelThroughputMapOutput
   244  	ToProvisionedModelThroughputMapOutputWithContext(context.Context) ProvisionedModelThroughputMapOutput
   245  }
   246  
   247  type ProvisionedModelThroughputMap map[string]ProvisionedModelThroughputInput
   248  
   249  func (ProvisionedModelThroughputMap) ElementType() reflect.Type {
   250  	return reflect.TypeOf((*map[string]*ProvisionedModelThroughput)(nil)).Elem()
   251  }
   252  
   253  func (i ProvisionedModelThroughputMap) ToProvisionedModelThroughputMapOutput() ProvisionedModelThroughputMapOutput {
   254  	return i.ToProvisionedModelThroughputMapOutputWithContext(context.Background())
   255  }
   256  
   257  func (i ProvisionedModelThroughputMap) ToProvisionedModelThroughputMapOutputWithContext(ctx context.Context) ProvisionedModelThroughputMapOutput {
   258  	return pulumi.ToOutputWithContext(ctx, i).(ProvisionedModelThroughputMapOutput)
   259  }
   260  
   261  type ProvisionedModelThroughputOutput struct{ *pulumi.OutputState }
   262  
   263  func (ProvisionedModelThroughputOutput) ElementType() reflect.Type {
   264  	return reflect.TypeOf((**ProvisionedModelThroughput)(nil)).Elem()
   265  }
   266  
   267  func (o ProvisionedModelThroughputOutput) ToProvisionedModelThroughputOutput() ProvisionedModelThroughputOutput {
   268  	return o
   269  }
   270  
   271  func (o ProvisionedModelThroughputOutput) ToProvisionedModelThroughputOutputWithContext(ctx context.Context) ProvisionedModelThroughputOutput {
   272  	return o
   273  }
   274  
   275  // Commitment duration requested for the Provisioned Throughput. For custom models, you can purchase on-demand Provisioned Throughput by omitting this argument. Valid values: `OneMonth`, `SixMonths`.
   276  func (o ProvisionedModelThroughputOutput) CommitmentDuration() pulumi.StringPtrOutput {
   277  	return o.ApplyT(func(v *ProvisionedModelThroughput) pulumi.StringPtrOutput { return v.CommitmentDuration }).(pulumi.StringPtrOutput)
   278  }
   279  
   280  // ARN of the model to associate with this Provisioned Throughput.
   281  func (o ProvisionedModelThroughputOutput) ModelArn() pulumi.StringOutput {
   282  	return o.ApplyT(func(v *ProvisionedModelThroughput) pulumi.StringOutput { return v.ModelArn }).(pulumi.StringOutput)
   283  }
   284  
   285  // Number of model units to allocate. A model unit delivers a specific throughput level for the specified model.
   286  func (o ProvisionedModelThroughputOutput) ModelUnits() pulumi.IntOutput {
   287  	return o.ApplyT(func(v *ProvisionedModelThroughput) pulumi.IntOutput { return v.ModelUnits }).(pulumi.IntOutput)
   288  }
   289  
   290  // The ARN of the Provisioned Throughput.
   291  func (o ProvisionedModelThroughputOutput) ProvisionedModelArn() pulumi.StringOutput {
   292  	return o.ApplyT(func(v *ProvisionedModelThroughput) pulumi.StringOutput { return v.ProvisionedModelArn }).(pulumi.StringOutput)
   293  }
   294  
   295  // Unique name for this Provisioned Throughput.
   296  func (o ProvisionedModelThroughputOutput) ProvisionedModelName() pulumi.StringOutput {
   297  	return o.ApplyT(func(v *ProvisionedModelThroughput) pulumi.StringOutput { return v.ProvisionedModelName }).(pulumi.StringOutput)
   298  }
   299  
   300  // A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   301  func (o ProvisionedModelThroughputOutput) Tags() pulumi.StringMapOutput {
   302  	return o.ApplyT(func(v *ProvisionedModelThroughput) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   303  }
   304  
   305  // Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   306  //
   307  // Deprecated: Please use `tags` instead.
   308  func (o ProvisionedModelThroughputOutput) TagsAll() pulumi.StringMapOutput {
   309  	return o.ApplyT(func(v *ProvisionedModelThroughput) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   310  }
   311  
   312  func (o ProvisionedModelThroughputOutput) Timeouts() ProvisionedModelThroughputTimeoutsPtrOutput {
   313  	return o.ApplyT(func(v *ProvisionedModelThroughput) ProvisionedModelThroughputTimeoutsPtrOutput { return v.Timeouts }).(ProvisionedModelThroughputTimeoutsPtrOutput)
   314  }
   315  
   316  type ProvisionedModelThroughputArrayOutput struct{ *pulumi.OutputState }
   317  
   318  func (ProvisionedModelThroughputArrayOutput) ElementType() reflect.Type {
   319  	return reflect.TypeOf((*[]*ProvisionedModelThroughput)(nil)).Elem()
   320  }
   321  
   322  func (o ProvisionedModelThroughputArrayOutput) ToProvisionedModelThroughputArrayOutput() ProvisionedModelThroughputArrayOutput {
   323  	return o
   324  }
   325  
   326  func (o ProvisionedModelThroughputArrayOutput) ToProvisionedModelThroughputArrayOutputWithContext(ctx context.Context) ProvisionedModelThroughputArrayOutput {
   327  	return o
   328  }
   329  
   330  func (o ProvisionedModelThroughputArrayOutput) Index(i pulumi.IntInput) ProvisionedModelThroughputOutput {
   331  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ProvisionedModelThroughput {
   332  		return vs[0].([]*ProvisionedModelThroughput)[vs[1].(int)]
   333  	}).(ProvisionedModelThroughputOutput)
   334  }
   335  
   336  type ProvisionedModelThroughputMapOutput struct{ *pulumi.OutputState }
   337  
   338  func (ProvisionedModelThroughputMapOutput) ElementType() reflect.Type {
   339  	return reflect.TypeOf((*map[string]*ProvisionedModelThroughput)(nil)).Elem()
   340  }
   341  
   342  func (o ProvisionedModelThroughputMapOutput) ToProvisionedModelThroughputMapOutput() ProvisionedModelThroughputMapOutput {
   343  	return o
   344  }
   345  
   346  func (o ProvisionedModelThroughputMapOutput) ToProvisionedModelThroughputMapOutputWithContext(ctx context.Context) ProvisionedModelThroughputMapOutput {
   347  	return o
   348  }
   349  
   350  func (o ProvisionedModelThroughputMapOutput) MapIndex(k pulumi.StringInput) ProvisionedModelThroughputOutput {
   351  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ProvisionedModelThroughput {
   352  		return vs[0].(map[string]*ProvisionedModelThroughput)[vs[1].(string)]
   353  	}).(ProvisionedModelThroughputOutput)
   354  }
   355  
   356  func init() {
   357  	pulumi.RegisterInputType(reflect.TypeOf((*ProvisionedModelThroughputInput)(nil)).Elem(), &ProvisionedModelThroughput{})
   358  	pulumi.RegisterInputType(reflect.TypeOf((*ProvisionedModelThroughputArrayInput)(nil)).Elem(), ProvisionedModelThroughputArray{})
   359  	pulumi.RegisterInputType(reflect.TypeOf((*ProvisionedModelThroughputMapInput)(nil)).Elem(), ProvisionedModelThroughputMap{})
   360  	pulumi.RegisterOutputType(ProvisionedModelThroughputOutput{})
   361  	pulumi.RegisterOutputType(ProvisionedModelThroughputArrayOutput{})
   362  	pulumi.RegisterOutputType(ProvisionedModelThroughputMapOutput{})
   363  }