github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/opensearch/inboundConnectionAccepter.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  // Manages an [AWS Opensearch Inbound Connection Accepter](https://docs.aws.amazon.com/opensearch-service/latest/APIReference/API_AcceptInboundConnection.html). If connecting domains from different AWS accounts, ensure that the accepter is configured to use the AWS account where the _remote_ opensearch domain exists.
    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"
    28  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/opensearch"
    29  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    30  //
    31  // )
    32  //
    33  //	func main() {
    34  //		pulumi.Run(func(ctx *pulumi.Context) error {
    35  //			current, err := aws.GetCallerIdentity(ctx, nil, nil)
    36  //			if err != nil {
    37  //				return err
    38  //			}
    39  //			currentGetRegion, err := aws.GetRegion(ctx, nil, nil)
    40  //			if err != nil {
    41  //				return err
    42  //			}
    43  //			foo, err := opensearch.NewOutboundConnection(ctx, "foo", &opensearch.OutboundConnectionArgs{
    44  //				ConnectionAlias: pulumi.String("outbound_connection"),
    45  //				LocalDomainInfo: &opensearch.OutboundConnectionLocalDomainInfoArgs{
    46  //					OwnerId:    pulumi.String(current.AccountId),
    47  //					Region:     pulumi.String(currentGetRegion.Name),
    48  //					DomainName: pulumi.Any(localDomain.DomainName),
    49  //				},
    50  //				RemoteDomainInfo: &opensearch.OutboundConnectionRemoteDomainInfoArgs{
    51  //					OwnerId:    pulumi.String(current.AccountId),
    52  //					Region:     pulumi.String(currentGetRegion.Name),
    53  //					DomainName: pulumi.Any(remoteDomain.DomainName),
    54  //				},
    55  //			})
    56  //			if err != nil {
    57  //				return err
    58  //			}
    59  //			_, err = opensearch.NewInboundConnectionAccepter(ctx, "foo", &opensearch.InboundConnectionAccepterArgs{
    60  //				ConnectionId: foo.ID(),
    61  //			})
    62  //			if err != nil {
    63  //				return err
    64  //			}
    65  //			return nil
    66  //		})
    67  //	}
    68  //
    69  // ```
    70  // <!--End PulumiCodeChooser -->
    71  //
    72  // ## Import
    73  //
    74  // Using `pulumi import`, import AWS Opensearch Inbound Connection Accepters using the Inbound Connection ID. For example:
    75  //
    76  // ```sh
    77  // $ pulumi import aws:opensearch/inboundConnectionAccepter:InboundConnectionAccepter foo connection-id
    78  // ```
    79  type InboundConnectionAccepter struct {
    80  	pulumi.CustomResourceState
    81  
    82  	// Specifies the ID of the connection to accept.
    83  	ConnectionId pulumi.StringOutput `pulumi:"connectionId"`
    84  	// Status of the connection request.
    85  	ConnectionStatus pulumi.StringOutput `pulumi:"connectionStatus"`
    86  }
    87  
    88  // NewInboundConnectionAccepter registers a new resource with the given unique name, arguments, and options.
    89  func NewInboundConnectionAccepter(ctx *pulumi.Context,
    90  	name string, args *InboundConnectionAccepterArgs, opts ...pulumi.ResourceOption) (*InboundConnectionAccepter, error) {
    91  	if args == nil {
    92  		return nil, errors.New("missing one or more required arguments")
    93  	}
    94  
    95  	if args.ConnectionId == nil {
    96  		return nil, errors.New("invalid value for required argument 'ConnectionId'")
    97  	}
    98  	opts = internal.PkgResourceDefaultOpts(opts)
    99  	var resource InboundConnectionAccepter
   100  	err := ctx.RegisterResource("aws:opensearch/inboundConnectionAccepter:InboundConnectionAccepter", name, args, &resource, opts...)
   101  	if err != nil {
   102  		return nil, err
   103  	}
   104  	return &resource, nil
   105  }
   106  
   107  // GetInboundConnectionAccepter gets an existing InboundConnectionAccepter resource's state with the given name, ID, and optional
   108  // state properties that are used to uniquely qualify the lookup (nil if not required).
   109  func GetInboundConnectionAccepter(ctx *pulumi.Context,
   110  	name string, id pulumi.IDInput, state *InboundConnectionAccepterState, opts ...pulumi.ResourceOption) (*InboundConnectionAccepter, error) {
   111  	var resource InboundConnectionAccepter
   112  	err := ctx.ReadResource("aws:opensearch/inboundConnectionAccepter:InboundConnectionAccepter", name, id, state, &resource, opts...)
   113  	if err != nil {
   114  		return nil, err
   115  	}
   116  	return &resource, nil
   117  }
   118  
   119  // Input properties used for looking up and filtering InboundConnectionAccepter resources.
   120  type inboundConnectionAccepterState struct {
   121  	// Specifies the ID of the connection to accept.
   122  	ConnectionId *string `pulumi:"connectionId"`
   123  	// Status of the connection request.
   124  	ConnectionStatus *string `pulumi:"connectionStatus"`
   125  }
   126  
   127  type InboundConnectionAccepterState struct {
   128  	// Specifies the ID of the connection to accept.
   129  	ConnectionId pulumi.StringPtrInput
   130  	// Status of the connection request.
   131  	ConnectionStatus pulumi.StringPtrInput
   132  }
   133  
   134  func (InboundConnectionAccepterState) ElementType() reflect.Type {
   135  	return reflect.TypeOf((*inboundConnectionAccepterState)(nil)).Elem()
   136  }
   137  
   138  type inboundConnectionAccepterArgs struct {
   139  	// Specifies the ID of the connection to accept.
   140  	ConnectionId string `pulumi:"connectionId"`
   141  }
   142  
   143  // The set of arguments for constructing a InboundConnectionAccepter resource.
   144  type InboundConnectionAccepterArgs struct {
   145  	// Specifies the ID of the connection to accept.
   146  	ConnectionId pulumi.StringInput
   147  }
   148  
   149  func (InboundConnectionAccepterArgs) ElementType() reflect.Type {
   150  	return reflect.TypeOf((*inboundConnectionAccepterArgs)(nil)).Elem()
   151  }
   152  
   153  type InboundConnectionAccepterInput interface {
   154  	pulumi.Input
   155  
   156  	ToInboundConnectionAccepterOutput() InboundConnectionAccepterOutput
   157  	ToInboundConnectionAccepterOutputWithContext(ctx context.Context) InboundConnectionAccepterOutput
   158  }
   159  
   160  func (*InboundConnectionAccepter) ElementType() reflect.Type {
   161  	return reflect.TypeOf((**InboundConnectionAccepter)(nil)).Elem()
   162  }
   163  
   164  func (i *InboundConnectionAccepter) ToInboundConnectionAccepterOutput() InboundConnectionAccepterOutput {
   165  	return i.ToInboundConnectionAccepterOutputWithContext(context.Background())
   166  }
   167  
   168  func (i *InboundConnectionAccepter) ToInboundConnectionAccepterOutputWithContext(ctx context.Context) InboundConnectionAccepterOutput {
   169  	return pulumi.ToOutputWithContext(ctx, i).(InboundConnectionAccepterOutput)
   170  }
   171  
   172  // InboundConnectionAccepterArrayInput is an input type that accepts InboundConnectionAccepterArray and InboundConnectionAccepterArrayOutput values.
   173  // You can construct a concrete instance of `InboundConnectionAccepterArrayInput` via:
   174  //
   175  //	InboundConnectionAccepterArray{ InboundConnectionAccepterArgs{...} }
   176  type InboundConnectionAccepterArrayInput interface {
   177  	pulumi.Input
   178  
   179  	ToInboundConnectionAccepterArrayOutput() InboundConnectionAccepterArrayOutput
   180  	ToInboundConnectionAccepterArrayOutputWithContext(context.Context) InboundConnectionAccepterArrayOutput
   181  }
   182  
   183  type InboundConnectionAccepterArray []InboundConnectionAccepterInput
   184  
   185  func (InboundConnectionAccepterArray) ElementType() reflect.Type {
   186  	return reflect.TypeOf((*[]*InboundConnectionAccepter)(nil)).Elem()
   187  }
   188  
   189  func (i InboundConnectionAccepterArray) ToInboundConnectionAccepterArrayOutput() InboundConnectionAccepterArrayOutput {
   190  	return i.ToInboundConnectionAccepterArrayOutputWithContext(context.Background())
   191  }
   192  
   193  func (i InboundConnectionAccepterArray) ToInboundConnectionAccepterArrayOutputWithContext(ctx context.Context) InboundConnectionAccepterArrayOutput {
   194  	return pulumi.ToOutputWithContext(ctx, i).(InboundConnectionAccepterArrayOutput)
   195  }
   196  
   197  // InboundConnectionAccepterMapInput is an input type that accepts InboundConnectionAccepterMap and InboundConnectionAccepterMapOutput values.
   198  // You can construct a concrete instance of `InboundConnectionAccepterMapInput` via:
   199  //
   200  //	InboundConnectionAccepterMap{ "key": InboundConnectionAccepterArgs{...} }
   201  type InboundConnectionAccepterMapInput interface {
   202  	pulumi.Input
   203  
   204  	ToInboundConnectionAccepterMapOutput() InboundConnectionAccepterMapOutput
   205  	ToInboundConnectionAccepterMapOutputWithContext(context.Context) InboundConnectionAccepterMapOutput
   206  }
   207  
   208  type InboundConnectionAccepterMap map[string]InboundConnectionAccepterInput
   209  
   210  func (InboundConnectionAccepterMap) ElementType() reflect.Type {
   211  	return reflect.TypeOf((*map[string]*InboundConnectionAccepter)(nil)).Elem()
   212  }
   213  
   214  func (i InboundConnectionAccepterMap) ToInboundConnectionAccepterMapOutput() InboundConnectionAccepterMapOutput {
   215  	return i.ToInboundConnectionAccepterMapOutputWithContext(context.Background())
   216  }
   217  
   218  func (i InboundConnectionAccepterMap) ToInboundConnectionAccepterMapOutputWithContext(ctx context.Context) InboundConnectionAccepterMapOutput {
   219  	return pulumi.ToOutputWithContext(ctx, i).(InboundConnectionAccepterMapOutput)
   220  }
   221  
   222  type InboundConnectionAccepterOutput struct{ *pulumi.OutputState }
   223  
   224  func (InboundConnectionAccepterOutput) ElementType() reflect.Type {
   225  	return reflect.TypeOf((**InboundConnectionAccepter)(nil)).Elem()
   226  }
   227  
   228  func (o InboundConnectionAccepterOutput) ToInboundConnectionAccepterOutput() InboundConnectionAccepterOutput {
   229  	return o
   230  }
   231  
   232  func (o InboundConnectionAccepterOutput) ToInboundConnectionAccepterOutputWithContext(ctx context.Context) InboundConnectionAccepterOutput {
   233  	return o
   234  }
   235  
   236  // Specifies the ID of the connection to accept.
   237  func (o InboundConnectionAccepterOutput) ConnectionId() pulumi.StringOutput {
   238  	return o.ApplyT(func(v *InboundConnectionAccepter) pulumi.StringOutput { return v.ConnectionId }).(pulumi.StringOutput)
   239  }
   240  
   241  // Status of the connection request.
   242  func (o InboundConnectionAccepterOutput) ConnectionStatus() pulumi.StringOutput {
   243  	return o.ApplyT(func(v *InboundConnectionAccepter) pulumi.StringOutput { return v.ConnectionStatus }).(pulumi.StringOutput)
   244  }
   245  
   246  type InboundConnectionAccepterArrayOutput struct{ *pulumi.OutputState }
   247  
   248  func (InboundConnectionAccepterArrayOutput) ElementType() reflect.Type {
   249  	return reflect.TypeOf((*[]*InboundConnectionAccepter)(nil)).Elem()
   250  }
   251  
   252  func (o InboundConnectionAccepterArrayOutput) ToInboundConnectionAccepterArrayOutput() InboundConnectionAccepterArrayOutput {
   253  	return o
   254  }
   255  
   256  func (o InboundConnectionAccepterArrayOutput) ToInboundConnectionAccepterArrayOutputWithContext(ctx context.Context) InboundConnectionAccepterArrayOutput {
   257  	return o
   258  }
   259  
   260  func (o InboundConnectionAccepterArrayOutput) Index(i pulumi.IntInput) InboundConnectionAccepterOutput {
   261  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *InboundConnectionAccepter {
   262  		return vs[0].([]*InboundConnectionAccepter)[vs[1].(int)]
   263  	}).(InboundConnectionAccepterOutput)
   264  }
   265  
   266  type InboundConnectionAccepterMapOutput struct{ *pulumi.OutputState }
   267  
   268  func (InboundConnectionAccepterMapOutput) ElementType() reflect.Type {
   269  	return reflect.TypeOf((*map[string]*InboundConnectionAccepter)(nil)).Elem()
   270  }
   271  
   272  func (o InboundConnectionAccepterMapOutput) ToInboundConnectionAccepterMapOutput() InboundConnectionAccepterMapOutput {
   273  	return o
   274  }
   275  
   276  func (o InboundConnectionAccepterMapOutput) ToInboundConnectionAccepterMapOutputWithContext(ctx context.Context) InboundConnectionAccepterMapOutput {
   277  	return o
   278  }
   279  
   280  func (o InboundConnectionAccepterMapOutput) MapIndex(k pulumi.StringInput) InboundConnectionAccepterOutput {
   281  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *InboundConnectionAccepter {
   282  		return vs[0].(map[string]*InboundConnectionAccepter)[vs[1].(string)]
   283  	}).(InboundConnectionAccepterOutput)
   284  }
   285  
   286  func init() {
   287  	pulumi.RegisterInputType(reflect.TypeOf((*InboundConnectionAccepterInput)(nil)).Elem(), &InboundConnectionAccepter{})
   288  	pulumi.RegisterInputType(reflect.TypeOf((*InboundConnectionAccepterArrayInput)(nil)).Elem(), InboundConnectionAccepterArray{})
   289  	pulumi.RegisterInputType(reflect.TypeOf((*InboundConnectionAccepterMapInput)(nil)).Elem(), InboundConnectionAccepterMap{})
   290  	pulumi.RegisterOutputType(InboundConnectionAccepterOutput{})
   291  	pulumi.RegisterOutputType(InboundConnectionAccepterArrayOutput{})
   292  	pulumi.RegisterOutputType(InboundConnectionAccepterMapOutput{})
   293  }