UNPKG

@lbrlabs/pulumi-scaleway

Version:

A Pulumi package for creating and managing scaleway cloud resources.

414 lines (413 loc) 15.8 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "./types/input"; import * as outputs from "./types/output"; /** * Creates and manages Scaleway Redis Clusters. * For more information, see [the documentation](https://developers.scaleway.com/en/products/redis/api/v1alpha1/). * * ## Examples * * ### Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@lbrlabs/pulumi-scaleway"; * * const main = new scaleway.RedisCluster("main", { * acls: [{ * description: "Allow all", * ip: "0.0.0.0/0", * }], * clusterSize: 1, * nodeType: "RED1-MICRO", * password: "thiZ_is_v&ry_s3cret", * tags: [ * "test", * "redis", * ], * tlsEnabled: true, * userName: "my_initial_user", * version: "6.2.6", * }); * ``` * * ### With settings * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@lbrlabs/pulumi-scaleway"; * * const main = new scaleway.RedisCluster("main", { * nodeType: "RED1-MICRO", * password: "thiZ_is_v&ry_s3cret", * settings: { * maxclients: "1000", * "tcp-keepalive": "120", * }, * userName: "my_initial_user", * version: "6.2.6", * }); * ``` * * ### With a private network * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@lbrlabs/pulumi-scaleway"; * * const pn = new scaleway.VpcPrivateNetwork("pn", {}); * const main = new scaleway.RedisCluster("main", { * version: "6.2.6", * nodeType: "RED1-MICRO", * userName: "my_initial_user", * password: "thiZ_is_v&ry_s3cret", * clusterSize: 1, * privateNetworks: [{ * id: pn.id, * serviceIps: ["10.12.1.1/20"], * }], * }, { * dependsOn: [pn], * }); * ``` * * ## Import * * Redis Cluster can be imported using the `{zone}/{id}`, e.g. bash * * ```sh * $ pulumi import scaleway:index/redisCluster:RedisCluster main fr-par-1/11111111-1111-1111-1111-111111111111 * ``` */ export declare class RedisCluster extends pulumi.CustomResource { /** * Get an existing RedisCluster resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input<pulumi.ID>, state?: RedisClusterState, opts?: pulumi.CustomResourceOptions): RedisCluster; /** * Returns true if the given object is an instance of RedisCluster. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is RedisCluster; /** * List of acl rules, this is cluster's authorized IPs. More details on the ACL section. */ readonly acls: pulumi.Output<outputs.RedisClusterAcl[] | undefined>; /** * The PEM of the certificate used by redis, only when `tlsEnabled` is true */ readonly certificate: pulumi.Output<string>; /** * The number of nodes in the Redis Cluster. * * > **Important:** You cannot set `clusterSize` to 2, you either have to choose Standalone mode (1 node) or Cluster mode * which is minimum 3 (1 main node + 2 secondary nodes) * * > **Important:** You can set a bigger `clusterSize` than you initially did, it will migrate the Redis Cluster, but * keep in mind that you cannot downgrade a Redis Cluster so setting a smaller `clusterSize` will not have any effect. */ readonly clusterSize: pulumi.Output<number>; /** * The date and time of creation of the Redis Cluster. */ readonly createdAt: pulumi.Output<string>; /** * The name of the Redis Cluster. */ readonly name: pulumi.Output<string>; /** * The type of Redis Cluster you want to create (e.g. `RED1-M`). * * > **Important:** Updates to `nodeType` will migrate the Redis Cluster to the desired `nodeType`. Keep in mind that * you cannot downgrade a Redis Cluster. */ readonly nodeType: pulumi.Output<string>; /** * Password for the first user of the Redis Cluster. */ readonly password: pulumi.Output<string>; /** * Describes the private network you want to connect to your cluster. If not set, a public * network will be provided. More details on the Private Network section * * > **Important:** The way to use private networks differs whether you are using redis in standalone or cluster mode. * * - Standalone mode (`clusterSize` = 1) : you can attach as many private networks as you want (each must be a separate * block). If you detach your only private network, your cluster won't be reachable until you define a new private or * public network. You can modify your privateNetwork and its specs, you can have both a private and public network side * by side. * * - Cluster mode (`clusterSize` > 1) : you can define a single private network as you create your cluster, you won't be * able to edit or detach it afterward, unless you create another cluster. Your `serviceIps` must be listed as follows: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * ``` */ readonly privateNetworks: pulumi.Output<outputs.RedisClusterPrivateNetwork[] | undefined>; /** * `projectId`) The ID of the project the Redis Cluster is * associated with. */ readonly projectId: pulumi.Output<string>; /** * (Optional) Public network details. Only one of `privateNetwork` and `publicNetwork` may be set. * > The `publicNetwork` block exports: */ readonly publicNetwork: pulumi.Output<outputs.RedisClusterPublicNetwork>; /** * Map of settings for redis cluster. Available settings can be found by listing redis versions * with scaleway API or CLI */ readonly settings: pulumi.Output<{ [key: string]: string; } | undefined>; /** * The tags associated with the Redis Cluster. */ readonly tags: pulumi.Output<string[] | undefined>; /** * Whether TLS is enabled or not. * * > The changes on `tlsEnabled` will force the resource creation. */ readonly tlsEnabled: pulumi.Output<boolean | undefined>; /** * The date and time of the last update of the Redis Cluster. */ readonly updatedAt: pulumi.Output<string>; /** * Identifier for the first user of the Redis Cluster. */ readonly userName: pulumi.Output<string>; /** * Redis's Cluster version (e.g. `6.2.6`). * * > **Important:** Updates to `version` will migrate the Redis Cluster to the desired `version`. Keep in mind that you * cannot downgrade a Redis Cluster. */ readonly version: pulumi.Output<string>; /** * `zone`) The zone in which the * Redis Cluster should be created. */ readonly zone: pulumi.Output<string>; /** * Create a RedisCluster resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: RedisClusterArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering RedisCluster resources. */ export interface RedisClusterState { /** * List of acl rules, this is cluster's authorized IPs. More details on the ACL section. */ acls?: pulumi.Input<pulumi.Input<inputs.RedisClusterAcl>[]>; /** * The PEM of the certificate used by redis, only when `tlsEnabled` is true */ certificate?: pulumi.Input<string>; /** * The number of nodes in the Redis Cluster. * * > **Important:** You cannot set `clusterSize` to 2, you either have to choose Standalone mode (1 node) or Cluster mode * which is minimum 3 (1 main node + 2 secondary nodes) * * > **Important:** You can set a bigger `clusterSize` than you initially did, it will migrate the Redis Cluster, but * keep in mind that you cannot downgrade a Redis Cluster so setting a smaller `clusterSize` will not have any effect. */ clusterSize?: pulumi.Input<number>; /** * The date and time of creation of the Redis Cluster. */ createdAt?: pulumi.Input<string>; /** * The name of the Redis Cluster. */ name?: pulumi.Input<string>; /** * The type of Redis Cluster you want to create (e.g. `RED1-M`). * * > **Important:** Updates to `nodeType` will migrate the Redis Cluster to the desired `nodeType`. Keep in mind that * you cannot downgrade a Redis Cluster. */ nodeType?: pulumi.Input<string>; /** * Password for the first user of the Redis Cluster. */ password?: pulumi.Input<string>; /** * Describes the private network you want to connect to your cluster. If not set, a public * network will be provided. More details on the Private Network section * * > **Important:** The way to use private networks differs whether you are using redis in standalone or cluster mode. * * - Standalone mode (`clusterSize` = 1) : you can attach as many private networks as you want (each must be a separate * block). If you detach your only private network, your cluster won't be reachable until you define a new private or * public network. You can modify your privateNetwork and its specs, you can have both a private and public network side * by side. * * - Cluster mode (`clusterSize` > 1) : you can define a single private network as you create your cluster, you won't be * able to edit or detach it afterward, unless you create another cluster. Your `serviceIps` must be listed as follows: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * ``` */ privateNetworks?: pulumi.Input<pulumi.Input<inputs.RedisClusterPrivateNetwork>[]>; /** * `projectId`) The ID of the project the Redis Cluster is * associated with. */ projectId?: pulumi.Input<string>; /** * (Optional) Public network details. Only one of `privateNetwork` and `publicNetwork` may be set. * > The `publicNetwork` block exports: */ publicNetwork?: pulumi.Input<inputs.RedisClusterPublicNetwork>; /** * Map of settings for redis cluster. Available settings can be found by listing redis versions * with scaleway API or CLI */ settings?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * The tags associated with the Redis Cluster. */ tags?: pulumi.Input<pulumi.Input<string>[]>; /** * Whether TLS is enabled or not. * * > The changes on `tlsEnabled` will force the resource creation. */ tlsEnabled?: pulumi.Input<boolean>; /** * The date and time of the last update of the Redis Cluster. */ updatedAt?: pulumi.Input<string>; /** * Identifier for the first user of the Redis Cluster. */ userName?: pulumi.Input<string>; /** * Redis's Cluster version (e.g. `6.2.6`). * * > **Important:** Updates to `version` will migrate the Redis Cluster to the desired `version`. Keep in mind that you * cannot downgrade a Redis Cluster. */ version?: pulumi.Input<string>; /** * `zone`) The zone in which the * Redis Cluster should be created. */ zone?: pulumi.Input<string>; } /** * The set of arguments for constructing a RedisCluster resource. */ export interface RedisClusterArgs { /** * List of acl rules, this is cluster's authorized IPs. More details on the ACL section. */ acls?: pulumi.Input<pulumi.Input<inputs.RedisClusterAcl>[]>; /** * The number of nodes in the Redis Cluster. * * > **Important:** You cannot set `clusterSize` to 2, you either have to choose Standalone mode (1 node) or Cluster mode * which is minimum 3 (1 main node + 2 secondary nodes) * * > **Important:** You can set a bigger `clusterSize` than you initially did, it will migrate the Redis Cluster, but * keep in mind that you cannot downgrade a Redis Cluster so setting a smaller `clusterSize` will not have any effect. */ clusterSize?: pulumi.Input<number>; /** * The name of the Redis Cluster. */ name?: pulumi.Input<string>; /** * The type of Redis Cluster you want to create (e.g. `RED1-M`). * * > **Important:** Updates to `nodeType` will migrate the Redis Cluster to the desired `nodeType`. Keep in mind that * you cannot downgrade a Redis Cluster. */ nodeType: pulumi.Input<string>; /** * Password for the first user of the Redis Cluster. */ password: pulumi.Input<string>; /** * Describes the private network you want to connect to your cluster. If not set, a public * network will be provided. More details on the Private Network section * * > **Important:** The way to use private networks differs whether you are using redis in standalone or cluster mode. * * - Standalone mode (`clusterSize` = 1) : you can attach as many private networks as you want (each must be a separate * block). If you detach your only private network, your cluster won't be reachable until you define a new private or * public network. You can modify your privateNetwork and its specs, you can have both a private and public network side * by side. * * - Cluster mode (`clusterSize` > 1) : you can define a single private network as you create your cluster, you won't be * able to edit or detach it afterward, unless you create another cluster. Your `serviceIps` must be listed as follows: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * ``` */ privateNetworks?: pulumi.Input<pulumi.Input<inputs.RedisClusterPrivateNetwork>[]>; /** * `projectId`) The ID of the project the Redis Cluster is * associated with. */ projectId?: pulumi.Input<string>; /** * (Optional) Public network details. Only one of `privateNetwork` and `publicNetwork` may be set. * > The `publicNetwork` block exports: */ publicNetwork?: pulumi.Input<inputs.RedisClusterPublicNetwork>; /** * Map of settings for redis cluster. Available settings can be found by listing redis versions * with scaleway API or CLI */ settings?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * The tags associated with the Redis Cluster. */ tags?: pulumi.Input<pulumi.Input<string>[]>; /** * Whether TLS is enabled or not. * * > The changes on `tlsEnabled` will force the resource creation. */ tlsEnabled?: pulumi.Input<boolean>; /** * Identifier for the first user of the Redis Cluster. */ userName: pulumi.Input<string>; /** * Redis's Cluster version (e.g. `6.2.6`). * * > **Important:** Updates to `version` will migrate the Redis Cluster to the desired `version`. Keep in mind that you * cannot downgrade a Redis Cluster. */ version: pulumi.Input<string>; /** * `zone`) The zone in which the * Redis Cluster should be created. */ zone?: pulumi.Input<string>; }