github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/redshiftserverless/endpointAccess.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 redshiftserverless
     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  // Creates a new Amazon Redshift Serverless Endpoint Access.
    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/redshiftserverless"
    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 := redshiftserverless.NewEndpointAccess(ctx, "example", &redshiftserverless.EndpointAccessArgs{
    33  //				EndpointName:  pulumi.String("example"),
    34  //				WorkgroupName: pulumi.String("example"),
    35  //			})
    36  //			if err != nil {
    37  //				return err
    38  //			}
    39  //			return nil
    40  //		})
    41  //	}
    42  //
    43  // ```
    44  // <!--End PulumiCodeChooser -->
    45  //
    46  // ## Import
    47  //
    48  // Using `pulumi import`, import Redshift Serverless Endpoint Access using the `endpoint_name`. For example:
    49  //
    50  // ```sh
    51  // $ pulumi import aws:redshiftserverless/endpointAccess:EndpointAccess example example
    52  // ```
    53  type EndpointAccess struct {
    54  	pulumi.CustomResourceState
    55  
    56  	// The DNS address of the VPC endpoint.
    57  	Address pulumi.StringOutput `pulumi:"address"`
    58  	// Amazon Resource Name (ARN) of the Redshift Serverless Endpoint Access.
    59  	Arn pulumi.StringOutput `pulumi:"arn"`
    60  	// The name of the endpoint.
    61  	EndpointName pulumi.StringOutput `pulumi:"endpointName"`
    62  	// The owner Amazon Web Services account for the Amazon Redshift Serverless workgroup.
    63  	OwnerAccount pulumi.StringPtrOutput `pulumi:"ownerAccount"`
    64  	// The port that Amazon Redshift Serverless listens on.
    65  	Port pulumi.IntOutput `pulumi:"port"`
    66  	// An array of VPC subnet IDs to associate with the endpoint.
    67  	SubnetIds pulumi.StringArrayOutput `pulumi:"subnetIds"`
    68  	// The VPC endpoint or the Redshift Serverless workgroup. See `VPC Endpoint` below.
    69  	VpcEndpoints EndpointAccessVpcEndpointArrayOutput `pulumi:"vpcEndpoints"`
    70  	// An array of security group IDs to associate with the workgroup.
    71  	VpcSecurityGroupIds pulumi.StringArrayOutput `pulumi:"vpcSecurityGroupIds"`
    72  	// The name of the workgroup.
    73  	WorkgroupName pulumi.StringOutput `pulumi:"workgroupName"`
    74  }
    75  
    76  // NewEndpointAccess registers a new resource with the given unique name, arguments, and options.
    77  func NewEndpointAccess(ctx *pulumi.Context,
    78  	name string, args *EndpointAccessArgs, opts ...pulumi.ResourceOption) (*EndpointAccess, error) {
    79  	if args == nil {
    80  		return nil, errors.New("missing one or more required arguments")
    81  	}
    82  
    83  	if args.EndpointName == nil {
    84  		return nil, errors.New("invalid value for required argument 'EndpointName'")
    85  	}
    86  	if args.SubnetIds == nil {
    87  		return nil, errors.New("invalid value for required argument 'SubnetIds'")
    88  	}
    89  	if args.WorkgroupName == nil {
    90  		return nil, errors.New("invalid value for required argument 'WorkgroupName'")
    91  	}
    92  	opts = internal.PkgResourceDefaultOpts(opts)
    93  	var resource EndpointAccess
    94  	err := ctx.RegisterResource("aws:redshiftserverless/endpointAccess:EndpointAccess", name, args, &resource, opts...)
    95  	if err != nil {
    96  		return nil, err
    97  	}
    98  	return &resource, nil
    99  }
   100  
   101  // GetEndpointAccess gets an existing EndpointAccess resource's state with the given name, ID, and optional
   102  // state properties that are used to uniquely qualify the lookup (nil if not required).
   103  func GetEndpointAccess(ctx *pulumi.Context,
   104  	name string, id pulumi.IDInput, state *EndpointAccessState, opts ...pulumi.ResourceOption) (*EndpointAccess, error) {
   105  	var resource EndpointAccess
   106  	err := ctx.ReadResource("aws:redshiftserverless/endpointAccess:EndpointAccess", name, id, state, &resource, opts...)
   107  	if err != nil {
   108  		return nil, err
   109  	}
   110  	return &resource, nil
   111  }
   112  
   113  // Input properties used for looking up and filtering EndpointAccess resources.
   114  type endpointAccessState struct {
   115  	// The DNS address of the VPC endpoint.
   116  	Address *string `pulumi:"address"`
   117  	// Amazon Resource Name (ARN) of the Redshift Serverless Endpoint Access.
   118  	Arn *string `pulumi:"arn"`
   119  	// The name of the endpoint.
   120  	EndpointName *string `pulumi:"endpointName"`
   121  	// The owner Amazon Web Services account for the Amazon Redshift Serverless workgroup.
   122  	OwnerAccount *string `pulumi:"ownerAccount"`
   123  	// The port that Amazon Redshift Serverless listens on.
   124  	Port *int `pulumi:"port"`
   125  	// An array of VPC subnet IDs to associate with the endpoint.
   126  	SubnetIds []string `pulumi:"subnetIds"`
   127  	// The VPC endpoint or the Redshift Serverless workgroup. See `VPC Endpoint` below.
   128  	VpcEndpoints []EndpointAccessVpcEndpoint `pulumi:"vpcEndpoints"`
   129  	// An array of security group IDs to associate with the workgroup.
   130  	VpcSecurityGroupIds []string `pulumi:"vpcSecurityGroupIds"`
   131  	// The name of the workgroup.
   132  	WorkgroupName *string `pulumi:"workgroupName"`
   133  }
   134  
   135  type EndpointAccessState struct {
   136  	// The DNS address of the VPC endpoint.
   137  	Address pulumi.StringPtrInput
   138  	// Amazon Resource Name (ARN) of the Redshift Serverless Endpoint Access.
   139  	Arn pulumi.StringPtrInput
   140  	// The name of the endpoint.
   141  	EndpointName pulumi.StringPtrInput
   142  	// The owner Amazon Web Services account for the Amazon Redshift Serverless workgroup.
   143  	OwnerAccount pulumi.StringPtrInput
   144  	// The port that Amazon Redshift Serverless listens on.
   145  	Port pulumi.IntPtrInput
   146  	// An array of VPC subnet IDs to associate with the endpoint.
   147  	SubnetIds pulumi.StringArrayInput
   148  	// The VPC endpoint or the Redshift Serverless workgroup. See `VPC Endpoint` below.
   149  	VpcEndpoints EndpointAccessVpcEndpointArrayInput
   150  	// An array of security group IDs to associate with the workgroup.
   151  	VpcSecurityGroupIds pulumi.StringArrayInput
   152  	// The name of the workgroup.
   153  	WorkgroupName pulumi.StringPtrInput
   154  }
   155  
   156  func (EndpointAccessState) ElementType() reflect.Type {
   157  	return reflect.TypeOf((*endpointAccessState)(nil)).Elem()
   158  }
   159  
   160  type endpointAccessArgs struct {
   161  	// The name of the endpoint.
   162  	EndpointName string `pulumi:"endpointName"`
   163  	// The owner Amazon Web Services account for the Amazon Redshift Serverless workgroup.
   164  	OwnerAccount *string `pulumi:"ownerAccount"`
   165  	// An array of VPC subnet IDs to associate with the endpoint.
   166  	SubnetIds []string `pulumi:"subnetIds"`
   167  	// An array of security group IDs to associate with the workgroup.
   168  	VpcSecurityGroupIds []string `pulumi:"vpcSecurityGroupIds"`
   169  	// The name of the workgroup.
   170  	WorkgroupName string `pulumi:"workgroupName"`
   171  }
   172  
   173  // The set of arguments for constructing a EndpointAccess resource.
   174  type EndpointAccessArgs struct {
   175  	// The name of the endpoint.
   176  	EndpointName pulumi.StringInput
   177  	// The owner Amazon Web Services account for the Amazon Redshift Serverless workgroup.
   178  	OwnerAccount pulumi.StringPtrInput
   179  	// An array of VPC subnet IDs to associate with the endpoint.
   180  	SubnetIds pulumi.StringArrayInput
   181  	// An array of security group IDs to associate with the workgroup.
   182  	VpcSecurityGroupIds pulumi.StringArrayInput
   183  	// The name of the workgroup.
   184  	WorkgroupName pulumi.StringInput
   185  }
   186  
   187  func (EndpointAccessArgs) ElementType() reflect.Type {
   188  	return reflect.TypeOf((*endpointAccessArgs)(nil)).Elem()
   189  }
   190  
   191  type EndpointAccessInput interface {
   192  	pulumi.Input
   193  
   194  	ToEndpointAccessOutput() EndpointAccessOutput
   195  	ToEndpointAccessOutputWithContext(ctx context.Context) EndpointAccessOutput
   196  }
   197  
   198  func (*EndpointAccess) ElementType() reflect.Type {
   199  	return reflect.TypeOf((**EndpointAccess)(nil)).Elem()
   200  }
   201  
   202  func (i *EndpointAccess) ToEndpointAccessOutput() EndpointAccessOutput {
   203  	return i.ToEndpointAccessOutputWithContext(context.Background())
   204  }
   205  
   206  func (i *EndpointAccess) ToEndpointAccessOutputWithContext(ctx context.Context) EndpointAccessOutput {
   207  	return pulumi.ToOutputWithContext(ctx, i).(EndpointAccessOutput)
   208  }
   209  
   210  // EndpointAccessArrayInput is an input type that accepts EndpointAccessArray and EndpointAccessArrayOutput values.
   211  // You can construct a concrete instance of `EndpointAccessArrayInput` via:
   212  //
   213  //	EndpointAccessArray{ EndpointAccessArgs{...} }
   214  type EndpointAccessArrayInput interface {
   215  	pulumi.Input
   216  
   217  	ToEndpointAccessArrayOutput() EndpointAccessArrayOutput
   218  	ToEndpointAccessArrayOutputWithContext(context.Context) EndpointAccessArrayOutput
   219  }
   220  
   221  type EndpointAccessArray []EndpointAccessInput
   222  
   223  func (EndpointAccessArray) ElementType() reflect.Type {
   224  	return reflect.TypeOf((*[]*EndpointAccess)(nil)).Elem()
   225  }
   226  
   227  func (i EndpointAccessArray) ToEndpointAccessArrayOutput() EndpointAccessArrayOutput {
   228  	return i.ToEndpointAccessArrayOutputWithContext(context.Background())
   229  }
   230  
   231  func (i EndpointAccessArray) ToEndpointAccessArrayOutputWithContext(ctx context.Context) EndpointAccessArrayOutput {
   232  	return pulumi.ToOutputWithContext(ctx, i).(EndpointAccessArrayOutput)
   233  }
   234  
   235  // EndpointAccessMapInput is an input type that accepts EndpointAccessMap and EndpointAccessMapOutput values.
   236  // You can construct a concrete instance of `EndpointAccessMapInput` via:
   237  //
   238  //	EndpointAccessMap{ "key": EndpointAccessArgs{...} }
   239  type EndpointAccessMapInput interface {
   240  	pulumi.Input
   241  
   242  	ToEndpointAccessMapOutput() EndpointAccessMapOutput
   243  	ToEndpointAccessMapOutputWithContext(context.Context) EndpointAccessMapOutput
   244  }
   245  
   246  type EndpointAccessMap map[string]EndpointAccessInput
   247  
   248  func (EndpointAccessMap) ElementType() reflect.Type {
   249  	return reflect.TypeOf((*map[string]*EndpointAccess)(nil)).Elem()
   250  }
   251  
   252  func (i EndpointAccessMap) ToEndpointAccessMapOutput() EndpointAccessMapOutput {
   253  	return i.ToEndpointAccessMapOutputWithContext(context.Background())
   254  }
   255  
   256  func (i EndpointAccessMap) ToEndpointAccessMapOutputWithContext(ctx context.Context) EndpointAccessMapOutput {
   257  	return pulumi.ToOutputWithContext(ctx, i).(EndpointAccessMapOutput)
   258  }
   259  
   260  type EndpointAccessOutput struct{ *pulumi.OutputState }
   261  
   262  func (EndpointAccessOutput) ElementType() reflect.Type {
   263  	return reflect.TypeOf((**EndpointAccess)(nil)).Elem()
   264  }
   265  
   266  func (o EndpointAccessOutput) ToEndpointAccessOutput() EndpointAccessOutput {
   267  	return o
   268  }
   269  
   270  func (o EndpointAccessOutput) ToEndpointAccessOutputWithContext(ctx context.Context) EndpointAccessOutput {
   271  	return o
   272  }
   273  
   274  // The DNS address of the VPC endpoint.
   275  func (o EndpointAccessOutput) Address() pulumi.StringOutput {
   276  	return o.ApplyT(func(v *EndpointAccess) pulumi.StringOutput { return v.Address }).(pulumi.StringOutput)
   277  }
   278  
   279  // Amazon Resource Name (ARN) of the Redshift Serverless Endpoint Access.
   280  func (o EndpointAccessOutput) Arn() pulumi.StringOutput {
   281  	return o.ApplyT(func(v *EndpointAccess) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   282  }
   283  
   284  // The name of the endpoint.
   285  func (o EndpointAccessOutput) EndpointName() pulumi.StringOutput {
   286  	return o.ApplyT(func(v *EndpointAccess) pulumi.StringOutput { return v.EndpointName }).(pulumi.StringOutput)
   287  }
   288  
   289  // The owner Amazon Web Services account for the Amazon Redshift Serverless workgroup.
   290  func (o EndpointAccessOutput) OwnerAccount() pulumi.StringPtrOutput {
   291  	return o.ApplyT(func(v *EndpointAccess) pulumi.StringPtrOutput { return v.OwnerAccount }).(pulumi.StringPtrOutput)
   292  }
   293  
   294  // The port that Amazon Redshift Serverless listens on.
   295  func (o EndpointAccessOutput) Port() pulumi.IntOutput {
   296  	return o.ApplyT(func(v *EndpointAccess) pulumi.IntOutput { return v.Port }).(pulumi.IntOutput)
   297  }
   298  
   299  // An array of VPC subnet IDs to associate with the endpoint.
   300  func (o EndpointAccessOutput) SubnetIds() pulumi.StringArrayOutput {
   301  	return o.ApplyT(func(v *EndpointAccess) pulumi.StringArrayOutput { return v.SubnetIds }).(pulumi.StringArrayOutput)
   302  }
   303  
   304  // The VPC endpoint or the Redshift Serverless workgroup. See `VPC Endpoint` below.
   305  func (o EndpointAccessOutput) VpcEndpoints() EndpointAccessVpcEndpointArrayOutput {
   306  	return o.ApplyT(func(v *EndpointAccess) EndpointAccessVpcEndpointArrayOutput { return v.VpcEndpoints }).(EndpointAccessVpcEndpointArrayOutput)
   307  }
   308  
   309  // An array of security group IDs to associate with the workgroup.
   310  func (o EndpointAccessOutput) VpcSecurityGroupIds() pulumi.StringArrayOutput {
   311  	return o.ApplyT(func(v *EndpointAccess) pulumi.StringArrayOutput { return v.VpcSecurityGroupIds }).(pulumi.StringArrayOutput)
   312  }
   313  
   314  // The name of the workgroup.
   315  func (o EndpointAccessOutput) WorkgroupName() pulumi.StringOutput {
   316  	return o.ApplyT(func(v *EndpointAccess) pulumi.StringOutput { return v.WorkgroupName }).(pulumi.StringOutput)
   317  }
   318  
   319  type EndpointAccessArrayOutput struct{ *pulumi.OutputState }
   320  
   321  func (EndpointAccessArrayOutput) ElementType() reflect.Type {
   322  	return reflect.TypeOf((*[]*EndpointAccess)(nil)).Elem()
   323  }
   324  
   325  func (o EndpointAccessArrayOutput) ToEndpointAccessArrayOutput() EndpointAccessArrayOutput {
   326  	return o
   327  }
   328  
   329  func (o EndpointAccessArrayOutput) ToEndpointAccessArrayOutputWithContext(ctx context.Context) EndpointAccessArrayOutput {
   330  	return o
   331  }
   332  
   333  func (o EndpointAccessArrayOutput) Index(i pulumi.IntInput) EndpointAccessOutput {
   334  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *EndpointAccess {
   335  		return vs[0].([]*EndpointAccess)[vs[1].(int)]
   336  	}).(EndpointAccessOutput)
   337  }
   338  
   339  type EndpointAccessMapOutput struct{ *pulumi.OutputState }
   340  
   341  func (EndpointAccessMapOutput) ElementType() reflect.Type {
   342  	return reflect.TypeOf((*map[string]*EndpointAccess)(nil)).Elem()
   343  }
   344  
   345  func (o EndpointAccessMapOutput) ToEndpointAccessMapOutput() EndpointAccessMapOutput {
   346  	return o
   347  }
   348  
   349  func (o EndpointAccessMapOutput) ToEndpointAccessMapOutputWithContext(ctx context.Context) EndpointAccessMapOutput {
   350  	return o
   351  }
   352  
   353  func (o EndpointAccessMapOutput) MapIndex(k pulumi.StringInput) EndpointAccessOutput {
   354  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *EndpointAccess {
   355  		return vs[0].(map[string]*EndpointAccess)[vs[1].(string)]
   356  	}).(EndpointAccessOutput)
   357  }
   358  
   359  func init() {
   360  	pulumi.RegisterInputType(reflect.TypeOf((*EndpointAccessInput)(nil)).Elem(), &EndpointAccess{})
   361  	pulumi.RegisterInputType(reflect.TypeOf((*EndpointAccessArrayInput)(nil)).Elem(), EndpointAccessArray{})
   362  	pulumi.RegisterInputType(reflect.TypeOf((*EndpointAccessMapInput)(nil)).Elem(), EndpointAccessMap{})
   363  	pulumi.RegisterOutputType(EndpointAccessOutput{})
   364  	pulumi.RegisterOutputType(EndpointAccessArrayOutput{})
   365  	pulumi.RegisterOutputType(EndpointAccessMapOutput{})
   366  }