Hci Marketplace Gallery Image Args
Manages an Azure Stack HCI Marketplace Gallery Image.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
import * as azuread from "@pulumi/azuread";
const exampleResourceGroup = new azure.core.ResourceGroup("example", {
name: "examples",
location: "West Europe",
});
const example = azure.core.getClientConfig({});
// service principal of 'Microsoft.AzureStackHCI Resource Provider'
const hciRp = azuread.getServicePrincipal({
clientId: "1412d89f-b8a8-4111-b4fd-e82905cbd85d",
});
const exampleAssignment = new azure.authorization.Assignment("example", {
scope: exampleResourceGroup.id,
roleDefinitionName: "Azure Connected Machine Resource Manager",
principalId: hciRp.then(hciRp => hciRp.objectId),
});
const exampleHciMarketplaceGalleryImage = new azure.stack.HciMarketplaceGalleryImage("example", {
name: "example-mgi",
resourceGroupName: exampleResourceGroup.name,
location: exampleResourceGroup.location,
customLocationId: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ExtendedLocation/customLocations/cl1",
hypervGeneration: "V2",
osType: "Windows",
version: "20348.2655.240905",
identifier: {
publisher: "MicrosoftWindowsServer",
offer: "WindowsServer",
sku: "2022-datacenter-azure-edition-core",
},
tags: {
foo: "bar",
env: "example",
},
});
import pulumi
import pulumi_azure as azure
import pulumi_azuread as azuread
example_resource_group = azure.core.ResourceGroup("example",
name="examples",
location="West Europe")
example = azure.core.get_client_config()
# service principal of 'Microsoft.AzureStackHCI Resource Provider'
hci_rp = azuread.get_service_principal(client_id="1412d89f-b8a8-4111-b4fd-e82905cbd85d")
example_assignment = azure.authorization.Assignment("example",
scope=example_resource_group.id,
role_definition_name="Azure Connected Machine Resource Manager",
principal_id=hci_rp.object_id)
example_hci_marketplace_gallery_image = azure.stack.HciMarketplaceGalleryImage("example",
name="example-mgi",
resource_group_name=example_resource_group.name,
location=example_resource_group.location,
custom_location_id="/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ExtendedLocation/customLocations/cl1",
hyperv_generation="V2",
os_type="Windows",
version="20348.2655.240905",
identifier={
"publisher": "MicrosoftWindowsServer",
"offer": "WindowsServer",
"sku": "2022-datacenter-azure-edition-core",
},
tags={
"foo": "bar",
"env": "example",
})
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
using AzureAD = Pulumi.AzureAD;
return await Deployment.RunAsync(() =>
{
var exampleResourceGroup = new Azure.Core.ResourceGroup("example", new()
{
Name = "examples",
Location = "West Europe",
});
var example = Azure.Core.GetClientConfig.Invoke();
// service principal of 'Microsoft.AzureStackHCI Resource Provider'
var hciRp = AzureAD.GetServicePrincipal.Invoke(new()
{
ClientId = "1412d89f-b8a8-4111-b4fd-e82905cbd85d",
});
var exampleAssignment = new Azure.Authorization.Assignment("example", new()
{
Scope = exampleResourceGroup.Id,
RoleDefinitionName = "Azure Connected Machine Resource Manager",
PrincipalId = hciRp.Apply(getServicePrincipalResult => getServicePrincipalResult.ObjectId),
});
var exampleHciMarketplaceGalleryImage = new Azure.Stack.HciMarketplaceGalleryImage("example", new()
{
Name = "example-mgi",
ResourceGroupName = exampleResourceGroup.Name,
Location = exampleResourceGroup.Location,
CustomLocationId = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ExtendedLocation/customLocations/cl1",
HypervGeneration = "V2",
OsType = "Windows",
Version = "20348.2655.240905",
Identifier = new Azure.Stack.Inputs.HciMarketplaceGalleryImageIdentifierArgs
{
Publisher = "MicrosoftWindowsServer",
Offer = "WindowsServer",
Sku = "2022-datacenter-azure-edition-core",
},
Tags =
{
{ "foo", "bar" },
{ "env", "example" },
},
});
});
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/authorization"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/stack"
"github.com/pulumi/pulumi-azuread/sdk/v5/go/azuread"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
exampleResourceGroup, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
Name: pulumi.String("examples"),
Location: pulumi.String("West Europe"),
})
if err != nil {
return err
}
_, err = core.GetClientConfig(ctx, map[string]interface{}{}, nil)
if err != nil {
return err
}
// service principal of 'Microsoft.AzureStackHCI Resource Provider'
hciRp, err := azuread.LookupServicePrincipal(ctx, &azuread.LookupServicePrincipalArgs{
ClientId: pulumi.StringRef("1412d89f-b8a8-4111-b4fd-e82905cbd85d"),
}, nil)
if err != nil {
return err
}
_, err = authorization.NewAssignment(ctx, "example", &authorization.AssignmentArgs{
Scope: exampleResourceGroup.ID(),
RoleDefinitionName: pulumi.String("Azure Connected Machine Resource Manager"),
PrincipalId: pulumi.String(hciRp.ObjectId),
})
if err != nil {
return err
}
_, err = stack.NewHciMarketplaceGalleryImage(ctx, "example", &stack.HciMarketplaceGalleryImageArgs{
Name: pulumi.String("example-mgi"),
ResourceGroupName: exampleResourceGroup.Name,
Location: exampleResourceGroup.Location,
CustomLocationId: pulumi.String("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ExtendedLocation/customLocations/cl1"),
HypervGeneration: pulumi.String("V2"),
OsType: pulumi.String("Windows"),
Version: pulumi.String("20348.2655.240905"),
Identifier: &stack.HciMarketplaceGalleryImageIdentifierArgs{
Publisher: pulumi.String("MicrosoftWindowsServer"),
Offer: pulumi.String("WindowsServer"),
Sku: pulumi.String("2022-datacenter-azure-edition-core"),
},
Tags: pulumi.StringMap{
"foo": pulumi.String("bar"),
"env": pulumi.String("example"),
},
})
if err != nil {
return err
}
return nil
})
}
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.core.CoreFunctions;
import com.pulumi.azuread.AzureadFunctions;
import com.pulumi.azuread.inputs.GetServicePrincipalArgs;
import com.pulumi.azure.authorization.Assignment;
import com.pulumi.azure.authorization.AssignmentArgs;
import com.pulumi.azure.stack.HciMarketplaceGalleryImage;
import com.pulumi.azure.stack.HciMarketplaceGalleryImageArgs;
import com.pulumi.azure.stack.inputs.HciMarketplaceGalleryImageIdentifierArgs;
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 exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()
.name("examples")
.location("West Europe")
.build());
final var example = CoreFunctions.getClientConfig(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference);
// service principal of 'Microsoft.AzureStackHCI Resource Provider'
final var hciRp = AzureadFunctions.getServicePrincipal(GetServicePrincipalArgs.builder()
.clientId("1412d89f-b8a8-4111-b4fd-e82905cbd85d")
.build());
var exampleAssignment = new Assignment("exampleAssignment", AssignmentArgs.builder()
.scope(exampleResourceGroup.id())
.roleDefinitionName("Azure Connected Machine Resource Manager")
.principalId(hciRp.objectId())
.build());
var exampleHciMarketplaceGalleryImage = new HciMarketplaceGalleryImage("exampleHciMarketplaceGalleryImage", HciMarketplaceGalleryImageArgs.builder()
.name("example-mgi")
.resourceGroupName(exampleResourceGroup.name())
.location(exampleResourceGroup.location())
.customLocationId("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ExtendedLocation/customLocations/cl1")
.hypervGeneration("V2")
.osType("Windows")
.version("20348.2655.240905")
.identifier(HciMarketplaceGalleryImageIdentifierArgs.builder()
.publisher("MicrosoftWindowsServer")
.offer("WindowsServer")
.sku("2022-datacenter-azure-edition-core")
.build())
.tags(Map.ofEntries(
Map.entry("foo", "bar"),
Map.entry("env", "example")
))
.build());
}
}
resources:
exampleResourceGroup:
type: azure:core:ResourceGroup
name: example
properties:
name: examples
location: West Europe
exampleAssignment:
type: azure:authorization:Assignment
name: example
properties:
scope: ${exampleResourceGroup.id}
roleDefinitionName: Azure Connected Machine Resource Manager
principalId: ${hciRp.objectId}
exampleHciMarketplaceGalleryImage:
type: azure:stack:HciMarketplaceGalleryImage
name: example
properties:
name: example-mgi
resourceGroupName: ${exampleResourceGroup.name}
location: ${exampleResourceGroup.location}
customLocationId: /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ExtendedLocation/customLocations/cl1
hypervGeneration: V2
osType: Windows
version: 20348.2655.240905
identifier:
publisher: MicrosoftWindowsServer
offer: WindowsServer
sku: 2022-datacenter-azure-edition-core
tags:
foo: bar
env: example
variables:
example:
fn::invoke:
function: azure:core:getClientConfig
arguments: {}
# service principal of 'Microsoft.AzureStackHCI Resource Provider'
hciRp:
fn::invoke:
function: azuread:getServicePrincipal
arguments:
clientId: 1412d89f-b8a8-4111-b4fd-e82905cbd85d
API Providers
This resource uses the following Azure API Providers:
Microsoft.AzureStackHCI
: 2024-01-01
Import
Azure Stack HCI Marketplace Gallery Images can be imported using the resource id
, e.g.
$ pulumi import azure:stack/hciMarketplaceGalleryImage:HciMarketplaceGalleryImage example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.AzureStackHCI/marketplaceGalleryImages/image1
Constructors
Properties
The ID of the Custom Location where the Azure Stack HCI Marketplace Gallery Image should exist. Changing this forces a new resource to be created.
The hypervisor generation of the Azure Stack HCI Marketplace Gallery Image. Possible values are V1
and V2
. Changing this forces a new Azure Stack HCI Marketplace Gallery Image to be created.
An identifier
block as defined below. Changing this forces a new Azure Stack HCI Marketplace Gallery Image to be created.
The name of the Resource Group where the Azure Stack HCI Marketplace Gallery Image should exist. Changing this forces a new Azure Stack HCI Marketplace Gallery Image to be created.
The ID of the Azure Stack HCI Storage Path used for this Marketplace Gallery Image. Changing this forces a new Azure Stack HCI Virtual Hard Disk to be created.