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