Class ReservedCacheNode


  • public class ReservedCacheNode
    extends com.pulumi.resources.CustomResource
    Manages an ElastiCache Reserved Cache Node. > **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 [ElastiCache Reserved Nodes Documentation](https://aws.amazon.com/elasticache/reserved-cache-nodes/) and [PurchaseReservedCacheNodesOffering](https://docs.aws.amazon.com/AmazonElastiCache/latest/APIReference/API_PurchaseReservedCacheNodesOffering.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.elasticache.ElasticacheFunctions;
     import com.pulumi.aws.elasticache.inputs.GetReservedCacheNodeOfferingArgs;
     import com.pulumi.aws.elasticache.ReservedCacheNode;
     import com.pulumi.aws.elasticache.ReservedCacheNodeArgs;
     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 example = ElasticacheFunctions.getReservedCacheNodeOffering(GetReservedCacheNodeOfferingArgs.builder()
                 .cacheNodeType("cache.t4g.small")
                 .duration("P1Y")
                 .offeringType("No Upfront")
                 .productDescription("redis")
                 .build());
     
             var exampleReservedCacheNode = new ReservedCacheNode("exampleReservedCacheNode", ReservedCacheNodeArgs.builder()
                 .reservedCacheNodesOfferingId(example.offeringId())
                 .elasticacheReservedCacheNodeId("optionalCustomReservationID")
                 .cacheNodeCount(3)
                 .build());
     
         }
     }
     
     
    ## Import Using `pulumi import`, import ElastiCache Reserved Cache Node using the `id`. For example: ```sh $ pulumi import aws:elasticache/reservedCacheNode:ReservedCacheNode example 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.Integer> cacheNodeCount()  
      com.pulumi.core.Output<java.lang.String> cacheNodeType()  
      com.pulumi.core.Output<java.lang.String> duration()  
      com.pulumi.core.Output<java.lang.String> elasticacheReservedCacheNodeId()  
      com.pulumi.core.Output<java.lang.Double> fixedPrice()  
      static ReservedCacheNode get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, ReservedCacheNodeState 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> offeringType()  
      com.pulumi.core.Output<java.lang.String> productDescription()  
      com.pulumi.core.Output<java.util.List<ReservedCacheNodeRecurringCharge>> recurringCharges()  
      com.pulumi.core.Output<java.lang.String> region()  
      com.pulumi.core.Output<java.lang.String> reservedCacheNodesOfferingId()  
      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.util.Optional<ReservedCacheNodeTimeouts>> timeouts()  
      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

      • ReservedCacheNode

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

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

        public ReservedCacheNode​(java.lang.String name,
                                 ReservedCacheNodeArgs 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 cache node.
      • cacheNodeCount

        public com.pulumi.core.Output<java.lang.Integer> cacheNodeCount()
        Returns:
        Number of cache node instances to reserve. Default value is `1`.
      • cacheNodeType

        public com.pulumi.core.Output<java.lang.String> cacheNodeType()
        Returns:
        Node type for the reserved cache nodes.
      • duration

        public com.pulumi.core.Output<java.lang.String> duration()
        Returns:
        Duration of the reservation as an RFC3339 duration.
      • elasticacheReservedCacheNodeId

        public com.pulumi.core.Output<java.lang.String> elasticacheReservedCacheNodeId()
        Returns:
        Customer-specified identifier to track this reservation. If not specified, AWS will assign a random ID.
      • fixedPrice

        public com.pulumi.core.Output<java.lang.Double> fixedPrice()
        Returns:
        Fixed price charged for this reserved cache node.
      • offeringType

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

        public com.pulumi.core.Output<java.lang.String> productDescription()
        Returns:
        Engine type for the reserved cache node.
      • recurringCharges

        public com.pulumi.core.Output<java.util.List<ReservedCacheNodeRecurringCharge>> recurringCharges()
        Returns:
        Recurring price charged to run this reserved cache node.
      • 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.
      • reservedCacheNodesOfferingId

        public com.pulumi.core.Output<java.lang.String> reservedCacheNodesOfferingId()
        Returns:
        ID of the reserved cache node offering to purchase. To determine an `reservedCacheNodesOfferingId`, see the `aws.elasticache.getReservedCacheNodeOffering` data source. The following arguments are optional:
      • 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 cache node.
      • 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 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 cache node.
      • get

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