github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/redshift/endpointAuthorization.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 redshift
     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 endpoint authorization.
    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/redshift"
    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 := redshift.NewEndpointAuthorization(ctx, "example", &redshift.EndpointAuthorizationArgs{
    33  //				Account:           pulumi.String("01234567910"),
    34  //				ClusterIdentifier: pulumi.Any(exampleAwsRedshiftCluster.ClusterIdentifier),
    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 endpoint authorization using the `id`. For example:
    49  //
    50  // ```sh
    51  // $ pulumi import aws:redshift/endpointAuthorization:EndpointAuthorization example 01234567910:cluster-example-id
    52  // ```
    53  type EndpointAuthorization struct {
    54  	pulumi.CustomResourceState
    55  
    56  	// The Amazon Web Services account ID to grant access to.
    57  	Account pulumi.StringOutput `pulumi:"account"`
    58  	// Indicates whether all VPCs in the grantee account are allowed access to the cluster.
    59  	AllowedAllVpcs pulumi.BoolOutput `pulumi:"allowedAllVpcs"`
    60  	// The cluster identifier of the cluster to grant access to.
    61  	ClusterIdentifier pulumi.StringOutput `pulumi:"clusterIdentifier"`
    62  	// The number of Redshift-managed VPC endpoints created for the authorization.
    63  	EndpointCount pulumi.IntOutput `pulumi:"endpointCount"`
    64  	// Indicates whether to force the revoke action. If true, the Redshift-managed VPC endpoints associated with the endpoint authorization are also deleted. Default value is `false`.
    65  	ForceDelete pulumi.BoolPtrOutput `pulumi:"forceDelete"`
    66  	// The Amazon Web Services account ID of the grantee of the cluster.
    67  	Grantee pulumi.StringOutput `pulumi:"grantee"`
    68  	// The Amazon Web Services account ID of the cluster owner.
    69  	Grantor pulumi.StringOutput `pulumi:"grantor"`
    70  	// The virtual private cloud (VPC) identifiers to grant access to. If none are specified all VPCs in shared account are allowed.
    71  	VpcIds pulumi.StringArrayOutput `pulumi:"vpcIds"`
    72  }
    73  
    74  // NewEndpointAuthorization registers a new resource with the given unique name, arguments, and options.
    75  func NewEndpointAuthorization(ctx *pulumi.Context,
    76  	name string, args *EndpointAuthorizationArgs, opts ...pulumi.ResourceOption) (*EndpointAuthorization, error) {
    77  	if args == nil {
    78  		return nil, errors.New("missing one or more required arguments")
    79  	}
    80  
    81  	if args.Account == nil {
    82  		return nil, errors.New("invalid value for required argument 'Account'")
    83  	}
    84  	if args.ClusterIdentifier == nil {
    85  		return nil, errors.New("invalid value for required argument 'ClusterIdentifier'")
    86  	}
    87  	opts = internal.PkgResourceDefaultOpts(opts)
    88  	var resource EndpointAuthorization
    89  	err := ctx.RegisterResource("aws:redshift/endpointAuthorization:EndpointAuthorization", name, args, &resource, opts...)
    90  	if err != nil {
    91  		return nil, err
    92  	}
    93  	return &resource, nil
    94  }
    95  
    96  // GetEndpointAuthorization gets an existing EndpointAuthorization 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 GetEndpointAuthorization(ctx *pulumi.Context,
    99  	name string, id pulumi.IDInput, state *EndpointAuthorizationState, opts ...pulumi.ResourceOption) (*EndpointAuthorization, error) {
   100  	var resource EndpointAuthorization
   101  	err := ctx.ReadResource("aws:redshift/endpointAuthorization:EndpointAuthorization", 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 EndpointAuthorization resources.
   109  type endpointAuthorizationState struct {
   110  	// The Amazon Web Services account ID to grant access to.
   111  	Account *string `pulumi:"account"`
   112  	// Indicates whether all VPCs in the grantee account are allowed access to the cluster.
   113  	AllowedAllVpcs *bool `pulumi:"allowedAllVpcs"`
   114  	// The cluster identifier of the cluster to grant access to.
   115  	ClusterIdentifier *string `pulumi:"clusterIdentifier"`
   116  	// The number of Redshift-managed VPC endpoints created for the authorization.
   117  	EndpointCount *int `pulumi:"endpointCount"`
   118  	// Indicates whether to force the revoke action. If true, the Redshift-managed VPC endpoints associated with the endpoint authorization are also deleted. Default value is `false`.
   119  	ForceDelete *bool `pulumi:"forceDelete"`
   120  	// The Amazon Web Services account ID of the grantee of the cluster.
   121  	Grantee *string `pulumi:"grantee"`
   122  	// The Amazon Web Services account ID of the cluster owner.
   123  	Grantor *string `pulumi:"grantor"`
   124  	// The virtual private cloud (VPC) identifiers to grant access to. If none are specified all VPCs in shared account are allowed.
   125  	VpcIds []string `pulumi:"vpcIds"`
   126  }
   127  
   128  type EndpointAuthorizationState struct {
   129  	// The Amazon Web Services account ID to grant access to.
   130  	Account pulumi.StringPtrInput
   131  	// Indicates whether all VPCs in the grantee account are allowed access to the cluster.
   132  	AllowedAllVpcs pulumi.BoolPtrInput
   133  	// The cluster identifier of the cluster to grant access to.
   134  	ClusterIdentifier pulumi.StringPtrInput
   135  	// The number of Redshift-managed VPC endpoints created for the authorization.
   136  	EndpointCount pulumi.IntPtrInput
   137  	// Indicates whether to force the revoke action. If true, the Redshift-managed VPC endpoints associated with the endpoint authorization are also deleted. Default value is `false`.
   138  	ForceDelete pulumi.BoolPtrInput
   139  	// The Amazon Web Services account ID of the grantee of the cluster.
   140  	Grantee pulumi.StringPtrInput
   141  	// The Amazon Web Services account ID of the cluster owner.
   142  	Grantor pulumi.StringPtrInput
   143  	// The virtual private cloud (VPC) identifiers to grant access to. If none are specified all VPCs in shared account are allowed.
   144  	VpcIds pulumi.StringArrayInput
   145  }
   146  
   147  func (EndpointAuthorizationState) ElementType() reflect.Type {
   148  	return reflect.TypeOf((*endpointAuthorizationState)(nil)).Elem()
   149  }
   150  
   151  type endpointAuthorizationArgs struct {
   152  	// The Amazon Web Services account ID to grant access to.
   153  	Account string `pulumi:"account"`
   154  	// The cluster identifier of the cluster to grant access to.
   155  	ClusterIdentifier string `pulumi:"clusterIdentifier"`
   156  	// Indicates whether to force the revoke action. If true, the Redshift-managed VPC endpoints associated with the endpoint authorization are also deleted. Default value is `false`.
   157  	ForceDelete *bool `pulumi:"forceDelete"`
   158  	// The virtual private cloud (VPC) identifiers to grant access to. If none are specified all VPCs in shared account are allowed.
   159  	VpcIds []string `pulumi:"vpcIds"`
   160  }
   161  
   162  // The set of arguments for constructing a EndpointAuthorization resource.
   163  type EndpointAuthorizationArgs struct {
   164  	// The Amazon Web Services account ID to grant access to.
   165  	Account pulumi.StringInput
   166  	// The cluster identifier of the cluster to grant access to.
   167  	ClusterIdentifier pulumi.StringInput
   168  	// Indicates whether to force the revoke action. If true, the Redshift-managed VPC endpoints associated with the endpoint authorization are also deleted. Default value is `false`.
   169  	ForceDelete pulumi.BoolPtrInput
   170  	// The virtual private cloud (VPC) identifiers to grant access to. If none are specified all VPCs in shared account are allowed.
   171  	VpcIds pulumi.StringArrayInput
   172  }
   173  
   174  func (EndpointAuthorizationArgs) ElementType() reflect.Type {
   175  	return reflect.TypeOf((*endpointAuthorizationArgs)(nil)).Elem()
   176  }
   177  
   178  type EndpointAuthorizationInput interface {
   179  	pulumi.Input
   180  
   181  	ToEndpointAuthorizationOutput() EndpointAuthorizationOutput
   182  	ToEndpointAuthorizationOutputWithContext(ctx context.Context) EndpointAuthorizationOutput
   183  }
   184  
   185  func (*EndpointAuthorization) ElementType() reflect.Type {
   186  	return reflect.TypeOf((**EndpointAuthorization)(nil)).Elem()
   187  }
   188  
   189  func (i *EndpointAuthorization) ToEndpointAuthorizationOutput() EndpointAuthorizationOutput {
   190  	return i.ToEndpointAuthorizationOutputWithContext(context.Background())
   191  }
   192  
   193  func (i *EndpointAuthorization) ToEndpointAuthorizationOutputWithContext(ctx context.Context) EndpointAuthorizationOutput {
   194  	return pulumi.ToOutputWithContext(ctx, i).(EndpointAuthorizationOutput)
   195  }
   196  
   197  // EndpointAuthorizationArrayInput is an input type that accepts EndpointAuthorizationArray and EndpointAuthorizationArrayOutput values.
   198  // You can construct a concrete instance of `EndpointAuthorizationArrayInput` via:
   199  //
   200  //	EndpointAuthorizationArray{ EndpointAuthorizationArgs{...} }
   201  type EndpointAuthorizationArrayInput interface {
   202  	pulumi.Input
   203  
   204  	ToEndpointAuthorizationArrayOutput() EndpointAuthorizationArrayOutput
   205  	ToEndpointAuthorizationArrayOutputWithContext(context.Context) EndpointAuthorizationArrayOutput
   206  }
   207  
   208  type EndpointAuthorizationArray []EndpointAuthorizationInput
   209  
   210  func (EndpointAuthorizationArray) ElementType() reflect.Type {
   211  	return reflect.TypeOf((*[]*EndpointAuthorization)(nil)).Elem()
   212  }
   213  
   214  func (i EndpointAuthorizationArray) ToEndpointAuthorizationArrayOutput() EndpointAuthorizationArrayOutput {
   215  	return i.ToEndpointAuthorizationArrayOutputWithContext(context.Background())
   216  }
   217  
   218  func (i EndpointAuthorizationArray) ToEndpointAuthorizationArrayOutputWithContext(ctx context.Context) EndpointAuthorizationArrayOutput {
   219  	return pulumi.ToOutputWithContext(ctx, i).(EndpointAuthorizationArrayOutput)
   220  }
   221  
   222  // EndpointAuthorizationMapInput is an input type that accepts EndpointAuthorizationMap and EndpointAuthorizationMapOutput values.
   223  // You can construct a concrete instance of `EndpointAuthorizationMapInput` via:
   224  //
   225  //	EndpointAuthorizationMap{ "key": EndpointAuthorizationArgs{...} }
   226  type EndpointAuthorizationMapInput interface {
   227  	pulumi.Input
   228  
   229  	ToEndpointAuthorizationMapOutput() EndpointAuthorizationMapOutput
   230  	ToEndpointAuthorizationMapOutputWithContext(context.Context) EndpointAuthorizationMapOutput
   231  }
   232  
   233  type EndpointAuthorizationMap map[string]EndpointAuthorizationInput
   234  
   235  func (EndpointAuthorizationMap) ElementType() reflect.Type {
   236  	return reflect.TypeOf((*map[string]*EndpointAuthorization)(nil)).Elem()
   237  }
   238  
   239  func (i EndpointAuthorizationMap) ToEndpointAuthorizationMapOutput() EndpointAuthorizationMapOutput {
   240  	return i.ToEndpointAuthorizationMapOutputWithContext(context.Background())
   241  }
   242  
   243  func (i EndpointAuthorizationMap) ToEndpointAuthorizationMapOutputWithContext(ctx context.Context) EndpointAuthorizationMapOutput {
   244  	return pulumi.ToOutputWithContext(ctx, i).(EndpointAuthorizationMapOutput)
   245  }
   246  
   247  type EndpointAuthorizationOutput struct{ *pulumi.OutputState }
   248  
   249  func (EndpointAuthorizationOutput) ElementType() reflect.Type {
   250  	return reflect.TypeOf((**EndpointAuthorization)(nil)).Elem()
   251  }
   252  
   253  func (o EndpointAuthorizationOutput) ToEndpointAuthorizationOutput() EndpointAuthorizationOutput {
   254  	return o
   255  }
   256  
   257  func (o EndpointAuthorizationOutput) ToEndpointAuthorizationOutputWithContext(ctx context.Context) EndpointAuthorizationOutput {
   258  	return o
   259  }
   260  
   261  // The Amazon Web Services account ID to grant access to.
   262  func (o EndpointAuthorizationOutput) Account() pulumi.StringOutput {
   263  	return o.ApplyT(func(v *EndpointAuthorization) pulumi.StringOutput { return v.Account }).(pulumi.StringOutput)
   264  }
   265  
   266  // Indicates whether all VPCs in the grantee account are allowed access to the cluster.
   267  func (o EndpointAuthorizationOutput) AllowedAllVpcs() pulumi.BoolOutput {
   268  	return o.ApplyT(func(v *EndpointAuthorization) pulumi.BoolOutput { return v.AllowedAllVpcs }).(pulumi.BoolOutput)
   269  }
   270  
   271  // The cluster identifier of the cluster to grant access to.
   272  func (o EndpointAuthorizationOutput) ClusterIdentifier() pulumi.StringOutput {
   273  	return o.ApplyT(func(v *EndpointAuthorization) pulumi.StringOutput { return v.ClusterIdentifier }).(pulumi.StringOutput)
   274  }
   275  
   276  // The number of Redshift-managed VPC endpoints created for the authorization.
   277  func (o EndpointAuthorizationOutput) EndpointCount() pulumi.IntOutput {
   278  	return o.ApplyT(func(v *EndpointAuthorization) pulumi.IntOutput { return v.EndpointCount }).(pulumi.IntOutput)
   279  }
   280  
   281  // Indicates whether to force the revoke action. If true, the Redshift-managed VPC endpoints associated with the endpoint authorization are also deleted. Default value is `false`.
   282  func (o EndpointAuthorizationOutput) ForceDelete() pulumi.BoolPtrOutput {
   283  	return o.ApplyT(func(v *EndpointAuthorization) pulumi.BoolPtrOutput { return v.ForceDelete }).(pulumi.BoolPtrOutput)
   284  }
   285  
   286  // The Amazon Web Services account ID of the grantee of the cluster.
   287  func (o EndpointAuthorizationOutput) Grantee() pulumi.StringOutput {
   288  	return o.ApplyT(func(v *EndpointAuthorization) pulumi.StringOutput { return v.Grantee }).(pulumi.StringOutput)
   289  }
   290  
   291  // The Amazon Web Services account ID of the cluster owner.
   292  func (o EndpointAuthorizationOutput) Grantor() pulumi.StringOutput {
   293  	return o.ApplyT(func(v *EndpointAuthorization) pulumi.StringOutput { return v.Grantor }).(pulumi.StringOutput)
   294  }
   295  
   296  // The virtual private cloud (VPC) identifiers to grant access to. If none are specified all VPCs in shared account are allowed.
   297  func (o EndpointAuthorizationOutput) VpcIds() pulumi.StringArrayOutput {
   298  	return o.ApplyT(func(v *EndpointAuthorization) pulumi.StringArrayOutput { return v.VpcIds }).(pulumi.StringArrayOutput)
   299  }
   300  
   301  type EndpointAuthorizationArrayOutput struct{ *pulumi.OutputState }
   302  
   303  func (EndpointAuthorizationArrayOutput) ElementType() reflect.Type {
   304  	return reflect.TypeOf((*[]*EndpointAuthorization)(nil)).Elem()
   305  }
   306  
   307  func (o EndpointAuthorizationArrayOutput) ToEndpointAuthorizationArrayOutput() EndpointAuthorizationArrayOutput {
   308  	return o
   309  }
   310  
   311  func (o EndpointAuthorizationArrayOutput) ToEndpointAuthorizationArrayOutputWithContext(ctx context.Context) EndpointAuthorizationArrayOutput {
   312  	return o
   313  }
   314  
   315  func (o EndpointAuthorizationArrayOutput) Index(i pulumi.IntInput) EndpointAuthorizationOutput {
   316  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *EndpointAuthorization {
   317  		return vs[0].([]*EndpointAuthorization)[vs[1].(int)]
   318  	}).(EndpointAuthorizationOutput)
   319  }
   320  
   321  type EndpointAuthorizationMapOutput struct{ *pulumi.OutputState }
   322  
   323  func (EndpointAuthorizationMapOutput) ElementType() reflect.Type {
   324  	return reflect.TypeOf((*map[string]*EndpointAuthorization)(nil)).Elem()
   325  }
   326  
   327  func (o EndpointAuthorizationMapOutput) ToEndpointAuthorizationMapOutput() EndpointAuthorizationMapOutput {
   328  	return o
   329  }
   330  
   331  func (o EndpointAuthorizationMapOutput) ToEndpointAuthorizationMapOutputWithContext(ctx context.Context) EndpointAuthorizationMapOutput {
   332  	return o
   333  }
   334  
   335  func (o EndpointAuthorizationMapOutput) MapIndex(k pulumi.StringInput) EndpointAuthorizationOutput {
   336  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *EndpointAuthorization {
   337  		return vs[0].(map[string]*EndpointAuthorization)[vs[1].(string)]
   338  	}).(EndpointAuthorizationOutput)
   339  }
   340  
   341  func init() {
   342  	pulumi.RegisterInputType(reflect.TypeOf((*EndpointAuthorizationInput)(nil)).Elem(), &EndpointAuthorization{})
   343  	pulumi.RegisterInputType(reflect.TypeOf((*EndpointAuthorizationArrayInput)(nil)).Elem(), EndpointAuthorizationArray{})
   344  	pulumi.RegisterInputType(reflect.TypeOf((*EndpointAuthorizationMapInput)(nil)).Elem(), EndpointAuthorizationMap{})
   345  	pulumi.RegisterOutputType(EndpointAuthorizationOutput{})
   346  	pulumi.RegisterOutputType(EndpointAuthorizationArrayOutput{})
   347  	pulumi.RegisterOutputType(EndpointAuthorizationMapOutput{})
   348  }