github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/opensearch/serverlessVpcEndpoint.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 opensearch 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 // Resource for managing an AWS OpenSearchServerless VPC Endpoint. 16 // 17 // ## Example Usage 18 // 19 // ### Basic Usage 20 // 21 // <!--Start PulumiCodeChooser --> 22 // ```go 23 // package main 24 // 25 // import ( 26 // 27 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/opensearch" 28 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 29 // 30 // ) 31 // 32 // func main() { 33 // pulumi.Run(func(ctx *pulumi.Context) error { 34 // _, err := opensearch.NewServerlessVpcEndpoint(ctx, "example", &opensearch.ServerlessVpcEndpointArgs{ 35 // Name: pulumi.String("myendpoint"), 36 // SubnetIds: pulumi.StringArray{ 37 // exampleAwsSubnet.Id, 38 // }, 39 // VpcId: pulumi.Any(exampleAwsVpc.Id), 40 // }) 41 // if err != nil { 42 // return err 43 // } 44 // return nil 45 // }) 46 // } 47 // 48 // ``` 49 // <!--End PulumiCodeChooser --> 50 // 51 // ## Import 52 // 53 // Using `pulumi import`, import OpenSearchServerless Vpc Endpointa using the `id`. For example: 54 // 55 // ```sh 56 // $ pulumi import aws:opensearch/serverlessVpcEndpoint:ServerlessVpcEndpoint example vpce-8012925589 57 // ``` 58 type ServerlessVpcEndpoint struct { 59 pulumi.CustomResourceState 60 61 // Name of the interface endpoint. 62 Name pulumi.StringOutput `pulumi:"name"` 63 // One or more security groups that define the ports, protocols, and sources for inbound traffic that you are authorizing into your endpoint. Up to 5 security groups can be provided. 64 SecurityGroupIds pulumi.StringArrayOutput `pulumi:"securityGroupIds"` 65 // One or more subnet IDs from which you'll access OpenSearch Serverless. Up to 6 subnets can be provided. 66 SubnetIds pulumi.StringArrayOutput `pulumi:"subnetIds"` 67 Timeouts ServerlessVpcEndpointTimeoutsPtrOutput `pulumi:"timeouts"` 68 // ID of the VPC from which you'll access OpenSearch Serverless. 69 // 70 // The following arguments are optional: 71 VpcId pulumi.StringOutput `pulumi:"vpcId"` 72 } 73 74 // NewServerlessVpcEndpoint registers a new resource with the given unique name, arguments, and options. 75 func NewServerlessVpcEndpoint(ctx *pulumi.Context, 76 name string, args *ServerlessVpcEndpointArgs, opts ...pulumi.ResourceOption) (*ServerlessVpcEndpoint, error) { 77 if args == nil { 78 return nil, errors.New("missing one or more required arguments") 79 } 80 81 if args.SubnetIds == nil { 82 return nil, errors.New("invalid value for required argument 'SubnetIds'") 83 } 84 if args.VpcId == nil { 85 return nil, errors.New("invalid value for required argument 'VpcId'") 86 } 87 opts = internal.PkgResourceDefaultOpts(opts) 88 var resource ServerlessVpcEndpoint 89 err := ctx.RegisterResource("aws:opensearch/serverlessVpcEndpoint:ServerlessVpcEndpoint", name, args, &resource, opts...) 90 if err != nil { 91 return nil, err 92 } 93 return &resource, nil 94 } 95 96 // GetServerlessVpcEndpoint gets an existing ServerlessVpcEndpoint resource's state with the given name, ID, and optional 97 // state properties that are used to uniquely qualify the lookup (nil if not required). 98 func GetServerlessVpcEndpoint(ctx *pulumi.Context, 99 name string, id pulumi.IDInput, state *ServerlessVpcEndpointState, opts ...pulumi.ResourceOption) (*ServerlessVpcEndpoint, error) { 100 var resource ServerlessVpcEndpoint 101 err := ctx.ReadResource("aws:opensearch/serverlessVpcEndpoint:ServerlessVpcEndpoint", name, id, state, &resource, opts...) 102 if err != nil { 103 return nil, err 104 } 105 return &resource, nil 106 } 107 108 // Input properties used for looking up and filtering ServerlessVpcEndpoint resources. 109 type serverlessVpcEndpointState struct { 110 // Name of the interface endpoint. 111 Name *string `pulumi:"name"` 112 // One or more security groups that define the ports, protocols, and sources for inbound traffic that you are authorizing into your endpoint. Up to 5 security groups can be provided. 113 SecurityGroupIds []string `pulumi:"securityGroupIds"` 114 // One or more subnet IDs from which you'll access OpenSearch Serverless. Up to 6 subnets can be provided. 115 SubnetIds []string `pulumi:"subnetIds"` 116 Timeouts *ServerlessVpcEndpointTimeouts `pulumi:"timeouts"` 117 // ID of the VPC from which you'll access OpenSearch Serverless. 118 // 119 // The following arguments are optional: 120 VpcId *string `pulumi:"vpcId"` 121 } 122 123 type ServerlessVpcEndpointState struct { 124 // Name of the interface endpoint. 125 Name pulumi.StringPtrInput 126 // One or more security groups that define the ports, protocols, and sources for inbound traffic that you are authorizing into your endpoint. Up to 5 security groups can be provided. 127 SecurityGroupIds pulumi.StringArrayInput 128 // One or more subnet IDs from which you'll access OpenSearch Serverless. Up to 6 subnets can be provided. 129 SubnetIds pulumi.StringArrayInput 130 Timeouts ServerlessVpcEndpointTimeoutsPtrInput 131 // ID of the VPC from which you'll access OpenSearch Serverless. 132 // 133 // The following arguments are optional: 134 VpcId pulumi.StringPtrInput 135 } 136 137 func (ServerlessVpcEndpointState) ElementType() reflect.Type { 138 return reflect.TypeOf((*serverlessVpcEndpointState)(nil)).Elem() 139 } 140 141 type serverlessVpcEndpointArgs struct { 142 // Name of the interface endpoint. 143 Name *string `pulumi:"name"` 144 // One or more security groups that define the ports, protocols, and sources for inbound traffic that you are authorizing into your endpoint. Up to 5 security groups can be provided. 145 SecurityGroupIds []string `pulumi:"securityGroupIds"` 146 // One or more subnet IDs from which you'll access OpenSearch Serverless. Up to 6 subnets can be provided. 147 SubnetIds []string `pulumi:"subnetIds"` 148 Timeouts *ServerlessVpcEndpointTimeouts `pulumi:"timeouts"` 149 // ID of the VPC from which you'll access OpenSearch Serverless. 150 // 151 // The following arguments are optional: 152 VpcId string `pulumi:"vpcId"` 153 } 154 155 // The set of arguments for constructing a ServerlessVpcEndpoint resource. 156 type ServerlessVpcEndpointArgs struct { 157 // Name of the interface endpoint. 158 Name pulumi.StringPtrInput 159 // One or more security groups that define the ports, protocols, and sources for inbound traffic that you are authorizing into your endpoint. Up to 5 security groups can be provided. 160 SecurityGroupIds pulumi.StringArrayInput 161 // One or more subnet IDs from which you'll access OpenSearch Serverless. Up to 6 subnets can be provided. 162 SubnetIds pulumi.StringArrayInput 163 Timeouts ServerlessVpcEndpointTimeoutsPtrInput 164 // ID of the VPC from which you'll access OpenSearch Serverless. 165 // 166 // The following arguments are optional: 167 VpcId pulumi.StringInput 168 } 169 170 func (ServerlessVpcEndpointArgs) ElementType() reflect.Type { 171 return reflect.TypeOf((*serverlessVpcEndpointArgs)(nil)).Elem() 172 } 173 174 type ServerlessVpcEndpointInput interface { 175 pulumi.Input 176 177 ToServerlessVpcEndpointOutput() ServerlessVpcEndpointOutput 178 ToServerlessVpcEndpointOutputWithContext(ctx context.Context) ServerlessVpcEndpointOutput 179 } 180 181 func (*ServerlessVpcEndpoint) ElementType() reflect.Type { 182 return reflect.TypeOf((**ServerlessVpcEndpoint)(nil)).Elem() 183 } 184 185 func (i *ServerlessVpcEndpoint) ToServerlessVpcEndpointOutput() ServerlessVpcEndpointOutput { 186 return i.ToServerlessVpcEndpointOutputWithContext(context.Background()) 187 } 188 189 func (i *ServerlessVpcEndpoint) ToServerlessVpcEndpointOutputWithContext(ctx context.Context) ServerlessVpcEndpointOutput { 190 return pulumi.ToOutputWithContext(ctx, i).(ServerlessVpcEndpointOutput) 191 } 192 193 // ServerlessVpcEndpointArrayInput is an input type that accepts ServerlessVpcEndpointArray and ServerlessVpcEndpointArrayOutput values. 194 // You can construct a concrete instance of `ServerlessVpcEndpointArrayInput` via: 195 // 196 // ServerlessVpcEndpointArray{ ServerlessVpcEndpointArgs{...} } 197 type ServerlessVpcEndpointArrayInput interface { 198 pulumi.Input 199 200 ToServerlessVpcEndpointArrayOutput() ServerlessVpcEndpointArrayOutput 201 ToServerlessVpcEndpointArrayOutputWithContext(context.Context) ServerlessVpcEndpointArrayOutput 202 } 203 204 type ServerlessVpcEndpointArray []ServerlessVpcEndpointInput 205 206 func (ServerlessVpcEndpointArray) ElementType() reflect.Type { 207 return reflect.TypeOf((*[]*ServerlessVpcEndpoint)(nil)).Elem() 208 } 209 210 func (i ServerlessVpcEndpointArray) ToServerlessVpcEndpointArrayOutput() ServerlessVpcEndpointArrayOutput { 211 return i.ToServerlessVpcEndpointArrayOutputWithContext(context.Background()) 212 } 213 214 func (i ServerlessVpcEndpointArray) ToServerlessVpcEndpointArrayOutputWithContext(ctx context.Context) ServerlessVpcEndpointArrayOutput { 215 return pulumi.ToOutputWithContext(ctx, i).(ServerlessVpcEndpointArrayOutput) 216 } 217 218 // ServerlessVpcEndpointMapInput is an input type that accepts ServerlessVpcEndpointMap and ServerlessVpcEndpointMapOutput values. 219 // You can construct a concrete instance of `ServerlessVpcEndpointMapInput` via: 220 // 221 // ServerlessVpcEndpointMap{ "key": ServerlessVpcEndpointArgs{...} } 222 type ServerlessVpcEndpointMapInput interface { 223 pulumi.Input 224 225 ToServerlessVpcEndpointMapOutput() ServerlessVpcEndpointMapOutput 226 ToServerlessVpcEndpointMapOutputWithContext(context.Context) ServerlessVpcEndpointMapOutput 227 } 228 229 type ServerlessVpcEndpointMap map[string]ServerlessVpcEndpointInput 230 231 func (ServerlessVpcEndpointMap) ElementType() reflect.Type { 232 return reflect.TypeOf((*map[string]*ServerlessVpcEndpoint)(nil)).Elem() 233 } 234 235 func (i ServerlessVpcEndpointMap) ToServerlessVpcEndpointMapOutput() ServerlessVpcEndpointMapOutput { 236 return i.ToServerlessVpcEndpointMapOutputWithContext(context.Background()) 237 } 238 239 func (i ServerlessVpcEndpointMap) ToServerlessVpcEndpointMapOutputWithContext(ctx context.Context) ServerlessVpcEndpointMapOutput { 240 return pulumi.ToOutputWithContext(ctx, i).(ServerlessVpcEndpointMapOutput) 241 } 242 243 type ServerlessVpcEndpointOutput struct{ *pulumi.OutputState } 244 245 func (ServerlessVpcEndpointOutput) ElementType() reflect.Type { 246 return reflect.TypeOf((**ServerlessVpcEndpoint)(nil)).Elem() 247 } 248 249 func (o ServerlessVpcEndpointOutput) ToServerlessVpcEndpointOutput() ServerlessVpcEndpointOutput { 250 return o 251 } 252 253 func (o ServerlessVpcEndpointOutput) ToServerlessVpcEndpointOutputWithContext(ctx context.Context) ServerlessVpcEndpointOutput { 254 return o 255 } 256 257 // Name of the interface endpoint. 258 func (o ServerlessVpcEndpointOutput) Name() pulumi.StringOutput { 259 return o.ApplyT(func(v *ServerlessVpcEndpoint) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput) 260 } 261 262 // One or more security groups that define the ports, protocols, and sources for inbound traffic that you are authorizing into your endpoint. Up to 5 security groups can be provided. 263 func (o ServerlessVpcEndpointOutput) SecurityGroupIds() pulumi.StringArrayOutput { 264 return o.ApplyT(func(v *ServerlessVpcEndpoint) pulumi.StringArrayOutput { return v.SecurityGroupIds }).(pulumi.StringArrayOutput) 265 } 266 267 // One or more subnet IDs from which you'll access OpenSearch Serverless. Up to 6 subnets can be provided. 268 func (o ServerlessVpcEndpointOutput) SubnetIds() pulumi.StringArrayOutput { 269 return o.ApplyT(func(v *ServerlessVpcEndpoint) pulumi.StringArrayOutput { return v.SubnetIds }).(pulumi.StringArrayOutput) 270 } 271 272 func (o ServerlessVpcEndpointOutput) Timeouts() ServerlessVpcEndpointTimeoutsPtrOutput { 273 return o.ApplyT(func(v *ServerlessVpcEndpoint) ServerlessVpcEndpointTimeoutsPtrOutput { return v.Timeouts }).(ServerlessVpcEndpointTimeoutsPtrOutput) 274 } 275 276 // ID of the VPC from which you'll access OpenSearch Serverless. 277 // 278 // The following arguments are optional: 279 func (o ServerlessVpcEndpointOutput) VpcId() pulumi.StringOutput { 280 return o.ApplyT(func(v *ServerlessVpcEndpoint) pulumi.StringOutput { return v.VpcId }).(pulumi.StringOutput) 281 } 282 283 type ServerlessVpcEndpointArrayOutput struct{ *pulumi.OutputState } 284 285 func (ServerlessVpcEndpointArrayOutput) ElementType() reflect.Type { 286 return reflect.TypeOf((*[]*ServerlessVpcEndpoint)(nil)).Elem() 287 } 288 289 func (o ServerlessVpcEndpointArrayOutput) ToServerlessVpcEndpointArrayOutput() ServerlessVpcEndpointArrayOutput { 290 return o 291 } 292 293 func (o ServerlessVpcEndpointArrayOutput) ToServerlessVpcEndpointArrayOutputWithContext(ctx context.Context) ServerlessVpcEndpointArrayOutput { 294 return o 295 } 296 297 func (o ServerlessVpcEndpointArrayOutput) Index(i pulumi.IntInput) ServerlessVpcEndpointOutput { 298 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ServerlessVpcEndpoint { 299 return vs[0].([]*ServerlessVpcEndpoint)[vs[1].(int)] 300 }).(ServerlessVpcEndpointOutput) 301 } 302 303 type ServerlessVpcEndpointMapOutput struct{ *pulumi.OutputState } 304 305 func (ServerlessVpcEndpointMapOutput) ElementType() reflect.Type { 306 return reflect.TypeOf((*map[string]*ServerlessVpcEndpoint)(nil)).Elem() 307 } 308 309 func (o ServerlessVpcEndpointMapOutput) ToServerlessVpcEndpointMapOutput() ServerlessVpcEndpointMapOutput { 310 return o 311 } 312 313 func (o ServerlessVpcEndpointMapOutput) ToServerlessVpcEndpointMapOutputWithContext(ctx context.Context) ServerlessVpcEndpointMapOutput { 314 return o 315 } 316 317 func (o ServerlessVpcEndpointMapOutput) MapIndex(k pulumi.StringInput) ServerlessVpcEndpointOutput { 318 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ServerlessVpcEndpoint { 319 return vs[0].(map[string]*ServerlessVpcEndpoint)[vs[1].(string)] 320 }).(ServerlessVpcEndpointOutput) 321 } 322 323 func init() { 324 pulumi.RegisterInputType(reflect.TypeOf((*ServerlessVpcEndpointInput)(nil)).Elem(), &ServerlessVpcEndpoint{}) 325 pulumi.RegisterInputType(reflect.TypeOf((*ServerlessVpcEndpointArrayInput)(nil)).Elem(), ServerlessVpcEndpointArray{}) 326 pulumi.RegisterInputType(reflect.TypeOf((*ServerlessVpcEndpointMapInput)(nil)).Elem(), ServerlessVpcEndpointMap{}) 327 pulumi.RegisterOutputType(ServerlessVpcEndpointOutput{}) 328 pulumi.RegisterOutputType(ServerlessVpcEndpointArrayOutput{}) 329 pulumi.RegisterOutputType(ServerlessVpcEndpointMapOutput{}) 330 }