com.pulumi.azurenative.dbformariadb.Server 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.dbformariadb;
import com.pulumi.azurenative.Utilities;
import com.pulumi.azurenative.dbformariadb.ServerArgs;
import com.pulumi.azurenative.dbformariadb.outputs.ServerPrivateEndpointConnectionResponse;
import com.pulumi.azurenative.dbformariadb.outputs.SkuResponse;
import com.pulumi.azurenative.dbformariadb.outputs.StorageProfileResponse;
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.Map;
import java.util.Optional;
import javax.annotation.Nullable;
/**
* Represents a server.
* Azure REST API version: 2018-06-01. Prior API version in Azure Native 1.x: 2018-06-01.
*
* Other available API versions: 2018-06-01-preview.
*
* ## Example Usage
* ### Create a database as a point in time restore
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.dbformariadb.Server;
* import com.pulumi.azurenative.dbformariadb.ServerArgs;
* import com.pulumi.azurenative.dbformariadb.inputs.SkuArgs;
* 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 server = new Server("server", ServerArgs.builder()
* .location("brazilsouth")
* .properties(ServerPropertiesForDefaultCreateArgs.builder()
* .createMode("PointInTimeRestore")
* .restorePointInTime("2017-12-14T00:00:37.467Z")
* .sourceServerId("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/SourceResourceGroup/providers/Microsoft.DBforMariaDB/servers/sourceserver")
* .build())
* .resourceGroupName("TargetResourceGroup")
* .serverName("targetserver")
* .sku(SkuArgs.builder()
* .capacity(2)
* .family("Gen5")
* .name("GP_Gen5_2")
* .tier("GeneralPurpose")
* .build())
* .tags(Map.of("ElasticServer", "1"))
* .build());
*
* }
* }
*
* }
*
* ### Create a new server
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.dbformariadb.Server;
* import com.pulumi.azurenative.dbformariadb.ServerArgs;
* import com.pulumi.azurenative.dbformariadb.inputs.SkuArgs;
* 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 server = new Server("server", ServerArgs.builder()
* .location("westus")
* .properties(ServerPropertiesForDefaultCreateArgs.builder()
* .administratorLogin("cloudsa")
* .administratorLoginPassword("")
* .createMode("Default")
* .minimalTlsVersion("TLS1_2")
* .sslEnforcement("Enabled")
* .storageProfile(StorageProfileArgs.builder()
* .backupRetentionDays(7)
* .geoRedundantBackup("Enabled")
* .storageMB(128000)
* .build())
* .build())
* .resourceGroupName("testrg")
* .serverName("mariadbtestsvc4")
* .sku(SkuArgs.builder()
* .capacity(2)
* .family("Gen5")
* .name("GP_Gen5_2")
* .tier("GeneralPurpose")
* .build())
* .tags(Map.of("ElasticServer", "1"))
* .build());
*
* }
* }
*
* }
*
* ### Create a replica server
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.dbformariadb.Server;
* import com.pulumi.azurenative.dbformariadb.ServerArgs;
* 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 server = new Server("server", ServerArgs.builder()
* .location("westus")
* .properties(ServerPropertiesForReplicaArgs.builder()
* .createMode("Replica")
* .sourceServerId("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/MasterResourceGroup/providers/Microsoft.DBforMariaDB/servers/masterserver")
* .build())
* .resourceGroupName("TargetResourceGroup")
* .serverName("targetserver")
* .build());
*
* }
* }
*
* }
*
* ### Create a server as a geo restore
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.dbformariadb.Server;
* import com.pulumi.azurenative.dbformariadb.ServerArgs;
* import com.pulumi.azurenative.dbformariadb.inputs.SkuArgs;
* 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 server = new Server("server", ServerArgs.builder()
* .location("westus")
* .properties(ServerPropertiesForGeoRestoreArgs.builder()
* .createMode("GeoRestore")
* .sourceServerId("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/SourceResourceGroup/providers/Microsoft.DBforMariaDB/servers/sourceserver")
* .build())
* .resourceGroupName("TargetResourceGroup")
* .serverName("targetserver")
* .sku(SkuArgs.builder()
* .capacity(2)
* .family("Gen5")
* .name("GP_Gen5_2")
* .tier("GeneralPurpose")
* .build())
* .tags(Map.of("ElasticServer", "1"))
* .build());
*
* }
* }
*
* }
*
*
* ## Import
*
* An existing resource can be imported using its type token, name, and identifier, e.g.
*
* ```sh
* $ pulumi import azure-native:dbformariadb:Server targetserver /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}
* ```
*
*/
@ResourceType(type="azure-native:dbformariadb:Server")
public class Server extends com.pulumi.resources.CustomResource {
/**
* The administrator's login name of a server. Can only be specified when the server is being created (and is required for creation).
*
*/
@Export(name="administratorLogin", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> administratorLogin;
/**
* @return The administrator's login name of a server. Can only be specified when the server is being created (and is required for creation).
*
*/
public Output> administratorLogin() {
return Codegen.optional(this.administratorLogin);
}
/**
* Earliest restore point creation time (ISO8601 format)
*
*/
@Export(name="earliestRestoreDate", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> earliestRestoreDate;
/**
* @return Earliest restore point creation time (ISO8601 format)
*
*/
public Output> earliestRestoreDate() {
return Codegen.optional(this.earliestRestoreDate);
}
/**
* The fully qualified domain name of a server.
*
*/
@Export(name="fullyQualifiedDomainName", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> fullyQualifiedDomainName;
/**
* @return The fully qualified domain name of a server.
*
*/
public Output> fullyQualifiedDomainName() {
return Codegen.optional(this.fullyQualifiedDomainName);
}
/**
* The geo-location where the resource lives
*
*/
@Export(name="location", refs={String.class}, tree="[0]")
private Output location;
/**
* @return The geo-location where the resource lives
*
*/
public Output location() {
return this.location;
}
/**
* The master server id of a replica server.
*
*/
@Export(name="masterServerId", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> masterServerId;
/**
* @return The master server id of a replica server.
*
*/
public Output> masterServerId() {
return Codegen.optional(this.masterServerId);
}
/**
* Enforce a minimal Tls version for the server.
*
*/
@Export(name="minimalTlsVersion", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> minimalTlsVersion;
/**
* @return Enforce a minimal Tls version for the server.
*
*/
public Output> minimalTlsVersion() {
return Codegen.optional(this.minimalTlsVersion);
}
/**
* 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;
}
/**
* List of private endpoint connections on a server
*
*/
@Export(name="privateEndpointConnections", refs={List.class,ServerPrivateEndpointConnectionResponse.class}, tree="[0,1]")
private Output> privateEndpointConnections;
/**
* @return List of private endpoint connections on a server
*
*/
public Output> privateEndpointConnections() {
return this.privateEndpointConnections;
}
/**
* Whether or not public network access is allowed for this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled'
*
*/
@Export(name="publicNetworkAccess", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> publicNetworkAccess;
/**
* @return Whether or not public network access is allowed for this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled'
*
*/
public Output> publicNetworkAccess() {
return Codegen.optional(this.publicNetworkAccess);
}
/**
* The maximum number of replicas that a master server can have.
*
*/
@Export(name="replicaCapacity", refs={Integer.class}, tree="[0]")
private Output* @Nullable */ Integer> replicaCapacity;
/**
* @return The maximum number of replicas that a master server can have.
*
*/
public Output> replicaCapacity() {
return Codegen.optional(this.replicaCapacity);
}
/**
* The replication role of the server.
*
*/
@Export(name="replicationRole", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> replicationRole;
/**
* @return The replication role of the server.
*
*/
public Output> replicationRole() {
return Codegen.optional(this.replicationRole);
}
/**
* The SKU (pricing tier) of the server.
*
*/
@Export(name="sku", refs={SkuResponse.class}, tree="[0]")
private Output* @Nullable */ SkuResponse> sku;
/**
* @return The SKU (pricing tier) of the server.
*
*/
public Output> sku() {
return Codegen.optional(this.sku);
}
/**
* Enable ssl enforcement or not when connect to server.
*
*/
@Export(name="sslEnforcement", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> sslEnforcement;
/**
* @return Enable ssl enforcement or not when connect to server.
*
*/
public Output> sslEnforcement() {
return Codegen.optional(this.sslEnforcement);
}
/**
* Storage profile of a server.
*
*/
@Export(name="storageProfile", refs={StorageProfileResponse.class}, tree="[0]")
private Output* @Nullable */ StorageProfileResponse> storageProfile;
/**
* @return Storage profile of a server.
*
*/
public Output> storageProfile() {
return Codegen.optional(this.storageProfile);
}
/**
* Resource tags.
*
*/
@Export(name="tags", refs={Map.class,String.class}, tree="[0,1,1]")
private Output* @Nullable */ Map> tags;
/**
* @return Resource tags.
*
*/
public Output>> tags() {
return Codegen.optional(this.tags);
}
/**
* 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;
}
/**
* A state of a server that is visible to user.
*
*/
@Export(name="userVisibleState", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> userVisibleState;
/**
* @return A state of a server that is visible to user.
*
*/
public Output> userVisibleState() {
return Codegen.optional(this.userVisibleState);
}
/**
* Server version.
*
*/
@Export(name="version", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> version;
/**
* @return Server version.
*
*/
public Output> version() {
return Codegen.optional(this.version);
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public Server(java.lang.String name) {
this(name, ServerArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public Server(java.lang.String name, ServerArgs 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 Server(java.lang.String name, ServerArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure-native:dbformariadb:Server", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
}
private Server(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure-native:dbformariadb:Server", name, null, makeResourceOptions(options, id), false);
}
private static ServerArgs makeArgs(ServerArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
if (options != null && options.getUrn().isPresent()) {
return null;
}
return args == null ? ServerArgs.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:dbformariadb/v20180601:Server").build()),
Output.of(Alias.builder().type("azure-native:dbformariadb/v20180601preview:Server").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 Server get(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new Server(name, id, options);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy