import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * Manages a Microsoft SQL Virtual Machine Availability Group Listener. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as azure from "@pulumi/azure"; * * const example = azure.network.getSubnet({ * name: "examplesubnet", * virtualNetworkName: "examplevnet", * resourceGroupName: "example-resources", * }); * const exampleGetLB = azure.lb.getLB({ * name: "example-lb", * resourceGroupName: "example-resources", * }); * const exampleGetVirtualMachine = (new Array(2)).map((_, i) => i).map(__index => (azure.compute.getVirtualMachine({ * name: "example-vm", * resourceGroupName: "example-resources", * }))); * const exampleVirtualMachineGroup = new azure.mssql.VirtualMachineGroup("example", { * name: "examplegroup", * resourceGroupName: "example-resources", * location: "West Europe", * sqlImageOffer: "SQL2017-WS2016", * sqlImageSku: "Developer", * wsfcDomainProfile: { * fqdn: "testdomain.com", * clusterSubnetType: "SingleSubnet", * }, * }); * const exampleVirtualMachine: azure.mssql.VirtualMachine[] = []; * for (const range = {value: 0}; range.value < 2; range.value++) { * exampleVirtualMachine.push(new azure.mssql.VirtualMachine(`example-${range.value}`, { * virtualMachineId: exampleGetVirtualMachine[range.value].then(exampleGetVirtualMachine => exampleGetVirtualMachine.id), * sqlLicenseType: "PAYG", * sqlVirtualMachineGroupId: exampleVirtualMachineGroup.id, * wsfcDomainCredential: { * clusterBootstrapAccountPassword: "P@ssw0rd1234!", * clusterOperatorAccountPassword: "P@ssw0rd1234!", * sqlServiceAccountPassword: "P@ssw0rd1234!", * }, * })); * } * const exampleVirtualMachineAvailabilityGroupListener = new azure.mssql.VirtualMachineAvailabilityGroupListener("example", { * name: "listener1", * availabilityGroupName: "availabilitygroup1", * port: 1433, * sqlVirtualMachineGroupId: exampleVirtualMachineGroup.id, * loadBalancerConfiguration: { * loadBalancerId: exampleGetLB.then(exampleGetLB => exampleGetLB.id), * privateIpAddress: "10.0.2.11", * probePort: 51572, * subnetId: example.then(example => example.id), * sqlVirtualMachineIds: [ * exampleVirtualMachine[0].id, * exampleVirtualMachine[1].id, * ], * }, * replicas: [ * { * sqlVirtualMachineId: exampleVirtualMachine[0].id, * role: "Primary", * commit: "Synchronous_Commit", * failover: "Automatic", * readableSecondary: "All", * }, * { * sqlVirtualMachineId: exampleVirtualMachine[1].id, * role: "Secondary", * commit: "Asynchronous_Commit", * failover: "Manual", * readableSecondary: "No", * }, * ], * }); * ``` * * ## API Providers * * * This resource uses the following Azure API Providers: * * * `Microsoft.SqlVirtualMachine` - 2023-10-01 * * ## Import * * Microsoft SQL Virtual Machine Availability Group Listeners can be imported using the `resource id`, e.g. * * ```sh * $ pulumi import azure:mssql/virtualMachineAvailabilityGroupListener:VirtualMachineAvailabilityGroupListener example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/vmgroup1/availabilityGroupListeners/listener1 * ``` */ export declare class VirtualMachineAvailabilityGroupListener extends pulumi.CustomResource { /** * Get an existing VirtualMachineAvailabilityGroupListener 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 state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input, state?: VirtualMachineAvailabilityGroupListenerState, opts?: pulumi.CustomResourceOptions): VirtualMachineAvailabilityGroupListener; /** * Returns true if the given object is an instance of VirtualMachineAvailabilityGroupListener. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is VirtualMachineAvailabilityGroupListener; /** * The name of the Availability Group. Changing this forces a new resource to be created. */ readonly availabilityGroupName: pulumi.Output; /** * A `loadBalancerConfiguration` block as defined below. Changing this forces a new resource to be created. * * > **Note:** Either one of `loadBalancerConfiguration` or `multiSubnetIpConfiguration` must be specified. */ readonly loadBalancerConfiguration: pulumi.Output; /** * One or more `multiSubnetIpConfiguration` blocks as defined below. Changing this forces a new resource to be created. */ readonly multiSubnetIpConfigurations: pulumi.Output; /** * The name which should be used for the Microsoft SQL Virtual Machine Availability Group Listener. Changing this forces a new resource to be created. */ readonly name: pulumi.Output; /** * The port of the listener. Changing this forces a new resource to be created. */ readonly port: pulumi.Output; /** * One or more `replica` blocks as defined below. Changing this forces a new resource to be created. */ readonly replicas: pulumi.Output; /** * The ID of the SQL Virtual Machine Group to create the listener. Changing this forces a new resource to be created. */ readonly sqlVirtualMachineGroupId: pulumi.Output; /** * Create a VirtualMachineAvailabilityGroupListener resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: VirtualMachineAvailabilityGroupListenerArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering VirtualMachineAvailabilityGroupListener resources. */ export interface VirtualMachineAvailabilityGroupListenerState { /** * The name of the Availability Group. Changing this forces a new resource to be created. */ availabilityGroupName?: pulumi.Input; /** * A `loadBalancerConfiguration` block as defined below. Changing this forces a new resource to be created. * * > **Note:** Either one of `loadBalancerConfiguration` or `multiSubnetIpConfiguration` must be specified. */ loadBalancerConfiguration?: pulumi.Input; /** * One or more `multiSubnetIpConfiguration` blocks as defined below. Changing this forces a new resource to be created. */ multiSubnetIpConfigurations?: pulumi.Input[]>; /** * The name which should be used for the Microsoft SQL Virtual Machine Availability Group Listener. Changing this forces a new resource to be created. */ name?: pulumi.Input; /** * The port of the listener. Changing this forces a new resource to be created. */ port?: pulumi.Input; /** * One or more `replica` blocks as defined below. Changing this forces a new resource to be created. */ replicas?: pulumi.Input[]>; /** * The ID of the SQL Virtual Machine Group to create the listener. Changing this forces a new resource to be created. */ sqlVirtualMachineGroupId?: pulumi.Input; } /** * The set of arguments for constructing a VirtualMachineAvailabilityGroupListener resource. */ export interface VirtualMachineAvailabilityGroupListenerArgs { /** * The name of the Availability Group. Changing this forces a new resource to be created. */ availabilityGroupName?: pulumi.Input; /** * A `loadBalancerConfiguration` block as defined below. Changing this forces a new resource to be created. * * > **Note:** Either one of `loadBalancerConfiguration` or `multiSubnetIpConfiguration` must be specified. */ loadBalancerConfiguration?: pulumi.Input; /** * One or more `multiSubnetIpConfiguration` blocks as defined below. Changing this forces a new resource to be created. */ multiSubnetIpConfigurations?: pulumi.Input[]>; /** * The name which should be used for the Microsoft SQL Virtual Machine Availability Group Listener. Changing this forces a new resource to be created. */ name?: pulumi.Input; /** * The port of the listener. Changing this forces a new resource to be created. */ port?: pulumi.Input; /** * One or more `replica` blocks as defined below. Changing this forces a new resource to be created. */ replicas: pulumi.Input[]>; /** * The ID of the SQL Virtual Machine Group to create the listener. Changing this forces a new resource to be created. */ sqlVirtualMachineGroupId: pulumi.Input; }