Microsoft SQL Server v0.0.8 published on Wednesday, Nov 1, 2023 by pulumiverse
mssql.getServerRole
Explore with Pulumi AI
Microsoft SQL Server v0.0.8 published on Wednesday, Nov 1, 2023 by pulumiverse
Obtains information about single server role.
Example Usage
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Mssql = Pulumi.Mssql;
return await Deployment.RunAsync(() =>
{
var byName = Mssql.GetServerRole.Invoke(new()
{
Name = "example",
});
var byId = Mssql.GetServerRole.Invoke(new()
{
Id = "8",
});
});
package main
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumiverse/pulumi-mssql/sdk/go/mssql"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := mssql.LookupServerRole(ctx, &mssql.LookupServerRoleArgs{
Name: pulumi.StringRef("example"),
}, nil)
if err != nil {
return err
}
_, err = mssql.LookupServerRole(ctx, &mssql.LookupServerRoleArgs{
Id: pulumi.StringRef("8"),
}, nil)
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.mssql.MssqlFunctions;
import com.pulumi.mssql.inputs.GetServerRoleArgs;
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 byName = MssqlFunctions.getServerRole(GetServerRoleArgs.builder()
.name("example")
.build());
final var byId = MssqlFunctions.getServerRole(GetServerRoleArgs.builder()
.id(8)
.build());
}
}
import pulumi
import pulumi_mssql as mssql
by_name = mssql.get_server_role(name="example")
by_id = mssql.get_server_role(id="8")
import * as pulumi from "@pulumi/pulumi";
import * as mssql from "@pulumi/mssql";
const byName = mssql.getServerRole({
name: "example",
});
const byId = mssql.getServerRole({
id: "8",
});
variables:
byName:
fn::invoke:
Function: mssql:getServerRole
Arguments:
name: example
byId:
fn::invoke:
Function: mssql:getServerRole
Arguments:
id: 8
Using getServerRole
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getServerRole(args: GetServerRoleArgs, opts?: InvokeOptions): Promise<GetServerRoleResult>
function getServerRoleOutput(args: GetServerRoleOutputArgs, opts?: InvokeOptions): Output<GetServerRoleResult>
def get_server_role(id: Optional[str] = None,
name: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetServerRoleResult
def get_server_role_output(id: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetServerRoleResult]
func LookupServerRole(ctx *Context, args *LookupServerRoleArgs, opts ...InvokeOption) (*LookupServerRoleResult, error)
func LookupServerRoleOutput(ctx *Context, args *LookupServerRoleOutputArgs, opts ...InvokeOption) LookupServerRoleResultOutput
> Note: This function is named LookupServerRole
in the Go SDK.
public static class GetServerRole
{
public static Task<GetServerRoleResult> InvokeAsync(GetServerRoleArgs args, InvokeOptions? opts = null)
public static Output<GetServerRoleResult> Invoke(GetServerRoleInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetServerRoleResult> getServerRole(GetServerRoleArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: mssql:index/getServerRole:getServerRole
arguments:
# arguments dictionary
The following arguments are supported:
getServerRole Result
The following output properties are available:
- Id string
- Role principal ID. Either
name
orid
must be provided. - Members
List<Pulumiverse.
Mssql. Outputs. Get Server Role Member> - Set of role members
- Name string
- Role name. Must follow Regular Identifiers rules and cannot be longer than 128 chars. Either
name
orid
must be provided. - Owner
Id string - ID of another server role or login owning this role. Can be retrieved using
mssql.ServerRole
ormssql.SqlLogin
.
- Id string
- Role principal ID. Either
name
orid
must be provided. - Members
[]Get
Server Role Member Type - Set of role members
- Name string
- Role name. Must follow Regular Identifiers rules and cannot be longer than 128 chars. Either
name
orid
must be provided. - Owner
Id string - ID of another server role or login owning this role. Can be retrieved using
mssql.ServerRole
ormssql.SqlLogin
.
- id String
- Role principal ID. Either
name
orid
must be provided. - members
List<Get
Server Role Member> - Set of role members
- name String
- Role name. Must follow Regular Identifiers rules and cannot be longer than 128 chars. Either
name
orid
must be provided. - owner
Id String - ID of another server role or login owning this role. Can be retrieved using
mssql.ServerRole
ormssql.SqlLogin
.
- id string
- Role principal ID. Either
name
orid
must be provided. - members
Get
Server Role Member[] - Set of role members
- name string
- Role name. Must follow Regular Identifiers rules and cannot be longer than 128 chars. Either
name
orid
must be provided. - owner
Id string - ID of another server role or login owning this role. Can be retrieved using
mssql.ServerRole
ormssql.SqlLogin
.
- id str
- Role principal ID. Either
name
orid
must be provided. - members
Sequence[Get
Server Role Member] - Set of role members
- name str
- Role name. Must follow Regular Identifiers rules and cannot be longer than 128 chars. Either
name
orid
must be provided. - owner_
id str - ID of another server role or login owning this role. Can be retrieved using
mssql.ServerRole
ormssql.SqlLogin
.
- id String
- Role principal ID. Either
name
orid
must be provided. - members List<Property Map>
- Set of role members
- name String
- Role name. Must follow Regular Identifiers rules and cannot be longer than 128 chars. Either
name
orid
must be provided. - owner
Id String - ID of another server role or login owning this role. Can be retrieved using
mssql.ServerRole
ormssql.SqlLogin
.
Supporting Types
GetServerRoleMember
Package Details
- Repository
- mssql pulumiverse/pulumi-mssql
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
mssql
Terraform Provider.
Microsoft SQL Server v0.0.8 published on Wednesday, Nov 1, 2023 by pulumiverse