Azure Classic

v5.25.0 published on Thursday, Nov 24, 2022 by Pulumi

getService

Use this data source to access information about an existing Database Migration Service.

Example Usage

using System.Collections.Generic;
using Pulumi;
using Azure = Pulumi.Azure;

return await Deployment.RunAsync(() => 
{
    var example = Azure.DatabaseMigration.GetService.Invoke(new()
    {
        Name = "example-dms",
        ResourceGroupName = "example-rg",
    });

    return new Dictionary<string, object?>
    {
        ["azurermDmsId"] = example.Apply(getServiceResult => getServiceResult.Id),
    };
});
package main

import (
	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/databasemigration"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := databasemigration.LookupService(ctx, &databasemigration.LookupServiceArgs{
			Name:              "example-dms",
			ResourceGroupName: "example-rg",
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("azurermDmsId", example.Id)
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.databasemigration.DatabasemigrationFunctions;
import com.pulumi.azure.apimanagement.inputs.GetServiceArgs;
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 example = DatabasemigrationFunctions.getService(GetServiceArgs.builder()
            .name("example-dms")
            .resourceGroupName("example-rg")
            .build());

        ctx.export("azurermDmsId", example.applyValue(getServiceResult -> getServiceResult.id()));
    }
}
import pulumi
import pulumi_azure as azure

example = azure.databasemigration.get_service(name="example-dms",
    resource_group_name="example-rg")
pulumi.export("azurermDmsId", example.id)
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const example = azure.databasemigration.getService({
    name: "example-dms",
    resourceGroupName: "example-rg",
});
export const azurermDmsId = example.then(example => example.id);
variables:
  example:
    Fn::Invoke:
      Function: azure:databasemigration:getService
      Arguments:
        name: example-dms
        resourceGroupName: example-rg
outputs:
  azurermDmsId: ${example.id}

Using getService

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 getService(args: GetServiceArgs, opts?: InvokeOptions): Promise<GetServiceResult>
function getServiceOutput(args: GetServiceOutputArgs, opts?: InvokeOptions): Output<GetServiceResult>
def get_service(name: Optional[str] = None,
                resource_group_name: Optional[str] = None,
                opts: Optional[InvokeOptions] = None) -> GetServiceResult
def get_service_output(name: Optional[pulumi.Input[str]] = None,
                resource_group_name: Optional[pulumi.Input[str]] = None,
                opts: Optional[InvokeOptions] = None) -> Output[GetServiceResult]
func LookupService(ctx *Context, args *LookupServiceArgs, opts ...InvokeOption) (*LookupServiceResult, error)
func LookupServiceOutput(ctx *Context, args *LookupServiceOutputArgs, opts ...InvokeOption) LookupServiceResultOutput

> Note: This function is named LookupService in the Go SDK.

public static class GetService 
{
    public static Task<GetServiceResult> InvokeAsync(GetServiceArgs args, InvokeOptions? opts = null)
    public static Output<GetServiceResult> Invoke(GetServiceInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetServiceResult> getService(GetServiceArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: azure:databasemigration/getService:getService
  arguments:
    # arguments dictionary

The following arguments are supported:

Name string

Specify the name of the database migration service.

ResourceGroupName string

Specifies the Name of the Resource Group within which the database migration service exists

Name string

Specify the name of the database migration service.

ResourceGroupName string

Specifies the Name of the Resource Group within which the database migration service exists

name String

Specify the name of the database migration service.

resourceGroupName String

Specifies the Name of the Resource Group within which the database migration service exists

name string

Specify the name of the database migration service.

resourceGroupName string

Specifies the Name of the Resource Group within which the database migration service exists

name str

Specify the name of the database migration service.

resource_group_name str

Specifies the Name of the Resource Group within which the database migration service exists

name String

Specify the name of the database migration service.

resourceGroupName String

Specifies the Name of the Resource Group within which the database migration service exists

getService Result

The following output properties are available:

Id string

The provider-assigned unique ID for this managed resource.

Location string

Azure location where the resource exists.

Name string
ResourceGroupName string
SkuName string

The SKU name of database migration service.

SubnetId string

The ID of the virtual subnet resource to which the database migration service exists.

Tags Dictionary<string, string>

A mapping of tags to assigned to the resource.

Id string

The provider-assigned unique ID for this managed resource.

Location string

Azure location where the resource exists.

Name string
ResourceGroupName string
SkuName string

The SKU name of database migration service.

SubnetId string

The ID of the virtual subnet resource to which the database migration service exists.

Tags map[string]string

A mapping of tags to assigned to the resource.

id String

The provider-assigned unique ID for this managed resource.

location String

Azure location where the resource exists.

name String
resourceGroupName String
skuName String

The SKU name of database migration service.

subnetId String

The ID of the virtual subnet resource to which the database migration service exists.

tags Map<String,String>

A mapping of tags to assigned to the resource.

id string

The provider-assigned unique ID for this managed resource.

location string

Azure location where the resource exists.

name string
resourceGroupName string
skuName string

The SKU name of database migration service.

subnetId string

The ID of the virtual subnet resource to which the database migration service exists.

tags {[key: string]: string}

A mapping of tags to assigned to the resource.

id str

The provider-assigned unique ID for this managed resource.

location str

Azure location where the resource exists.

name str
resource_group_name str
sku_name str

The SKU name of database migration service.

subnet_id str

The ID of the virtual subnet resource to which the database migration service exists.

tags Mapping[str, str]

A mapping of tags to assigned to the resource.

id String

The provider-assigned unique ID for this managed resource.

location String

Azure location where the resource exists.

name String
resourceGroupName String
skuName String

The SKU name of database migration service.

subnetId String

The ID of the virtual subnet resource to which the database migration service exists.

tags Map<String>

A mapping of tags to assigned to the resource.

Package Details

Repository
https://github.com/pulumi/pulumi-azure
License
Apache-2.0
Notes

This Pulumi package is based on the azurerm Terraform Provider.