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

We recommend using Azure Native.

Azure Classic v5.81.0 published on Monday, Jun 24, 2024 by Pulumi

azure.lighthouse.Assignment

Explore with Pulumi AI

azure logo

We recommend using Azure Native.

Azure Classic v5.81.0 published on Monday, Jun 24, 2024 by Pulumi

    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",
    });
    
    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")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
    	"github.com/pulumi/pulumi-azure/sdk/v5/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, nil, 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
    	})
    }
    
    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",
        });
    
    });
    
    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());
    
        }
    }
    
    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: {}
    

    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 string
    The unique name of the resource.
    args AssignmentArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args 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 string
    The unique name of the resource.
    args AssignmentArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args AssignmentArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args 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",
    });
    
    example, err := lighthouse.NewAssignment(ctx, "exampleassignmentResourceResourceFromLighthouseassignment", &lighthouse.AssignmentArgs{
    	LighthouseDefinitionId: pulumi.String("string"),
    	Scope:                  pulumi.String("string"),
    	Name:                   pulumi.String("string"),
    })
    
    var exampleassignmentResourceResourceFromLighthouseassignment = new Assignment("exampleassignmentResourceResourceFromLighthouseassignment", AssignmentArgs.builder()
        .lighthouseDefinitionId("string")
        .scope("string")
        .name("string")
        .build());
    
    exampleassignment_resource_resource_from_lighthouseassignment = azure.lighthouse.Assignment("exampleassignmentResourceResourceFromLighthouseassignment",
        lighthouse_definition_id="string",
        scope="string",
        name="string")
    
    const exampleassignmentResourceResourceFromLighthouseassignment = new azure.lighthouse.Assignment("exampleassignmentResourceResourceFromLighthouseassignment", {
        lighthouseDefinitionId: "string",
        scope: "string",
        name: "string",
    });
    
    type: azure:lighthouse:Assignment
    properties:
        lighthouseDefinitionId: string
        name: string
        scope: string
    

    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

    The Assignment resource accepts the following input properties:

    LighthouseDefinitionId 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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
    

    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.
    azure logo

    We recommend using Azure Native.

    Azure Classic v5.81.0 published on Monday, Jun 24, 2024 by Pulumi