Reserved Instance Args
Manages an RDS DB Reserved Instance.
NOTE: Once created, a reservation is valid for the
duration
of the providedoffering_id
and cannot be deleted. Performing adestroy
will only remove the resource from state. For more information see RDS Reserved Instances Documentation and PurchaseReservedDBInstancesOffering. 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.List;
import java.util.ArrayList;
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.applyValue(getReservedInstanceOfferingResult -> getReservedInstanceOfferingResult.offeringId()))
.reservationId("optionalCustomReservationID")
.instanceCount(3)
.build());
}
}
Import
RDS DB Instance Reservations can be imported using the instance_id
, e.g.,
$ pulumi import aws:rds/reservedInstance:ReservedInstance reservation_instance CustomReservationID
Constructors
Properties
Number of instances to reserve. Default value is 1
.
ID of the Reserved DB instance offering to purchase. To determine an offering_id
, see the aws.rds.getReservedInstanceOffering
data source. The following arguments are optional:
Customer-specified identifier to track this reservation.