com.pulumi.azurenative.dbformysql.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.dbformysql;
import com.pulumi.azurenative.Utilities;
import com.pulumi.azurenative.dbformysql.ServerArgs;
import com.pulumi.azurenative.dbformysql.outputs.BackupResponse;
import com.pulumi.azurenative.dbformysql.outputs.DataEncryptionResponse;
import com.pulumi.azurenative.dbformysql.outputs.HighAvailabilityResponse;
import com.pulumi.azurenative.dbformysql.outputs.IdentityResponse;
import com.pulumi.azurenative.dbformysql.outputs.MaintenanceWindowResponse;
import com.pulumi.azurenative.dbformysql.outputs.NetworkResponse;
import com.pulumi.azurenative.dbformysql.outputs.SkuResponse;
import com.pulumi.azurenative.dbformysql.outputs.StorageResponse;
import com.pulumi.azurenative.dbformysql.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.Map;
import java.util.Optional;
import javax.annotation.Nullable;
/**
* Represents a server.
* Azure REST API version: 2022-01-01. Prior API version in Azure Native 1.x: 2017-12-01.
*
* Other available API versions: 2017-12-01, 2018-06-01-privatepreview, 2020-07-01-preview, 2020-07-01-privatepreview, 2022-09-30-preview, 2023-06-01-preview, 2023-06-30, 2023-10-01-preview, 2023-12-01-preview, 2023-12-30, 2024-02-01-preview, 2024-06-01-preview.
*
* ## Example Usage
* ### 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.dbformysql.Server;
* import com.pulumi.azurenative.dbformysql.ServerArgs;
* import com.pulumi.azurenative.dbformysql.inputs.BackupArgs;
* import com.pulumi.azurenative.dbformysql.inputs.HighAvailabilityArgs;
* import com.pulumi.azurenative.dbformysql.inputs.SkuArgs;
* import com.pulumi.azurenative.dbformysql.inputs.StorageArgs;
* 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()
* .administratorLogin("cloudsa")
* .administratorLoginPassword("your_password")
* .availabilityZone("1")
* .backup(BackupArgs.builder()
* .backupRetentionDays(7)
* .geoRedundantBackup("Disabled")
* .build())
* .createMode("Default")
* .highAvailability(HighAvailabilityArgs.builder()
* .mode("ZoneRedundant")
* .standbyAvailabilityZone("3")
* .build())
* .location("southeastasia")
* .resourceGroupName("testrg")
* .serverName("mysqltestserver")
* .sku(SkuArgs.builder()
* .name("Standard_D2ds_v4")
* .tier("GeneralPurpose")
* .build())
* .storage(StorageArgs.builder()
* .autoGrow("Disabled")
* .iops(600)
* .storageSizeGB(100)
* .build())
* .tags(Map.of("num", "1"))
* .version("5.7")
* .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.dbformysql.Server;
* import com.pulumi.azurenative.dbformysql.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()
* .createMode("Replica")
* .location("SoutheastAsia")
* .resourceGroupName("testgr")
* .serverName("replica-server")
* .sourceServerResourceId("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testgr/providers/Microsoft.DBforMySQL/flexibleServers/source-server")
* .build());
*
* }
* }
*
* }
*
* ### Create a server 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.dbformysql.Server;
* import com.pulumi.azurenative.dbformysql.ServerArgs;
* import com.pulumi.azurenative.dbformysql.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()
* .createMode("PointInTimeRestore")
* .location("SoutheastAsia")
* .resourceGroupName("TargetResourceGroup")
* .restorePointInTime("2021-06-24T00:00:37.467Z")
* .serverName("targetserver")
* .sku(SkuArgs.builder()
* .name("Standard_D14_v2")
* .tier("GeneralPurpose")
* .build())
* .sourceServerResourceId("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/SourceResourceGroup/providers/Microsoft.DBforMySQL/flexibleServers/sourceserver")
* .tags(Map.of("num", "1"))
* .build());
*
* }
* }
*
* }
*
*
* ## Import
*
* An existing resource can be imported using its type token, name, and identifier, e.g.
*
* ```sh
* $ pulumi import azure-native:dbformysql:Server mysqltestserver /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}
* ```
*
*/
@ResourceType(type="azure-native:dbformysql: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);
}
/**
* availability Zone information of the server.
*
*/
@Export(name="availabilityZone", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> availabilityZone;
/**
* @return availability Zone information of the server.
*
*/
public Output> availabilityZone() {
return Codegen.optional(this.availabilityZone);
}
/**
* Backup related properties of a server.
*
*/
@Export(name="backup", refs={BackupResponse.class}, tree="[0]")
private Output* @Nullable */ BackupResponse> backup;
/**
* @return Backup related properties of a server.
*
*/
public Output> backup() {
return Codegen.optional(this.backup);
}
/**
* The Data Encryption for CMK.
*
*/
@Export(name="dataEncryption", refs={DataEncryptionResponse.class}, tree="[0]")
private Output* @Nullable */ DataEncryptionResponse> dataEncryption;
/**
* @return The Data Encryption for CMK.
*
*/
public Output> dataEncryption() {
return Codegen.optional(this.dataEncryption);
}
/**
* The fully qualified domain name of a server.
*
*/
@Export(name="fullyQualifiedDomainName", refs={String.class}, tree="[0]")
private Output fullyQualifiedDomainName;
/**
* @return The fully qualified domain name of a server.
*
*/
public Output fullyQualifiedDomainName() {
return this.fullyQualifiedDomainName;
}
/**
* High availability related properties of a server.
*
*/
@Export(name="highAvailability", refs={HighAvailabilityResponse.class}, tree="[0]")
private Output* @Nullable */ HighAvailabilityResponse> highAvailability;
/**
* @return High availability related properties of a server.
*
*/
public Output> highAvailability() {
return Codegen.optional(this.highAvailability);
}
/**
* The cmk identity for the server.
*
*/
@Export(name="identity", refs={IdentityResponse.class}, tree="[0]")
private Output* @Nullable */ IdentityResponse> identity;
/**
* @return The cmk identity for the server.
*
*/
public Output> identity() {
return Codegen.optional(this.identity);
}
/**
* 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;
}
/**
* Maintenance window of a server.
*
*/
@Export(name="maintenanceWindow", refs={MaintenanceWindowResponse.class}, tree="[0]")
private Output* @Nullable */ MaintenanceWindowResponse> maintenanceWindow;
/**
* @return Maintenance window of a server.
*
*/
public Output> maintenanceWindow() {
return Codegen.optional(this.maintenanceWindow);
}
/**
* 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;
}
/**
* Network related properties of a server.
*
*/
@Export(name="network", refs={NetworkResponse.class}, tree="[0]")
private Output* @Nullable */ NetworkResponse> network;
/**
* @return Network related properties of a server.
*
*/
public Output> network() {
return Codegen.optional(this.network);
}
/**
* The maximum number of replicas that a primary server can have.
*
*/
@Export(name="replicaCapacity", refs={Integer.class}, tree="[0]")
private Output replicaCapacity;
/**
* @return The maximum number of replicas that a primary server can have.
*
*/
public Output replicaCapacity() {
return this.replicaCapacity;
}
/**
* The replication role.
*
*/
@Export(name="replicationRole", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> replicationRole;
/**
* @return The replication role.
*
*/
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);
}
/**
* The source MySQL server id.
*
*/
@Export(name="sourceServerResourceId", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> sourceServerResourceId;
/**
* @return The source MySQL server id.
*
*/
public Output> sourceServerResourceId() {
return Codegen.optional(this.sourceServerResourceId);
}
/**
* The state of a server.
*
*/
@Export(name="state", refs={String.class}, tree="[0]")
private Output state;
/**
* @return The state of a server.
*
*/
public Output state() {
return this.state;
}
/**
* Storage related properties of a server.
*
*/
@Export(name="storage", refs={StorageResponse.class}, tree="[0]")
private Output* @Nullable */ StorageResponse> storage;
/**
* @return Storage related properties of a server.
*
*/
public Output> storage() {
return Codegen.optional(this.storage);
}
/**
* The system metadata relating to this resource.
*
*/
@Export(name="systemData", refs={SystemDataResponse.class}, tree="[0]")
private Output systemData;
/**
* @return The system metadata relating to this resource.
*
*/
public Output systemData() {
return this.systemData;
}
/**
* 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;
}
/**
* 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:dbformysql: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:dbformysql: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:dbformysql/v20200701preview:Server").build()),
Output.of(Alias.builder().type("azure-native:dbformysql/v20200701privatepreview:Server").build()),
Output.of(Alias.builder().type("azure-native:dbformysql/v20210501:Server").build()),
Output.of(Alias.builder().type("azure-native:dbformysql/v20210501preview:Server").build()),
Output.of(Alias.builder().type("azure-native:dbformysql/v20211201preview:Server").build()),
Output.of(Alias.builder().type("azure-native:dbformysql/v20220101:Server").build()),
Output.of(Alias.builder().type("azure-native:dbformysql/v20220930preview:Server").build()),
Output.of(Alias.builder().type("azure-native:dbformysql/v20230601preview:Server").build()),
Output.of(Alias.builder().type("azure-native:dbformysql/v20230630:Server").build()),
Output.of(Alias.builder().type("azure-native:dbformysql/v20231001preview:Server").build()),
Output.of(Alias.builder().type("azure-native:dbformysql/v20231201preview:Server").build()),
Output.of(Alias.builder().type("azure-native:dbformysql/v20231230:Server").build()),
Output.of(Alias.builder().type("azure-native:dbformysql/v20240201preview:Server").build()),
Output.of(Alias.builder().type("azure-native:dbformysql/v20240601preview: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