Site
Site resource. Uses Azure REST API version 2024-04-15. In version 2.x of the Azure Native provider, it used API version 2023-09-01. Other available API versions: 2023-09-01. These can be accessed by generating a local SDK package using the CLI command pulumi package add azure-native hybridnetwork [ApiVersion]
. See the ../../../version-guide/#accessing-any-api-version-via-local-packages for details.
Example Usage
Create network site
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var site = new AzureNative.HybridNetwork.Site("site", new()
{
Location = "westUs2",
Properties = new AzureNative.HybridNetwork.Inputs.SitePropertiesFormatArgs
{
Nfvis =
{
new AzureNative.HybridNetwork.Inputs.AzureCoreNFVIDetailsArgs
{
Location = "westUs2",
Name = "nfvi1",
NfviType = "AzureCore",
},
new AzureNative.HybridNetwork.Inputs.AzureArcK8sClusterNFVIDetailsArgs
{
CustomLocationReference = new AzureNative.HybridNetwork.Inputs.ReferencedResourceArgs
{
Id = "/subscriptions/subid/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation1",
},
Name = "nfvi2",
NfviType = "AzureArcKubernetes",
},
new AzureNative.HybridNetwork.Inputs.AzureOperatorNexusClusterNFVIDetailsArgs
{
CustomLocationReference = new AzureNative.HybridNetwork.Inputs.ReferencedResourceArgs
{
Id = "/subscriptions/subid/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation2",
},
Name = "nfvi3",
NfviType = "AzureOperatorNexus",
},
},
},
ResourceGroupName = "rg1",
SiteName = "testSite",
});
});
Content copied to clipboard
package main
import (
hybridnetwork "github.com/pulumi/pulumi-azure-native-sdk/hybridnetwork/v3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := hybridnetwork.NewSite(ctx, "site", &hybridnetwork.SiteArgs{
Location: pulumi.String("westUs2"),
Properties: &hybridnetwork.SitePropertiesFormatArgs{
Nfvis: pulumi.Array{
hybridnetwork.AzureCoreNFVIDetails{
Location: "westUs2",
Name: "nfvi1",
NfviType: "AzureCore",
},
hybridnetwork.AzureArcK8sClusterNFVIDetails{
CustomLocationReference: hybridnetwork.ReferencedResource{
Id: "/subscriptions/subid/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation1",
},
Name: "nfvi2",
NfviType: "AzureArcKubernetes",
},
hybridnetwork.AzureOperatorNexusClusterNFVIDetails{
CustomLocationReference: hybridnetwork.ReferencedResource{
Id: "/subscriptions/subid/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation2",
},
Name: "nfvi3",
NfviType: "AzureOperatorNexus",
},
},
},
ResourceGroupName: pulumi.String("rg1"),
SiteName: pulumi.String("testSite"),
})
if err != nil {
return err
}
return nil
})
}
Content copied to clipboard
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.hybridnetwork.Site;
import com.pulumi.azurenative.hybridnetwork.SiteArgs;
import com.pulumi.azurenative.hybridnetwork.inputs.SitePropertiesFormatArgs;
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 site = new Site("site", SiteArgs.builder()
.location("westUs2")
.properties(SitePropertiesFormatArgs.builder()
.nfvis(
AzureCoreNFVIDetailsArgs.builder()
.location("westUs2")
.name("nfvi1")
.nfviType("AzureCore")
.build(),
AzureArcK8sClusterNFVIDetailsArgs.builder()
.customLocationReference(ReferencedResourceArgs.builder()
.id("/subscriptions/subid/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation1")
.build())
.name("nfvi2")
.nfviType("AzureArcKubernetes")
.build(),
AzureOperatorNexusClusterNFVIDetailsArgs.builder()
.customLocationReference(ReferencedResourceArgs.builder()
.id("/subscriptions/subid/resourceGroups/testResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/testCustomLocation2")
.build())
.name("nfvi3")
.nfviType("AzureOperatorNexus")
.build())
.build())
.resourceGroupName("rg1")
.siteName("testSite")
.build());
}
}
Content copied to clipboard
Import
An existing resource can be imported using its type token, name, and identifier, e.g.
$ pulumi import azure-native:hybridnetwork:Site testSite /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/sites/{siteName}
Content copied to clipboard