github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/elasticache/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 elasticache
     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 ElastiCache parameter group resource.
    16  //
    17  // > **NOTE:** Attempting to remove the `reserved-memory` parameter when `family` is set to `redis2.6` or `redis2.8` may show a perpetual difference in this provider due to an ElastiCache API limitation. Leave that parameter configured with any value to workaround the issue.
    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/elasticache"
    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 := elasticache.NewParameterGroup(ctx, "default", &elasticache.ParameterGroupArgs{
    35  //				Name:   pulumi.String("cache-params"),
    36  //				Family: pulumi.String("redis2.8"),
    37  //				Parameters: elasticache.ParameterGroupParameterArray{
    38  //					&elasticache.ParameterGroupParameterArgs{
    39  //						Name:  pulumi.String("activerehashing"),
    40  //						Value: pulumi.String("yes"),
    41  //					},
    42  //					&elasticache.ParameterGroupParameterArgs{
    43  //						Name:  pulumi.String("min-slaves-to-write"),
    44  //						Value: pulumi.String("2"),
    45  //					},
    46  //				},
    47  //			})
    48  //			if err != nil {
    49  //				return err
    50  //			}
    51  //			return nil
    52  //		})
    53  //	}
    54  //
    55  // ```
    56  // <!--End PulumiCodeChooser -->
    57  //
    58  // ## Import
    59  //
    60  // Using `pulumi import`, import ElastiCache Parameter Groups using the `name`. For example:
    61  //
    62  // ```sh
    63  // $ pulumi import aws:elasticache/parameterGroup:ParameterGroup default redis-params
    64  // ```
    65  type ParameterGroup struct {
    66  	pulumi.CustomResourceState
    67  
    68  	// The AWS ARN associated with the parameter group.
    69  	Arn pulumi.StringOutput `pulumi:"arn"`
    70  	// The description of the ElastiCache parameter group. Defaults to "Managed by Pulumi".
    71  	Description pulumi.StringOutput `pulumi:"description"`
    72  	// The family of the ElastiCache parameter group.
    73  	Family pulumi.StringOutput `pulumi:"family"`
    74  	// The name of the ElastiCache parameter.
    75  	Name pulumi.StringOutput `pulumi:"name"`
    76  	// A list of ElastiCache parameters to apply.
    77  	Parameters ParameterGroupParameterArrayOutput `pulumi:"parameters"`
    78  	// Key-value mapping of resource tags. 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  	if args.Description == nil {
    97  		args.Description = pulumi.StringPtr("Managed by Pulumi")
    98  	}
    99  	opts = internal.PkgResourceDefaultOpts(opts)
   100  	var resource ParameterGroup
   101  	err := ctx.RegisterResource("aws:elasticache/parameterGroup:ParameterGroup", name, args, &resource, opts...)
   102  	if err != nil {
   103  		return nil, err
   104  	}
   105  	return &resource, nil
   106  }
   107  
   108  // GetParameterGroup gets an existing ParameterGroup resource's state with the given name, ID, and optional
   109  // state properties that are used to uniquely qualify the lookup (nil if not required).
   110  func GetParameterGroup(ctx *pulumi.Context,
   111  	name string, id pulumi.IDInput, state *ParameterGroupState, opts ...pulumi.ResourceOption) (*ParameterGroup, error) {
   112  	var resource ParameterGroup
   113  	err := ctx.ReadResource("aws:elasticache/parameterGroup:ParameterGroup", name, id, state, &resource, opts...)
   114  	if err != nil {
   115  		return nil, err
   116  	}
   117  	return &resource, nil
   118  }
   119  
   120  // Input properties used for looking up and filtering ParameterGroup resources.
   121  type parameterGroupState struct {
   122  	// The AWS ARN associated with the parameter group.
   123  	Arn *string `pulumi:"arn"`
   124  	// The description of the ElastiCache parameter group. Defaults to "Managed by Pulumi".
   125  	Description *string `pulumi:"description"`
   126  	// The family of the ElastiCache parameter group.
   127  	Family *string `pulumi:"family"`
   128  	// The name of the ElastiCache parameter.
   129  	Name *string `pulumi:"name"`
   130  	// A list of ElastiCache parameters to apply.
   131  	Parameters []ParameterGroupParameter `pulumi:"parameters"`
   132  	// Key-value mapping of resource tags. 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 ParameterGroupState struct {
   141  	// The AWS ARN associated with the parameter group.
   142  	Arn pulumi.StringPtrInput
   143  	// The description of the ElastiCache parameter group. Defaults to "Managed by Pulumi".
   144  	Description pulumi.StringPtrInput
   145  	// The family of the ElastiCache parameter group.
   146  	Family pulumi.StringPtrInput
   147  	// The name of the ElastiCache parameter.
   148  	Name pulumi.StringPtrInput
   149  	// A list of ElastiCache parameters to apply.
   150  	Parameters ParameterGroupParameterArrayInput
   151  	// Key-value mapping of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level
   152  	Tags pulumi.StringMapInput
   153  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   154  	//
   155  	// Deprecated: Please use `tags` instead.
   156  	TagsAll pulumi.StringMapInput
   157  }
   158  
   159  func (ParameterGroupState) ElementType() reflect.Type {
   160  	return reflect.TypeOf((*parameterGroupState)(nil)).Elem()
   161  }
   162  
   163  type parameterGroupArgs struct {
   164  	// The description of the ElastiCache parameter group. Defaults to "Managed by Pulumi".
   165  	Description *string `pulumi:"description"`
   166  	// The family of the ElastiCache parameter group.
   167  	Family string `pulumi:"family"`
   168  	// The name of the ElastiCache parameter.
   169  	Name *string `pulumi:"name"`
   170  	// A list of ElastiCache parameters to apply.
   171  	Parameters []ParameterGroupParameter `pulumi:"parameters"`
   172  	// Key-value mapping of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level
   173  	Tags map[string]string `pulumi:"tags"`
   174  }
   175  
   176  // The set of arguments for constructing a ParameterGroup resource.
   177  type ParameterGroupArgs struct {
   178  	// The description of the ElastiCache parameter group. Defaults to "Managed by Pulumi".
   179  	Description pulumi.StringPtrInput
   180  	// The family of the ElastiCache parameter group.
   181  	Family pulumi.StringInput
   182  	// The name of the ElastiCache parameter.
   183  	Name pulumi.StringPtrInput
   184  	// A list of ElastiCache parameters to apply.
   185  	Parameters ParameterGroupParameterArrayInput
   186  	// Key-value mapping of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level
   187  	Tags pulumi.StringMapInput
   188  }
   189  
   190  func (ParameterGroupArgs) ElementType() reflect.Type {
   191  	return reflect.TypeOf((*parameterGroupArgs)(nil)).Elem()
   192  }
   193  
   194  type ParameterGroupInput interface {
   195  	pulumi.Input
   196  
   197  	ToParameterGroupOutput() ParameterGroupOutput
   198  	ToParameterGroupOutputWithContext(ctx context.Context) ParameterGroupOutput
   199  }
   200  
   201  func (*ParameterGroup) ElementType() reflect.Type {
   202  	return reflect.TypeOf((**ParameterGroup)(nil)).Elem()
   203  }
   204  
   205  func (i *ParameterGroup) ToParameterGroupOutput() ParameterGroupOutput {
   206  	return i.ToParameterGroupOutputWithContext(context.Background())
   207  }
   208  
   209  func (i *ParameterGroup) ToParameterGroupOutputWithContext(ctx context.Context) ParameterGroupOutput {
   210  	return pulumi.ToOutputWithContext(ctx, i).(ParameterGroupOutput)
   211  }
   212  
   213  // ParameterGroupArrayInput is an input type that accepts ParameterGroupArray and ParameterGroupArrayOutput values.
   214  // You can construct a concrete instance of `ParameterGroupArrayInput` via:
   215  //
   216  //	ParameterGroupArray{ ParameterGroupArgs{...} }
   217  type ParameterGroupArrayInput interface {
   218  	pulumi.Input
   219  
   220  	ToParameterGroupArrayOutput() ParameterGroupArrayOutput
   221  	ToParameterGroupArrayOutputWithContext(context.Context) ParameterGroupArrayOutput
   222  }
   223  
   224  type ParameterGroupArray []ParameterGroupInput
   225  
   226  func (ParameterGroupArray) ElementType() reflect.Type {
   227  	return reflect.TypeOf((*[]*ParameterGroup)(nil)).Elem()
   228  }
   229  
   230  func (i ParameterGroupArray) ToParameterGroupArrayOutput() ParameterGroupArrayOutput {
   231  	return i.ToParameterGroupArrayOutputWithContext(context.Background())
   232  }
   233  
   234  func (i ParameterGroupArray) ToParameterGroupArrayOutputWithContext(ctx context.Context) ParameterGroupArrayOutput {
   235  	return pulumi.ToOutputWithContext(ctx, i).(ParameterGroupArrayOutput)
   236  }
   237  
   238  // ParameterGroupMapInput is an input type that accepts ParameterGroupMap and ParameterGroupMapOutput values.
   239  // You can construct a concrete instance of `ParameterGroupMapInput` via:
   240  //
   241  //	ParameterGroupMap{ "key": ParameterGroupArgs{...} }
   242  type ParameterGroupMapInput interface {
   243  	pulumi.Input
   244  
   245  	ToParameterGroupMapOutput() ParameterGroupMapOutput
   246  	ToParameterGroupMapOutputWithContext(context.Context) ParameterGroupMapOutput
   247  }
   248  
   249  type ParameterGroupMap map[string]ParameterGroupInput
   250  
   251  func (ParameterGroupMap) ElementType() reflect.Type {
   252  	return reflect.TypeOf((*map[string]*ParameterGroup)(nil)).Elem()
   253  }
   254  
   255  func (i ParameterGroupMap) ToParameterGroupMapOutput() ParameterGroupMapOutput {
   256  	return i.ToParameterGroupMapOutputWithContext(context.Background())
   257  }
   258  
   259  func (i ParameterGroupMap) ToParameterGroupMapOutputWithContext(ctx context.Context) ParameterGroupMapOutput {
   260  	return pulumi.ToOutputWithContext(ctx, i).(ParameterGroupMapOutput)
   261  }
   262  
   263  type ParameterGroupOutput struct{ *pulumi.OutputState }
   264  
   265  func (ParameterGroupOutput) ElementType() reflect.Type {
   266  	return reflect.TypeOf((**ParameterGroup)(nil)).Elem()
   267  }
   268  
   269  func (o ParameterGroupOutput) ToParameterGroupOutput() ParameterGroupOutput {
   270  	return o
   271  }
   272  
   273  func (o ParameterGroupOutput) ToParameterGroupOutputWithContext(ctx context.Context) ParameterGroupOutput {
   274  	return o
   275  }
   276  
   277  // The AWS ARN associated with the parameter group.
   278  func (o ParameterGroupOutput) Arn() pulumi.StringOutput {
   279  	return o.ApplyT(func(v *ParameterGroup) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   280  }
   281  
   282  // The description of the ElastiCache parameter group. Defaults to "Managed by Pulumi".
   283  func (o ParameterGroupOutput) Description() pulumi.StringOutput {
   284  	return o.ApplyT(func(v *ParameterGroup) pulumi.StringOutput { return v.Description }).(pulumi.StringOutput)
   285  }
   286  
   287  // The family of the ElastiCache parameter group.
   288  func (o ParameterGroupOutput) Family() pulumi.StringOutput {
   289  	return o.ApplyT(func(v *ParameterGroup) pulumi.StringOutput { return v.Family }).(pulumi.StringOutput)
   290  }
   291  
   292  // The name of the ElastiCache parameter.
   293  func (o ParameterGroupOutput) Name() pulumi.StringOutput {
   294  	return o.ApplyT(func(v *ParameterGroup) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
   295  }
   296  
   297  // A list of ElastiCache parameters to apply.
   298  func (o ParameterGroupOutput) Parameters() ParameterGroupParameterArrayOutput {
   299  	return o.ApplyT(func(v *ParameterGroup) ParameterGroupParameterArrayOutput { return v.Parameters }).(ParameterGroupParameterArrayOutput)
   300  }
   301  
   302  // Key-value mapping of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level
   303  func (o ParameterGroupOutput) Tags() pulumi.StringMapOutput {
   304  	return o.ApplyT(func(v *ParameterGroup) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   305  }
   306  
   307  // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   308  //
   309  // Deprecated: Please use `tags` instead.
   310  func (o ParameterGroupOutput) TagsAll() pulumi.StringMapOutput {
   311  	return o.ApplyT(func(v *ParameterGroup) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   312  }
   313  
   314  type ParameterGroupArrayOutput struct{ *pulumi.OutputState }
   315  
   316  func (ParameterGroupArrayOutput) ElementType() reflect.Type {
   317  	return reflect.TypeOf((*[]*ParameterGroup)(nil)).Elem()
   318  }
   319  
   320  func (o ParameterGroupArrayOutput) ToParameterGroupArrayOutput() ParameterGroupArrayOutput {
   321  	return o
   322  }
   323  
   324  func (o ParameterGroupArrayOutput) ToParameterGroupArrayOutputWithContext(ctx context.Context) ParameterGroupArrayOutput {
   325  	return o
   326  }
   327  
   328  func (o ParameterGroupArrayOutput) Index(i pulumi.IntInput) ParameterGroupOutput {
   329  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ParameterGroup {
   330  		return vs[0].([]*ParameterGroup)[vs[1].(int)]
   331  	}).(ParameterGroupOutput)
   332  }
   333  
   334  type ParameterGroupMapOutput struct{ *pulumi.OutputState }
   335  
   336  func (ParameterGroupMapOutput) ElementType() reflect.Type {
   337  	return reflect.TypeOf((*map[string]*ParameterGroup)(nil)).Elem()
   338  }
   339  
   340  func (o ParameterGroupMapOutput) ToParameterGroupMapOutput() ParameterGroupMapOutput {
   341  	return o
   342  }
   343  
   344  func (o ParameterGroupMapOutput) ToParameterGroupMapOutputWithContext(ctx context.Context) ParameterGroupMapOutput {
   345  	return o
   346  }
   347  
   348  func (o ParameterGroupMapOutput) MapIndex(k pulumi.StringInput) ParameterGroupOutput {
   349  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ParameterGroup {
   350  		return vs[0].(map[string]*ParameterGroup)[vs[1].(string)]
   351  	}).(ParameterGroupOutput)
   352  }
   353  
   354  func init() {
   355  	pulumi.RegisterInputType(reflect.TypeOf((*ParameterGroupInput)(nil)).Elem(), &ParameterGroup{})
   356  	pulumi.RegisterInputType(reflect.TypeOf((*ParameterGroupArrayInput)(nil)).Elem(), ParameterGroupArray{})
   357  	pulumi.RegisterInputType(reflect.TypeOf((*ParameterGroupMapInput)(nil)).Elem(), ParameterGroupMap{})
   358  	pulumi.RegisterOutputType(ParameterGroupOutput{})
   359  	pulumi.RegisterOutputType(ParameterGroupArrayOutput{})
   360  	pulumi.RegisterOutputType(ParameterGroupMapOutput{})
   361  }