/
getServer.go
73 lines (68 loc) · 2.39 KB
/
getServer.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package mssql
import (
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// Use this data source to access information about an existing Microsoft SQL Server.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-azure/sdk/v3/go/azure/mssql"
// "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := mssql.LookupServer(ctx, &mssql.LookupServerArgs{
// Name: "existingMsSqlServer",
// ResourceGroupName: "existingResGroup",
// }, nil)
// if err != nil {
// return err
// }
// ctx.Export("id", example.Id)
// return nil
// })
// }
// ```
func LookupServer(ctx *pulumi.Context, args *LookupServerArgs, opts ...pulumi.InvokeOption) (*LookupServerResult, error) {
var rv LookupServerResult
err := ctx.Invoke("azure:mssql/getServer:getServer", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getServer.
type LookupServerArgs struct {
// The name of this Microsoft SQL Server.
Name string `pulumi:"name"`
// The name of the Resource Group where the Microsoft SQL Server exists.
ResourceGroupName string `pulumi:"resourceGroupName"`
}
// A collection of values returned by getServer.
type LookupServerResult struct {
// The server's administrator login name.
AdministratorLogin string `pulumi:"administratorLogin"`
// The fully qualified domain name of the Azure SQL Server.
FullyQualifiedDomainName string `pulumi:"fullyQualifiedDomainName"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// A `identity` block as defined below.
Identities []GetServerIdentity `pulumi:"identities"`
// The Azure Region where the Microsoft SQL Server exists.
Location string `pulumi:"location"`
Name string `pulumi:"name"`
ResourceGroupName string `pulumi:"resourceGroupName"`
// A list of dropped restorable database IDs on the server.
RestorableDroppedDatabaseIds []string `pulumi:"restorableDroppedDatabaseIds"`
// A mapping of tags assigned to this Microsoft SQL Server.
Tags map[string]string `pulumi:"tags"`
// This servers MS SQL version.
Version string `pulumi:"version"`
}