Class ParameterGroup


  • public class ParameterGroup
    extends com.pulumi.resources.CustomResource
    Provides an RDS DB parameter group resource. Documentation of the available parameters for various RDS engines can be found at: * [Aurora MySQL Parameters](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/AuroraMySQL.Reference.html) * [Aurora PostgreSQL Parameters](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/AuroraPostgreSQL.Reference.html) * [MariaDB Parameters](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.MariaDB.Parameters.html) * [Oracle Parameters](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ModifyInstance.Oracle.html#USER_ModifyInstance.Oracle.sqlnet) * [PostgreSQL Parameters](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.PostgreSQL.CommonDBATasks.html#Appendix.PostgreSQL.CommonDBATasks.Parameters) > **Hands-on:** For an example of the `aws.rds.ParameterGroup` in use, follow the Manage AWS RDS Instances tutorial on HashiCorp Learn. > **NOTE:** If you encounter a pulumi preview showing parameter changes after an apply (_i.e._, _perpetual diffs_), see the Problematic Plan Changes example below for additional guidance. ## Example Usage ### Basic Usage
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.rds.ParameterGroup;
     import com.pulumi.aws.rds.ParameterGroupArgs;
     import com.pulumi.aws.rds.inputs.ParameterGroupParameterArgs;
     import java.util.ArrayList;
     import java.util.Arrays;
     import java.util.Map;
     import java.io.File;
     import java.nio.file.Files;
     import java.nio.file.Paths;
     
     public class App {
         public static void main(String[] args) {
             Pulumi.run(App::stack);
         }
     
         public static void stack(Context ctx) {
             var default_ = new ParameterGroup("default", ParameterGroupArgs.builder()
                 .parameters(            
                     ParameterGroupParameterArgs.builder()
                         .name("character_set_server")
                         .value("utf8")
                         .build(),
                     ParameterGroupParameterArgs.builder()
                         .name("character_set_client")
                         .value("utf8")
                         .build())
                 .name("rds-pg")
                 .family("mysql5.6")
                 .build());
     
         }
     }
     
     
    ### Example of Problematic Configuration The following Terraform configuration includes a parameter that overlaps with an AWS default parameter, using the same `name` (`defaultPasswordLifetime`) and `value` (`0`). However: - AWS sets the default `applyMethod` for this parameter to `pending-reboot`. - The AWS Provider defaults all parameters' `applyMethod` to `immediate`. This configuration attempts to change _only_ the `applyMethod` from `pending-reboot` to `immediate`, which is not allowed by AWS.
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.rds.ParameterGroup;
     import com.pulumi.aws.rds.ParameterGroupArgs;
     import com.pulumi.aws.rds.inputs.ParameterGroupParameterArgs;
     import java.util.ArrayList;
     import java.util.Arrays;
     import java.util.Map;
     import java.io.File;
     import java.nio.file.Files;
     import java.nio.file.Paths;
     
     public class App {
         public static void main(String[] args) {
             Pulumi.run(App::stack);
         }
     
         public static void stack(Context ctx) {
             var test = new ParameterGroup("test", ParameterGroupArgs.builder()
                 .parameters(ParameterGroupParameterArgs.builder()
                     .name("default_password_lifetime")
                     .value("0")
                     .build())
                 .name("random-test-parameter")
                 .family("mysql5.7")
                 .build());
     
         }
     }
     
     
    ### Solution 1: Remove the Default Parameter Exclude the default parameter, such as `defaultPasswordLifetime` in this example, from your configuration entirely. This ensures Terraform does not attempt to modify the parameter, leaving it with AWS's default settings.
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.rds.ParameterGroup;
     import com.pulumi.aws.rds.ParameterGroupArgs;
     import java.util.ArrayList;
     import java.util.Arrays;
     import java.util.Map;
     import java.io.File;
     import java.nio.file.Files;
     import java.nio.file.Paths;
     
     public class App {
         public static void main(String[] args) {
             Pulumi.run(App::stack);
         }
     
         public static void stack(Context ctx) {
             var test = new ParameterGroup("test", ParameterGroupArgs.builder()
                 .name("random-test-parameter")
                 .family("mysql5.7")
                 .build());
     
         }
     }
     
     
    ### Solution 2: Modify the Parameter's Value Also Change the `value` of the parameter along with its `applyMethod`. Since the AWS default `value` is `0`, selecting any other valid value (_e.g._, `1`) will resolve the issue.
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.rds.ParameterGroup;
     import com.pulumi.aws.rds.ParameterGroupArgs;
     import com.pulumi.aws.rds.inputs.ParameterGroupParameterArgs;
     import java.util.ArrayList;
     import java.util.Arrays;
     import java.util.Map;
     import java.io.File;
     import java.nio.file.Files;
     import java.nio.file.Paths;
     
     public class App {
         public static void main(String[] args) {
             Pulumi.run(App::stack);
         }
     
         public static void stack(Context ctx) {
             var test = new ParameterGroup("test", ParameterGroupArgs.builder()
                 .parameters(ParameterGroupParameterArgs.builder()
                     .name("default_password_lifetime")
                     .value("1")
                     .build())
                 .name("random-test-parameter")
                 .family("mysql5.7")
                 .build());
     
         }
     }
     
     
    ### Solution 3: Align `applyMethod` with AWS Defaults Explicitly set the `applyMethod` to match AWS's default value for this parameter (`pending-reboot`). This prevents conflicts between Terraform's default (`immediate`) and AWS's default where the `value` is not changing.
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.rds.ParameterGroup;
     import com.pulumi.aws.rds.ParameterGroupArgs;
     import com.pulumi.aws.rds.inputs.ParameterGroupParameterArgs;
     import java.util.ArrayList;
     import java.util.Arrays;
     import java.util.Map;
     import java.io.File;
     import java.nio.file.Files;
     import java.nio.file.Paths;
     
     public class App {
         public static void main(String[] args) {
             Pulumi.run(App::stack);
         }
     
         public static void stack(Context ctx) {
             var test = new ParameterGroup("test", ParameterGroupArgs.builder()
                 .parameters(ParameterGroupParameterArgs.builder()
                     .applyMethod("pending-reboot")
                     .name("default_password_lifetime")
                     .value("0")
                     .build())
                 .name("random-test-parameter")
                 .family("mysql5.7")
                 .build());
     
         }
     }
     
     
    ## Import ### Identity Schema #### Required - `name` (String) Name of the DB parameter group. #### Optional - `accountId` (String) AWS Account where this resource is managed. - `region` (String) Region where this resource is managed. Using `pulumi import`, import DB Parameter groups using the `name`. For example: ```sh $ pulumi import aws:rds/parameterGroup:ParameterGroup example rds-pg ```
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.pulumi.resources.CustomResource

        com.pulumi.resources.CustomResource.CustomResourceInternal
      • Nested classes/interfaces inherited from class com.pulumi.resources.Resource

        com.pulumi.resources.Resource.LazyField<T extends java.lang.Object>, com.pulumi.resources.Resource.LazyFields, com.pulumi.resources.Resource.ResourceInternal
    • Field Summary

      • Fields inherited from class com.pulumi.resources.Resource

        childResources, remote
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.pulumi.core.Output<java.lang.String> arn()  
      com.pulumi.core.Output<java.lang.String> description()  
      com.pulumi.core.Output<java.lang.String> family()  
      static ParameterGroup get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, ParameterGroupState state, com.pulumi.resources.CustomResourceOptions options)
      Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
      com.pulumi.core.Output<java.lang.String> name()  
      com.pulumi.core.Output<java.lang.String> namePrefix()  
      com.pulumi.core.Output<java.util.Optional<java.util.List<ParameterGroupParameter>>> parameters()  
      com.pulumi.core.Output<java.lang.String> region()  
      com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> skipDestroy()  
      com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>>> tags()  
      com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> tagsAll()  
      • Methods inherited from class com.pulumi.resources.CustomResource

        getId, id, idFuture
      • Methods inherited from class com.pulumi.resources.Resource

        getChildResources, getResourceName, getResourceType, getUrn, pulumiChildResources, pulumiResourceName, pulumiResourceType, urn
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ParameterGroup

        public ParameterGroup​(java.lang.String name)
        Parameters:
        name - The _unique_ name of the resulting resource.
      • ParameterGroup

        public ParameterGroup​(java.lang.String name,
                              ParameterGroupArgs args)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
      • ParameterGroup

        public ParameterGroup​(java.lang.String name,
                              ParameterGroupArgs args,
                              @Nullable
                              com.pulumi.resources.CustomResourceOptions options)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
        options - A bag of options that control this resource's behavior.
    • Method Detail

      • arn

        public com.pulumi.core.Output<java.lang.String> arn()
        Returns:
        ARN of the DB parameter group.
      • description

        public com.pulumi.core.Output<java.lang.String> description()
        Returns:
        Description of the DB parameter group. Defaults to "Managed by Pulumi".
      • family

        public com.pulumi.core.Output<java.lang.String> family()
        Returns:
        Family of the DB parameter group.
      • name

        public com.pulumi.core.Output<java.lang.String> name()
        Returns:
        Name of the DB parameter group. If omitted, the provider will assign a random, unique name.
      • namePrefix

        public com.pulumi.core.Output<java.lang.String> namePrefix()
        Returns:
        Creates a unique name beginning with the specified prefix. Conflicts with `name`.
      • parameters

        public com.pulumi.core.Output<java.util.Optional<java.util.List<ParameterGroupParameter>>> parameters()
        Returns:
        DB parameters to apply. See `parameter` Block below for more details. Note that parameters may differ from a family to an other. Full list of all parameters can be discovered via [`aws rds describe-db-parameters`](https://docs.aws.amazon.com/cli/latest/reference/rds/describe-db-parameters.html) after initial creation of the group.
      • region

        public com.pulumi.core.Output<java.lang.String> region()
        Returns:
        Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
      • skipDestroy

        public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> skipDestroy()
        Returns:
        Set to true if you do not wish the parameter group to be deleted at destroy time, and instead just remove the parameter group from the Terraform state.
      • tags

        public com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>>> tags()
        Returns:
        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.
      • tagsAll

        public com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> tagsAll()
        Returns:
        Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
      • get

        public static ParameterGroup get​(java.lang.String name,
                                         com.pulumi.core.Output<java.lang.String> id,
                                         @Nullable
                                         ParameterGroupState state,
                                         @Nullable
                                         com.pulumi.resources.CustomResourceOptions options)
        Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
        Parameters:
        name - The _unique_ name of the resulting resource.
        id - The _unique_ provider ID of the resource to lookup.
        state -
        options - Optional settings to control the behavior of the CustomResource.