github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/neptune/clusterEndpoint.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 neptune
     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  // Provides an Neptune Cluster Endpoint Resource.
    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/neptune"
    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 := neptune.NewClusterEndpoint(ctx, "example", &neptune.ClusterEndpointArgs{
    33  //				ClusterIdentifier:         pulumi.Any(test.ClusterIdentifier),
    34  //				ClusterEndpointIdentifier: pulumi.String("example"),
    35  //				EndpointType:              pulumi.String("READER"),
    36  //			})
    37  //			if err != nil {
    38  //				return err
    39  //			}
    40  //			return nil
    41  //		})
    42  //	}
    43  //
    44  // ```
    45  // <!--End PulumiCodeChooser -->
    46  //
    47  // ## Import
    48  //
    49  // Using `pulumi import`, import `aws_neptune_cluster_endpoint` using the `cluster-identifier:endpoint-identfier`. For example:
    50  //
    51  // ```sh
    52  // $ pulumi import aws:neptune/clusterEndpoint:ClusterEndpoint example my-cluster:my-endpoint
    53  // ```
    54  type ClusterEndpoint struct {
    55  	pulumi.CustomResourceState
    56  
    57  	// The Neptune Cluster Endpoint Amazon Resource Name (ARN).
    58  	Arn pulumi.StringOutput `pulumi:"arn"`
    59  	// The identifier of the endpoint.
    60  	ClusterEndpointIdentifier pulumi.StringOutput `pulumi:"clusterEndpointIdentifier"`
    61  	// The DB cluster identifier of the DB cluster associated with the endpoint.
    62  	ClusterIdentifier pulumi.StringOutput `pulumi:"clusterIdentifier"`
    63  	// The DNS address of the endpoint.
    64  	Endpoint pulumi.StringOutput `pulumi:"endpoint"`
    65  	// The type of the endpoint. One of: `READER`, `WRITER`, `ANY`.
    66  	EndpointType pulumi.StringOutput `pulumi:"endpointType"`
    67  	// List of DB instance identifiers that aren't part of the custom endpoint group. All other eligible instances are reachable through the custom endpoint. Only relevant if the list of static members is empty.
    68  	ExcludedMembers pulumi.StringArrayOutput `pulumi:"excludedMembers"`
    69  	// List of DB instance identifiers that are part of the custom endpoint group.
    70  	StaticMembers pulumi.StringArrayOutput `pulumi:"staticMembers"`
    71  	// A map of tags to assign to the Neptune cluster. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    72  	Tags pulumi.StringMapOutput `pulumi:"tags"`
    73  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
    74  	//
    75  	// Deprecated: Please use `tags` instead.
    76  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
    77  }
    78  
    79  // NewClusterEndpoint registers a new resource with the given unique name, arguments, and options.
    80  func NewClusterEndpoint(ctx *pulumi.Context,
    81  	name string, args *ClusterEndpointArgs, opts ...pulumi.ResourceOption) (*ClusterEndpoint, error) {
    82  	if args == nil {
    83  		return nil, errors.New("missing one or more required arguments")
    84  	}
    85  
    86  	if args.ClusterEndpointIdentifier == nil {
    87  		return nil, errors.New("invalid value for required argument 'ClusterEndpointIdentifier'")
    88  	}
    89  	if args.ClusterIdentifier == nil {
    90  		return nil, errors.New("invalid value for required argument 'ClusterIdentifier'")
    91  	}
    92  	if args.EndpointType == nil {
    93  		return nil, errors.New("invalid value for required argument 'EndpointType'")
    94  	}
    95  	opts = internal.PkgResourceDefaultOpts(opts)
    96  	var resource ClusterEndpoint
    97  	err := ctx.RegisterResource("aws:neptune/clusterEndpoint:ClusterEndpoint", name, args, &resource, opts...)
    98  	if err != nil {
    99  		return nil, err
   100  	}
   101  	return &resource, nil
   102  }
   103  
   104  // GetClusterEndpoint gets an existing ClusterEndpoint resource's state with the given name, ID, and optional
   105  // state properties that are used to uniquely qualify the lookup (nil if not required).
   106  func GetClusterEndpoint(ctx *pulumi.Context,
   107  	name string, id pulumi.IDInput, state *ClusterEndpointState, opts ...pulumi.ResourceOption) (*ClusterEndpoint, error) {
   108  	var resource ClusterEndpoint
   109  	err := ctx.ReadResource("aws:neptune/clusterEndpoint:ClusterEndpoint", name, id, state, &resource, opts...)
   110  	if err != nil {
   111  		return nil, err
   112  	}
   113  	return &resource, nil
   114  }
   115  
   116  // Input properties used for looking up and filtering ClusterEndpoint resources.
   117  type clusterEndpointState struct {
   118  	// The Neptune Cluster Endpoint Amazon Resource Name (ARN).
   119  	Arn *string `pulumi:"arn"`
   120  	// The identifier of the endpoint.
   121  	ClusterEndpointIdentifier *string `pulumi:"clusterEndpointIdentifier"`
   122  	// The DB cluster identifier of the DB cluster associated with the endpoint.
   123  	ClusterIdentifier *string `pulumi:"clusterIdentifier"`
   124  	// The DNS address of the endpoint.
   125  	Endpoint *string `pulumi:"endpoint"`
   126  	// The type of the endpoint. One of: `READER`, `WRITER`, `ANY`.
   127  	EndpointType *string `pulumi:"endpointType"`
   128  	// List of DB instance identifiers that aren't part of the custom endpoint group. All other eligible instances are reachable through the custom endpoint. Only relevant if the list of static members is empty.
   129  	ExcludedMembers []string `pulumi:"excludedMembers"`
   130  	// List of DB instance identifiers that are part of the custom endpoint group.
   131  	StaticMembers []string `pulumi:"staticMembers"`
   132  	// A map of tags to assign to the Neptune cluster. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   133  	Tags map[string]string `pulumi:"tags"`
   134  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   135  	//
   136  	// Deprecated: Please use `tags` instead.
   137  	TagsAll map[string]string `pulumi:"tagsAll"`
   138  }
   139  
   140  type ClusterEndpointState struct {
   141  	// The Neptune Cluster Endpoint Amazon Resource Name (ARN).
   142  	Arn pulumi.StringPtrInput
   143  	// The identifier of the endpoint.
   144  	ClusterEndpointIdentifier pulumi.StringPtrInput
   145  	// The DB cluster identifier of the DB cluster associated with the endpoint.
   146  	ClusterIdentifier pulumi.StringPtrInput
   147  	// The DNS address of the endpoint.
   148  	Endpoint pulumi.StringPtrInput
   149  	// The type of the endpoint. One of: `READER`, `WRITER`, `ANY`.
   150  	EndpointType pulumi.StringPtrInput
   151  	// List of DB instance identifiers that aren't part of the custom endpoint group. All other eligible instances are reachable through the custom endpoint. Only relevant if the list of static members is empty.
   152  	ExcludedMembers pulumi.StringArrayInput
   153  	// List of DB instance identifiers that are part of the custom endpoint group.
   154  	StaticMembers pulumi.StringArrayInput
   155  	// A map of tags to assign to the Neptune cluster. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   156  	Tags pulumi.StringMapInput
   157  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   158  	//
   159  	// Deprecated: Please use `tags` instead.
   160  	TagsAll pulumi.StringMapInput
   161  }
   162  
   163  func (ClusterEndpointState) ElementType() reflect.Type {
   164  	return reflect.TypeOf((*clusterEndpointState)(nil)).Elem()
   165  }
   166  
   167  type clusterEndpointArgs struct {
   168  	// The identifier of the endpoint.
   169  	ClusterEndpointIdentifier string `pulumi:"clusterEndpointIdentifier"`
   170  	// The DB cluster identifier of the DB cluster associated with the endpoint.
   171  	ClusterIdentifier string `pulumi:"clusterIdentifier"`
   172  	// The type of the endpoint. One of: `READER`, `WRITER`, `ANY`.
   173  	EndpointType string `pulumi:"endpointType"`
   174  	// List of DB instance identifiers that aren't part of the custom endpoint group. All other eligible instances are reachable through the custom endpoint. Only relevant if the list of static members is empty.
   175  	ExcludedMembers []string `pulumi:"excludedMembers"`
   176  	// List of DB instance identifiers that are part of the custom endpoint group.
   177  	StaticMembers []string `pulumi:"staticMembers"`
   178  	// A map of tags to assign to the Neptune cluster. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   179  	Tags map[string]string `pulumi:"tags"`
   180  }
   181  
   182  // The set of arguments for constructing a ClusterEndpoint resource.
   183  type ClusterEndpointArgs struct {
   184  	// The identifier of the endpoint.
   185  	ClusterEndpointIdentifier pulumi.StringInput
   186  	// The DB cluster identifier of the DB cluster associated with the endpoint.
   187  	ClusterIdentifier pulumi.StringInput
   188  	// The type of the endpoint. One of: `READER`, `WRITER`, `ANY`.
   189  	EndpointType pulumi.StringInput
   190  	// List of DB instance identifiers that aren't part of the custom endpoint group. All other eligible instances are reachable through the custom endpoint. Only relevant if the list of static members is empty.
   191  	ExcludedMembers pulumi.StringArrayInput
   192  	// List of DB instance identifiers that are part of the custom endpoint group.
   193  	StaticMembers pulumi.StringArrayInput
   194  	// A map of tags to assign to the Neptune cluster. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   195  	Tags pulumi.StringMapInput
   196  }
   197  
   198  func (ClusterEndpointArgs) ElementType() reflect.Type {
   199  	return reflect.TypeOf((*clusterEndpointArgs)(nil)).Elem()
   200  }
   201  
   202  type ClusterEndpointInput interface {
   203  	pulumi.Input
   204  
   205  	ToClusterEndpointOutput() ClusterEndpointOutput
   206  	ToClusterEndpointOutputWithContext(ctx context.Context) ClusterEndpointOutput
   207  }
   208  
   209  func (*ClusterEndpoint) ElementType() reflect.Type {
   210  	return reflect.TypeOf((**ClusterEndpoint)(nil)).Elem()
   211  }
   212  
   213  func (i *ClusterEndpoint) ToClusterEndpointOutput() ClusterEndpointOutput {
   214  	return i.ToClusterEndpointOutputWithContext(context.Background())
   215  }
   216  
   217  func (i *ClusterEndpoint) ToClusterEndpointOutputWithContext(ctx context.Context) ClusterEndpointOutput {
   218  	return pulumi.ToOutputWithContext(ctx, i).(ClusterEndpointOutput)
   219  }
   220  
   221  // ClusterEndpointArrayInput is an input type that accepts ClusterEndpointArray and ClusterEndpointArrayOutput values.
   222  // You can construct a concrete instance of `ClusterEndpointArrayInput` via:
   223  //
   224  //	ClusterEndpointArray{ ClusterEndpointArgs{...} }
   225  type ClusterEndpointArrayInput interface {
   226  	pulumi.Input
   227  
   228  	ToClusterEndpointArrayOutput() ClusterEndpointArrayOutput
   229  	ToClusterEndpointArrayOutputWithContext(context.Context) ClusterEndpointArrayOutput
   230  }
   231  
   232  type ClusterEndpointArray []ClusterEndpointInput
   233  
   234  func (ClusterEndpointArray) ElementType() reflect.Type {
   235  	return reflect.TypeOf((*[]*ClusterEndpoint)(nil)).Elem()
   236  }
   237  
   238  func (i ClusterEndpointArray) ToClusterEndpointArrayOutput() ClusterEndpointArrayOutput {
   239  	return i.ToClusterEndpointArrayOutputWithContext(context.Background())
   240  }
   241  
   242  func (i ClusterEndpointArray) ToClusterEndpointArrayOutputWithContext(ctx context.Context) ClusterEndpointArrayOutput {
   243  	return pulumi.ToOutputWithContext(ctx, i).(ClusterEndpointArrayOutput)
   244  }
   245  
   246  // ClusterEndpointMapInput is an input type that accepts ClusterEndpointMap and ClusterEndpointMapOutput values.
   247  // You can construct a concrete instance of `ClusterEndpointMapInput` via:
   248  //
   249  //	ClusterEndpointMap{ "key": ClusterEndpointArgs{...} }
   250  type ClusterEndpointMapInput interface {
   251  	pulumi.Input
   252  
   253  	ToClusterEndpointMapOutput() ClusterEndpointMapOutput
   254  	ToClusterEndpointMapOutputWithContext(context.Context) ClusterEndpointMapOutput
   255  }
   256  
   257  type ClusterEndpointMap map[string]ClusterEndpointInput
   258  
   259  func (ClusterEndpointMap) ElementType() reflect.Type {
   260  	return reflect.TypeOf((*map[string]*ClusterEndpoint)(nil)).Elem()
   261  }
   262  
   263  func (i ClusterEndpointMap) ToClusterEndpointMapOutput() ClusterEndpointMapOutput {
   264  	return i.ToClusterEndpointMapOutputWithContext(context.Background())
   265  }
   266  
   267  func (i ClusterEndpointMap) ToClusterEndpointMapOutputWithContext(ctx context.Context) ClusterEndpointMapOutput {
   268  	return pulumi.ToOutputWithContext(ctx, i).(ClusterEndpointMapOutput)
   269  }
   270  
   271  type ClusterEndpointOutput struct{ *pulumi.OutputState }
   272  
   273  func (ClusterEndpointOutput) ElementType() reflect.Type {
   274  	return reflect.TypeOf((**ClusterEndpoint)(nil)).Elem()
   275  }
   276  
   277  func (o ClusterEndpointOutput) ToClusterEndpointOutput() ClusterEndpointOutput {
   278  	return o
   279  }
   280  
   281  func (o ClusterEndpointOutput) ToClusterEndpointOutputWithContext(ctx context.Context) ClusterEndpointOutput {
   282  	return o
   283  }
   284  
   285  // The Neptune Cluster Endpoint Amazon Resource Name (ARN).
   286  func (o ClusterEndpointOutput) Arn() pulumi.StringOutput {
   287  	return o.ApplyT(func(v *ClusterEndpoint) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   288  }
   289  
   290  // The identifier of the endpoint.
   291  func (o ClusterEndpointOutput) ClusterEndpointIdentifier() pulumi.StringOutput {
   292  	return o.ApplyT(func(v *ClusterEndpoint) pulumi.StringOutput { return v.ClusterEndpointIdentifier }).(pulumi.StringOutput)
   293  }
   294  
   295  // The DB cluster identifier of the DB cluster associated with the endpoint.
   296  func (o ClusterEndpointOutput) ClusterIdentifier() pulumi.StringOutput {
   297  	return o.ApplyT(func(v *ClusterEndpoint) pulumi.StringOutput { return v.ClusterIdentifier }).(pulumi.StringOutput)
   298  }
   299  
   300  // The DNS address of the endpoint.
   301  func (o ClusterEndpointOutput) Endpoint() pulumi.StringOutput {
   302  	return o.ApplyT(func(v *ClusterEndpoint) pulumi.StringOutput { return v.Endpoint }).(pulumi.StringOutput)
   303  }
   304  
   305  // The type of the endpoint. One of: `READER`, `WRITER`, `ANY`.
   306  func (o ClusterEndpointOutput) EndpointType() pulumi.StringOutput {
   307  	return o.ApplyT(func(v *ClusterEndpoint) pulumi.StringOutput { return v.EndpointType }).(pulumi.StringOutput)
   308  }
   309  
   310  // List of DB instance identifiers that aren't part of the custom endpoint group. All other eligible instances are reachable through the custom endpoint. Only relevant if the list of static members is empty.
   311  func (o ClusterEndpointOutput) ExcludedMembers() pulumi.StringArrayOutput {
   312  	return o.ApplyT(func(v *ClusterEndpoint) pulumi.StringArrayOutput { return v.ExcludedMembers }).(pulumi.StringArrayOutput)
   313  }
   314  
   315  // List of DB instance identifiers that are part of the custom endpoint group.
   316  func (o ClusterEndpointOutput) StaticMembers() pulumi.StringArrayOutput {
   317  	return o.ApplyT(func(v *ClusterEndpoint) pulumi.StringArrayOutput { return v.StaticMembers }).(pulumi.StringArrayOutput)
   318  }
   319  
   320  // A map of tags to assign to the Neptune cluster. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   321  func (o ClusterEndpointOutput) Tags() pulumi.StringMapOutput {
   322  	return o.ApplyT(func(v *ClusterEndpoint) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   323  }
   324  
   325  // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   326  //
   327  // Deprecated: Please use `tags` instead.
   328  func (o ClusterEndpointOutput) TagsAll() pulumi.StringMapOutput {
   329  	return o.ApplyT(func(v *ClusterEndpoint) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   330  }
   331  
   332  type ClusterEndpointArrayOutput struct{ *pulumi.OutputState }
   333  
   334  func (ClusterEndpointArrayOutput) ElementType() reflect.Type {
   335  	return reflect.TypeOf((*[]*ClusterEndpoint)(nil)).Elem()
   336  }
   337  
   338  func (o ClusterEndpointArrayOutput) ToClusterEndpointArrayOutput() ClusterEndpointArrayOutput {
   339  	return o
   340  }
   341  
   342  func (o ClusterEndpointArrayOutput) ToClusterEndpointArrayOutputWithContext(ctx context.Context) ClusterEndpointArrayOutput {
   343  	return o
   344  }
   345  
   346  func (o ClusterEndpointArrayOutput) Index(i pulumi.IntInput) ClusterEndpointOutput {
   347  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ClusterEndpoint {
   348  		return vs[0].([]*ClusterEndpoint)[vs[1].(int)]
   349  	}).(ClusterEndpointOutput)
   350  }
   351  
   352  type ClusterEndpointMapOutput struct{ *pulumi.OutputState }
   353  
   354  func (ClusterEndpointMapOutput) ElementType() reflect.Type {
   355  	return reflect.TypeOf((*map[string]*ClusterEndpoint)(nil)).Elem()
   356  }
   357  
   358  func (o ClusterEndpointMapOutput) ToClusterEndpointMapOutput() ClusterEndpointMapOutput {
   359  	return o
   360  }
   361  
   362  func (o ClusterEndpointMapOutput) ToClusterEndpointMapOutputWithContext(ctx context.Context) ClusterEndpointMapOutput {
   363  	return o
   364  }
   365  
   366  func (o ClusterEndpointMapOutput) MapIndex(k pulumi.StringInput) ClusterEndpointOutput {
   367  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ClusterEndpoint {
   368  		return vs[0].(map[string]*ClusterEndpoint)[vs[1].(string)]
   369  	}).(ClusterEndpointOutput)
   370  }
   371  
   372  func init() {
   373  	pulumi.RegisterInputType(reflect.TypeOf((*ClusterEndpointInput)(nil)).Elem(), &ClusterEndpoint{})
   374  	pulumi.RegisterInputType(reflect.TypeOf((*ClusterEndpointArrayInput)(nil)).Elem(), ClusterEndpointArray{})
   375  	pulumi.RegisterInputType(reflect.TypeOf((*ClusterEndpointMapInput)(nil)).Elem(), ClusterEndpointMap{})
   376  	pulumi.RegisterOutputType(ClusterEndpointOutput{})
   377  	pulumi.RegisterOutputType(ClusterEndpointArrayOutput{})
   378  	pulumi.RegisterOutputType(ClusterEndpointMapOutput{})
   379  }