All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.ovhcloud.pulumi.ovh.CloudProject.Database Maven / Gradle / Ivy

There is a newer version: 1.1.0
Show newest version
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.ovhcloud.pulumi.ovh.CloudProject;

import com.ovhcloud.pulumi.ovh.CloudProject.DatabaseArgs;
import com.ovhcloud.pulumi.ovh.CloudProject.inputs.DatabaseState;
import com.ovhcloud.pulumi.ovh.CloudProject.outputs.DatabaseEndpoint;
import com.ovhcloud.pulumi.ovh.CloudProject.outputs.DatabaseIpRestriction;
import com.ovhcloud.pulumi.ovh.CloudProject.outputs.DatabaseNode;
import com.ovhcloud.pulumi.ovh.Utilities;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import java.lang.Boolean;
import java.lang.Integer;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * ## Example Usage
 * 
 * Minimum settings for each engine (region choice is up to the user):
 * 
 * <!--Start PulumiCodeChooser -->
 * 
 * {@code
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.ovh.CloudProject.Database;
 * import com.pulumi.ovh.CloudProject.DatabaseArgs;
 * import com.pulumi.ovh.CloudProject.inputs.DatabaseNodeArgs;
 * import com.pulumi.ovh.CloudProject.inputs.DatabaseIpRestrictionArgs;
 * 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) {
 *         var cassandradb = new Database("cassandradb", DatabaseArgs.builder()
 *             .serviceName("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
 *             .description("my-first-cassandra")
 *             .engine("cassandra")
 *             .version("4.0")
 *             .plan("essential")
 *             .nodes(            
 *                 DatabaseNodeArgs.builder()
 *                     .region("BHS")
 *                     .build(),
 *                 DatabaseNodeArgs.builder()
 *                     .region("BHS")
 *                     .build(),
 *                 DatabaseNodeArgs.builder()
 *                     .region("BHS")
 *                     .build())
 *             .flavor("db1-4")
 *             .build());
 * 
 *         var kafkadb = new Database("kafkadb", DatabaseArgs.builder()
 *             .serviceName("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
 *             .description("my-first-kafka")
 *             .engine("kafka")
 *             .version("3.4")
 *             .plan("business")
 *             .kafkaRestApi(true)
 *             .kafkaSchemaRegistry(true)
 *             .nodes(            
 *                 DatabaseNodeArgs.builder()
 *                     .region("DE")
 *                     .build(),
 *                 DatabaseNodeArgs.builder()
 *                     .region("DE")
 *                     .build(),
 *                 DatabaseNodeArgs.builder()
 *                     .region("DE")
 *                     .build())
 *             .flavor("db1-4")
 *             .build());
 * 
 *         var m3db = new Database("m3db", DatabaseArgs.builder()
 *             .serviceName("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
 *             .description("my-first-m3db")
 *             .engine("m3db")
 *             .version("1.2")
 *             .plan("essential")
 *             .nodes(DatabaseNodeArgs.builder()
 *                 .region("BHS")
 *                 .build())
 *             .flavor("db1-7")
 *             .build());
 * 
 *         var mongodb = new Database("mongodb", DatabaseArgs.builder()
 *             .serviceName("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
 *             .description("my-first-mongodb")
 *             .engine("mongodb")
 *             .version("5.0")
 *             .plan("discovery")
 *             .nodes(DatabaseNodeArgs.builder()
 *                 .region("GRA")
 *                 .build())
 *             .flavor("db1-2")
 *             .build());
 * 
 *         var mysqldb = new Database("mysqldb", DatabaseArgs.builder()
 *             .serviceName("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
 *             .description("my-first-mysql")
 *             .engine("mysql")
 *             .version("8")
 *             .plan("essential")
 *             .nodes(DatabaseNodeArgs.builder()
 *                 .region("SBG")
 *                 .build())
 *             .flavor("db1-4")
 *             .advancedConfiguration(Map.ofEntries(
 *                 Map.entry("mysql.sql_mode", "ANSI,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION,NO_ZERO_DATE,NO_ZERO_IN_DATE,STRICT_ALL_TABLES"),
 *                 Map.entry("mysql.sql_require_primary_key", "true")
 *             ))
 *             .build());
 * 
 *         var opensearchdb = new Database("opensearchdb", DatabaseArgs.builder()
 *             .serviceName("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
 *             .description("my-first-opensearch")
 *             .engine("opensearch")
 *             .version("1")
 *             .plan("essential")
 *             .opensearchAclsEnabled(true)
 *             .nodes(DatabaseNodeArgs.builder()
 *                 .region("UK")
 *                 .build())
 *             .flavor("db1-4")
 *             .build());
 * 
 *         var pgsqldb = new Database("pgsqldb", DatabaseArgs.builder()
 *             .serviceName("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
 *             .description("my-first-postgresql")
 *             .engine("postgresql")
 *             .version("14")
 *             .plan("essential")
 *             .nodes(DatabaseNodeArgs.builder()
 *                 .region("WAW")
 *                 .build())
 *             .flavor("db1-4")
 *             .ipRestrictions(            
 *                 DatabaseIpRestrictionArgs.builder()
 *                     .description("ip 1")
 *                     .ip("178.97.6.0/24")
 *                     .build(),
 *                 DatabaseIpRestrictionArgs.builder()
 *                     .description("ip 2")
 *                     .ip("178.97.7.0/24")
 *                     .build())
 *             .build());
 * 
 *         var redisdb = new Database("redisdb", DatabaseArgs.builder()
 *             .serviceName("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
 *             .description("my-first-redis")
 *             .engine("redis")
 *             .version("6.2")
 *             .plan("essential")
 *             .nodes(DatabaseNodeArgs.builder()
 *                 .region("BHS")
 *                 .build())
 *             .flavor("db1-4")
 *             .build());
 * 
 *         var grafana = new Database("grafana", DatabaseArgs.builder()
 *             .serviceName("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
 *             .description("my-first-grafana")
 *             .engine("grafana")
 *             .version("9.1")
 *             .plan("essential")
 *             .nodes(DatabaseNodeArgs.builder()
 *                 .region("GRA")
 *                 .build())
 *             .flavor("db1-4")
 *             .build());
 * 
 *     }
 * }
 * }
 * 
* <!--End PulumiCodeChooser --> * * To deploy a business PostgreSQL service with two nodes on public network: * * <!--Start PulumiCodeChooser --> *
 * {@code
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.ovh.CloudProject.Database;
 * import com.pulumi.ovh.CloudProject.DatabaseArgs;
 * import com.pulumi.ovh.CloudProject.inputs.DatabaseNodeArgs;
 * 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) {
 *         var postgresql = new Database("postgresql", DatabaseArgs.builder()
 *             .description("my-first-postgresql")
 *             .engine("postgresql")
 *             .flavor("db1-15")
 *             .nodes(            
 *                 DatabaseNodeArgs.builder()
 *                     .region("GRA")
 *                     .build(),
 *                 DatabaseNodeArgs.builder()
 *                     .region("GRA")
 *                     .build())
 *             .plan("business")
 *             .serviceName("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
 *             .version("14")
 *             .build());
 * 
 *     }
 * }
 * }
 * 
* <!--End PulumiCodeChooser --> * * To deploy an enterprise MongoDB service with three nodes on private network: * * <!--Start PulumiCodeChooser --> *
 * {@code
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.ovh.CloudProject.Database;
 * import com.pulumi.ovh.CloudProject.DatabaseArgs;
 * import com.pulumi.ovh.CloudProject.inputs.DatabaseNodeArgs;
 * 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) {
 *         var mongodb = new Database("mongodb", DatabaseArgs.builder()
 *             .description("my-first-mongodb")
 *             .engine("mongodb")
 *             .flavor("db1-30")
 *             .nodes(            
 *                 DatabaseNodeArgs.builder()
 *                     .networkId("XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX")
 *                     .region("SBG")
 *                     .subnetId("XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX")
 *                     .build(),
 *                 DatabaseNodeArgs.builder()
 *                     .networkId("XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX")
 *                     .region("SBG")
 *                     .subnetId("XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX")
 *                     .build(),
 *                 DatabaseNodeArgs.builder()
 *                     .networkId("XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX")
 *                     .region("SBG")
 *                     .subnetId("XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX")
 *                     .build())
 *             .plan("production")
 *             .serviceName("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
 *             .version("5.0")
 *             .build());
 * 
 *     }
 * }
 * }
 * 
* <!--End PulumiCodeChooser --> * * ## Import * * OVHcloud Managed database clusters can be imported using the `service_name`, `engine`, `id` of the cluster, separated by "/" E.g., * * bash * * ```sh * $ pulumi import ovh:CloudProject/database:Database my_database_cluster service_name/engine/id * ``` * */ @ResourceType(type="ovh:CloudProject/database:Database") public class Database extends com.pulumi.resources.CustomResource { /** * Advanced configuration key / value. * */ @Export(name="advancedConfiguration", refs={Map.class,String.class}, tree="[0,1,1]") private Output> advancedConfiguration; /** * @return Advanced configuration key / value. * */ public Output> advancedConfiguration() { return this.advancedConfiguration; } /** * List of region where backups are pushed. Not more than 1 regions for MongoDB. Not more than 2 regions for the other engines with one being the same as the nodes[].region field * */ @Export(name="backupRegions", refs={List.class,String.class}, tree="[0,1]") private Output> backupRegions; /** * @return List of region where backups are pushed. Not more than 1 regions for MongoDB. Not more than 2 regions for the other engines with one being the same as the nodes[].region field * */ public Output> backupRegions() { return this.backupRegions; } /** * Time on which backups start every day. * */ @Export(name="backupTime", refs={String.class}, tree="[0]") private Output backupTime; /** * @return Time on which backups start every day. * */ public Output backupTime() { return this.backupTime; } /** * Date of the creation of the cluster. * */ @Export(name="createdAt", refs={String.class}, tree="[0]") private Output createdAt; /** * @return Date of the creation of the cluster. * */ public Output createdAt() { return this.createdAt; } /** * Small description of the database service. * */ @Export(name="description", refs={String.class}, tree="[0]") private Output description; /** * @return Small description of the database service. * */ public Output> description() { return Codegen.optional(this.description); } /** * The disk size (in GB) of the database service. * */ @Export(name="diskSize", refs={Integer.class}, tree="[0]") private Output diskSize; /** * @return The disk size (in GB) of the database service. * */ public Output diskSize() { return this.diskSize; } /** * Defines the disk type of the database service. * */ @Export(name="diskType", refs={String.class}, tree="[0]") private Output diskType; /** * @return Defines the disk type of the database service. * */ public Output diskType() { return this.diskType; } /** * List of all endpoints objects of the service. * */ @Export(name="endpoints", refs={List.class,DatabaseEndpoint.class}, tree="[0,1]") private Output> endpoints; /** * @return List of all endpoints objects of the service. * */ public Output> endpoints() { return this.endpoints; } /** * The database engine you want to deploy. To get a full list of available engine visit. * [public documentation](https://docs.ovh.com/gb/en/publiccloud/databases). * */ @Export(name="engine", refs={String.class}, tree="[0]") private Output engine; /** * @return The database engine you want to deploy. To get a full list of available engine visit. * [public documentation](https://docs.ovh.com/gb/en/publiccloud/databases). * */ public Output engine() { return this.engine; } /** * A valid OVHcloud public cloud database flavor name in which the nodes will be started. * Ex: "db1-7". Changing this value upgrade the nodes with the new flavor. * You can find the list of flavor names: https://www.ovhcloud.com/fr/public-cloud/prices/ * */ @Export(name="flavor", refs={String.class}, tree="[0]") private Output flavor; /** * @return A valid OVHcloud public cloud database flavor name in which the nodes will be started. * Ex: "db1-7". Changing this value upgrade the nodes with the new flavor. * You can find the list of flavor names: https://www.ovhcloud.com/fr/public-cloud/prices/ * */ public Output flavor() { return this.flavor; } /** * IP Blocks authorized to access to the cluster. * */ @Export(name="ipRestrictions", refs={List.class,DatabaseIpRestriction.class}, tree="[0,1]") private Output> ipRestrictions; /** * @return IP Blocks authorized to access to the cluster. * */ public Output>> ipRestrictions() { return Codegen.optional(this.ipRestrictions); } /** * Defines whether the REST API is enabled on a kafka cluster * */ @Export(name="kafkaRestApi", refs={Boolean.class}, tree="[0]") private Output kafkaRestApi; /** * @return Defines whether the REST API is enabled on a kafka cluster * */ public Output> kafkaRestApi() { return Codegen.optional(this.kafkaRestApi); } /** * Defines whether the schema registry is enabled on a Kafka cluster * */ @Export(name="kafkaSchemaRegistry", refs={Boolean.class}, tree="[0]") private Output kafkaSchemaRegistry; /** * @return Defines whether the schema registry is enabled on a Kafka cluster * */ public Output> kafkaSchemaRegistry() { return Codegen.optional(this.kafkaSchemaRegistry); } /** * Time on which maintenances can start every day. * */ @Export(name="maintenanceTime", refs={String.class}, tree="[0]") private Output maintenanceTime; /** * @return Time on which maintenances can start every day. * */ public Output maintenanceTime() { return this.maintenanceTime; } /** * Type of network of the cluster. * */ @Export(name="networkType", refs={String.class}, tree="[0]") private Output networkType; /** * @return Type of network of the cluster. * */ public Output networkType() { return this.networkType; } /** * List of nodes object. * Multi region cluster are not yet available, all node should be identical. * */ @Export(name="nodes", refs={List.class,DatabaseNode.class}, tree="[0,1]") private Output> nodes; /** * @return List of nodes object. * Multi region cluster are not yet available, all node should be identical. * */ public Output> nodes() { return this.nodes; } /** * Defines whether the ACLs are enabled on an OpenSearch cluster * */ @Export(name="opensearchAclsEnabled", refs={Boolean.class}, tree="[0]") private Output opensearchAclsEnabled; /** * @return Defines whether the ACLs are enabled on an OpenSearch cluster * */ public Output> opensearchAclsEnabled() { return Codegen.optional(this.opensearchAclsEnabled); } /** * Plan of the cluster. * * MongoDB: Enum: "discovery", "production", "advanced". * * Mysql, PosgreSQL, Cassandra, M3DB, : Enum: "essential", "business", "enterprise". * * M3 Aggregator: "business", "enterprise". * * Redis: "essential", "business" * */ @Export(name="plan", refs={String.class}, tree="[0]") private Output plan; /** * @return Plan of the cluster. * * MongoDB: Enum: "discovery", "production", "advanced". * * Mysql, PosgreSQL, Cassandra, M3DB, : Enum: "essential", "business", "enterprise". * * M3 Aggregator: "business", "enterprise". * * Redis: "essential", "business" * */ public Output plan() { return this.plan; } /** * The id of the public cloud project. If omitted, * the `OVH_CLOUD_PROJECT_SERVICE` environment variable is used. * */ @Export(name="serviceName", refs={String.class}, tree="[0]") private Output serviceName; /** * @return The id of the public cloud project. If omitted, * the `OVH_CLOUD_PROJECT_SERVICE` environment variable is used. * */ public Output serviceName() { return this.serviceName; } /** * Current status of the cluster. * */ @Export(name="status", refs={String.class}, tree="[0]") private Output status; /** * @return Current status of the cluster. * */ public Output status() { return this.status; } /** * The version of the engine in which the service should be deployed * */ @Export(name="version", refs={String.class}, tree="[0]") private Output version; /** * @return The version of the engine in which the service should be deployed * */ public Output version() { return this.version; } /** * * @param name The _unique_ name of the resulting resource. */ public Database(java.lang.String name) { this(name, DatabaseArgs.Empty); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. */ public Database(java.lang.String name, DatabaseArgs args) { this(name, args, null); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. * @param options A bag of options that control this resource's behavior. */ public Database(java.lang.String name, DatabaseArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("ovh:CloudProject/database:Database", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false); } private Database(java.lang.String name, Output id, @Nullable DatabaseState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("ovh:CloudProject/database:Database", name, state, makeResourceOptions(options, id), false); } private static DatabaseArgs makeArgs(DatabaseArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { if (options != null && options.getUrn().isPresent()) { return null; } return args == null ? DatabaseArgs.Empty : args; } private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output id) { var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder() .version(Utilities.getVersion()) .build(); return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id); } /** * Get an existing Host 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 * @param options Optional settings to control the behavior of the CustomResource. */ public static Database get(java.lang.String name, Output id, @Nullable DatabaseState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { return new Database(name, id, state, options); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy