ReservedCacheNode class
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 and PurchaseReservedCacheNodesOffering.
> 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
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = aws.elasticache.getReservedCacheNodeOffering({
cacheNodeType: "cache.t4g.small",
duration: "P1Y",
offeringType: "No Upfront",
productDescription: "redis",
});
const exampleReservedCacheNode = new aws.elasticache.ReservedCacheNode("example", {
reservedCacheNodesOfferingId: example.then(example => example.offeringId),
elasticacheReservedCacheNodeId: "optionalCustomReservationID",
cacheNodeCount: 3,
});
import pulumi
import pulumi_aws as aws
example = aws.elasticache.get_reserved_cache_node_offering(cache_node_type="cache.t4g.small",
duration="P1Y",
offering_type="No Upfront",
product_description="redis")
example_reserved_cache_node = aws.elasticache.ReservedCacheNode("example",
reserved_cache_nodes_offering_id=example.offering_id,
elasticache_reserved_cache_node_id="optionalCustomReservationID",
cache_node_count=3)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = Aws.ElastiCache.GetReservedCacheNodeOffering.Invoke(new()
{
CacheNodeType = "cache.t4g.small",
Duration = "P1Y",
OfferingType = "No Upfront",
ProductDescription = "redis",
});
var exampleReservedCacheNode = new Aws.ElastiCache.ReservedCacheNode("example", new()
{
ReservedCacheNodesOfferingId = example.Apply(getReservedCacheNodeOfferingResult => getReservedCacheNodeOfferingResult.OfferingId),
ElasticacheReservedCacheNodeId = "optionalCustomReservationID",
CacheNodeCount = 3,
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/elasticache"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := elasticache.GetReservedCacheNodeOffering(ctx, &elasticache.GetReservedCacheNodeOfferingArgs{
CacheNodeType: "cache.t4g.small",
Duration: "P1Y",
OfferingType: "No Upfront",
ProductDescription: "redis",
}, nil)
if err != nil {
return err
}
_, err = elasticache.NewReservedCacheNode(ctx, "example", &elasticache.ReservedCacheNodeArgs{
ReservedCacheNodesOfferingId: pulumi.String(example.OfferingId),
ElasticacheReservedCacheNodeId: pulumi.String("optionalCustomReservationID"),
CacheNodeCount: pulumi.Int(3),
})
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
aws = {
source = "pulumi/aws"
}
}
}
data "aws_elasticache_getreservedcachenodeoffering" "example" {
cache_node_type = "cache.t4g.small"
duration = "P1Y"
offering_type = "No Upfront"
product_description = "redis"
}
resource "aws_elasticache_reservedcachenode" "example" {
reserved_cache_nodes_offering_id = data.aws_elasticache_getreservedcachenodeoffering.example.offering_id
elasticache_reserved_cache_node_id = "optionalCustomReservationID"
cache_node_count = 3
}
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());
}
}
resources:
exampleReservedCacheNode:
type: aws:elasticache:ReservedCacheNode
name: example
properties:
reservedCacheNodesOfferingId: ${example.offeringId}
elasticacheReservedCacheNodeId: optionalCustomReservationID
cacheNodeCount: 3
variables:
example:
fn::invoke:
function: aws:elasticache:getReservedCacheNodeOffering
arguments:
cacheNodeType: cache.t4g.small
duration: P1Y
offeringType: No Upfront
productDescription: redis
Import
Using pulumi import, import ElastiCache Reserved Cache Node using the id. For example:
$ pulumi import aws:elasticache/reservedCacheNode:ReservedCacheNode example CustomReservationID
Constructors
- ReservedCacheNode(String name, {ReservedCacheNodeArgs? args, CustomResourceOptions? options})
-
Creates a new ReservedCacheNode.
nameThe Pulumi resource name.argsArguments used to configure this ReservedCacheNode. The set of arguments for ReservedCacheNode.optionsResource options controlling this resource's behavior. - ReservedCacheNode.reference(String urn)
- Creates a typed reference to an existing ReservedCacheNode resource.
Properties
-
arn
↔ Output<
String> -
ARN for the reserved cache node.
latefinal
-
cacheNodeCount
↔ Output<
int> -
Number of cache node instances to reserve.
Default value is
1.latefinal -
cacheNodeType
↔ Output<
String> -
Node type for the reserved cache nodes.
latefinal
-
childResources
→ Set<
Resource> -
finalinherited
-
completionSources
↔ Map<
String, IOutputCompletionSource> -
latefinalinherited
-
duration
↔ Output<
String> -
Duration of the reservation as an RFC3339 duration.
latefinal
-
elasticacheReservedCacheNodeId
↔ Output<
String> -
Customer-specified identifier to track this reservation.
If not specified, AWS will assign a random ID.
latefinal
-
fixedPrice
↔ Output<
double> -
Fixed price charged for this reserved cache node.
latefinal
- hashCode → int
-
The hash code for this object.
no setterinherited
-
id
↔ Output<
String> -
getter/setter pairinherited
- isCustom → bool
-
Returns whether this resource is provider-managed.
no setterinherited
- isProtected → bool
-
Returns whether this resource is protected from deletion.
no setterinherited
- isRemote → bool
-
Whether this resource is registered as remote.
no setterinherited
- isResourceReference → bool
-
Whether this instance represents a resource value returned over RPC.
finalinherited
-
offeringType
↔ Output<
String> -
Offering type of this reserved cache node.
latefinal
-
productDescription
↔ Output<
String> -
Engine type for the reserved cache node.
latefinal
-
recurringCharges
↔ Output<
List< ReservedCacheNodeRecurringCharge> > -
Recurring price charged to run this reserved cache node.
latefinal
-
region
↔ Output<
String> -
Region where this resource will be managed. Defaults to the Region set in the provider configuration.
latefinal
-
reservedCacheNodesOfferingId
↔ Output<
String> -
ID of the reserved cache node offering to purchase.
To determine an
reservedCacheNodesOfferingId, see theaws.elasticache.getReservedCacheNodeOfferingdata source.latefinal -
resourceTransforms
→ List<
ResourceTransform> -
Inherited/explicit async transforms.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
startTime
↔ Output<
String> -
Time the reservation started.
latefinal
-
state
↔ Output<
String> -
State of the reserved cache node.
latefinal
-
Map of tags to assign to the reservation. If configured with a provider
defaultTagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.latefinal -
Map of tags assigned to the resource, including those inherited from the provider
defaultTagsconfiguration block.latefinal -
timeouts
↔ Output<
ReservedCacheNodeTimeouts?> -
latefinal
-
transformations
→ List<
ResourceTransformation> -
Inherited/explicit legacy transformations.
no setterinherited
-
urn
↔ Output<
String> -
latefinalinherited
-
usagePrice
↔ Output<
double> -
Hourly price charged for this reserved cache node.
latefinal
Methods
-
failId(
Object error) → void -
Completes this resource ID with an error when registration fails.
inherited
-
failOutputs(
Object error) → void -
Completes all output properties with
error.inherited -
failUrn(
Object error) → void -
Completes this resource URN with an error when registration fails.
inherited
-
getProvider(
String moduleMember) → ProviderResource? -
Returns provider for
moduleMember's package, if configured.inherited -
getResourceName(
) → String -
Returns this resource's logical name.
inherited
-
getResourceType(
) → String -
Returns this resource's Pulumi type token.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
registerOutput<
T> (String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output< T> -
Registers a dynamic output property for this resource.
inherited
-
resolveId(
String? value, {required bool isKnown}) → void -
Resolves the provider-assigned ID for this resource.
inherited
-
resolveOutputs(
Struct outputs) → void -
Resolves all output properties from a monitor response payload.
inherited
-
resolveUrn(
String value) → void -
Resolves this resource's URN once assigned by the engine.
inherited
-
serializeProperties(
Map< String, dynamic> properties) → Future<Struct> -
Serializes resource properties for RPC transmission.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
get(
String name, Input< String> id, {ReservedCacheNodeState? state, CustomResourceOptions? options}) → ReservedCacheNode -
Gets an existing ReservedCacheNode resource's state with the given
nameandid.