1. Packages
  2. Azure Classic
  3. API Docs
  4. lighthouse
  5. Assignment

We recommend using Azure Native.

Azure v6.22.0 published on Tuesday, Apr 1, 2025 by Pulumi

azure.lighthouse.Assignment

Explore with Pulumi AI

Manages a Lighthouse Assignment to a subscription, or to a resource group.

Example Usage

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

const primary = azure.core.getSubscription({});
const example = new azure.lighthouse.Assignment("example", {
    scope: primary.then(primary => primary.id),
    lighthouseDefinitionId: "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ManagedServices/registrationDefinitions/00000000-0000-0000-0000-000000000000",
});
Copy
import pulumi
import pulumi_azure as azure

primary = azure.core.get_subscription()
example = azure.lighthouse.Assignment("example",
    scope=primary.id,
    lighthouse_definition_id="/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ManagedServices/registrationDefinitions/00000000-0000-0000-0000-000000000000")
Copy
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		primary, err := core.LookupSubscription(ctx, &core.LookupSubscriptionArgs{}, nil)
		if err != nil {
			return err
		}
		_, err = lighthouse.NewAssignment(ctx, "example", &lighthouse.AssignmentArgs{
			Scope:                  pulumi.String(primary.Id),
			LighthouseDefinitionId: pulumi.String("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ManagedServices/registrationDefinitions/00000000-0000-0000-0000-000000000000"),
		})
		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 primary = Azure.Core.GetSubscription.Invoke();

    var example = new Azure.Lighthouse.Assignment("example", new()
    {
        Scope = primary.Apply(getSubscriptionResult => getSubscriptionResult.Id),
        LighthouseDefinitionId = "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ManagedServices/registrationDefinitions/00000000-0000-0000-0000-000000000000",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.core.CoreFunctions;
import com.pulumi.azure.core.inputs.GetSubscriptionArgs;
import com.pulumi.azure.lighthouse.Assignment;
import com.pulumi.azure.lighthouse.AssignmentArgs;
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 primary = CoreFunctions.getSubscription();

        var example = new Assignment("example", AssignmentArgs.builder()
            .scope(primary.applyValue(getSubscriptionResult -> getSubscriptionResult.id()))
            .lighthouseDefinitionId("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ManagedServices/registrationDefinitions/00000000-0000-0000-0000-000000000000")
            .build());

    }
}
Copy
resources:
  example:
    type: azure:lighthouse:Assignment
    properties:
      scope: ${primary.id}
      lighthouseDefinitionId: /subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ManagedServices/registrationDefinitions/00000000-0000-0000-0000-000000000000
variables:
  primary:
    fn::invoke:
      function: azure:core:getSubscription
      arguments: {}
Copy

Create Assignment Resource

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

Constructor syntax

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

@overload
def Assignment(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               lighthouse_definition_id: Optional[str] = None,
               scope: Optional[str] = None,
               name: Optional[str] = None)
func NewAssignment(ctx *Context, name string, args AssignmentArgs, opts ...ResourceOption) (*Assignment, error)
public Assignment(string name, AssignmentArgs args, CustomResourceOptions? opts = null)
public Assignment(String name, AssignmentArgs args)
public Assignment(String name, AssignmentArgs args, CustomResourceOptions options)
type: azure:lighthouse:Assignment
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. AssignmentArgs
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. AssignmentArgs
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. AssignmentArgs
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. AssignmentArgs
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. AssignmentArgs
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 exampleassignmentResourceResourceFromLighthouseassignment = new Azure.Lighthouse.Assignment("exampleassignmentResourceResourceFromLighthouseassignment", new()
{
    LighthouseDefinitionId = "string",
    Scope = "string",
    Name = "string",
});
Copy
example, err := lighthouse.NewAssignment(ctx, "exampleassignmentResourceResourceFromLighthouseassignment", &lighthouse.AssignmentArgs{
	LighthouseDefinitionId: pulumi.String("string"),
	Scope:                  pulumi.String("string"),
	Name:                   pulumi.String("string"),
})
Copy
var exampleassignmentResourceResourceFromLighthouseassignment = new com.pulumi.azure.lighthouse.Assignment("exampleassignmentResourceResourceFromLighthouseassignment", com.pulumi.azure.lighthouse.AssignmentArgs.builder()
    .lighthouseDefinitionId("string")
    .scope("string")
    .name("string")
    .build());
Copy
exampleassignment_resource_resource_from_lighthouseassignment = azure.lighthouse.Assignment("exampleassignmentResourceResourceFromLighthouseassignment",
    lighthouse_definition_id="string",
    scope="string",
    name="string")
Copy
const exampleassignmentResourceResourceFromLighthouseassignment = new azure.lighthouse.Assignment("exampleassignmentResourceResourceFromLighthouseassignment", {
    lighthouseDefinitionId: "string",
    scope: "string",
    name: "string",
});
Copy
type: azure:lighthouse:Assignment
properties:
    lighthouseDefinitionId: string
    name: string
    scope: string
Copy

Assignment 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 Assignment resource accepts the following input properties:

LighthouseDefinitionId
This property is required.
Changes to this property will trigger replacement.
string
A Fully qualified path of the lighthouse definition, such as /subscriptions/0afefe50-734e-4610-8c82-a144aff49dea/providers/Microsoft.ManagedServices/registrationDefinitions/26c128c2-fefa-4340-9bb1-8e081c90ada2. Changing this forces a new resource to be created.
Scope
This property is required.
Changes to this property will trigger replacement.
string
The scope at which the Lighthouse Assignment applies too, such as /subscriptions/0b1f6471-1bf0-4dda-aec3-111122223333 or /subscriptions/0b1f6471-1bf0-4dda-aec3-111122223333/resourceGroups/myGroup. Changing this forces a new resource to be created.
Name Changes to this property will trigger replacement. string
A unique UUID/GUID which identifies this lighthouse assignment- one will be generated if not specified. Changing this forces a new resource to be created.
LighthouseDefinitionId
This property is required.
Changes to this property will trigger replacement.
string
A Fully qualified path of the lighthouse definition, such as /subscriptions/0afefe50-734e-4610-8c82-a144aff49dea/providers/Microsoft.ManagedServices/registrationDefinitions/26c128c2-fefa-4340-9bb1-8e081c90ada2. Changing this forces a new resource to be created.
Scope
This property is required.
Changes to this property will trigger replacement.
string
The scope at which the Lighthouse Assignment applies too, such as /subscriptions/0b1f6471-1bf0-4dda-aec3-111122223333 or /subscriptions/0b1f6471-1bf0-4dda-aec3-111122223333/resourceGroups/myGroup. Changing this forces a new resource to be created.
Name Changes to this property will trigger replacement. string
A unique UUID/GUID which identifies this lighthouse assignment- one will be generated if not specified. Changing this forces a new resource to be created.
lighthouseDefinitionId
This property is required.
Changes to this property will trigger replacement.
String
A Fully qualified path of the lighthouse definition, such as /subscriptions/0afefe50-734e-4610-8c82-a144aff49dea/providers/Microsoft.ManagedServices/registrationDefinitions/26c128c2-fefa-4340-9bb1-8e081c90ada2. Changing this forces a new resource to be created.
scope
This property is required.
Changes to this property will trigger replacement.
String
The scope at which the Lighthouse Assignment applies too, such as /subscriptions/0b1f6471-1bf0-4dda-aec3-111122223333 or /subscriptions/0b1f6471-1bf0-4dda-aec3-111122223333/resourceGroups/myGroup. Changing this forces a new resource to be created.
name Changes to this property will trigger replacement. String
A unique UUID/GUID which identifies this lighthouse assignment- one will be generated if not specified. Changing this forces a new resource to be created.
lighthouseDefinitionId
This property is required.
Changes to this property will trigger replacement.
string
A Fully qualified path of the lighthouse definition, such as /subscriptions/0afefe50-734e-4610-8c82-a144aff49dea/providers/Microsoft.ManagedServices/registrationDefinitions/26c128c2-fefa-4340-9bb1-8e081c90ada2. Changing this forces a new resource to be created.
scope
This property is required.
Changes to this property will trigger replacement.
string
The scope at which the Lighthouse Assignment applies too, such as /subscriptions/0b1f6471-1bf0-4dda-aec3-111122223333 or /subscriptions/0b1f6471-1bf0-4dda-aec3-111122223333/resourceGroups/myGroup. Changing this forces a new resource to be created.
name Changes to this property will trigger replacement. string
A unique UUID/GUID which identifies this lighthouse assignment- one will be generated if not specified. Changing this forces a new resource to be created.
lighthouse_definition_id
This property is required.
Changes to this property will trigger replacement.
str
A Fully qualified path of the lighthouse definition, such as /subscriptions/0afefe50-734e-4610-8c82-a144aff49dea/providers/Microsoft.ManagedServices/registrationDefinitions/26c128c2-fefa-4340-9bb1-8e081c90ada2. Changing this forces a new resource to be created.
scope
This property is required.
Changes to this property will trigger replacement.
str
The scope at which the Lighthouse Assignment applies too, such as /subscriptions/0b1f6471-1bf0-4dda-aec3-111122223333 or /subscriptions/0b1f6471-1bf0-4dda-aec3-111122223333/resourceGroups/myGroup. Changing this forces a new resource to be created.
name Changes to this property will trigger replacement. str
A unique UUID/GUID which identifies this lighthouse assignment- one will be generated if not specified. Changing this forces a new resource to be created.
lighthouseDefinitionId
This property is required.
Changes to this property will trigger replacement.
String
A Fully qualified path of the lighthouse definition, such as /subscriptions/0afefe50-734e-4610-8c82-a144aff49dea/providers/Microsoft.ManagedServices/registrationDefinitions/26c128c2-fefa-4340-9bb1-8e081c90ada2. Changing this forces a new resource to be created.
scope
This property is required.
Changes to this property will trigger replacement.
String
The scope at which the Lighthouse Assignment applies too, such as /subscriptions/0b1f6471-1bf0-4dda-aec3-111122223333 or /subscriptions/0b1f6471-1bf0-4dda-aec3-111122223333/resourceGroups/myGroup. Changing this forces a new resource to be created.
name Changes to this property will trigger replacement. String
A unique UUID/GUID which identifies this lighthouse assignment- one will be generated if not specified. Changing this forces a new resource to be created.

Outputs

All input properties are implicitly available as output properties. Additionally, the Assignment 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 Assignment Resource

Get an existing Assignment 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?: AssignmentState, opts?: CustomResourceOptions): Assignment
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        lighthouse_definition_id: Optional[str] = None,
        name: Optional[str] = None,
        scope: Optional[str] = None) -> Assignment
func GetAssignment(ctx *Context, name string, id IDInput, state *AssignmentState, opts ...ResourceOption) (*Assignment, error)
public static Assignment Get(string name, Input<string> id, AssignmentState? state, CustomResourceOptions? opts = null)
public static Assignment get(String name, Output<String> id, AssignmentState state, CustomResourceOptions options)
resources:  _:    type: azure:lighthouse:Assignment    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:
LighthouseDefinitionId Changes to this property will trigger replacement. string
A Fully qualified path of the lighthouse definition, such as /subscriptions/0afefe50-734e-4610-8c82-a144aff49dea/providers/Microsoft.ManagedServices/registrationDefinitions/26c128c2-fefa-4340-9bb1-8e081c90ada2. Changing this forces a new resource to be created.
Name Changes to this property will trigger replacement. string
A unique UUID/GUID which identifies this lighthouse assignment- one will be generated if not specified. Changing this forces a new resource to be created.
Scope Changes to this property will trigger replacement. string
The scope at which the Lighthouse Assignment applies too, such as /subscriptions/0b1f6471-1bf0-4dda-aec3-111122223333 or /subscriptions/0b1f6471-1bf0-4dda-aec3-111122223333/resourceGroups/myGroup. Changing this forces a new resource to be created.
LighthouseDefinitionId Changes to this property will trigger replacement. string
A Fully qualified path of the lighthouse definition, such as /subscriptions/0afefe50-734e-4610-8c82-a144aff49dea/providers/Microsoft.ManagedServices/registrationDefinitions/26c128c2-fefa-4340-9bb1-8e081c90ada2. Changing this forces a new resource to be created.
Name Changes to this property will trigger replacement. string
A unique UUID/GUID which identifies this lighthouse assignment- one will be generated if not specified. Changing this forces a new resource to be created.
Scope Changes to this property will trigger replacement. string
The scope at which the Lighthouse Assignment applies too, such as /subscriptions/0b1f6471-1bf0-4dda-aec3-111122223333 or /subscriptions/0b1f6471-1bf0-4dda-aec3-111122223333/resourceGroups/myGroup. Changing this forces a new resource to be created.
lighthouseDefinitionId Changes to this property will trigger replacement. String
A Fully qualified path of the lighthouse definition, such as /subscriptions/0afefe50-734e-4610-8c82-a144aff49dea/providers/Microsoft.ManagedServices/registrationDefinitions/26c128c2-fefa-4340-9bb1-8e081c90ada2. Changing this forces a new resource to be created.
name Changes to this property will trigger replacement. String
A unique UUID/GUID which identifies this lighthouse assignment- one will be generated if not specified. Changing this forces a new resource to be created.
scope Changes to this property will trigger replacement. String
The scope at which the Lighthouse Assignment applies too, such as /subscriptions/0b1f6471-1bf0-4dda-aec3-111122223333 or /subscriptions/0b1f6471-1bf0-4dda-aec3-111122223333/resourceGroups/myGroup. Changing this forces a new resource to be created.
lighthouseDefinitionId Changes to this property will trigger replacement. string
A Fully qualified path of the lighthouse definition, such as /subscriptions/0afefe50-734e-4610-8c82-a144aff49dea/providers/Microsoft.ManagedServices/registrationDefinitions/26c128c2-fefa-4340-9bb1-8e081c90ada2. Changing this forces a new resource to be created.
name Changes to this property will trigger replacement. string
A unique UUID/GUID which identifies this lighthouse assignment- one will be generated if not specified. Changing this forces a new resource to be created.
scope Changes to this property will trigger replacement. string
The scope at which the Lighthouse Assignment applies too, such as /subscriptions/0b1f6471-1bf0-4dda-aec3-111122223333 or /subscriptions/0b1f6471-1bf0-4dda-aec3-111122223333/resourceGroups/myGroup. Changing this forces a new resource to be created.
lighthouse_definition_id Changes to this property will trigger replacement. str
A Fully qualified path of the lighthouse definition, such as /subscriptions/0afefe50-734e-4610-8c82-a144aff49dea/providers/Microsoft.ManagedServices/registrationDefinitions/26c128c2-fefa-4340-9bb1-8e081c90ada2. Changing this forces a new resource to be created.
name Changes to this property will trigger replacement. str
A unique UUID/GUID which identifies this lighthouse assignment- one will be generated if not specified. Changing this forces a new resource to be created.
scope Changes to this property will trigger replacement. str
The scope at which the Lighthouse Assignment applies too, such as /subscriptions/0b1f6471-1bf0-4dda-aec3-111122223333 or /subscriptions/0b1f6471-1bf0-4dda-aec3-111122223333/resourceGroups/myGroup. Changing this forces a new resource to be created.
lighthouseDefinitionId Changes to this property will trigger replacement. String
A Fully qualified path of the lighthouse definition, such as /subscriptions/0afefe50-734e-4610-8c82-a144aff49dea/providers/Microsoft.ManagedServices/registrationDefinitions/26c128c2-fefa-4340-9bb1-8e081c90ada2. Changing this forces a new resource to be created.
name Changes to this property will trigger replacement. String
A unique UUID/GUID which identifies this lighthouse assignment- one will be generated if not specified. Changing this forces a new resource to be created.
scope Changes to this property will trigger replacement. String
The scope at which the Lighthouse Assignment applies too, such as /subscriptions/0b1f6471-1bf0-4dda-aec3-111122223333 or /subscriptions/0b1f6471-1bf0-4dda-aec3-111122223333/resourceGroups/myGroup. Changing this forces a new resource to be created.

Import

Lighthouse Assignments can be imported using the resource id, e.g.

$ pulumi import azure:lighthouse/assignment:Assignment example /subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ManagedServices/registrationAssignments/00000000-0000-0000-0000-000000000000
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.