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

com.pulumi.azurenative.sql.Server Maven / Gradle / Ivy

There is a newer version: 2.82.0
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.azurenative.sql;

import com.pulumi.azurenative.Utilities;
import com.pulumi.azurenative.sql.ServerArgs;
import com.pulumi.azurenative.sql.outputs.ResourceIdentityResponse;
import com.pulumi.azurenative.sql.outputs.ServerExternalAdministratorResponse;
import com.pulumi.azurenative.sql.outputs.ServerPrivateEndpointConnectionResponse;
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.String;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * An Azure SQL Database server.
 * Azure REST API version: 2021-11-01. Prior API version in Azure Native 1.x: 2020-11-01-preview.
 * 
 * Other available API versions: 2014-04-01, 2022-11-01-preview, 2023-02-01-preview, 2023-05-01-preview, 2023-08-01-preview, 2024-05-01-preview.
 * 
 * **Warning:** when `AzureADOnlyAuthentication` is enabled, the Azure SQL API rejects any `AdministratorLoginPassword`, even if it is the same as the current one.
 * 
 * According to the Azure team, this API design owes to the following reasons:
 * - Changing the password is not allowed when Entra-only authentication is enabled because it could lead to invalid templates.
 * - Any updates containing the same, unchanged password are also rejected because different behavior for same vs different passwords would be a vector for brute forcing the password.
 * 
 * To work around this, you can comment out `AdministratorLoginPassword` when enabling `AzureADOnlyAuthentication`. To update the password, you can disable `AzureADOnlyAuthentication` and re-enable it after the update.
 * 
 * For more details and discussion please see [this issue](https://github.com/pulumi/pulumi-azure-native/issues/2937).
 * 
 * ## Example Usage
 * ### Create server
 * 
 * 
 * {@code
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azurenative.sql.Server;
 * import com.pulumi.azurenative.sql.ServerArgs;
 * import com.pulumi.azurenative.sql.inputs.ServerExternalAdministratorArgs;
 * 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 }{{@code
 *     public static void main(String[] args) }{{@code
 *         Pulumi.run(App::stack);
 *     }}{@code
 * 
 *     public static void stack(Context ctx) }{{@code
 *         var server = new Server("server", ServerArgs.builder()
 *             .administratorLogin("dummylogin")
 *             .administratorLoginPassword("PLACEHOLDER")
 *             .administrators(ServerExternalAdministratorArgs.builder()
 *                 .azureADOnlyAuthentication(true)
 *                 .login("bob}{@literal @}{@code contoso.com")
 *                 .principalType("User")
 *                 .sid("00000011-1111-2222-2222-123456789111")
 *                 .tenantId("00000011-1111-2222-2222-123456789111")
 *                 .build())
 *             .location("Japan East")
 *             .publicNetworkAccess("Enabled")
 *             .resourceGroupName("sqlcrudtest-7398")
 *             .restrictOutboundNetworkAccess("Enabled")
 *             .serverName("sqlcrudtest-4645")
 *             .build());
 * 
 *     }}{@code
 * }}{@code
 * 
 * }
 * 
* * ## Import * * An existing resource can be imported using its type token, name, and identifier, e.g. * * ```sh * $ pulumi import azure-native:sql:Server sqlcrudtest-4645 /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName} * ``` * */ @ResourceType(type="azure-native:sql:Server") public class Server extends com.pulumi.resources.CustomResource { /** * Administrator username for the server. Once created it cannot be changed. * */ @Export(name="administratorLogin", refs={String.class}, tree="[0]") private Output administratorLogin; /** * @return Administrator username for the server. Once created it cannot be changed. * */ public Output> administratorLogin() { return Codegen.optional(this.administratorLogin); } /** * The Azure Active Directory administrator of the server. * */ @Export(name="administrators", refs={ServerExternalAdministratorResponse.class}, tree="[0]") private Output administrators; /** * @return The Azure Active Directory administrator of the server. * */ public Output> administrators() { return Codegen.optional(this.administrators); } /** * The Client id used for cross tenant CMK scenario * */ @Export(name="federatedClientId", refs={String.class}, tree="[0]") private Output federatedClientId; /** * @return The Client id used for cross tenant CMK scenario * */ public Output> federatedClientId() { return Codegen.optional(this.federatedClientId); } /** * The fully qualified domain name of the server. * */ @Export(name="fullyQualifiedDomainName", refs={String.class}, tree="[0]") private Output fullyQualifiedDomainName; /** * @return The fully qualified domain name of the server. * */ public Output fullyQualifiedDomainName() { return this.fullyQualifiedDomainName; } /** * The Azure Active Directory identity of the server. * */ @Export(name="identity", refs={ResourceIdentityResponse.class}, tree="[0]") private Output identity; /** * @return The Azure Active Directory identity of the server. * */ public Output> identity() { return Codegen.optional(this.identity); } /** * A CMK URI of the key to use for encryption. * */ @Export(name="keyId", refs={String.class}, tree="[0]") private Output keyId; /** * @return A CMK URI of the key to use for encryption. * */ public Output> keyId() { return Codegen.optional(this.keyId); } /** * Kind of sql server. This is metadata used for the Azure portal experience. * */ @Export(name="kind", refs={String.class}, tree="[0]") private Output kind; /** * @return Kind of sql server. This is metadata used for the Azure portal experience. * */ public Output kind() { return this.kind; } /** * Resource location. * */ @Export(name="location", refs={String.class}, tree="[0]") private Output location; /** * @return Resource location. * */ public Output location() { return this.location; } /** * Minimal TLS version. Allowed values: '1.0', '1.1', '1.2' * */ @Export(name="minimalTlsVersion", refs={String.class}, tree="[0]") private Output minimalTlsVersion; /** * @return Minimal TLS version. Allowed values: '1.0', '1.1', '1.2' * */ public Output> minimalTlsVersion() { return Codegen.optional(this.minimalTlsVersion); } /** * Resource name. * */ @Export(name="name", refs={String.class}, tree="[0]") private Output name; /** * @return Resource name. * */ public Output name() { return this.name; } /** * The resource id of a user assigned identity to be used by default. * */ @Export(name="primaryUserAssignedIdentityId", refs={String.class}, tree="[0]") private Output primaryUserAssignedIdentityId; /** * @return The resource id of a user assigned identity to be used by default. * */ public Output> primaryUserAssignedIdentityId() { return Codegen.optional(this.primaryUserAssignedIdentityId); } /** * 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 endpoint 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 publicNetworkAccess; /** * @return Whether or not public endpoint 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); } /** * Whether or not to restrict outbound network access for this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled' * */ @Export(name="restrictOutboundNetworkAccess", refs={String.class}, tree="[0]") private Output restrictOutboundNetworkAccess; /** * @return Whether or not to restrict outbound network access for this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled' * */ public Output> restrictOutboundNetworkAccess() { return Codegen.optional(this.restrictOutboundNetworkAccess); } /** * The state of the server. * */ @Export(name="state", refs={String.class}, tree="[0]") private Output state; /** * @return The state of the server. * */ public Output state() { return this.state; } /** * Resource tags. * */ @Export(name="tags", refs={Map.class,String.class}, tree="[0,1,1]") private Output> tags; /** * @return Resource tags. * */ public Output>> tags() { return Codegen.optional(this.tags); } /** * Resource type. * */ @Export(name="type", refs={String.class}, tree="[0]") private Output type; /** * @return Resource type. * */ public Output type() { return this.type; } /** * The version of the server. * */ @Export(name="version", refs={String.class}, tree="[0]") private Output version; /** * @return The version of the server. * */ public Output> version() { return Codegen.optional(this.version); } /** * Whether or not existing server has a workspace created and if it allows connection from workspace * */ @Export(name="workspaceFeature", refs={String.class}, tree="[0]") private Output workspaceFeature; /** * @return Whether or not existing server has a workspace created and if it allows connection from workspace * */ public Output workspaceFeature() { return this.workspaceFeature; } /** * * @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:sql: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:sql: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:sql/v20140401:Server").build()), Output.of(Alias.builder().type("azure-native:sql/v20150501preview:Server").build()), Output.of(Alias.builder().type("azure-native:sql/v20190601preview:Server").build()), Output.of(Alias.builder().type("azure-native:sql/v20200202preview:Server").build()), Output.of(Alias.builder().type("azure-native:sql/v20200801preview:Server").build()), Output.of(Alias.builder().type("azure-native:sql/v20201101preview:Server").build()), Output.of(Alias.builder().type("azure-native:sql/v20210201preview:Server").build()), Output.of(Alias.builder().type("azure-native:sql/v20210501preview:Server").build()), Output.of(Alias.builder().type("azure-native:sql/v20210801preview:Server").build()), Output.of(Alias.builder().type("azure-native:sql/v20211101:Server").build()), Output.of(Alias.builder().type("azure-native:sql/v20211101preview:Server").build()), Output.of(Alias.builder().type("azure-native:sql/v20220201preview:Server").build()), Output.of(Alias.builder().type("azure-native:sql/v20220501preview:Server").build()), Output.of(Alias.builder().type("azure-native:sql/v20220801preview:Server").build()), Output.of(Alias.builder().type("azure-native:sql/v20221101preview:Server").build()), Output.of(Alias.builder().type("azure-native:sql/v20230201preview:Server").build()), Output.of(Alias.builder().type("azure-native:sql/v20230501preview:Server").build()), Output.of(Alias.builder().type("azure-native:sql/v20230801preview:Server").build()), Output.of(Alias.builder().type("azure-native:sql/v20240501preview: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 - 2025 Weber Informatics LLC | Privacy Policy