FlexibleServerActiveDirectoryAdministratorArgs

data class FlexibleServerActiveDirectoryAdministratorArgs(val objectId: Output<String>? = null, val principalName: Output<String>? = null, val principalType: Output<String>? = null, val resourceGroupName: Output<String>? = null, val serverName: Output<String>? = null, val tenantId: Output<String>? = null) : ConvertibleToJava<FlexibleServerActiveDirectoryAdministratorArgs>

Allows you to set a user or group as the AD administrator for a PostgreSQL Flexible Server.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.core.CoreFunctions;
import com.pulumi.azuread.AzureadFunctions;
import com.pulumi.azuread.inputs.GetServicePrincipalArgs;
import com.pulumi.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.postgresql.FlexibleServer;
import com.pulumi.azure.postgresql.FlexibleServerArgs;
import com.pulumi.azure.postgresql.inputs.FlexibleServerAuthenticationArgs;
import com.pulumi.azure.postgresql.FlexibleServerActiveDirectoryAdministrator;
import com.pulumi.azure.postgresql.FlexibleServerActiveDirectoryAdministratorArgs;
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 current = CoreFunctions.getClientConfig();
final var exampleServicePrincipal = AzureadFunctions.getServicePrincipal(GetServicePrincipalArgs.builder()
.objectId(current.applyValue(getClientConfigResult -> getClientConfigResult.objectId()))
.build());
var exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()
.location("West Europe")
.build());
var exampleFlexibleServer = new FlexibleServer("exampleFlexibleServer", FlexibleServerArgs.builder()
.resourceGroupName(exampleResourceGroup.name())
.location(exampleResourceGroup.location())
.administratorLogin("adminTerraform")
.administratorPassword("QAZwsx123")
.storageMb(32768)
.version("12")
.skuName("GP_Standard_D2s_v3")
.zone("2")
.authentication(FlexibleServerAuthenticationArgs.builder()
.activeDirectoryAuthEnabled(true)
.tenantId(current.applyValue(getClientConfigResult -> getClientConfigResult.tenantId()))
.build())
.build());
var exampleFlexibleServerActiveDirectoryAdministrator = new FlexibleServerActiveDirectoryAdministrator("exampleFlexibleServerActiveDirectoryAdministrator", FlexibleServerActiveDirectoryAdministratorArgs.builder()
.serverName(exampleFlexibleServer.name())
.resourceGroupName(exampleResourceGroup.name())
.tenantId(current.applyValue(getClientConfigResult -> getClientConfigResult.tenantId()))
.objectId(exampleServicePrincipal.applyValue(getServicePrincipalResult -> getServicePrincipalResult.objectId()))
.principalName(exampleServicePrincipal.applyValue(getServicePrincipalResult -> getServicePrincipalResult.displayName()))
.principalType("ServicePrincipal")
.build());
}
}

Import

A PostgreSQL Flexible Server Active Directory Administrator can be imported using the resource id, e.g.

$ pulumi import azure:postgresql/flexibleServerActiveDirectoryAdministrator:FlexibleServerActiveDirectoryAdministrator example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/myserver/administrators/objectId

Constructors

fun FlexibleServerActiveDirectoryAdministratorArgs(objectId: Output<String>? = null, principalName: Output<String>? = null, principalType: Output<String>? = null, resourceGroupName: Output<String>? = null, serverName: Output<String>? = null, tenantId: Output<String>? = null)

Functions

Link copied to clipboard
open override fun toJava(): FlexibleServerActiveDirectoryAdministratorArgs

Properties

Link copied to clipboard
val objectId: Output<String>? = null

The object ID of a user, service principal or security group in the Azure Active Directory tenant set as the Flexible Server Admin. Changing this forces a new resource to be created.

Link copied to clipboard
val principalName: Output<String>? = null

The name of Azure Active Directory principal. Changing this forces a new resource to be created.

Link copied to clipboard
val principalType: Output<String>? = null

The type of Azure Active Directory principal. Possible values are Group, ServicePrincipal and User. Changing this forces a new resource to be created.

Link copied to clipboard
val resourceGroupName: Output<String>? = null

The name of the resource group for the PostgreSQL Server. Changing this forces a new resource to be created.

Link copied to clipboard
val serverName: Output<String>? = null

The name of the PostgreSQL Flexible Server on which to set the administrator. Changing this forces a new resource to be created.

Link copied to clipboard
val tenantId: Output<String>? = null

The Azure Tenant ID. Changing this forces a new resource to be created.