Class ReservedInstance


  • public class ReservedInstance
    extends com.pulumi.resources.CustomResource
    Manages an RDS DB Reserved Instance. > **NOTE:** Once created, a reservation is valid for the `duration` of the provided `offeringId` and cannot be deleted. Performing a `destroy` will only remove the resource from state. For more information see [RDS Reserved Instances Documentation](https://aws.amazon.com/rds/reserved-instances/) and [PurchaseReservedDBInstancesOffering](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_PurchaseReservedDBInstancesOffering.html). > **NOTE:** Due to the expense of testing this resource, we provide it as best effort. If you find it useful, and have the ability to help test or notice issues, consider reaching out to us on GitHub. ## Example Usage
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.rds.RdsFunctions;
     import com.pulumi.aws.rds.inputs.GetReservedInstanceOfferingArgs;
     import com.pulumi.aws.rds.ReservedInstance;
     import com.pulumi.aws.rds.ReservedInstanceArgs;
     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) {
             final var test = RdsFunctions.getReservedInstanceOffering(GetReservedInstanceOfferingArgs.builder()
                 .dbInstanceClass("db.t2.micro")
                 .duration(31536000)
                 .multiAz(false)
                 .offeringType("All Upfront")
                 .productDescription("mysql")
                 .build());
     
             var example = new ReservedInstance("example", ReservedInstanceArgs.builder()
                 .offeringId(test.offeringId())
                 .reservationId("optionalCustomReservationID")
                 .instanceCount(3)
                 .build());
     
         }
     }
     
     
    ## Import Using `pulumi import`, import RDS DB Instance Reservations using the `instanceId`. For example: ```sh $ pulumi import aws:rds/reservedInstance:ReservedInstance reservation_instance CustomReservationID ```
    • 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> currencyCode()  
      com.pulumi.core.Output<java.lang.String> dbInstanceClass()  
      com.pulumi.core.Output<java.lang.Integer> duration()  
      com.pulumi.core.Output<java.lang.Double> fixedPrice()  
      static ReservedInstance get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, ReservedInstanceState 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.util.Optional<java.lang.Integer>> instanceCount()  
      com.pulumi.core.Output<java.lang.String> leaseId()  
      com.pulumi.core.Output<java.lang.Boolean> multiAz()  
      com.pulumi.core.Output<java.lang.String> offeringId()  
      com.pulumi.core.Output<java.lang.String> offeringType()  
      com.pulumi.core.Output<java.lang.String> productDescription()  
      com.pulumi.core.Output<java.util.List<ReservedInstanceRecurringCharge>> recurringCharges()  
      com.pulumi.core.Output<java.lang.String> region()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> reservationId()  
      com.pulumi.core.Output<java.lang.String> startTime()  
      com.pulumi.core.Output<java.lang.String> state()  
      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()  
      com.pulumi.core.Output<java.lang.Double> usagePrice()  
      • 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

      • ReservedInstance

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

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

        public ReservedInstance​(java.lang.String name,
                                ReservedInstanceArgs 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 for the reserved DB instance.
      • currencyCode

        public com.pulumi.core.Output<java.lang.String> currencyCode()
        Returns:
        Currency code for the reserved DB instance.
      • dbInstanceClass

        public com.pulumi.core.Output<java.lang.String> dbInstanceClass()
        Returns:
        DB instance class for the reserved DB instance.
      • duration

        public com.pulumi.core.Output<java.lang.Integer> duration()
        Returns:
        Duration of the reservation in seconds.
      • fixedPrice

        public com.pulumi.core.Output<java.lang.Double> fixedPrice()
        Returns:
        Fixed price charged for this reserved DB instance.
      • instanceCount

        public com.pulumi.core.Output<java.util.Optional<java.lang.Integer>> instanceCount()
        Returns:
        Number of instances to reserve. Default value is `1`.
      • leaseId

        public com.pulumi.core.Output<java.lang.String> leaseId()
        Returns:
        Unique identifier for the lease associated with the reserved DB instance. Amazon Web Services Support might request the lease ID for an issue related to a reserved DB instance.
      • multiAz

        public com.pulumi.core.Output<java.lang.Boolean> multiAz()
        Returns:
        Whether the reservation applies to Multi-AZ deployments.
      • offeringId

        public com.pulumi.core.Output<java.lang.String> offeringId()
        Returns:
        ID of the Reserved DB instance offering to purchase. To determine an `offeringId`, see the `aws.rds.getReservedInstanceOffering` data source. The following arguments are optional:
      • offeringType

        public com.pulumi.core.Output<java.lang.String> offeringType()
        Returns:
        Offering type of this reserved DB instance.
      • productDescription

        public com.pulumi.core.Output<java.lang.String> productDescription()
        Returns:
        Description of the reserved DB instance.
      • recurringCharges

        public com.pulumi.core.Output<java.util.List<ReservedInstanceRecurringCharge>> recurringCharges()
        Returns:
        Recurring price charged to run this reserved DB instance. See `recurringCharges` below.
      • 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.
      • reservationId

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> reservationId()
        Returns:
        Customer-specified identifier to track this reservation.
      • startTime

        public com.pulumi.core.Output<java.lang.String> startTime()
        Returns:
        Time the reservation started.
      • state

        public com.pulumi.core.Output<java.lang.String> state()
        Returns:
        State of the reserved DB instance.
      • 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 DB reservation. 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.
      • usagePrice

        public com.pulumi.core.Output<java.lang.Double> usagePrice()
        Returns:
        Hourly price charged for this reserved DB instance.
      • get

        public static ReservedInstance get​(java.lang.String name,
                                           com.pulumi.core.Output<java.lang.String> id,
                                           @Nullable
                                           ReservedInstanceState 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.