github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/memorydb/parameterGroup.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  	"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 a MemoryDB Parameter Group.
    16  //
    17  // More information about parameter groups can be found in the [MemoryDB User Guide](https://docs.aws.amazon.com/memorydb/latest/devguide/parametergroups.html).
    18  //
    19  // ## Example Usage
    20  //
    21  // <!--Start PulumiCodeChooser -->
    22  // ```go
    23  // package main
    24  //
    25  // import (
    26  //
    27  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/memorydb"
    28  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    29  //
    30  // )
    31  //
    32  //	func main() {
    33  //		pulumi.Run(func(ctx *pulumi.Context) error {
    34  //			_, err := memorydb.NewParameterGroup(ctx, "example", &memorydb.ParameterGroupArgs{
    35  //				Name:   pulumi.String("my-parameter-group"),
    36  //				Family: pulumi.String("memorydb_redis6"),
    37  //				Parameters: memorydb.ParameterGroupParameterArray{
    38  //					&memorydb.ParameterGroupParameterArgs{
    39  //						Name:  pulumi.String("activedefrag"),
    40  //						Value: pulumi.String("yes"),
    41  //					},
    42  //				},
    43  //			})
    44  //			if err != nil {
    45  //				return err
    46  //			}
    47  //			return nil
    48  //		})
    49  //	}
    50  //
    51  // ```
    52  // <!--End PulumiCodeChooser -->
    53  //
    54  // ## Import
    55  //
    56  // Using `pulumi import`, import a parameter group using the `name`. For example:
    57  //
    58  // ```sh
    59  // $ pulumi import aws:memorydb/parameterGroup:ParameterGroup example my-parameter-group
    60  // ```
    61  type ParameterGroup struct {
    62  	pulumi.CustomResourceState
    63  
    64  	// The ARN of the parameter group.
    65  	Arn pulumi.StringOutput `pulumi:"arn"`
    66  	// Description for the parameter group.
    67  	Description pulumi.StringPtrOutput `pulumi:"description"`
    68  	// The engine version that the parameter group can be used with.
    69  	//
    70  	// The following arguments are optional:
    71  	Family pulumi.StringOutput `pulumi:"family"`
    72  	// Name of the parameter group. If omitted, the provider will assign a random, unique name. Conflicts with `namePrefix`.
    73  	Name pulumi.StringOutput `pulumi:"name"`
    74  	// Creates a unique name beginning with the specified prefix. Conflicts with `name`.
    75  	NamePrefix pulumi.StringOutput `pulumi:"namePrefix"`
    76  	// Set of MemoryDB parameters to apply. Any parameters not specified will fall back to their family defaults. Detailed below.
    77  	Parameters ParameterGroupParameterArrayOutput `pulumi:"parameters"`
    78  	// 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.
    79  	Tags pulumi.StringMapOutput `pulumi:"tags"`
    80  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
    81  	//
    82  	// Deprecated: Please use `tags` instead.
    83  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
    84  }
    85  
    86  // NewParameterGroup registers a new resource with the given unique name, arguments, and options.
    87  func NewParameterGroup(ctx *pulumi.Context,
    88  	name string, args *ParameterGroupArgs, opts ...pulumi.ResourceOption) (*ParameterGroup, error) {
    89  	if args == nil {
    90  		return nil, errors.New("missing one or more required arguments")
    91  	}
    92  
    93  	if args.Family == nil {
    94  		return nil, errors.New("invalid value for required argument 'Family'")
    95  	}
    96  	opts = internal.PkgResourceDefaultOpts(opts)
    97  	var resource ParameterGroup
    98  	err := ctx.RegisterResource("aws:memorydb/parameterGroup:ParameterGroup", name, args, &resource, opts...)
    99  	if err != nil {
   100  		return nil, err
   101  	}
   102  	return &resource, nil
   103  }
   104  
   105  // GetParameterGroup gets an existing ParameterGroup resource's state with the given name, ID, and optional
   106  // state properties that are used to uniquely qualify the lookup (nil if not required).
   107  func GetParameterGroup(ctx *pulumi.Context,
   108  	name string, id pulumi.IDInput, state *ParameterGroupState, opts ...pulumi.ResourceOption) (*ParameterGroup, error) {
   109  	var resource ParameterGroup
   110  	err := ctx.ReadResource("aws:memorydb/parameterGroup:ParameterGroup", name, id, state, &resource, opts...)
   111  	if err != nil {
   112  		return nil, err
   113  	}
   114  	return &resource, nil
   115  }
   116  
   117  // Input properties used for looking up and filtering ParameterGroup resources.
   118  type parameterGroupState struct {
   119  	// The ARN of the parameter group.
   120  	Arn *string `pulumi:"arn"`
   121  	// Description for the parameter group.
   122  	Description *string `pulumi:"description"`
   123  	// The engine version that the parameter group can be used with.
   124  	//
   125  	// The following arguments are optional:
   126  	Family *string `pulumi:"family"`
   127  	// Name of the parameter group. If omitted, the provider will assign a random, unique name. Conflicts with `namePrefix`.
   128  	Name *string `pulumi:"name"`
   129  	// Creates a unique name beginning with the specified prefix. Conflicts with `name`.
   130  	NamePrefix *string `pulumi:"namePrefix"`
   131  	// Set of MemoryDB parameters to apply. Any parameters not specified will fall back to their family defaults. Detailed below.
   132  	Parameters []ParameterGroupParameter `pulumi:"parameters"`
   133  	// 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.
   134  	Tags map[string]string `pulumi:"tags"`
   135  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   136  	//
   137  	// Deprecated: Please use `tags` instead.
   138  	TagsAll map[string]string `pulumi:"tagsAll"`
   139  }
   140  
   141  type ParameterGroupState struct {
   142  	// The ARN of the parameter group.
   143  	Arn pulumi.StringPtrInput
   144  	// Description for the parameter group.
   145  	Description pulumi.StringPtrInput
   146  	// The engine version that the parameter group can be used with.
   147  	//
   148  	// The following arguments are optional:
   149  	Family pulumi.StringPtrInput
   150  	// Name of the parameter group. If omitted, the provider will assign a random, unique name. Conflicts with `namePrefix`.
   151  	Name pulumi.StringPtrInput
   152  	// Creates a unique name beginning with the specified prefix. Conflicts with `name`.
   153  	NamePrefix pulumi.StringPtrInput
   154  	// Set of MemoryDB parameters to apply. Any parameters not specified will fall back to their family defaults. Detailed below.
   155  	Parameters ParameterGroupParameterArrayInput
   156  	// 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.
   157  	Tags pulumi.StringMapInput
   158  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   159  	//
   160  	// Deprecated: Please use `tags` instead.
   161  	TagsAll pulumi.StringMapInput
   162  }
   163  
   164  func (ParameterGroupState) ElementType() reflect.Type {
   165  	return reflect.TypeOf((*parameterGroupState)(nil)).Elem()
   166  }
   167  
   168  type parameterGroupArgs struct {
   169  	// Description for the parameter group.
   170  	Description *string `pulumi:"description"`
   171  	// The engine version that the parameter group can be used with.
   172  	//
   173  	// The following arguments are optional:
   174  	Family string `pulumi:"family"`
   175  	// Name of the parameter group. If omitted, the provider will assign a random, unique name. Conflicts with `namePrefix`.
   176  	Name *string `pulumi:"name"`
   177  	// Creates a unique name beginning with the specified prefix. Conflicts with `name`.
   178  	NamePrefix *string `pulumi:"namePrefix"`
   179  	// Set of MemoryDB parameters to apply. Any parameters not specified will fall back to their family defaults. Detailed below.
   180  	Parameters []ParameterGroupParameter `pulumi:"parameters"`
   181  	// 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.
   182  	Tags map[string]string `pulumi:"tags"`
   183  }
   184  
   185  // The set of arguments for constructing a ParameterGroup resource.
   186  type ParameterGroupArgs struct {
   187  	// Description for the parameter group.
   188  	Description pulumi.StringPtrInput
   189  	// The engine version that the parameter group can be used with.
   190  	//
   191  	// The following arguments are optional:
   192  	Family pulumi.StringInput
   193  	// Name of the parameter group. If omitted, the provider will assign a random, unique name. Conflicts with `namePrefix`.
   194  	Name pulumi.StringPtrInput
   195  	// Creates a unique name beginning with the specified prefix. Conflicts with `name`.
   196  	NamePrefix pulumi.StringPtrInput
   197  	// Set of MemoryDB parameters to apply. Any parameters not specified will fall back to their family defaults. Detailed below.
   198  	Parameters ParameterGroupParameterArrayInput
   199  	// 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.
   200  	Tags pulumi.StringMapInput
   201  }
   202  
   203  func (ParameterGroupArgs) ElementType() reflect.Type {
   204  	return reflect.TypeOf((*parameterGroupArgs)(nil)).Elem()
   205  }
   206  
   207  type ParameterGroupInput interface {
   208  	pulumi.Input
   209  
   210  	ToParameterGroupOutput() ParameterGroupOutput
   211  	ToParameterGroupOutputWithContext(ctx context.Context) ParameterGroupOutput
   212  }
   213  
   214  func (*ParameterGroup) ElementType() reflect.Type {
   215  	return reflect.TypeOf((**ParameterGroup)(nil)).Elem()
   216  }
   217  
   218  func (i *ParameterGroup) ToParameterGroupOutput() ParameterGroupOutput {
   219  	return i.ToParameterGroupOutputWithContext(context.Background())
   220  }
   221  
   222  func (i *ParameterGroup) ToParameterGroupOutputWithContext(ctx context.Context) ParameterGroupOutput {
   223  	return pulumi.ToOutputWithContext(ctx, i).(ParameterGroupOutput)
   224  }
   225  
   226  // ParameterGroupArrayInput is an input type that accepts ParameterGroupArray and ParameterGroupArrayOutput values.
   227  // You can construct a concrete instance of `ParameterGroupArrayInput` via:
   228  //
   229  //	ParameterGroupArray{ ParameterGroupArgs{...} }
   230  type ParameterGroupArrayInput interface {
   231  	pulumi.Input
   232  
   233  	ToParameterGroupArrayOutput() ParameterGroupArrayOutput
   234  	ToParameterGroupArrayOutputWithContext(context.Context) ParameterGroupArrayOutput
   235  }
   236  
   237  type ParameterGroupArray []ParameterGroupInput
   238  
   239  func (ParameterGroupArray) ElementType() reflect.Type {
   240  	return reflect.TypeOf((*[]*ParameterGroup)(nil)).Elem()
   241  }
   242  
   243  func (i ParameterGroupArray) ToParameterGroupArrayOutput() ParameterGroupArrayOutput {
   244  	return i.ToParameterGroupArrayOutputWithContext(context.Background())
   245  }
   246  
   247  func (i ParameterGroupArray) ToParameterGroupArrayOutputWithContext(ctx context.Context) ParameterGroupArrayOutput {
   248  	return pulumi.ToOutputWithContext(ctx, i).(ParameterGroupArrayOutput)
   249  }
   250  
   251  // ParameterGroupMapInput is an input type that accepts ParameterGroupMap and ParameterGroupMapOutput values.
   252  // You can construct a concrete instance of `ParameterGroupMapInput` via:
   253  //
   254  //	ParameterGroupMap{ "key": ParameterGroupArgs{...} }
   255  type ParameterGroupMapInput interface {
   256  	pulumi.Input
   257  
   258  	ToParameterGroupMapOutput() ParameterGroupMapOutput
   259  	ToParameterGroupMapOutputWithContext(context.Context) ParameterGroupMapOutput
   260  }
   261  
   262  type ParameterGroupMap map[string]ParameterGroupInput
   263  
   264  func (ParameterGroupMap) ElementType() reflect.Type {
   265  	return reflect.TypeOf((*map[string]*ParameterGroup)(nil)).Elem()
   266  }
   267  
   268  func (i ParameterGroupMap) ToParameterGroupMapOutput() ParameterGroupMapOutput {
   269  	return i.ToParameterGroupMapOutputWithContext(context.Background())
   270  }
   271  
   272  func (i ParameterGroupMap) ToParameterGroupMapOutputWithContext(ctx context.Context) ParameterGroupMapOutput {
   273  	return pulumi.ToOutputWithContext(ctx, i).(ParameterGroupMapOutput)
   274  }
   275  
   276  type ParameterGroupOutput struct{ *pulumi.OutputState }
   277  
   278  func (ParameterGroupOutput) ElementType() reflect.Type {
   279  	return reflect.TypeOf((**ParameterGroup)(nil)).Elem()
   280  }
   281  
   282  func (o ParameterGroupOutput) ToParameterGroupOutput() ParameterGroupOutput {
   283  	return o
   284  }
   285  
   286  func (o ParameterGroupOutput) ToParameterGroupOutputWithContext(ctx context.Context) ParameterGroupOutput {
   287  	return o
   288  }
   289  
   290  // The ARN of the parameter group.
   291  func (o ParameterGroupOutput) Arn() pulumi.StringOutput {
   292  	return o.ApplyT(func(v *ParameterGroup) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   293  }
   294  
   295  // Description for the parameter group.
   296  func (o ParameterGroupOutput) Description() pulumi.StringPtrOutput {
   297  	return o.ApplyT(func(v *ParameterGroup) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
   298  }
   299  
   300  // The engine version that the parameter group can be used with.
   301  //
   302  // The following arguments are optional:
   303  func (o ParameterGroupOutput) Family() pulumi.StringOutput {
   304  	return o.ApplyT(func(v *ParameterGroup) pulumi.StringOutput { return v.Family }).(pulumi.StringOutput)
   305  }
   306  
   307  // Name of the parameter group. If omitted, the provider will assign a random, unique name. Conflicts with `namePrefix`.
   308  func (o ParameterGroupOutput) Name() pulumi.StringOutput {
   309  	return o.ApplyT(func(v *ParameterGroup) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
   310  }
   311  
   312  // Creates a unique name beginning with the specified prefix. Conflicts with `name`.
   313  func (o ParameterGroupOutput) NamePrefix() pulumi.StringOutput {
   314  	return o.ApplyT(func(v *ParameterGroup) pulumi.StringOutput { return v.NamePrefix }).(pulumi.StringOutput)
   315  }
   316  
   317  // Set of MemoryDB parameters to apply. Any parameters not specified will fall back to their family defaults. Detailed below.
   318  func (o ParameterGroupOutput) Parameters() ParameterGroupParameterArrayOutput {
   319  	return o.ApplyT(func(v *ParameterGroup) ParameterGroupParameterArrayOutput { return v.Parameters }).(ParameterGroupParameterArrayOutput)
   320  }
   321  
   322  // 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.
   323  func (o ParameterGroupOutput) Tags() pulumi.StringMapOutput {
   324  	return o.ApplyT(func(v *ParameterGroup) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   325  }
   326  
   327  // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   328  //
   329  // Deprecated: Please use `tags` instead.
   330  func (o ParameterGroupOutput) TagsAll() pulumi.StringMapOutput {
   331  	return o.ApplyT(func(v *ParameterGroup) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   332  }
   333  
   334  type ParameterGroupArrayOutput struct{ *pulumi.OutputState }
   335  
   336  func (ParameterGroupArrayOutput) ElementType() reflect.Type {
   337  	return reflect.TypeOf((*[]*ParameterGroup)(nil)).Elem()
   338  }
   339  
   340  func (o ParameterGroupArrayOutput) ToParameterGroupArrayOutput() ParameterGroupArrayOutput {
   341  	return o
   342  }
   343  
   344  func (o ParameterGroupArrayOutput) ToParameterGroupArrayOutputWithContext(ctx context.Context) ParameterGroupArrayOutput {
   345  	return o
   346  }
   347  
   348  func (o ParameterGroupArrayOutput) Index(i pulumi.IntInput) ParameterGroupOutput {
   349  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ParameterGroup {
   350  		return vs[0].([]*ParameterGroup)[vs[1].(int)]
   351  	}).(ParameterGroupOutput)
   352  }
   353  
   354  type ParameterGroupMapOutput struct{ *pulumi.OutputState }
   355  
   356  func (ParameterGroupMapOutput) ElementType() reflect.Type {
   357  	return reflect.TypeOf((*map[string]*ParameterGroup)(nil)).Elem()
   358  }
   359  
   360  func (o ParameterGroupMapOutput) ToParameterGroupMapOutput() ParameterGroupMapOutput {
   361  	return o
   362  }
   363  
   364  func (o ParameterGroupMapOutput) ToParameterGroupMapOutputWithContext(ctx context.Context) ParameterGroupMapOutput {
   365  	return o
   366  }
   367  
   368  func (o ParameterGroupMapOutput) MapIndex(k pulumi.StringInput) ParameterGroupOutput {
   369  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ParameterGroup {
   370  		return vs[0].(map[string]*ParameterGroup)[vs[1].(string)]
   371  	}).(ParameterGroupOutput)
   372  }
   373  
   374  func init() {
   375  	pulumi.RegisterInputType(reflect.TypeOf((*ParameterGroupInput)(nil)).Elem(), &ParameterGroup{})
   376  	pulumi.RegisterInputType(reflect.TypeOf((*ParameterGroupArrayInput)(nil)).Elem(), ParameterGroupArray{})
   377  	pulumi.RegisterInputType(reflect.TypeOf((*ParameterGroupMapInput)(nil)).Elem(), ParameterGroupMap{})
   378  	pulumi.RegisterOutputType(ParameterGroupOutput{})
   379  	pulumi.RegisterOutputType(ParameterGroupArrayOutput{})
   380  	pulumi.RegisterOutputType(ParameterGroupMapOutput{})
   381  }