github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/bedrockfoundation/getModel.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 bedrockfoundation 5 6 import ( 7 "context" 8 "reflect" 9 10 "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" 11 "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 12 ) 13 14 // Data source for managing an AWS Bedrock Foundation Model. 15 // 16 // ## Example Usage 17 // 18 // ### Basic Usage 19 // 20 // <!--Start PulumiCodeChooser --> 21 // ```go 22 // package main 23 // 24 // import ( 25 // 26 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/bedrockfoundation" 27 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 28 // 29 // ) 30 // 31 // func main() { 32 // pulumi.Run(func(ctx *pulumi.Context) error { 33 // test, err := bedrockfoundation.GetModels(ctx, nil, nil) 34 // if err != nil { 35 // return err 36 // } 37 // _, err = bedrockfoundation.GetModel(ctx, &bedrockfoundation.GetModelArgs{ 38 // ModelId: test.ModelSummaries[0].ModelId, 39 // }, nil) 40 // if err != nil { 41 // return err 42 // } 43 // return nil 44 // }) 45 // } 46 // 47 // ``` 48 // <!--End PulumiCodeChooser --> 49 func GetModel(ctx *pulumi.Context, args *GetModelArgs, opts ...pulumi.InvokeOption) (*GetModelResult, error) { 50 opts = internal.PkgInvokeDefaultOpts(opts) 51 var rv GetModelResult 52 err := ctx.Invoke("aws:bedrockfoundation/getModel:getModel", args, &rv, opts...) 53 if err != nil { 54 return nil, err 55 } 56 return &rv, nil 57 } 58 59 // A collection of arguments for invoking getModel. 60 type GetModelArgs struct { 61 // Model identifier. 62 ModelId string `pulumi:"modelId"` 63 } 64 65 // A collection of values returned by getModel. 66 type GetModelResult struct { 67 // Customizations that the model supports. 68 CustomizationsSupporteds []string `pulumi:"customizationsSupporteds"` 69 Id string `pulumi:"id"` 70 // Inference types that the model supports. 71 InferenceTypesSupporteds []string `pulumi:"inferenceTypesSupporteds"` 72 // Input modalities that the model supports. 73 InputModalities []string `pulumi:"inputModalities"` 74 // Model ARN. 75 ModelArn string `pulumi:"modelArn"` 76 ModelId string `pulumi:"modelId"` 77 // Model name. 78 ModelName string `pulumi:"modelName"` 79 // Output modalities that the model supports. 80 OutputModalities []string `pulumi:"outputModalities"` 81 // Model provider name. 82 ProviderName string `pulumi:"providerName"` 83 // Indicates whether the model supports streaming. 84 ResponseStreamingSupported bool `pulumi:"responseStreamingSupported"` 85 } 86 87 func GetModelOutput(ctx *pulumi.Context, args GetModelOutputArgs, opts ...pulumi.InvokeOption) GetModelResultOutput { 88 return pulumi.ToOutputWithContext(context.Background(), args). 89 ApplyT(func(v interface{}) (GetModelResult, error) { 90 args := v.(GetModelArgs) 91 r, err := GetModel(ctx, &args, opts...) 92 var s GetModelResult 93 if r != nil { 94 s = *r 95 } 96 return s, err 97 }).(GetModelResultOutput) 98 } 99 100 // A collection of arguments for invoking getModel. 101 type GetModelOutputArgs struct { 102 // Model identifier. 103 ModelId pulumi.StringInput `pulumi:"modelId"` 104 } 105 106 func (GetModelOutputArgs) ElementType() reflect.Type { 107 return reflect.TypeOf((*GetModelArgs)(nil)).Elem() 108 } 109 110 // A collection of values returned by getModel. 111 type GetModelResultOutput struct{ *pulumi.OutputState } 112 113 func (GetModelResultOutput) ElementType() reflect.Type { 114 return reflect.TypeOf((*GetModelResult)(nil)).Elem() 115 } 116 117 func (o GetModelResultOutput) ToGetModelResultOutput() GetModelResultOutput { 118 return o 119 } 120 121 func (o GetModelResultOutput) ToGetModelResultOutputWithContext(ctx context.Context) GetModelResultOutput { 122 return o 123 } 124 125 // Customizations that the model supports. 126 func (o GetModelResultOutput) CustomizationsSupporteds() pulumi.StringArrayOutput { 127 return o.ApplyT(func(v GetModelResult) []string { return v.CustomizationsSupporteds }).(pulumi.StringArrayOutput) 128 } 129 130 func (o GetModelResultOutput) Id() pulumi.StringOutput { 131 return o.ApplyT(func(v GetModelResult) string { return v.Id }).(pulumi.StringOutput) 132 } 133 134 // Inference types that the model supports. 135 func (o GetModelResultOutput) InferenceTypesSupporteds() pulumi.StringArrayOutput { 136 return o.ApplyT(func(v GetModelResult) []string { return v.InferenceTypesSupporteds }).(pulumi.StringArrayOutput) 137 } 138 139 // Input modalities that the model supports. 140 func (o GetModelResultOutput) InputModalities() pulumi.StringArrayOutput { 141 return o.ApplyT(func(v GetModelResult) []string { return v.InputModalities }).(pulumi.StringArrayOutput) 142 } 143 144 // Model ARN. 145 func (o GetModelResultOutput) ModelArn() pulumi.StringOutput { 146 return o.ApplyT(func(v GetModelResult) string { return v.ModelArn }).(pulumi.StringOutput) 147 } 148 149 func (o GetModelResultOutput) ModelId() pulumi.StringOutput { 150 return o.ApplyT(func(v GetModelResult) string { return v.ModelId }).(pulumi.StringOutput) 151 } 152 153 // Model name. 154 func (o GetModelResultOutput) ModelName() pulumi.StringOutput { 155 return o.ApplyT(func(v GetModelResult) string { return v.ModelName }).(pulumi.StringOutput) 156 } 157 158 // Output modalities that the model supports. 159 func (o GetModelResultOutput) OutputModalities() pulumi.StringArrayOutput { 160 return o.ApplyT(func(v GetModelResult) []string { return v.OutputModalities }).(pulumi.StringArrayOutput) 161 } 162 163 // Model provider name. 164 func (o GetModelResultOutput) ProviderName() pulumi.StringOutput { 165 return o.ApplyT(func(v GetModelResult) string { return v.ProviderName }).(pulumi.StringOutput) 166 } 167 168 // Indicates whether the model supports streaming. 169 func (o GetModelResultOutput) ResponseStreamingSupported() pulumi.BoolOutput { 170 return o.ApplyT(func(v GetModelResult) bool { return v.ResponseStreamingSupported }).(pulumi.BoolOutput) 171 } 172 173 func init() { 174 pulumi.RegisterOutputType(GetModelResultOutput{}) 175 }