CacheBlobTarget
Manages a Blob Target within a HPC Cache.
Example Usage
using Pulumi;
using Azure = Pulumi.Azure;
using AzureAD = Pulumi.AzureAD;
class MyStack : Stack
{
public MyStack()
{
var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new Azure.Core.ResourceGroupArgs
{
Location = "West Europe",
});
var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new Azure.Network.VirtualNetworkArgs
{
AddressSpaces =
{
"10.0.0.0/16",
},
Location = exampleResourceGroup.Location,
ResourceGroupName = exampleResourceGroup.Name,
});
var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new Azure.Network.SubnetArgs
{
ResourceGroupName = exampleResourceGroup.Name,
VirtualNetworkName = exampleVirtualNetwork.Name,
AddressPrefix = "10.0.1.0/24",
});
var exampleCache = new Azure.Hpc.Cache("exampleCache", new Azure.Hpc.CacheArgs
{
ResourceGroupName = exampleResourceGroup.Name,
Location = exampleResourceGroup.Location,
CacheSizeInGb = 3072,
SubnetId = exampleSubnet.Id,
SkuName = "Standard_2G",
});
var exampleAccount = new Azure.Storage.Account("exampleAccount", new Azure.Storage.AccountArgs
{
ResourceGroupName = exampleResourceGroup.Name,
Location = exampleResourceGroup.Location,
AccountTier = "Standard",
AccountReplicationType = "LRS",
});
var exampleContainer = new Azure.Storage.Container("exampleContainer", new Azure.Storage.ContainerArgs
{
StorageAccountName = exampleAccount.Name,
});
var exampleServicePrincipal = Output.Create(AzureAD.GetServicePrincipal.InvokeAsync(new AzureAD.GetServicePrincipalArgs
{
DisplayName = "HPC Cache Resource Provider",
}));
var exampleStorageAccountContrib = new Azure.Authorization.Assignment("exampleStorageAccountContrib", new Azure.Authorization.AssignmentArgs
{
Scope = exampleAccount.Id,
RoleDefinitionName = "Storage Account Contributor",
PrincipalId = exampleServicePrincipal.Apply(exampleServicePrincipal => exampleServicePrincipal.ObjectId),
});
var exampleStorageBlobDataContrib = new Azure.Authorization.Assignment("exampleStorageBlobDataContrib", new Azure.Authorization.AssignmentArgs
{
Scope = exampleAccount.Id,
RoleDefinitionName = "Storage Blob Data Contributor",
PrincipalId = exampleServicePrincipal.Apply(exampleServicePrincipal => exampleServicePrincipal.ObjectId),
});
var exampleCacheBlobTarget = new Azure.Hpc.CacheBlobTarget("exampleCacheBlobTarget", new Azure.Hpc.CacheBlobTargetArgs
{
ResourceGroupName = exampleResourceGroup.Name,
CacheName = exampleCache.Name,
StorageContainerId = exampleContainer.ResourceManagerId,
NamespacePath = "/blob_storage",
});
}
}
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v3/go/azure/authorization"
"github.com/pulumi/pulumi-azure/sdk/v3/go/azure/core"
"github.com/pulumi/pulumi-azure/sdk/v3/go/azure/hpc"
"github.com/pulumi/pulumi-azure/sdk/v3/go/azure/network"
"github.com/pulumi/pulumi-azure/sdk/v3/go/azure/storage"
"github.com/pulumi/pulumi-azuread/sdk/v2/go/azuread"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{
Location: pulumi.String("West Europe"),
})
if err != nil {
return err
}
exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{
AddressSpaces: pulumi.StringArray{
pulumi.String("10.0.0.0/16"),
},
Location: exampleResourceGroup.Location,
ResourceGroupName: exampleResourceGroup.Name,
})
if err != nil {
return err
}
exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{
ResourceGroupName: exampleResourceGroup.Name,
VirtualNetworkName: exampleVirtualNetwork.Name,
AddressPrefix: pulumi.String("10.0.1.0/24"),
})
if err != nil {
return err
}
exampleCache, err := hpc.NewCache(ctx, "exampleCache", &hpc.CacheArgs{
ResourceGroupName: exampleResourceGroup.Name,
Location: exampleResourceGroup.Location,
CacheSizeInGb: pulumi.Int(3072),
SubnetId: exampleSubnet.ID(),
SkuName: pulumi.String("Standard_2G"),
})
if err != nil {
return err
}
exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{
ResourceGroupName: exampleResourceGroup.Name,
Location: exampleResourceGroup.Location,
AccountTier: pulumi.String("Standard"),
AccountReplicationType: pulumi.String("LRS"),
})
if err != nil {
return err
}
exampleContainer, err := storage.NewContainer(ctx, "exampleContainer", &storage.ContainerArgs{
StorageAccountName: exampleAccount.Name,
})
if err != nil {
return err
}
opt0 := "HPC Cache Resource Provider"
exampleServicePrincipal, err := azuread.LookupServicePrincipal(ctx, &azuread.LookupServicePrincipalArgs{
DisplayName: &opt0,
}, nil)
if err != nil {
return err
}
_, err = authorization.NewAssignment(ctx, "exampleStorageAccountContrib", &authorization.AssignmentArgs{
Scope: exampleAccount.ID(),
RoleDefinitionName: pulumi.String("Storage Account Contributor"),
PrincipalId: pulumi.String(exampleServicePrincipal.ObjectId),
})
if err != nil {
return err
}
_, err = authorization.NewAssignment(ctx, "exampleStorageBlobDataContrib", &authorization.AssignmentArgs{
Scope: exampleAccount.ID(),
RoleDefinitionName: pulumi.String("Storage Blob Data Contributor"),
PrincipalId: pulumi.String(exampleServicePrincipal.ObjectId),
})
if err != nil {
return err
}
_, err = hpc.NewCacheBlobTarget(ctx, "exampleCacheBlobTarget", &hpc.CacheBlobTargetArgs{
ResourceGroupName: exampleResourceGroup.Name,
CacheName: exampleCache.Name,
StorageContainerId: exampleContainer.ResourceManagerId,
NamespacePath: pulumi.String("/blob_storage"),
})
if err != nil {
return err
}
return nil
})
}import pulumi
import pulumi_azure as azure
import pulumi_azuread as azuread
example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe")
example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork",
address_spaces=["10.0.0.0/16"],
location=example_resource_group.location,
resource_group_name=example_resource_group.name)
example_subnet = azure.network.Subnet("exampleSubnet",
resource_group_name=example_resource_group.name,
virtual_network_name=example_virtual_network.name,
address_prefix="10.0.1.0/24")
example_cache = azure.hpc.Cache("exampleCache",
resource_group_name=example_resource_group.name,
location=example_resource_group.location,
cache_size_in_gb=3072,
subnet_id=example_subnet.id,
sku_name="Standard_2G")
example_account = azure.storage.Account("exampleAccount",
resource_group_name=example_resource_group.name,
location=example_resource_group.location,
account_tier="Standard",
account_replication_type="LRS")
example_container = azure.storage.Container("exampleContainer", storage_account_name=example_account.name)
example_service_principal = azuread.get_service_principal(display_name="HPC Cache Resource Provider")
example_storage_account_contrib = azure.authorization.Assignment("exampleStorageAccountContrib",
scope=example_account.id,
role_definition_name="Storage Account Contributor",
principal_id=example_service_principal.object_id)
example_storage_blob_data_contrib = azure.authorization.Assignment("exampleStorageBlobDataContrib",
scope=example_account.id,
role_definition_name="Storage Blob Data Contributor",
principal_id=example_service_principal.object_id)
example_cache_blob_target = azure.hpc.CacheBlobTarget("exampleCacheBlobTarget",
resource_group_name=example_resource_group.name,
cache_name=example_cache.name,
storage_container_id=example_container.resource_manager_id,
namespace_path="/blob_storage")import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
import * as azuread from "@pulumi/azuread";
const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"});
const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", {
addressSpaces: ["10.0.0.0/16"],
location: exampleResourceGroup.location,
resourceGroupName: exampleResourceGroup.name,
});
const exampleSubnet = new azure.network.Subnet("exampleSubnet", {
resourceGroupName: exampleResourceGroup.name,
virtualNetworkName: exampleVirtualNetwork.name,
addressPrefix: "10.0.1.0/24",
});
const exampleCache = new azure.hpc.Cache("exampleCache", {
resourceGroupName: exampleResourceGroup.name,
location: exampleResourceGroup.location,
cacheSizeInGb: 3072,
subnetId: exampleSubnet.id,
skuName: "Standard_2G",
});
const exampleAccount = new azure.storage.Account("exampleAccount", {
resourceGroupName: exampleResourceGroup.name,
location: exampleResourceGroup.location,
accountTier: "Standard",
accountReplicationType: "LRS",
});
const exampleContainer = new azure.storage.Container("exampleContainer", {storageAccountName: exampleAccount.name});
const exampleServicePrincipal = azuread.getServicePrincipal({
displayName: "HPC Cache Resource Provider",
});
const exampleStorageAccountContrib = new azure.authorization.Assignment("exampleStorageAccountContrib", {
scope: exampleAccount.id,
roleDefinitionName: "Storage Account Contributor",
principalId: exampleServicePrincipal.then(exampleServicePrincipal => exampleServicePrincipal.objectId),
});
const exampleStorageBlobDataContrib = new azure.authorization.Assignment("exampleStorageBlobDataContrib", {
scope: exampleAccount.id,
roleDefinitionName: "Storage Blob Data Contributor",
principalId: exampleServicePrincipal.then(exampleServicePrincipal => exampleServicePrincipal.objectId),
});
const exampleCacheBlobTarget = new azure.hpc.CacheBlobTarget("exampleCacheBlobTarget", {
resourceGroupName: exampleResourceGroup.name,
cacheName: exampleCache.name,
storageContainerId: exampleContainer.resourceManagerId,
namespacePath: "/blob_storage",
});Create a CacheBlobTarget Resource
new CacheBlobTarget(name: string, args: CacheBlobTargetArgs, opts?: CustomResourceOptions);def CacheBlobTarget(resource_name, opts=None, cache_name=None, name=None, namespace_path=None, resource_group_name=None, storage_container_id=None, __props__=None);func NewCacheBlobTarget(ctx *Context, name string, args CacheBlobTargetArgs, opts ...ResourceOption) (*CacheBlobTarget, error)public CacheBlobTarget(string name, CacheBlobTargetArgs args, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args CacheBlobTargetArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- opts ResourceOptions
- A bag of options that control this resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args CacheBlobTargetArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args CacheBlobTargetArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
CacheBlobTarget Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The CacheBlobTarget resource accepts the following input properties:
- Cache
Name string The name HPC Cache, which the HPC Cache Blob Target will be added to. Changing this forces a new resource to be created.
- Namespace
Path string The client-facing file path of the HPC Cache Blob Target.
- Resource
Group stringName The name of the Resource Group in which to create the HPC Cache Blob Target. Changing this forces a new resource to be created.
- Storage
Container stringId The Resource Manager ID of the Storage Container used as the HPC Cache Blob Target. Changing this forces a new resource to be created.
- Name string
The name of the HPC Cache Blob Target. Changing this forces a new resource to be created.
- Cache
Name string The name HPC Cache, which the HPC Cache Blob Target will be added to. Changing this forces a new resource to be created.
- Namespace
Path string The client-facing file path of the HPC Cache Blob Target.
- Resource
Group stringName The name of the Resource Group in which to create the HPC Cache Blob Target. Changing this forces a new resource to be created.
- Storage
Container stringId The Resource Manager ID of the Storage Container used as the HPC Cache Blob Target. Changing this forces a new resource to be created.
- Name string
The name of the HPC Cache Blob Target. Changing this forces a new resource to be created.
- cache
Name string The name HPC Cache, which the HPC Cache Blob Target will be added to. Changing this forces a new resource to be created.
- namespace
Path string The client-facing file path of the HPC Cache Blob Target.
- resource
Group stringName The name of the Resource Group in which to create the HPC Cache Blob Target. Changing this forces a new resource to be created.
- storage
Container stringId The Resource Manager ID of the Storage Container used as the HPC Cache Blob Target. Changing this forces a new resource to be created.
- name string
The name of the HPC Cache Blob Target. Changing this forces a new resource to be created.
- cache_
name str The name HPC Cache, which the HPC Cache Blob Target will be added to. Changing this forces a new resource to be created.
- namespace_
path str The client-facing file path of the HPC Cache Blob Target.
- resource_
group_ strname The name of the Resource Group in which to create the HPC Cache Blob Target. Changing this forces a new resource to be created.
- storage_
container_ strid The Resource Manager ID of the Storage Container used as the HPC Cache Blob Target. Changing this forces a new resource to be created.
- name str
The name of the HPC Cache Blob Target. Changing this forces a new resource to be created.
Outputs
All input properties are implicitly available as output properties. Additionally, the CacheBlobTarget resource produces the following output properties:
Look up an Existing CacheBlobTarget Resource
Get an existing CacheBlobTarget 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?: CacheBlobTargetState, opts?: CustomResourceOptions): CacheBlobTargetstatic get(resource_name, id, opts=None, cache_name=None, name=None, namespace_path=None, resource_group_name=None, storage_container_id=None, __props__=None);func GetCacheBlobTarget(ctx *Context, name string, id IDInput, state *CacheBlobTargetState, opts ...ResourceOption) (*CacheBlobTarget, error)public static CacheBlobTarget Get(string name, Input<string> id, CacheBlobTargetState? state, CustomResourceOptions? opts = null)- 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.
The following state arguments are supported:
- Cache
Name string The name HPC Cache, which the HPC Cache Blob Target will be added to. Changing this forces a new resource to be created.
- Name string
The name of the HPC Cache Blob Target. Changing this forces a new resource to be created.
- Namespace
Path string The client-facing file path of the HPC Cache Blob Target.
- Resource
Group stringName The name of the Resource Group in which to create the HPC Cache Blob Target. Changing this forces a new resource to be created.
- Storage
Container stringId The Resource Manager ID of the Storage Container used as the HPC Cache Blob Target. Changing this forces a new resource to be created.
- Cache
Name string The name HPC Cache, which the HPC Cache Blob Target will be added to. Changing this forces a new resource to be created.
- Name string
The name of the HPC Cache Blob Target. Changing this forces a new resource to be created.
- Namespace
Path string The client-facing file path of the HPC Cache Blob Target.
- Resource
Group stringName The name of the Resource Group in which to create the HPC Cache Blob Target. Changing this forces a new resource to be created.
- Storage
Container stringId The Resource Manager ID of the Storage Container used as the HPC Cache Blob Target. Changing this forces a new resource to be created.
- cache
Name string The name HPC Cache, which the HPC Cache Blob Target will be added to. Changing this forces a new resource to be created.
- name string
The name of the HPC Cache Blob Target. Changing this forces a new resource to be created.
- namespace
Path string The client-facing file path of the HPC Cache Blob Target.
- resource
Group stringName The name of the Resource Group in which to create the HPC Cache Blob Target. Changing this forces a new resource to be created.
- storage
Container stringId The Resource Manager ID of the Storage Container used as the HPC Cache Blob Target. Changing this forces a new resource to be created.
- cache_
name str The name HPC Cache, which the HPC Cache Blob Target will be added to. Changing this forces a new resource to be created.
- name str
The name of the HPC Cache Blob Target. Changing this forces a new resource to be created.
- namespace_
path str The client-facing file path of the HPC Cache Blob Target.
- resource_
group_ strname The name of the Resource Group in which to create the HPC Cache Blob Target. Changing this forces a new resource to be created.
- storage_
container_ strid The Resource Manager ID of the Storage Container used as the HPC Cache Blob Target. Changing this forces a new resource to be created.
Package Details
- Repository
- https://github.com/pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurermTerraform Provider.