1. Packages
  2. Azure Classic
  3. API Docs
  4. devcenter
  5. Gallery

We recommend using Azure Native.

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

azure.devcenter.Gallery

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 Dev Center Gallery.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    
    const example = new azure.core.ResourceGroup("example", {
        name: "example-resources",
        location: "West Europe",
    });
    const testUserAssignedIdentity = new azure.authorization.UserAssignedIdentity("test", {
        name: "example-uai",
        location: testAzurermResourceGroup.location,
        resourceGroupName: testAzurermResourceGroup.name,
    });
    const test = new azure.devcenter.DevCenter("test", {
        name: "example-devcenter",
        resourceGroupName: testAzurermResourceGroup.name,
        location: testAzurermResourceGroup.location,
        identity: {
            type: "UserAssigned",
            identityIds: [testUserAssignedIdentity.id],
        },
    });
    const exampleSharedImageGallery = new azure.compute.SharedImageGallery("example", {
        name: "example-image-gallery",
        location: example.location,
        resourceGroupName: example.name,
    });
    const exampleGallery = new azure.devcenter.Gallery("example", {
        devCenterId: exampleAzurermDevCenter.id,
        sharedGalleryId: exampleSharedImageGallery.id,
        name: "example",
    });
    
    import pulumi
    import pulumi_azure as azure
    
    example = azure.core.ResourceGroup("example",
        name="example-resources",
        location="West Europe")
    test_user_assigned_identity = azure.authorization.UserAssignedIdentity("test",
        name="example-uai",
        location=test_azurerm_resource_group["location"],
        resource_group_name=test_azurerm_resource_group["name"])
    test = azure.devcenter.DevCenter("test",
        name="example-devcenter",
        resource_group_name=test_azurerm_resource_group["name"],
        location=test_azurerm_resource_group["location"],
        identity=azure.devcenter.DevCenterIdentityArgs(
            type="UserAssigned",
            identity_ids=[test_user_assigned_identity.id],
        ))
    example_shared_image_gallery = azure.compute.SharedImageGallery("example",
        name="example-image-gallery",
        location=example.location,
        resource_group_name=example.name)
    example_gallery = azure.devcenter.Gallery("example",
        dev_center_id=example_azurerm_dev_center["id"],
        shared_gallery_id=example_shared_image_gallery.id,
        name="example")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization"
    	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute"
    	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
    	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/devcenter"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
    			Name:     pulumi.String("example-resources"),
    			Location: pulumi.String("West Europe"),
    		})
    		if err != nil {
    			return err
    		}
    		testUserAssignedIdentity, err := authorization.NewUserAssignedIdentity(ctx, "test", &authorization.UserAssignedIdentityArgs{
    			Name:              pulumi.String("example-uai"),
    			Location:          pulumi.Any(testAzurermResourceGroup.Location),
    			ResourceGroupName: pulumi.Any(testAzurermResourceGroup.Name),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = devcenter.NewDevCenter(ctx, "test", &devcenter.DevCenterArgs{
    			Name:              pulumi.String("example-devcenter"),
    			ResourceGroupName: pulumi.Any(testAzurermResourceGroup.Name),
    			Location:          pulumi.Any(testAzurermResourceGroup.Location),
    			Identity: &devcenter.DevCenterIdentityArgs{
    				Type: pulumi.String("UserAssigned"),
    				IdentityIds: pulumi.StringArray{
    					testUserAssignedIdentity.ID(),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		exampleSharedImageGallery, err := compute.NewSharedImageGallery(ctx, "example", &compute.SharedImageGalleryArgs{
    			Name:              pulumi.String("example-image-gallery"),
    			Location:          example.Location,
    			ResourceGroupName: example.Name,
    		})
    		if err != nil {
    			return err
    		}
    		_, err = devcenter.NewGallery(ctx, "example", &devcenter.GalleryArgs{
    			DevCenterId:     pulumi.Any(exampleAzurermDevCenter.Id),
    			SharedGalleryId: exampleSharedImageGallery.ID(),
    			Name:            pulumi.String("example"),
    		})
    		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 example = new Azure.Core.ResourceGroup("example", new()
        {
            Name = "example-resources",
            Location = "West Europe",
        });
    
        var testUserAssignedIdentity = new Azure.Authorization.UserAssignedIdentity("test", new()
        {
            Name = "example-uai",
            Location = testAzurermResourceGroup.Location,
            ResourceGroupName = testAzurermResourceGroup.Name,
        });
    
        var test = new Azure.DevCenter.DevCenter("test", new()
        {
            Name = "example-devcenter",
            ResourceGroupName = testAzurermResourceGroup.Name,
            Location = testAzurermResourceGroup.Location,
            Identity = new Azure.DevCenter.Inputs.DevCenterIdentityArgs
            {
                Type = "UserAssigned",
                IdentityIds = new[]
                {
                    testUserAssignedIdentity.Id,
                },
            },
        });
    
        var exampleSharedImageGallery = new Azure.Compute.SharedImageGallery("example", new()
        {
            Name = "example-image-gallery",
            Location = example.Location,
            ResourceGroupName = example.Name,
        });
    
        var exampleGallery = new Azure.DevCenter.Gallery("example", new()
        {
            DevCenterId = exampleAzurermDevCenter.Id,
            SharedGalleryId = exampleSharedImageGallery.Id,
            Name = "example",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azure.core.ResourceGroup;
    import com.pulumi.azure.core.ResourceGroupArgs;
    import com.pulumi.azure.authorization.UserAssignedIdentity;
    import com.pulumi.azure.authorization.UserAssignedIdentityArgs;
    import com.pulumi.azure.devcenter.DevCenter;
    import com.pulumi.azure.devcenter.DevCenterArgs;
    import com.pulumi.azure.devcenter.inputs.DevCenterIdentityArgs;
    import com.pulumi.azure.compute.SharedImageGallery;
    import com.pulumi.azure.compute.SharedImageGalleryArgs;
    import com.pulumi.azure.devcenter.Gallery;
    import com.pulumi.azure.devcenter.GalleryArgs;
    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) {
            var example = new ResourceGroup("example", ResourceGroupArgs.builder()
                .name("example-resources")
                .location("West Europe")
                .build());
    
            var testUserAssignedIdentity = new UserAssignedIdentity("testUserAssignedIdentity", UserAssignedIdentityArgs.builder()
                .name("example-uai")
                .location(testAzurermResourceGroup.location())
                .resourceGroupName(testAzurermResourceGroup.name())
                .build());
    
            var test = new DevCenter("test", DevCenterArgs.builder()
                .name("example-devcenter")
                .resourceGroupName(testAzurermResourceGroup.name())
                .location(testAzurermResourceGroup.location())
                .identity(DevCenterIdentityArgs.builder()
                    .type("UserAssigned")
                    .identityIds(testUserAssignedIdentity.id())
                    .build())
                .build());
    
            var exampleSharedImageGallery = new SharedImageGallery("exampleSharedImageGallery", SharedImageGalleryArgs.builder()
                .name("example-image-gallery")
                .location(example.location())
                .resourceGroupName(example.name())
                .build());
    
            var exampleGallery = new Gallery("exampleGallery", GalleryArgs.builder()
                .devCenterId(exampleAzurermDevCenter.id())
                .sharedGalleryId(exampleSharedImageGallery.id())
                .name("example")
                .build());
    
        }
    }
    
    resources:
      example:
        type: azure:core:ResourceGroup
        properties:
          name: example-resources
          location: West Europe
      test:
        type: azure:devcenter:DevCenter
        properties:
          name: example-devcenter
          resourceGroupName: ${testAzurermResourceGroup.name}
          location: ${testAzurermResourceGroup.location}
          identity:
            type: UserAssigned
            identityIds:
              - ${testUserAssignedIdentity.id}
      testUserAssignedIdentity:
        type: azure:authorization:UserAssignedIdentity
        name: test
        properties:
          name: example-uai
          location: ${testAzurermResourceGroup.location}
          resourceGroupName: ${testAzurermResourceGroup.name}
      exampleSharedImageGallery:
        type: azure:compute:SharedImageGallery
        name: example
        properties:
          name: example-image-gallery
          location: ${example.location}
          resourceGroupName: ${example.name}
      exampleGallery:
        type: azure:devcenter:Gallery
        name: example
        properties:
          devCenterId: ${exampleAzurermDevCenter.id}
          sharedGalleryId: ${exampleSharedImageGallery.id}
          name: example
    

    Create Gallery Resource

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

    Constructor syntax

    new Gallery(name: string, args: GalleryArgs, opts?: CustomResourceOptions);
    @overload
    def Gallery(resource_name: str,
                args: GalleryArgs,
                opts: Optional[ResourceOptions] = None)
    
    @overload
    def Gallery(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                dev_center_id: Optional[str] = None,
                shared_gallery_id: Optional[str] = None,
                name: Optional[str] = None)
    func NewGallery(ctx *Context, name string, args GalleryArgs, opts ...ResourceOption) (*Gallery, error)
    public Gallery(string name, GalleryArgs args, CustomResourceOptions? opts = null)
    public Gallery(String name, GalleryArgs args)
    public Gallery(String name, GalleryArgs args, CustomResourceOptions options)
    
    type: azure:devcenter:Gallery
    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 GalleryArgs
    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 GalleryArgs
    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 GalleryArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args GalleryArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args GalleryArgs
    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 galleryResource = new Azure.DevCenter.Gallery("galleryResource", new()
    {
        DevCenterId = "string",
        SharedGalleryId = "string",
        Name = "string",
    });
    
    example, err := devcenter.NewGallery(ctx, "galleryResource", &devcenter.GalleryArgs{
    	DevCenterId:     pulumi.String("string"),
    	SharedGalleryId: pulumi.String("string"),
    	Name:            pulumi.String("string"),
    })
    
    var galleryResource = new Gallery("galleryResource", GalleryArgs.builder()
        .devCenterId("string")
        .sharedGalleryId("string")
        .name("string")
        .build());
    
    gallery_resource = azure.devcenter.Gallery("galleryResource",
        dev_center_id="string",
        shared_gallery_id="string",
        name="string")
    
    const galleryResource = new azure.devcenter.Gallery("galleryResource", {
        devCenterId: "string",
        sharedGalleryId: "string",
        name: "string",
    });
    
    type: azure:devcenter:Gallery
    properties:
        devCenterId: string
        name: string
        sharedGalleryId: string
    

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

    DevCenterId string
    Specifies the ID of the Dev Center within which this Dev Center Gallery should exist. Changing this forces a new Dev Center Gallery to be created.
    SharedGalleryId string
    The ID of the Shared Gallery which should be connected to the Dev Center Gallery. Changing this forces a new Dev Center Gallery to be created.
    Name string
    Specifies the name of this Dev Center Gallery. Changing this forces a new Dev Center Gallery to be created.
    DevCenterId string
    Specifies the ID of the Dev Center within which this Dev Center Gallery should exist. Changing this forces a new Dev Center Gallery to be created.
    SharedGalleryId string
    The ID of the Shared Gallery which should be connected to the Dev Center Gallery. Changing this forces a new Dev Center Gallery to be created.
    Name string
    Specifies the name of this Dev Center Gallery. Changing this forces a new Dev Center Gallery to be created.
    devCenterId String
    Specifies the ID of the Dev Center within which this Dev Center Gallery should exist. Changing this forces a new Dev Center Gallery to be created.
    sharedGalleryId String
    The ID of the Shared Gallery which should be connected to the Dev Center Gallery. Changing this forces a new Dev Center Gallery to be created.
    name String
    Specifies the name of this Dev Center Gallery. Changing this forces a new Dev Center Gallery to be created.
    devCenterId string
    Specifies the ID of the Dev Center within which this Dev Center Gallery should exist. Changing this forces a new Dev Center Gallery to be created.
    sharedGalleryId string
    The ID of the Shared Gallery which should be connected to the Dev Center Gallery. Changing this forces a new Dev Center Gallery to be created.
    name string
    Specifies the name of this Dev Center Gallery. Changing this forces a new Dev Center Gallery to be created.
    dev_center_id str
    Specifies the ID of the Dev Center within which this Dev Center Gallery should exist. Changing this forces a new Dev Center Gallery to be created.
    shared_gallery_id str
    The ID of the Shared Gallery which should be connected to the Dev Center Gallery. Changing this forces a new Dev Center Gallery to be created.
    name str
    Specifies the name of this Dev Center Gallery. Changing this forces a new Dev Center Gallery to be created.
    devCenterId String
    Specifies the ID of the Dev Center within which this Dev Center Gallery should exist. Changing this forces a new Dev Center Gallery to be created.
    sharedGalleryId String
    The ID of the Shared Gallery which should be connected to the Dev Center Gallery. Changing this forces a new Dev Center Gallery to be created.
    name String
    Specifies the name of this Dev Center Gallery. Changing this forces a new Dev Center Gallery to be created.

    Outputs

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

    Get an existing Gallery 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?: GalleryState, opts?: CustomResourceOptions): Gallery
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            dev_center_id: Optional[str] = None,
            name: Optional[str] = None,
            shared_gallery_id: Optional[str] = None) -> Gallery
    func GetGallery(ctx *Context, name string, id IDInput, state *GalleryState, opts ...ResourceOption) (*Gallery, error)
    public static Gallery Get(string name, Input<string> id, GalleryState? state, CustomResourceOptions? opts = null)
    public static Gallery get(String name, Output<String> id, GalleryState 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:
    DevCenterId string
    Specifies the ID of the Dev Center within which this Dev Center Gallery should exist. Changing this forces a new Dev Center Gallery to be created.
    Name string
    Specifies the name of this Dev Center Gallery. Changing this forces a new Dev Center Gallery to be created.
    SharedGalleryId string
    The ID of the Shared Gallery which should be connected to the Dev Center Gallery. Changing this forces a new Dev Center Gallery to be created.
    DevCenterId string
    Specifies the ID of the Dev Center within which this Dev Center Gallery should exist. Changing this forces a new Dev Center Gallery to be created.
    Name string
    Specifies the name of this Dev Center Gallery. Changing this forces a new Dev Center Gallery to be created.
    SharedGalleryId string
    The ID of the Shared Gallery which should be connected to the Dev Center Gallery. Changing this forces a new Dev Center Gallery to be created.
    devCenterId String
    Specifies the ID of the Dev Center within which this Dev Center Gallery should exist. Changing this forces a new Dev Center Gallery to be created.
    name String
    Specifies the name of this Dev Center Gallery. Changing this forces a new Dev Center Gallery to be created.
    sharedGalleryId String
    The ID of the Shared Gallery which should be connected to the Dev Center Gallery. Changing this forces a new Dev Center Gallery to be created.
    devCenterId string
    Specifies the ID of the Dev Center within which this Dev Center Gallery should exist. Changing this forces a new Dev Center Gallery to be created.
    name string
    Specifies the name of this Dev Center Gallery. Changing this forces a new Dev Center Gallery to be created.
    sharedGalleryId string
    The ID of the Shared Gallery which should be connected to the Dev Center Gallery. Changing this forces a new Dev Center Gallery to be created.
    dev_center_id str
    Specifies the ID of the Dev Center within which this Dev Center Gallery should exist. Changing this forces a new Dev Center Gallery to be created.
    name str
    Specifies the name of this Dev Center Gallery. Changing this forces a new Dev Center Gallery to be created.
    shared_gallery_id str
    The ID of the Shared Gallery which should be connected to the Dev Center Gallery. Changing this forces a new Dev Center Gallery to be created.
    devCenterId String
    Specifies the ID of the Dev Center within which this Dev Center Gallery should exist. Changing this forces a new Dev Center Gallery to be created.
    name String
    Specifies the name of this Dev Center Gallery. Changing this forces a new Dev Center Gallery to be created.
    sharedGalleryId String
    The ID of the Shared Gallery which should be connected to the Dev Center Gallery. Changing this forces a new Dev Center Gallery to be created.

    Import

    An existing Dev Center Gallery can be imported into Terraform using the resource id, e.g.

    $ pulumi import azure:devcenter/gallery:Gallery example /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devCenters/{devCenterName}/galleries/{galleryName}
    
    • Where {subscriptionId} is the ID of the Azure Subscription where the Dev Center Gallery exists. For example 12345678-1234-9876-4563-123456789012.

    • Where {resourceGroupName} is the name of Resource Group where this Dev Center Gallery exists. For example example-resource-group.

    • Where {devCenterName} is the name of the Dev Center. For example devCenterValue.

    • Where {galleryName} is the name of the Gallery. For example galleryValue.

    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