github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/opensearch/getServerlessVpcEndpoint.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  	"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 OpenSearch Serverless VPC Endpoint.
    15  //
    16  // ## Example Usage
    17  //
    18  // <!--Start PulumiCodeChooser -->
    19  // ```go
    20  // package main
    21  //
    22  // import (
    23  //
    24  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/opensearch"
    25  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    26  //
    27  // )
    28  //
    29  //	func main() {
    30  //		pulumi.Run(func(ctx *pulumi.Context) error {
    31  //			_, err := opensearch.LookupServerlessVpcEndpoint(ctx, &opensearch.LookupServerlessVpcEndpointArgs{
    32  //				VpcEndpointId: "vpce-829a4487959e2a839",
    33  //			}, nil)
    34  //			if err != nil {
    35  //				return err
    36  //			}
    37  //			return nil
    38  //		})
    39  //	}
    40  //
    41  // ```
    42  // <!--End PulumiCodeChooser -->
    43  func LookupServerlessVpcEndpoint(ctx *pulumi.Context, args *LookupServerlessVpcEndpointArgs, opts ...pulumi.InvokeOption) (*LookupServerlessVpcEndpointResult, error) {
    44  	opts = internal.PkgInvokeDefaultOpts(opts)
    45  	var rv LookupServerlessVpcEndpointResult
    46  	err := ctx.Invoke("aws:opensearch/getServerlessVpcEndpoint:getServerlessVpcEndpoint", args, &rv, opts...)
    47  	if err != nil {
    48  		return nil, err
    49  	}
    50  	return &rv, nil
    51  }
    52  
    53  // A collection of arguments for invoking getServerlessVpcEndpoint.
    54  type LookupServerlessVpcEndpointArgs struct {
    55  	// The unique identifier of the endpoint.
    56  	VpcEndpointId string `pulumi:"vpcEndpointId"`
    57  }
    58  
    59  // A collection of values returned by getServerlessVpcEndpoint.
    60  type LookupServerlessVpcEndpointResult struct {
    61  	// The date the endpoint was created.
    62  	CreatedDate string `pulumi:"createdDate"`
    63  	// The provider-assigned unique ID for this managed resource.
    64  	Id string `pulumi:"id"`
    65  	// The name of the endpoint.
    66  	Name string `pulumi:"name"`
    67  	// The IDs of the security groups that define the ports, protocols, and sources for inbound traffic that you are authorizing into your endpoint.
    68  	SecurityGroupIds []string `pulumi:"securityGroupIds"`
    69  	// The IDs of the subnets from which you access OpenSearch Serverless.
    70  	SubnetIds     []string `pulumi:"subnetIds"`
    71  	VpcEndpointId string   `pulumi:"vpcEndpointId"`
    72  	// The ID of the VPC from which you access OpenSearch Serverless.
    73  	VpcId string `pulumi:"vpcId"`
    74  }
    75  
    76  func LookupServerlessVpcEndpointOutput(ctx *pulumi.Context, args LookupServerlessVpcEndpointOutputArgs, opts ...pulumi.InvokeOption) LookupServerlessVpcEndpointResultOutput {
    77  	return pulumi.ToOutputWithContext(context.Background(), args).
    78  		ApplyT(func(v interface{}) (LookupServerlessVpcEndpointResult, error) {
    79  			args := v.(LookupServerlessVpcEndpointArgs)
    80  			r, err := LookupServerlessVpcEndpoint(ctx, &args, opts...)
    81  			var s LookupServerlessVpcEndpointResult
    82  			if r != nil {
    83  				s = *r
    84  			}
    85  			return s, err
    86  		}).(LookupServerlessVpcEndpointResultOutput)
    87  }
    88  
    89  // A collection of arguments for invoking getServerlessVpcEndpoint.
    90  type LookupServerlessVpcEndpointOutputArgs struct {
    91  	// The unique identifier of the endpoint.
    92  	VpcEndpointId pulumi.StringInput `pulumi:"vpcEndpointId"`
    93  }
    94  
    95  func (LookupServerlessVpcEndpointOutputArgs) ElementType() reflect.Type {
    96  	return reflect.TypeOf((*LookupServerlessVpcEndpointArgs)(nil)).Elem()
    97  }
    98  
    99  // A collection of values returned by getServerlessVpcEndpoint.
   100  type LookupServerlessVpcEndpointResultOutput struct{ *pulumi.OutputState }
   101  
   102  func (LookupServerlessVpcEndpointResultOutput) ElementType() reflect.Type {
   103  	return reflect.TypeOf((*LookupServerlessVpcEndpointResult)(nil)).Elem()
   104  }
   105  
   106  func (o LookupServerlessVpcEndpointResultOutput) ToLookupServerlessVpcEndpointResultOutput() LookupServerlessVpcEndpointResultOutput {
   107  	return o
   108  }
   109  
   110  func (o LookupServerlessVpcEndpointResultOutput) ToLookupServerlessVpcEndpointResultOutputWithContext(ctx context.Context) LookupServerlessVpcEndpointResultOutput {
   111  	return o
   112  }
   113  
   114  // The date the endpoint was created.
   115  func (o LookupServerlessVpcEndpointResultOutput) CreatedDate() pulumi.StringOutput {
   116  	return o.ApplyT(func(v LookupServerlessVpcEndpointResult) string { return v.CreatedDate }).(pulumi.StringOutput)
   117  }
   118  
   119  // The provider-assigned unique ID for this managed resource.
   120  func (o LookupServerlessVpcEndpointResultOutput) Id() pulumi.StringOutput {
   121  	return o.ApplyT(func(v LookupServerlessVpcEndpointResult) string { return v.Id }).(pulumi.StringOutput)
   122  }
   123  
   124  // The name of the endpoint.
   125  func (o LookupServerlessVpcEndpointResultOutput) Name() pulumi.StringOutput {
   126  	return o.ApplyT(func(v LookupServerlessVpcEndpointResult) string { return v.Name }).(pulumi.StringOutput)
   127  }
   128  
   129  // The IDs of the security groups that define the ports, protocols, and sources for inbound traffic that you are authorizing into your endpoint.
   130  func (o LookupServerlessVpcEndpointResultOutput) SecurityGroupIds() pulumi.StringArrayOutput {
   131  	return o.ApplyT(func(v LookupServerlessVpcEndpointResult) []string { return v.SecurityGroupIds }).(pulumi.StringArrayOutput)
   132  }
   133  
   134  // The IDs of the subnets from which you access OpenSearch Serverless.
   135  func (o LookupServerlessVpcEndpointResultOutput) SubnetIds() pulumi.StringArrayOutput {
   136  	return o.ApplyT(func(v LookupServerlessVpcEndpointResult) []string { return v.SubnetIds }).(pulumi.StringArrayOutput)
   137  }
   138  
   139  func (o LookupServerlessVpcEndpointResultOutput) VpcEndpointId() pulumi.StringOutput {
   140  	return o.ApplyT(func(v LookupServerlessVpcEndpointResult) string { return v.VpcEndpointId }).(pulumi.StringOutput)
   141  }
   142  
   143  // The ID of the VPC from which you access OpenSearch Serverless.
   144  func (o LookupServerlessVpcEndpointResultOutput) VpcId() pulumi.StringOutput {
   145  	return o.ApplyT(func(v LookupServerlessVpcEndpointResult) string { return v.VpcId }).(pulumi.StringOutput)
   146  }
   147  
   148  func init() {
   149  	pulumi.RegisterOutputType(LookupServerlessVpcEndpointResultOutput{})
   150  }