Class Instance
A Google Cloud Redis instance.
To get more information about Instance, see:
- API documentation
- How-to Guides
- Official Documentation
Example Usage - Redis Instance Basic
using Pulumi;
using Gcp = Pulumi.Gcp;
class MyStack : Stack
{
public MyStack()
{
var cache = new Gcp.Redis.Instance("cache", new Gcp.Redis.InstanceArgs
{
MemorySizeGb = 1,
});
}
}
Example Usage - Redis Instance Full
using Pulumi;
using Gcp = Pulumi.Gcp;
class MyStack : Stack
{
public MyStack()
{
var redis_network = Output.Create(Gcp.Compute.GetNetwork.InvokeAsync(new Gcp.Compute.GetNetworkArgs
{
Name = "redis-test-network",
}));
var cache = new Gcp.Redis.Instance("cache", new Gcp.Redis.InstanceArgs
{
Tier = "STANDARD_HA",
MemorySizeGb = 1,
LocationId = "us-central1-a",
AlternativeLocationId = "us-central1-f",
AuthorizedNetwork = redis_network.Apply(redis_network => redis_network.Id),
RedisVersion = "REDIS_3_2",
DisplayName = "Test Instance",
ReservedIpRange = "192.168.0.0/29",
Labels =
{
{ "my_key", "my_val" },
{ "other_key", "other_val" },
},
});
}
}
Inherited Members
Namespace: Pulumi.Gcp.Redis
Assembly: Pulumi.Gcp.dll
Syntax
public class Instance : CustomResource
Constructors
View SourceInstance(String, InstanceArgs, CustomResourceOptions)
Create a Instance resource with the given unique name, arguments, and options.
Declaration
public Instance(string name, InstanceArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| InstanceArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceAlternativeLocationId
Only applicable to STANDARD_HA tier which protects the instance against zonal failures by provisioning it across two zones. If provided, it must be a different zone from the one provided in [locationId].
Declaration
public Output<string> AlternativeLocationId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
AuthorizedNetwork
The full name of the Google Compute Engine network to which the instance is connected. If left unspecified, the default network will be used.
Declaration
public Output<string> AuthorizedNetwork { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
ConnectMode
The connection mode of the Redis instance.
Declaration
public Output<string> ConnectMode { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
CreateTime
The time the instance was created in RFC3339 UTC "Zulu" format, accurate to nanoseconds.
Declaration
public Output<string> CreateTime { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
CurrentLocationId
The current zone where the Redis endpoint is placed. For Basic Tier instances, this will always be the same as the [locationId] provided by the user at creation time. For Standard Tier instances, this can be either [locationId] or [alternativeLocationId] and can change after a failover event.
Declaration
public Output<string> CurrentLocationId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
DisplayName
An arbitrary and optional user-provided name for the instance.
Declaration
public Output<string> DisplayName { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Host
Hostname or IP address of the exposed Redis endpoint used by clients to connect to the service.
Declaration
public Output<string> Host { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Labels
Resource labels to represent user provided metadata.
Declaration
public Output<ImmutableDictionary<string, string>> Labels { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.String>> |
LocationId
The zone where the instance will be provisioned. If not provided, the service will choose a zone for the instance. For STANDARD_HA tier, instances will be created across two zones for protection against zonal failures. If [alternativeLocationId] is also provided, it must be different from [locationId].
Declaration
public Output<string> LocationId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
MemorySizeGb
Redis memory size in GiB.
Declaration
public Output<int> MemorySizeGb { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Int32> |
Name
The ID of the instance or a fully qualified identifier for the instance.
Declaration
public Output<string> Name { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Port
The port number of the exposed Redis endpoint.
Declaration
public Output<int> Port { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Int32> |
Project
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
Declaration
public Output<string> Project { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
RedisConfigs
Redis configuration parameters, according to http://redis.io/topics/config. Please check Memorystore documentation for the list of supported parameters: https://cloud.google.com/memorystore/docs/redis/reference/rest/v1/projects.locations.instances#Instance.FIELDS.redis_configs
Declaration
public Output<ImmutableDictionary<string, string>> RedisConfigs { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.String>> |
RedisVersion
The version of Redis software. If not provided, latest supported version will be used. Currently, the supported values are:
- REDIS_4_0 for Redis 4.0 compatibility
- REDIS_3_2 for Redis 3.2 compatibility
Declaration
public Output<string> RedisVersion { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Region
The name of the Redis region of the instance.
Declaration
public Output<string> Region { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
ReservedIpRange
The CIDR range of internal addresses that are reserved for this instance. If not provided, the service will choose an unused /29 block, for example, 10.0.0.0/29 or 192.168.0.0/29. Ranges must be unique and non-overlapping with existing subnets in an authorized network.
Declaration
public Output<string> ReservedIpRange { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Tier
The service tier of the instance. Must be one of these values:
- BASIC: standalone instance
- STANDARD_HA: highly available primary/replica instances
Declaration
public Output<string> Tier { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(String, Input<String>, InstanceState, CustomResourceOptions)
Get an existing Instance resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static Instance Get(string name, Input<string> id, InstanceState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| InstanceState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| Instance |