com.pulumi.azurenative.cache.Database Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-native Show documentation
Show all versions of azure-native Show documentation
A native Pulumi package for creating and managing Azure 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.pulumi.azurenative.cache;
import com.pulumi.azurenative.Utilities;
import com.pulumi.azurenative.cache.DatabaseArgs;
import com.pulumi.azurenative.cache.outputs.DatabasePropertiesResponseGeoReplication;
import com.pulumi.azurenative.cache.outputs.ModuleResponse;
import com.pulumi.azurenative.cache.outputs.PersistenceResponse;
import com.pulumi.azurenative.cache.outputs.SystemDataResponse;
import com.pulumi.core.Alias;
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.Integer;
import java.lang.String;
import java.util.List;
import java.util.Optional;
import javax.annotation.Nullable;
/**
* Describes a database on the RedisEnterprise cluster
* Azure REST API version: 2023-03-01-preview. Prior API version in Azure Native 1.x: 2021-03-01.
*
* Other available API versions: 2023-07-01, 2023-08-01-preview, 2023-10-01-preview, 2023-11-01, 2024-02-01, 2024-03-01-preview, 2024-06-01-preview, 2024-09-01-preview.
*
* ## Example Usage
* ### RedisEnterpriseDatabasesCreate
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.cache.Database;
* import com.pulumi.azurenative.cache.DatabaseArgs;
* import com.pulumi.azurenative.cache.inputs.ModuleArgs;
* import com.pulumi.azurenative.cache.inputs.PersistenceArgs;
* 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 database = new Database("database", DatabaseArgs.builder()
* .clientProtocol("Encrypted")
* .clusterName("cache1")
* .clusteringPolicy("EnterpriseCluster")
* .databaseName("default")
* .evictionPolicy("AllKeysLRU")
* .modules(
* ModuleArgs.builder()
* .args("ERROR_RATE 0.00 INITIAL_SIZE 400")
* .name("RedisBloom")
* .build(),
* ModuleArgs.builder()
* .args("RETENTION_POLICY 20")
* .name("RedisTimeSeries")
* .build(),
* ModuleArgs.builder()
* .name("RediSearch")
* .build())
* .persistence(PersistenceArgs.builder()
* .aofEnabled(true)
* .aofFrequency("1s")
* .build())
* .port(10000)
* .resourceGroupName("rg1")
* .build());
*
* }
* }
*
* }
*
* ### RedisEnterpriseDatabasesCreate With Active Geo Replication
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.cache.Database;
* import com.pulumi.azurenative.cache.DatabaseArgs;
* import com.pulumi.azurenative.cache.inputs.DatabasePropertiesGeoReplicationArgs;
* 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 database = new Database("database", DatabaseArgs.builder()
* .clientProtocol("Encrypted")
* .clusterName("cache1")
* .clusteringPolicy("EnterpriseCluster")
* .databaseName("default")
* .evictionPolicy("NoEviction")
* .geoReplication(DatabasePropertiesGeoReplicationArgs.builder()
* .groupNickname("groupName")
* .linkedDatabases(
* LinkedDatabaseArgs.builder()
* .id("/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/databases/default")
* .build(),
* LinkedDatabaseArgs.builder()
* .id("/subscriptions/subid2/resourceGroups/rg2/providers/Microsoft.Cache/redisEnterprise/cache2/databases/default")
* .build())
* .build())
* .port(10000)
* .resourceGroupName("rg1")
* .build());
*
* }
* }
*
* }
*
*
* ## Import
*
* An existing resource can be imported using its type token, name, and identifier, e.g.
*
* ```sh
* $ pulumi import azure-native:cache:Database cache1/default /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}
* ```
*
*/
@ResourceType(type="azure-native:cache:Database")
public class Database extends com.pulumi.resources.CustomResource {
/**
* Specifies whether redis clients can connect using TLS-encrypted or plaintext redis protocols. Default is TLS-encrypted.
*
*/
@Export(name="clientProtocol", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> clientProtocol;
/**
* @return Specifies whether redis clients can connect using TLS-encrypted or plaintext redis protocols. Default is TLS-encrypted.
*
*/
public Output> clientProtocol() {
return Codegen.optional(this.clientProtocol);
}
/**
* Clustering policy - default is OSSCluster. Specified at create time.
*
*/
@Export(name="clusteringPolicy", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> clusteringPolicy;
/**
* @return Clustering policy - default is OSSCluster. Specified at create time.
*
*/
public Output> clusteringPolicy() {
return Codegen.optional(this.clusteringPolicy);
}
/**
* Redis eviction policy - default is VolatileLRU
*
*/
@Export(name="evictionPolicy", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> evictionPolicy;
/**
* @return Redis eviction policy - default is VolatileLRU
*
*/
public Output> evictionPolicy() {
return Codegen.optional(this.evictionPolicy);
}
/**
* Optional set of properties to configure geo replication for this database.
*
*/
@Export(name="geoReplication", refs={DatabasePropertiesResponseGeoReplication.class}, tree="[0]")
private Output* @Nullable */ DatabasePropertiesResponseGeoReplication> geoReplication;
/**
* @return Optional set of properties to configure geo replication for this database.
*
*/
public Output> geoReplication() {
return Codegen.optional(this.geoReplication);
}
/**
* Optional set of redis modules to enable in this database - modules can only be added at creation time.
*
*/
@Export(name="modules", refs={List.class,ModuleResponse.class}, tree="[0,1]")
private Output* @Nullable */ List> modules;
/**
* @return Optional set of redis modules to enable in this database - modules can only be added at creation time.
*
*/
public Output>> modules() {
return Codegen.optional(this.modules);
}
/**
* The name of the resource
*
*/
@Export(name="name", refs={String.class}, tree="[0]")
private Output name;
/**
* @return The name of the resource
*
*/
public Output name() {
return this.name;
}
/**
* Persistence settings
*
*/
@Export(name="persistence", refs={PersistenceResponse.class}, tree="[0]")
private Output* @Nullable */ PersistenceResponse> persistence;
/**
* @return Persistence settings
*
*/
public Output> persistence() {
return Codegen.optional(this.persistence);
}
/**
* TCP port of the database endpoint. Specified at create time. Defaults to an available port.
*
*/
@Export(name="port", refs={Integer.class}, tree="[0]")
private Output* @Nullable */ Integer> port;
/**
* @return TCP port of the database endpoint. Specified at create time. Defaults to an available port.
*
*/
public Output> port() {
return Codegen.optional(this.port);
}
/**
* Current provisioning status of the database
*
*/
@Export(name="provisioningState", refs={String.class}, tree="[0]")
private Output provisioningState;
/**
* @return Current provisioning status of the database
*
*/
public Output provisioningState() {
return this.provisioningState;
}
/**
* Current resource status of the database
*
*/
@Export(name="resourceState", refs={String.class}, tree="[0]")
private Output resourceState;
/**
* @return Current resource status of the database
*
*/
public Output resourceState() {
return this.resourceState;
}
/**
* Azure Resource Manager metadata containing createdBy and modifiedBy information.
*
*/
@Export(name="systemData", refs={SystemDataResponse.class}, tree="[0]")
private Output systemData;
/**
* @return Azure Resource Manager metadata containing createdBy and modifiedBy information.
*
*/
public Output systemData() {
return this.systemData;
}
/**
* The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
*
*/
@Export(name="type", refs={String.class}, tree="[0]")
private Output type;
/**
* @return The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
*
*/
public Output type() {
return this.type;
}
/**
*
* @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("azure-native:cache:Database", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
}
private Database(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure-native:cache:Database", name, null, 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())
.aliases(List.of(
Output.of(Alias.builder().type("azure-native:cache/v20201001preview:Database").build()),
Output.of(Alias.builder().type("azure-native:cache/v20210201preview:Database").build()),
Output.of(Alias.builder().type("azure-native:cache/v20210301:Database").build()),
Output.of(Alias.builder().type("azure-native:cache/v20210801:Database").build()),
Output.of(Alias.builder().type("azure-native:cache/v20220101:Database").build()),
Output.of(Alias.builder().type("azure-native:cache/v20221101preview:Database").build()),
Output.of(Alias.builder().type("azure-native:cache/v20230301preview:Database").build()),
Output.of(Alias.builder().type("azure-native:cache/v20230701:Database").build()),
Output.of(Alias.builder().type("azure-native:cache/v20230801preview:Database").build()),
Output.of(Alias.builder().type("azure-native:cache/v20231001preview:Database").build()),
Output.of(Alias.builder().type("azure-native:cache/v20231101:Database").build()),
Output.of(Alias.builder().type("azure-native:cache/v20240201:Database").build()),
Output.of(Alias.builder().type("azure-native:cache/v20240301preview:Database").build()),
Output.of(Alias.builder().type("azure-native:cache/v20240601preview:Database").build()),
Output.of(Alias.builder().type("azure-native:cache/v20240901preview:Database").build())
))
.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 options Optional settings to control the behavior of the CustomResource.
*/
public static Database get(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new Database(name, id, options);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy