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

com.pulumi.alicloud.polardb.Endpoint Maven / Gradle / Ivy

There is a newer version: 3.63.0-alpha.1727424957
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.pulumi.alicloud.polardb;

import com.pulumi.alicloud.Utilities;
import com.pulumi.alicloud.polardb.EndpointArgs;
import com.pulumi.alicloud.polardb.inputs.EndpointState;
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.String;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * Provides a PolarDB endpoint resource to manage custom endpoint of PolarDB cluster.
 * 
 * > **NOTE:** Available since v1.80.0.
 * **NOTE:** After v1.80.0 and before v1.121.0, you can only use this resource to manage the custom endpoint. Since v1.121.0, you also can import the primary endpoint and the cluster endpoint, to modify their ssl status and so on.
 * **NOTE:** The primary endpoint and the default cluster endpoint can not be created or deleted manually.
 * 
 * ## Example Usage
 * 
 * <!--Start PulumiCodeChooser -->
 * 
 * {@code
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.alicloud.polardb.PolardbFunctions;
 * import com.pulumi.alicloud.polardb.inputs.GetNodeClassesArgs;
 * import com.pulumi.alicloud.vpc.Network;
 * import com.pulumi.alicloud.vpc.NetworkArgs;
 * import com.pulumi.alicloud.vpc.Switch;
 * import com.pulumi.alicloud.vpc.SwitchArgs;
 * import com.pulumi.alicloud.polardb.Cluster;
 * import com.pulumi.alicloud.polardb.ClusterArgs;
 * import com.pulumi.alicloud.polardb.Endpoint;
 * import com.pulumi.alicloud.polardb.EndpointArgs;
 * 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 default = PolardbFunctions.getNodeClasses(GetNodeClassesArgs.builder()
 *             .dbType("MySQL")
 *             .dbVersion("8.0")
 *             .payType("PostPaid")
 *             .category("Normal")
 *             .build());
 * 
 *         var defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder()
 *             .vpcName("terraform-example")
 *             .cidrBlock("172.16.0.0/16")
 *             .build());
 * 
 *         var defaultSwitch = new Switch("defaultSwitch", SwitchArgs.builder()
 *             .vpcId(defaultNetwork.id())
 *             .cidrBlock("172.16.0.0/24")
 *             .zoneId(default_.classes()[0].zoneId())
 *             .vswitchName("terraform-example")
 *             .build());
 * 
 *         var defaultCluster = new Cluster("defaultCluster", ClusterArgs.builder()
 *             .dbType("MySQL")
 *             .dbVersion("8.0")
 *             .dbNodeClass(default_.classes()[0].supportedEngines()[0].availableResources()[0].dbNodeClass())
 *             .payType("PostPaid")
 *             .vswitchId(defaultSwitch.id())
 *             .description("terraform-example")
 *             .build());
 * 
 *         var defaultEndpoint = new Endpoint("defaultEndpoint", EndpointArgs.builder()
 *             .dbClusterId(defaultCluster.id())
 *             .endpointType("Custom")
 *             .build());
 * 
 *     }
 * }
 * }
 * 
* <!--End PulumiCodeChooser --> * * ## Import * * PolarDB endpoint can be imported using the id, e.g. * * ```sh * $ pulumi import alicloud:polardb/endpoint:Endpoint example pc-abc123456:pe-abc123456 * ``` * */ @ResourceType(type="alicloud:polardb/endpoint:Endpoint") public class Endpoint extends com.pulumi.resources.CustomResource { /** * Whether the new node automatically joins the default cluster address. Valid values are `Enable`, `Disable`. When creating a new custom endpoint, default to `Disable`. * */ @Export(name="autoAddNewNodes", refs={String.class}, tree="[0]") private Output autoAddNewNodes; /** * @return Whether the new node automatically joins the default cluster address. Valid values are `Enable`, `Disable`. When creating a new custom endpoint, default to `Disable`. * */ public Output autoAddNewNodes() { return this.autoAddNewNodes; } /** * Prefix of the specified endpoint. The prefix must be 6 to 30 characters in length, and can contain lowercase letters, digits, and hyphens (-), must start with a letter and end with a digit or letter. * */ @Export(name="connectionPrefix", refs={String.class}, tree="[0]") private Output connectionPrefix; /** * @return Prefix of the specified endpoint. The prefix must be 6 to 30 characters in length, and can contain lowercase letters, digits, and hyphens (-), must start with a letter and end with a digit or letter. * */ public Output connectionPrefix() { return this.connectionPrefix; } /** * The Id of cluster that can run database. * */ @Export(name="dbClusterId", refs={String.class}, tree="[0]") private Output dbClusterId; /** * @return The Id of cluster that can run database. * */ public Output dbClusterId() { return this.dbClusterId; } /** * The name of the endpoint. * */ @Export(name="dbEndpointDescription", refs={String.class}, tree="[0]") private Output dbEndpointDescription; /** * @return The name of the endpoint. * */ public Output> dbEndpointDescription() { return Codegen.optional(this.dbEndpointDescription); } /** * (Available since v1.161.0) The ID of the cluster endpoint. * */ @Export(name="dbEndpointId", refs={String.class}, tree="[0]") private Output dbEndpointId; /** * @return (Available since v1.161.0) The ID of the cluster endpoint. * */ public Output dbEndpointId() { return this.dbEndpointId; } /** * The advanced settings of the endpoint of Apsara PolarDB clusters are in JSON format. Including the settings of consistency level, transaction splitting, connection pool, and offload reads from primary node. For more details, see the [description of EndpointConfig in the Request parameters table for details](https://www.alibabacloud.com/help/doc-detail/116593.htm). * */ @Export(name="endpointConfig", refs={Map.class,String.class}, tree="[0,1,1]") private Output> endpointConfig; /** * @return The advanced settings of the endpoint of Apsara PolarDB clusters are in JSON format. Including the settings of consistency level, transaction splitting, connection pool, and offload reads from primary node. For more details, see the [description of EndpointConfig in the Request parameters table for details](https://www.alibabacloud.com/help/doc-detail/116593.htm). * */ public Output> endpointConfig() { return this.endpointConfig; } /** * Type of the endpoint. Before v1.121.0, it only can be `Custom`. since v1.121.0, `Custom`, `Cluster`, `Primary` are valid, default to `Custom`. However when creating a new endpoint, it also only can be `Custom`. * */ @Export(name="endpointType", refs={String.class}, tree="[0]") private Output endpointType; /** * @return Type of the endpoint. Before v1.121.0, it only can be `Custom`. since v1.121.0, `Custom`, `Cluster`, `Primary` are valid, default to `Custom`. However when creating a new endpoint, it also only can be `Custom`. * */ public Output> endpointType() { return Codegen.optional(this.endpointType); } /** * The network type of the endpoint address. * */ @Export(name="netType", refs={String.class}, tree="[0]") private Output netType; /** * @return The network type of the endpoint address. * */ public Output> netType() { return Codegen.optional(this.netType); } /** * Node id list for endpoint configuration. At least 2 nodes if specified, or if the cluster has more than 3 nodes, read-only endpoint is allowed to mount only one node. Default is all nodes. * */ @Export(name="nodes", refs={List.class,String.class}, tree="[0,1]") private Output> nodes; /** * @return Node id list for endpoint configuration. At least 2 nodes if specified, or if the cluster has more than 3 nodes, read-only endpoint is allowed to mount only one node. Default is all nodes. * */ public Output> nodes() { return this.nodes; } /** * Port of the specified endpoint. Valid values: 3000 to 5999. * */ @Export(name="port", refs={String.class}, tree="[0]") private Output port; /** * @return Port of the specified endpoint. Valid values: 3000 to 5999. * */ public Output port() { return this.port; } /** * Read or write mode. Valid values are `ReadWrite`, `ReadOnly`. When creating a new custom endpoint, default to `ReadOnly`. * */ @Export(name="readWriteMode", refs={String.class}, tree="[0]") private Output readWriteMode; /** * @return Read or write mode. Valid values are `ReadWrite`, `ReadOnly`. When creating a new custom endpoint, default to `ReadOnly`. * */ public Output readWriteMode() { return this.readWriteMode; } /** * Specifies whether automatic rotation of SSL certificates is enabled. Valid values: `Enable`,`Disable`. * */ @Export(name="sslAutoRotate", refs={String.class}, tree="[0]") private Output sslAutoRotate; /** * @return Specifies whether automatic rotation of SSL certificates is enabled. Valid values: `Enable`,`Disable`. * */ public Output> sslAutoRotate() { return Codegen.optional(this.sslAutoRotate); } /** * Specifies SSL certificate download link.\ * **NOTE:** For a PolarDB for MySQL cluster, this parameter is required, and only one connection string in each endpoint can enable the ssl, for other notes, see [Configure SSL encryption](https://www.alibabacloud.com/help/doc-detail/153182.htm). * For a PolarDB for PostgreSQL cluster or a PolarDB-O cluster, this parameter is not required, by default, SSL encryption is enabled for all endpoints. * */ @Export(name="sslCertificateUrl", refs={String.class}, tree="[0]") private Output sslCertificateUrl; /** * @return Specifies SSL certificate download link.\ * **NOTE:** For a PolarDB for MySQL cluster, this parameter is required, and only one connection string in each endpoint can enable the ssl, for other notes, see [Configure SSL encryption](https://www.alibabacloud.com/help/doc-detail/153182.htm). * For a PolarDB for PostgreSQL cluster or a PolarDB-O cluster, this parameter is not required, by default, SSL encryption is enabled for all endpoints. * */ public Output sslCertificateUrl() { return this.sslCertificateUrl; } /** * (Available since v1.121.0) The SSL connection string. * */ @Export(name="sslConnectionString", refs={String.class}, tree="[0]") private Output sslConnectionString; /** * @return (Available since v1.121.0) The SSL connection string. * */ public Output sslConnectionString() { return this.sslConnectionString; } /** * Specifies how to modify the SSL encryption status. Valid values: `Disable`, `Enable`, `Update`. * */ @Export(name="sslEnabled", refs={String.class}, tree="[0]") private Output sslEnabled; /** * @return Specifies how to modify the SSL encryption status. Valid values: `Disable`, `Enable`, `Update`. * */ public Output> sslEnabled() { return Codegen.optional(this.sslEnabled); } /** * (Available since v1.121.0) The time when the SSL certificate expires. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC. * */ @Export(name="sslExpireTime", refs={String.class}, tree="[0]") private Output sslExpireTime; /** * @return (Available since v1.121.0) The time when the SSL certificate expires. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC. * */ public Output sslExpireTime() { return this.sslExpireTime; } /** * * @param name The _unique_ name of the resulting resource. */ public Endpoint(java.lang.String name) { this(name, EndpointArgs.Empty); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. */ public Endpoint(java.lang.String name, EndpointArgs 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 Endpoint(java.lang.String name, EndpointArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("alicloud:polardb/endpoint:Endpoint", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false); } private Endpoint(java.lang.String name, Output id, @Nullable EndpointState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("alicloud:polardb/endpoint:Endpoint", name, state, makeResourceOptions(options, id), false); } private static EndpointArgs makeArgs(EndpointArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { if (options != null && options.getUrn().isPresent()) { return null; } return args == null ? EndpointArgs.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 Endpoint get(java.lang.String name, Output id, @Nullable EndpointState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { return new Endpoint(name, id, state, options); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy