com.ovhcloud.pulumi.ovh.Hosting.PrivateDatabase Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-ovh Show documentation
Show all versions of pulumi-ovh Show documentation
A Pulumi package for creating and managing OVH resources.
// *** 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.Hosting;
import com.ovhcloud.pulumi.ovh.Hosting.PrivateDatabaseArgs;
import com.ovhcloud.pulumi.ovh.Hosting.inputs.PrivateDatabaseState;
import com.ovhcloud.pulumi.ovh.Hosting.outputs.PrivateDatabaseOrder;
import com.ovhcloud.pulumi.ovh.Hosting.outputs.PrivateDatabasePlan;
import com.ovhcloud.pulumi.ovh.Hosting.outputs.PrivateDatabasePlanOption;
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.Double;
import java.lang.Integer;
import java.lang.String;
import java.util.List;
import java.util.Optional;
import javax.annotation.Nullable;
/**
* ## Example Usage
*
* <!--Start PulumiCodeChooser -->
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.ovh.Me.MeFunctions;
* import com.pulumi.ovh.Order.OrderFunctions;
* import com.pulumi.ovh.Order.inputs.GetCartArgs;
* import com.pulumi.ovh.Order.inputs.GetCartProductPlanArgs;
* import com.pulumi.ovh.Hosting.PrivateDatabase;
* import com.pulumi.ovh.Hosting.PrivateDatabaseArgs;
* import com.pulumi.ovh.Hosting.inputs.PrivateDatabasePlanArgs;
* 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) {
* final var myaccount = MeFunctions.getMe();
*
* final var mycart = OrderFunctions.getCart(GetCartArgs.builder()
* .ovhSubsidiary(myaccount.applyValue(getMeResult -> getMeResult.ovhSubsidiary()))
* .build());
*
* final var databaseCartProductPlan = OrderFunctions.getCartProductPlan(GetCartProductPlanArgs.builder()
* .cartId(mycart.applyValue(getCartResult -> getCartResult.id()))
* .priceCapacity("renew")
* .product("privateSQL")
* .planCode("private-sql-512-instance")
* .build());
*
* var databasePrivateDatabase = new PrivateDatabase("databasePrivateDatabase", PrivateDatabaseArgs.builder()
* .ovhSubsidiary(mycart.applyValue(getCartResult -> getCartResult.ovhSubsidiary()))
* .displayName("Postgresql-12")
* .plan(PrivateDatabasePlanArgs.builder()
* .duration(databaseCartProductPlan.applyValue(getCartProductPlanResult -> getCartProductPlanResult.prices()[3].duration()))
* .planCode(databaseCartProductPlan.applyValue(getCartProductPlanResult -> getCartProductPlanResult.planCode()))
* .pricingMode(databaseCartProductPlan.applyValue(getCartProductPlanResult -> getCartProductPlanResult.selectedPrices()[0].pricingMode()))
* .configurations(
* PrivateDatabasePlanConfigurationArgs.builder()
* .label("dc")
* .value("gra3")
* .build(),
* PrivateDatabasePlanConfigurationArgs.builder()
* .label("engine")
* .value("postgresql_12")
* .build())
* .build())
* .build());
*
* ctx.export("privatedatabaseServiceName", databasePrivateDatabase.serviceName());
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
* ## Import
*
* OVHcloud Webhosting database can be imported using the `service_name`, E.g.,
*
* ```sh
* $ pulumi import ovh:Hosting/privateDatabase:PrivateDatabase database service_name
* ```
*
*/
@ResourceType(type="ovh:Hosting/privateDatabase:PrivateDatabase")
public class PrivateDatabase extends com.pulumi.resources.CustomResource {
/**
* URN of the private database, used when writing IAM policies
*
*/
@Export(name="DatabaseURN", refs={String.class}, tree="[0]")
private Output DatabaseURN;
/**
* @return URN of the private database, used when writing IAM policies
*
*/
public Output DatabaseURN() {
return this.DatabaseURN;
}
/**
* Number of CPU on your private database
*
*/
@Export(name="cpu", refs={Integer.class}, tree="[0]")
private Output cpu;
/**
* @return Number of CPU on your private database
*
*/
public Output cpu() {
return this.cpu;
}
/**
* Datacenter where this private database is located
*
*/
@Export(name="datacenter", refs={String.class}, tree="[0]")
private Output datacenter;
/**
* @return Datacenter where this private database is located
*
*/
public Output datacenter() {
return this.datacenter;
}
/**
* Name displayed in customer panel for your private database
*
*/
@Export(name="displayName", refs={String.class}, tree="[0]")
private Output displayName;
/**
* @return Name displayed in customer panel for your private database
*
*/
public Output displayName() {
return this.displayName;
}
/**
* Private database hostname
*
*/
@Export(name="hostname", refs={String.class}, tree="[0]")
private Output hostname;
/**
* @return Private database hostname
*
*/
public Output hostname() {
return this.hostname;
}
/**
* Private database FTP hostname
*
*/
@Export(name="hostnameFtp", refs={String.class}, tree="[0]")
private Output hostnameFtp;
/**
* @return Private database FTP hostname
*
*/
public Output hostnameFtp() {
return this.hostnameFtp;
}
/**
* Infrastructure where service was stored
*
*/
@Export(name="infrastructure", refs={String.class}, tree="[0]")
private Output infrastructure;
/**
* @return Infrastructure where service was stored
*
*/
public Output infrastructure() {
return this.infrastructure;
}
/**
* Type of the private database offer
*
*/
@Export(name="offer", refs={String.class}, tree="[0]")
private Output offer;
/**
* @return Type of the private database offer
*
*/
public Output offer() {
return this.offer;
}
/**
* Details about your Order
*
*/
@Export(name="orders", refs={List.class,PrivateDatabaseOrder.class}, tree="[0,1]")
private Output> orders;
/**
* @return Details about your Order
*
*/
public Output> orders() {
return this.orders;
}
/**
* OVHcloud Subsidiary. Country of OVHcloud legal entity you'll be billed by. List of supported subsidiaries available on API at [/1.0/me.json under `models.nichandle.OvhSubsidiaryEnum`](https://eu.api.ovh.com/1.0/me.json)
*
*/
@Export(name="ovhSubsidiary", refs={String.class}, tree="[0]")
private Output ovhSubsidiary;
/**
* @return OVHcloud Subsidiary. Country of OVHcloud legal entity you'll be billed by. List of supported subsidiaries available on API at [/1.0/me.json under `models.nichandle.OvhSubsidiaryEnum`](https://eu.api.ovh.com/1.0/me.json)
*
*/
public Output ovhSubsidiary() {
return this.ovhSubsidiary;
}
/**
* Ovh payment mode
*
* @deprecated
* This field is not anymore used since the API has been deprecated in favor of /payment/mean. Now, the default payment mean is used.
*
*/
@Deprecated /* This field is not anymore used since the API has been deprecated in favor of /payment/mean. Now, the default payment mean is used. */
@Export(name="paymentMean", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> paymentMean;
/**
* @return Ovh payment mode
*
*/
public Output> paymentMean() {
return Codegen.optional(this.paymentMean);
}
/**
* Product Plan to order
*
*/
@Export(name="plan", refs={PrivateDatabasePlan.class}, tree="[0]")
private Output plan;
/**
* @return Product Plan to order
*
*/
public Output plan() {
return this.plan;
}
/**
* Product Plan to order
*
*/
@Export(name="planOptions", refs={List.class,PrivateDatabasePlanOption.class}, tree="[0,1]")
private Output* @Nullable */ List> planOptions;
/**
* @return Product Plan to order
*
*/
public Output>> planOptions() {
return Codegen.optional(this.planOptions);
}
/**
* Private database service port
*
*/
@Export(name="port", refs={Integer.class}, tree="[0]")
private Output port;
/**
* @return Private database service port
*
*/
public Output port() {
return this.port;
}
/**
* Private database FTP port
*
*/
@Export(name="portFtp", refs={Integer.class}, tree="[0]")
private Output portFtp;
/**
* @return Private database FTP port
*
*/
public Output portFtp() {
return this.portFtp;
}
/**
* Space allowed (in MB) on your private database
*
*/
@Export(name="quotaSize", refs={Integer.class}, tree="[0]")
private Output quotaSize;
/**
* @return Space allowed (in MB) on your private database
*
*/
public Output quotaSize() {
return this.quotaSize;
}
/**
* Sapce used (in MB) on your private database
*
*/
@Export(name="quotaUsed", refs={Integer.class}, tree="[0]")
private Output quotaUsed;
/**
* @return Sapce used (in MB) on your private database
*
*/
public Output quotaUsed() {
return this.quotaUsed;
}
/**
* Amount of ram (in MB) on your private database
*
*/
@Export(name="ram", refs={Integer.class}, tree="[0]")
private Output ram;
/**
* @return Amount of ram (in MB) on your private database
*
*/
public Output ram() {
return this.ram;
}
/**
* Private database server name
*
*/
@Export(name="server", refs={String.class}, tree="[0]")
private Output server;
/**
* @return Private database server name
*
*/
public Output server() {
return this.server;
}
/**
* Service name
*
*/
@Export(name="serviceName", refs={String.class}, tree="[0]")
private Output serviceName;
/**
* @return Service name
*
*/
public Output serviceName() {
return this.serviceName;
}
/**
* Private database state
*
*/
@Export(name="state", refs={String.class}, tree="[0]")
private Output state;
/**
* @return Private database state
*
*/
public Output state() {
return this.state;
}
/**
* Private database type
*
*/
@Export(name="type", refs={String.class}, tree="[0]")
private Output type;
/**
* @return Private database type
*
*/
public Output type() {
return this.type;
}
/**
* Private database available versions
*
*/
@Export(name="version", refs={String.class}, tree="[0]")
private Output version;
/**
* @return Private database available versions
*
*/
public Output version() {
return this.version;
}
/**
* Private database version label
*
*/
@Export(name="versionLabel", refs={String.class}, tree="[0]")
private Output versionLabel;
/**
* @return Private database version label
*
*/
public Output versionLabel() {
return this.versionLabel;
}
/**
* Private database version number
*
*/
@Export(name="versionNumber", refs={Double.class}, tree="[0]")
private Output versionNumber;
/**
* @return Private database version number
*
*/
public Output versionNumber() {
return this.versionNumber;
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public PrivateDatabase(java.lang.String name) {
this(name, PrivateDatabaseArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public PrivateDatabase(java.lang.String name, PrivateDatabaseArgs 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 PrivateDatabase(java.lang.String name, PrivateDatabaseArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("ovh:Hosting/privateDatabase:PrivateDatabase", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
}
private PrivateDatabase(java.lang.String name, Output id, @Nullable PrivateDatabaseState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("ovh:Hosting/privateDatabase:PrivateDatabase", name, state, makeResourceOptions(options, id), false);
}
private static PrivateDatabaseArgs makeArgs(PrivateDatabaseArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
if (options != null && options.getUrn().isPresent()) {
return null;
}
return args == null ? PrivateDatabaseArgs.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 PrivateDatabase get(java.lang.String name, Output id, @Nullable PrivateDatabaseState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new PrivateDatabase(name, id, state, options);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy