github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/memorydb/acl.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 memorydb
     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  // Provides a MemoryDB ACL.
    15  //
    16  // More information about users and ACL-s can be found in the [MemoryDB User Guide](https://docs.aws.amazon.com/memorydb/latest/devguide/clusters.acls.html).
    17  //
    18  // ## Example Usage
    19  //
    20  // <!--Start PulumiCodeChooser -->
    21  // ```go
    22  // package main
    23  //
    24  // import (
    25  //
    26  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/memorydb"
    27  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    28  //
    29  // )
    30  //
    31  //	func main() {
    32  //		pulumi.Run(func(ctx *pulumi.Context) error {
    33  //			_, err := memorydb.NewAcl(ctx, "example", &memorydb.AclArgs{
    34  //				Name: pulumi.String("my-acl"),
    35  //				UserNames: pulumi.StringArray{
    36  //					pulumi.String("my-user-1"),
    37  //					pulumi.String("my-user-2"),
    38  //				},
    39  //			})
    40  //			if err != nil {
    41  //				return err
    42  //			}
    43  //			return nil
    44  //		})
    45  //	}
    46  //
    47  // ```
    48  // <!--End PulumiCodeChooser -->
    49  //
    50  // ## Import
    51  //
    52  // Using `pulumi import`, import an ACL using the `name`. For example:
    53  //
    54  // ```sh
    55  // $ pulumi import aws:memorydb/acl:Acl example my-acl
    56  // ```
    57  type Acl struct {
    58  	pulumi.CustomResourceState
    59  
    60  	// The ARN of the ACL.
    61  	Arn pulumi.StringOutput `pulumi:"arn"`
    62  	// The minimum engine version supported by the ACL.
    63  	MinimumEngineVersion pulumi.StringOutput `pulumi:"minimumEngineVersion"`
    64  	// Name of the ACL. If omitted, the provider will assign a random, unique name. Conflicts with `namePrefix`.
    65  	Name pulumi.StringOutput `pulumi:"name"`
    66  	// Creates a unique name beginning with the specified prefix. Conflicts with `name`.
    67  	NamePrefix pulumi.StringOutput `pulumi:"namePrefix"`
    68  	// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    69  	Tags pulumi.StringMapOutput `pulumi:"tags"`
    70  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
    71  	//
    72  	// Deprecated: Please use `tags` instead.
    73  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
    74  	// Set of MemoryDB user names to be included in this ACL.
    75  	UserNames pulumi.StringArrayOutput `pulumi:"userNames"`
    76  }
    77  
    78  // NewAcl registers a new resource with the given unique name, arguments, and options.
    79  func NewAcl(ctx *pulumi.Context,
    80  	name string, args *AclArgs, opts ...pulumi.ResourceOption) (*Acl, error) {
    81  	if args == nil {
    82  		args = &AclArgs{}
    83  	}
    84  
    85  	opts = internal.PkgResourceDefaultOpts(opts)
    86  	var resource Acl
    87  	err := ctx.RegisterResource("aws:memorydb/acl:Acl", name, args, &resource, opts...)
    88  	if err != nil {
    89  		return nil, err
    90  	}
    91  	return &resource, nil
    92  }
    93  
    94  // GetAcl gets an existing Acl resource's state with the given name, ID, and optional
    95  // state properties that are used to uniquely qualify the lookup (nil if not required).
    96  func GetAcl(ctx *pulumi.Context,
    97  	name string, id pulumi.IDInput, state *AclState, opts ...pulumi.ResourceOption) (*Acl, error) {
    98  	var resource Acl
    99  	err := ctx.ReadResource("aws:memorydb/acl:Acl", name, id, state, &resource, opts...)
   100  	if err != nil {
   101  		return nil, err
   102  	}
   103  	return &resource, nil
   104  }
   105  
   106  // Input properties used for looking up and filtering Acl resources.
   107  type aclState struct {
   108  	// The ARN of the ACL.
   109  	Arn *string `pulumi:"arn"`
   110  	// The minimum engine version supported by the ACL.
   111  	MinimumEngineVersion *string `pulumi:"minimumEngineVersion"`
   112  	// Name of the ACL. If omitted, the provider will assign a random, unique name. Conflicts with `namePrefix`.
   113  	Name *string `pulumi:"name"`
   114  	// Creates a unique name beginning with the specified prefix. Conflicts with `name`.
   115  	NamePrefix *string `pulumi:"namePrefix"`
   116  	// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   117  	Tags map[string]string `pulumi:"tags"`
   118  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   119  	//
   120  	// Deprecated: Please use `tags` instead.
   121  	TagsAll map[string]string `pulumi:"tagsAll"`
   122  	// Set of MemoryDB user names to be included in this ACL.
   123  	UserNames []string `pulumi:"userNames"`
   124  }
   125  
   126  type AclState struct {
   127  	// The ARN of the ACL.
   128  	Arn pulumi.StringPtrInput
   129  	// The minimum engine version supported by the ACL.
   130  	MinimumEngineVersion pulumi.StringPtrInput
   131  	// Name of the ACL. If omitted, the provider will assign a random, unique name. Conflicts with `namePrefix`.
   132  	Name pulumi.StringPtrInput
   133  	// Creates a unique name beginning with the specified prefix. Conflicts with `name`.
   134  	NamePrefix pulumi.StringPtrInput
   135  	// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   136  	Tags pulumi.StringMapInput
   137  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   138  	//
   139  	// Deprecated: Please use `tags` instead.
   140  	TagsAll pulumi.StringMapInput
   141  	// Set of MemoryDB user names to be included in this ACL.
   142  	UserNames pulumi.StringArrayInput
   143  }
   144  
   145  func (AclState) ElementType() reflect.Type {
   146  	return reflect.TypeOf((*aclState)(nil)).Elem()
   147  }
   148  
   149  type aclArgs struct {
   150  	// Name of the ACL. If omitted, the provider will assign a random, unique name. Conflicts with `namePrefix`.
   151  	Name *string `pulumi:"name"`
   152  	// Creates a unique name beginning with the specified prefix. Conflicts with `name`.
   153  	NamePrefix *string `pulumi:"namePrefix"`
   154  	// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   155  	Tags map[string]string `pulumi:"tags"`
   156  	// Set of MemoryDB user names to be included in this ACL.
   157  	UserNames []string `pulumi:"userNames"`
   158  }
   159  
   160  // The set of arguments for constructing a Acl resource.
   161  type AclArgs struct {
   162  	// Name of the ACL. If omitted, the provider will assign a random, unique name. Conflicts with `namePrefix`.
   163  	Name pulumi.StringPtrInput
   164  	// Creates a unique name beginning with the specified prefix. Conflicts with `name`.
   165  	NamePrefix pulumi.StringPtrInput
   166  	// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   167  	Tags pulumi.StringMapInput
   168  	// Set of MemoryDB user names to be included in this ACL.
   169  	UserNames pulumi.StringArrayInput
   170  }
   171  
   172  func (AclArgs) ElementType() reflect.Type {
   173  	return reflect.TypeOf((*aclArgs)(nil)).Elem()
   174  }
   175  
   176  type AclInput interface {
   177  	pulumi.Input
   178  
   179  	ToAclOutput() AclOutput
   180  	ToAclOutputWithContext(ctx context.Context) AclOutput
   181  }
   182  
   183  func (*Acl) ElementType() reflect.Type {
   184  	return reflect.TypeOf((**Acl)(nil)).Elem()
   185  }
   186  
   187  func (i *Acl) ToAclOutput() AclOutput {
   188  	return i.ToAclOutputWithContext(context.Background())
   189  }
   190  
   191  func (i *Acl) ToAclOutputWithContext(ctx context.Context) AclOutput {
   192  	return pulumi.ToOutputWithContext(ctx, i).(AclOutput)
   193  }
   194  
   195  // AclArrayInput is an input type that accepts AclArray and AclArrayOutput values.
   196  // You can construct a concrete instance of `AclArrayInput` via:
   197  //
   198  //	AclArray{ AclArgs{...} }
   199  type AclArrayInput interface {
   200  	pulumi.Input
   201  
   202  	ToAclArrayOutput() AclArrayOutput
   203  	ToAclArrayOutputWithContext(context.Context) AclArrayOutput
   204  }
   205  
   206  type AclArray []AclInput
   207  
   208  func (AclArray) ElementType() reflect.Type {
   209  	return reflect.TypeOf((*[]*Acl)(nil)).Elem()
   210  }
   211  
   212  func (i AclArray) ToAclArrayOutput() AclArrayOutput {
   213  	return i.ToAclArrayOutputWithContext(context.Background())
   214  }
   215  
   216  func (i AclArray) ToAclArrayOutputWithContext(ctx context.Context) AclArrayOutput {
   217  	return pulumi.ToOutputWithContext(ctx, i).(AclArrayOutput)
   218  }
   219  
   220  // AclMapInput is an input type that accepts AclMap and AclMapOutput values.
   221  // You can construct a concrete instance of `AclMapInput` via:
   222  //
   223  //	AclMap{ "key": AclArgs{...} }
   224  type AclMapInput interface {
   225  	pulumi.Input
   226  
   227  	ToAclMapOutput() AclMapOutput
   228  	ToAclMapOutputWithContext(context.Context) AclMapOutput
   229  }
   230  
   231  type AclMap map[string]AclInput
   232  
   233  func (AclMap) ElementType() reflect.Type {
   234  	return reflect.TypeOf((*map[string]*Acl)(nil)).Elem()
   235  }
   236  
   237  func (i AclMap) ToAclMapOutput() AclMapOutput {
   238  	return i.ToAclMapOutputWithContext(context.Background())
   239  }
   240  
   241  func (i AclMap) ToAclMapOutputWithContext(ctx context.Context) AclMapOutput {
   242  	return pulumi.ToOutputWithContext(ctx, i).(AclMapOutput)
   243  }
   244  
   245  type AclOutput struct{ *pulumi.OutputState }
   246  
   247  func (AclOutput) ElementType() reflect.Type {
   248  	return reflect.TypeOf((**Acl)(nil)).Elem()
   249  }
   250  
   251  func (o AclOutput) ToAclOutput() AclOutput {
   252  	return o
   253  }
   254  
   255  func (o AclOutput) ToAclOutputWithContext(ctx context.Context) AclOutput {
   256  	return o
   257  }
   258  
   259  // The ARN of the ACL.
   260  func (o AclOutput) Arn() pulumi.StringOutput {
   261  	return o.ApplyT(func(v *Acl) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   262  }
   263  
   264  // The minimum engine version supported by the ACL.
   265  func (o AclOutput) MinimumEngineVersion() pulumi.StringOutput {
   266  	return o.ApplyT(func(v *Acl) pulumi.StringOutput { return v.MinimumEngineVersion }).(pulumi.StringOutput)
   267  }
   268  
   269  // Name of the ACL. If omitted, the provider will assign a random, unique name. Conflicts with `namePrefix`.
   270  func (o AclOutput) Name() pulumi.StringOutput {
   271  	return o.ApplyT(func(v *Acl) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
   272  }
   273  
   274  // Creates a unique name beginning with the specified prefix. Conflicts with `name`.
   275  func (o AclOutput) NamePrefix() pulumi.StringOutput {
   276  	return o.ApplyT(func(v *Acl) pulumi.StringOutput { return v.NamePrefix }).(pulumi.StringOutput)
   277  }
   278  
   279  // A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   280  func (o AclOutput) Tags() pulumi.StringMapOutput {
   281  	return o.ApplyT(func(v *Acl) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   282  }
   283  
   284  // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   285  //
   286  // Deprecated: Please use `tags` instead.
   287  func (o AclOutput) TagsAll() pulumi.StringMapOutput {
   288  	return o.ApplyT(func(v *Acl) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   289  }
   290  
   291  // Set of MemoryDB user names to be included in this ACL.
   292  func (o AclOutput) UserNames() pulumi.StringArrayOutput {
   293  	return o.ApplyT(func(v *Acl) pulumi.StringArrayOutput { return v.UserNames }).(pulumi.StringArrayOutput)
   294  }
   295  
   296  type AclArrayOutput struct{ *pulumi.OutputState }
   297  
   298  func (AclArrayOutput) ElementType() reflect.Type {
   299  	return reflect.TypeOf((*[]*Acl)(nil)).Elem()
   300  }
   301  
   302  func (o AclArrayOutput) ToAclArrayOutput() AclArrayOutput {
   303  	return o
   304  }
   305  
   306  func (o AclArrayOutput) ToAclArrayOutputWithContext(ctx context.Context) AclArrayOutput {
   307  	return o
   308  }
   309  
   310  func (o AclArrayOutput) Index(i pulumi.IntInput) AclOutput {
   311  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Acl {
   312  		return vs[0].([]*Acl)[vs[1].(int)]
   313  	}).(AclOutput)
   314  }
   315  
   316  type AclMapOutput struct{ *pulumi.OutputState }
   317  
   318  func (AclMapOutput) ElementType() reflect.Type {
   319  	return reflect.TypeOf((*map[string]*Acl)(nil)).Elem()
   320  }
   321  
   322  func (o AclMapOutput) ToAclMapOutput() AclMapOutput {
   323  	return o
   324  }
   325  
   326  func (o AclMapOutput) ToAclMapOutputWithContext(ctx context.Context) AclMapOutput {
   327  	return o
   328  }
   329  
   330  func (o AclMapOutput) MapIndex(k pulumi.StringInput) AclOutput {
   331  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Acl {
   332  		return vs[0].(map[string]*Acl)[vs[1].(string)]
   333  	}).(AclOutput)
   334  }
   335  
   336  func init() {
   337  	pulumi.RegisterInputType(reflect.TypeOf((*AclInput)(nil)).Elem(), &Acl{})
   338  	pulumi.RegisterInputType(reflect.TypeOf((*AclArrayInput)(nil)).Elem(), AclArray{})
   339  	pulumi.RegisterInputType(reflect.TypeOf((*AclMapInput)(nil)).Elem(), AclMap{})
   340  	pulumi.RegisterOutputType(AclOutput{})
   341  	pulumi.RegisterOutputType(AclArrayOutput{})
   342  	pulumi.RegisterOutputType(AclMapOutput{})
   343  }