1. Packages
  2. Azure Classic
  3. API Docs
  4. domainservices
  5. ServiceTrust

We recommend using Azure Native.

Azure v6.21.0 published on Friday, Mar 7, 2025 by Pulumi

azure.domainservices.ServiceTrust

Explore with Pulumi AI

Manages a Active Directory Domain Service Trust.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const example = azure.domainservices.getService({
    name: "example-ds",
    resourceGroupName: "example-rg",
});
const exampleServiceTrust = new azure.domainservices.ServiceTrust("example", {
    name: "example-trust",
    domainServiceId: example.then(example => example.id),
    trustedDomainFqdn: "example.com",
    trustedDomainDnsIps: [
        "10.1.0.3",
        "10.1.0.4",
    ],
    password: "Password123",
});
Copy
import pulumi
import pulumi_azure as azure

example = azure.domainservices.get_service(name="example-ds",
    resource_group_name="example-rg")
example_service_trust = azure.domainservices.ServiceTrust("example",
    name="example-trust",
    domain_service_id=example.id,
    trusted_domain_fqdn="example.com",
    trusted_domain_dns_ips=[
        "10.1.0.3",
        "10.1.0.4",
    ],
    password="Password123")
Copy
package main

import (
	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/domainservices"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := domainservices.LookupService(ctx, &domainservices.LookupServiceArgs{
			Name:              "example-ds",
			ResourceGroupName: "example-rg",
		}, nil)
		if err != nil {
			return err
		}
		_, err = domainservices.NewServiceTrust(ctx, "example", &domainservices.ServiceTrustArgs{
			Name:              pulumi.String("example-trust"),
			DomainServiceId:   pulumi.String(example.Id),
			TrustedDomainFqdn: pulumi.String("example.com"),
			TrustedDomainDnsIps: pulumi.StringArray{
				pulumi.String("10.1.0.3"),
				pulumi.String("10.1.0.4"),
			},
			Password: pulumi.String("Password123"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;

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

    var exampleServiceTrust = new Azure.DomainServices.ServiceTrust("example", new()
    {
        Name = "example-trust",
        DomainServiceId = example.Apply(getServiceResult => getServiceResult.Id),
        TrustedDomainFqdn = "example.com",
        TrustedDomainDnsIps = new[]
        {
            "10.1.0.3",
            "10.1.0.4",
        },
        Password = "Password123",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.domainservices.DomainservicesFunctions;
import com.pulumi.azure.domainservices.inputs.GetServiceArgs;
import com.pulumi.azure.domainservices.ServiceTrust;
import com.pulumi.azure.domainservices.ServiceTrustArgs;
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 = DomainservicesFunctions.getService(GetServiceArgs.builder()
            .name("example-ds")
            .resourceGroupName("example-rg")
            .build());

        var exampleServiceTrust = new ServiceTrust("exampleServiceTrust", ServiceTrustArgs.builder()
            .name("example-trust")
            .domainServiceId(example.applyValue(getServiceResult -> getServiceResult.id()))
            .trustedDomainFqdn("example.com")
            .trustedDomainDnsIps(            
                "10.1.0.3",
                "10.1.0.4")
            .password("Password123")
            .build());

    }
}
Copy
resources:
  exampleServiceTrust:
    type: azure:domainservices:ServiceTrust
    name: example
    properties:
      name: example-trust
      domainServiceId: ${example.id}
      trustedDomainFqdn: example.com
      trustedDomainDnsIps:
        - 10.1.0.3
        - 10.1.0.4
      password: Password123
variables:
  example:
    fn::invoke:
      function: azure:domainservices:getService
      arguments:
        name: example-ds
        resourceGroupName: example-rg
Copy

Create ServiceTrust Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new ServiceTrust(name: string, args: ServiceTrustArgs, opts?: CustomResourceOptions);
@overload
def ServiceTrust(resource_name: str,
                 args: ServiceTrustArgs,
                 opts: Optional[ResourceOptions] = None)

@overload
def ServiceTrust(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 domain_service_id: Optional[str] = None,
                 password: Optional[str] = None,
                 trusted_domain_dns_ips: Optional[Sequence[str]] = None,
                 trusted_domain_fqdn: Optional[str] = None,
                 name: Optional[str] = None)
func NewServiceTrust(ctx *Context, name string, args ServiceTrustArgs, opts ...ResourceOption) (*ServiceTrust, error)
public ServiceTrust(string name, ServiceTrustArgs args, CustomResourceOptions? opts = null)
public ServiceTrust(String name, ServiceTrustArgs args)
public ServiceTrust(String name, ServiceTrustArgs args, CustomResourceOptions options)
type: azure:domainservices:ServiceTrust
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. ServiceTrustArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. ServiceTrustArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. ServiceTrustArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. ServiceTrustArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. ServiceTrustArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var serviceTrustResource = new Azure.DomainServices.ServiceTrust("serviceTrustResource", new()
{
    DomainServiceId = "string",
    Password = "string",
    TrustedDomainDnsIps = new[]
    {
        "string",
    },
    TrustedDomainFqdn = "string",
    Name = "string",
});
Copy
example, err := domainservices.NewServiceTrust(ctx, "serviceTrustResource", &domainservices.ServiceTrustArgs{
	DomainServiceId: pulumi.String("string"),
	Password:        pulumi.String("string"),
	TrustedDomainDnsIps: pulumi.StringArray{
		pulumi.String("string"),
	},
	TrustedDomainFqdn: pulumi.String("string"),
	Name:              pulumi.String("string"),
})
Copy
var serviceTrustResource = new ServiceTrust("serviceTrustResource", ServiceTrustArgs.builder()
    .domainServiceId("string")
    .password("string")
    .trustedDomainDnsIps("string")
    .trustedDomainFqdn("string")
    .name("string")
    .build());
Copy
service_trust_resource = azure.domainservices.ServiceTrust("serviceTrustResource",
    domain_service_id="string",
    password="string",
    trusted_domain_dns_ips=["string"],
    trusted_domain_fqdn="string",
    name="string")
Copy
const serviceTrustResource = new azure.domainservices.ServiceTrust("serviceTrustResource", {
    domainServiceId: "string",
    password: "string",
    trustedDomainDnsIps: ["string"],
    trustedDomainFqdn: "string",
    name: "string",
});
Copy
type: azure:domainservices:ServiceTrust
properties:
    domainServiceId: string
    name: string
    password: string
    trustedDomainDnsIps:
        - string
    trustedDomainFqdn: string
Copy

ServiceTrust Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The ServiceTrust resource accepts the following input properties:

DomainServiceId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the Active Directory Domain Service. Changing this forces a new Active Directory Domain Service Trust to be created.
Password This property is required. string
The password of the inbound trust set in the on-premise Active Directory Domain Service.
TrustedDomainDnsIps This property is required. List<string>
Specifies a list of DNS IPs that are used to resolve the on-premise Active Directory Domain Service.
TrustedDomainFqdn This property is required. string
The FQDN of the on-premise Active Directory Domain Service.
Name Changes to this property will trigger replacement. string
The name which should be used for this Active Directory Domain Service Trust. Changing this forces a new Active Directory Domain Service Trust to be created.
DomainServiceId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the Active Directory Domain Service. Changing this forces a new Active Directory Domain Service Trust to be created.
Password This property is required. string
The password of the inbound trust set in the on-premise Active Directory Domain Service.
TrustedDomainDnsIps This property is required. []string
Specifies a list of DNS IPs that are used to resolve the on-premise Active Directory Domain Service.
TrustedDomainFqdn This property is required. string
The FQDN of the on-premise Active Directory Domain Service.
Name Changes to this property will trigger replacement. string
The name which should be used for this Active Directory Domain Service Trust. Changing this forces a new Active Directory Domain Service Trust to be created.
domainServiceId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the Active Directory Domain Service. Changing this forces a new Active Directory Domain Service Trust to be created.
password This property is required. String
The password of the inbound trust set in the on-premise Active Directory Domain Service.
trustedDomainDnsIps This property is required. List<String>
Specifies a list of DNS IPs that are used to resolve the on-premise Active Directory Domain Service.
trustedDomainFqdn This property is required. String
The FQDN of the on-premise Active Directory Domain Service.
name Changes to this property will trigger replacement. String
The name which should be used for this Active Directory Domain Service Trust. Changing this forces a new Active Directory Domain Service Trust to be created.
domainServiceId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the Active Directory Domain Service. Changing this forces a new Active Directory Domain Service Trust to be created.
password This property is required. string
The password of the inbound trust set in the on-premise Active Directory Domain Service.
trustedDomainDnsIps This property is required. string[]
Specifies a list of DNS IPs that are used to resolve the on-premise Active Directory Domain Service.
trustedDomainFqdn This property is required. string
The FQDN of the on-premise Active Directory Domain Service.
name Changes to this property will trigger replacement. string
The name which should be used for this Active Directory Domain Service Trust. Changing this forces a new Active Directory Domain Service Trust to be created.
domain_service_id
This property is required.
Changes to this property will trigger replacement.
str
The ID of the Active Directory Domain Service. Changing this forces a new Active Directory Domain Service Trust to be created.
password This property is required. str
The password of the inbound trust set in the on-premise Active Directory Domain Service.
trusted_domain_dns_ips This property is required. Sequence[str]
Specifies a list of DNS IPs that are used to resolve the on-premise Active Directory Domain Service.
trusted_domain_fqdn This property is required. str
The FQDN of the on-premise Active Directory Domain Service.
name Changes to this property will trigger replacement. str
The name which should be used for this Active Directory Domain Service Trust. Changing this forces a new Active Directory Domain Service Trust to be created.
domainServiceId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the Active Directory Domain Service. Changing this forces a new Active Directory Domain Service Trust to be created.
password This property is required. String
The password of the inbound trust set in the on-premise Active Directory Domain Service.
trustedDomainDnsIps This property is required. List<String>
Specifies a list of DNS IPs that are used to resolve the on-premise Active Directory Domain Service.
trustedDomainFqdn This property is required. String
The FQDN of the on-premise Active Directory Domain Service.
name Changes to this property will trigger replacement. String
The name which should be used for this Active Directory Domain Service Trust. Changing this forces a new Active Directory Domain Service Trust to be created.

Outputs

All input properties are implicitly available as output properties. Additionally, the ServiceTrust resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing ServiceTrust Resource

Get an existing ServiceTrust resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: ServiceTrustState, opts?: CustomResourceOptions): ServiceTrust
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        domain_service_id: Optional[str] = None,
        name: Optional[str] = None,
        password: Optional[str] = None,
        trusted_domain_dns_ips: Optional[Sequence[str]] = None,
        trusted_domain_fqdn: Optional[str] = None) -> ServiceTrust
func GetServiceTrust(ctx *Context, name string, id IDInput, state *ServiceTrustState, opts ...ResourceOption) (*ServiceTrust, error)
public static ServiceTrust Get(string name, Input<string> id, ServiceTrustState? state, CustomResourceOptions? opts = null)
public static ServiceTrust get(String name, Output<String> id, ServiceTrustState state, CustomResourceOptions options)
resources:  _:    type: azure:domainservices:ServiceTrust    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
DomainServiceId Changes to this property will trigger replacement. string
The ID of the Active Directory Domain Service. Changing this forces a new Active Directory Domain Service Trust to be created.
Name Changes to this property will trigger replacement. string
The name which should be used for this Active Directory Domain Service Trust. Changing this forces a new Active Directory Domain Service Trust to be created.
Password string
The password of the inbound trust set in the on-premise Active Directory Domain Service.
TrustedDomainDnsIps List<string>
Specifies a list of DNS IPs that are used to resolve the on-premise Active Directory Domain Service.
TrustedDomainFqdn string
The FQDN of the on-premise Active Directory Domain Service.
DomainServiceId Changes to this property will trigger replacement. string
The ID of the Active Directory Domain Service. Changing this forces a new Active Directory Domain Service Trust to be created.
Name Changes to this property will trigger replacement. string
The name which should be used for this Active Directory Domain Service Trust. Changing this forces a new Active Directory Domain Service Trust to be created.
Password string
The password of the inbound trust set in the on-premise Active Directory Domain Service.
TrustedDomainDnsIps []string
Specifies a list of DNS IPs that are used to resolve the on-premise Active Directory Domain Service.
TrustedDomainFqdn string
The FQDN of the on-premise Active Directory Domain Service.
domainServiceId Changes to this property will trigger replacement. String
The ID of the Active Directory Domain Service. Changing this forces a new Active Directory Domain Service Trust to be created.
name Changes to this property will trigger replacement. String
The name which should be used for this Active Directory Domain Service Trust. Changing this forces a new Active Directory Domain Service Trust to be created.
password String
The password of the inbound trust set in the on-premise Active Directory Domain Service.
trustedDomainDnsIps List<String>
Specifies a list of DNS IPs that are used to resolve the on-premise Active Directory Domain Service.
trustedDomainFqdn String
The FQDN of the on-premise Active Directory Domain Service.
domainServiceId Changes to this property will trigger replacement. string
The ID of the Active Directory Domain Service. Changing this forces a new Active Directory Domain Service Trust to be created.
name Changes to this property will trigger replacement. string
The name which should be used for this Active Directory Domain Service Trust. Changing this forces a new Active Directory Domain Service Trust to be created.
password string
The password of the inbound trust set in the on-premise Active Directory Domain Service.
trustedDomainDnsIps string[]
Specifies a list of DNS IPs that are used to resolve the on-premise Active Directory Domain Service.
trustedDomainFqdn string
The FQDN of the on-premise Active Directory Domain Service.
domain_service_id Changes to this property will trigger replacement. str
The ID of the Active Directory Domain Service. Changing this forces a new Active Directory Domain Service Trust to be created.
name Changes to this property will trigger replacement. str
The name which should be used for this Active Directory Domain Service Trust. Changing this forces a new Active Directory Domain Service Trust to be created.
password str
The password of the inbound trust set in the on-premise Active Directory Domain Service.
trusted_domain_dns_ips Sequence[str]
Specifies a list of DNS IPs that are used to resolve the on-premise Active Directory Domain Service.
trusted_domain_fqdn str
The FQDN of the on-premise Active Directory Domain Service.
domainServiceId Changes to this property will trigger replacement. String
The ID of the Active Directory Domain Service. Changing this forces a new Active Directory Domain Service Trust to be created.
name Changes to this property will trigger replacement. String
The name which should be used for this Active Directory Domain Service Trust. Changing this forces a new Active Directory Domain Service Trust to be created.
password String
The password of the inbound trust set in the on-premise Active Directory Domain Service.
trustedDomainDnsIps List<String>
Specifies a list of DNS IPs that are used to resolve the on-premise Active Directory Domain Service.
trustedDomainFqdn String
The FQDN of the on-premise Active Directory Domain Service.

Import

Active Directory Domain Service Trusts can be imported using the resource id, e.g.

$ pulumi import azure:domainservices/serviceTrust:ServiceTrust example /subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.AAD/domainServices/DomainService1/trusts/trust1
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
Azure Classic pulumi/pulumi-azure
License
Apache-2.0
Notes
This Pulumi package is based on the azurerm Terraform Provider.