We recommend using Azure Native.
azure.storage.Container
Explore with Pulumi AI
Manages a Container within an Azure Storage Account.
Example Usage
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new()
{
Location = "West Europe",
});
var exampleAccount = new Azure.Storage.Account("exampleAccount", new()
{
ResourceGroupName = exampleResourceGroup.Name,
Location = exampleResourceGroup.Location,
AccountTier = "Standard",
AccountReplicationType = "LRS",
Tags =
{
{ "environment", "staging" },
},
});
var exampleContainer = new Azure.Storage.Container("exampleContainer", new()
{
StorageAccountName = exampleAccount.Name,
ContainerAccessType = "private",
});
});
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage"
"github.com/pulumi/pulumi/sdk/v3/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
}
exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{
ResourceGroupName: exampleResourceGroup.Name,
Location: exampleResourceGroup.Location,
AccountTier: pulumi.String("Standard"),
AccountReplicationType: pulumi.String("LRS"),
Tags: pulumi.StringMap{
"environment": pulumi.String("staging"),
},
})
if err != nil {
return err
}
_, err = storage.NewContainer(ctx, "exampleContainer", &storage.ContainerArgs{
StorageAccountName: exampleAccount.Name,
ContainerAccessType: pulumi.String("private"),
})
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.storage.Account;
import com.pulumi.azure.storage.AccountArgs;
import com.pulumi.azure.storage.Container;
import com.pulumi.azure.storage.ContainerArgs;
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()
.location("West Europe")
.build());
var exampleAccount = new Account("exampleAccount", AccountArgs.builder()
.resourceGroupName(exampleResourceGroup.name())
.location(exampleResourceGroup.location())
.accountTier("Standard")
.accountReplicationType("LRS")
.tags(Map.of("environment", "staging"))
.build());
var exampleContainer = new Container("exampleContainer", ContainerArgs.builder()
.storageAccountName(exampleAccount.name())
.containerAccessType("private")
.build());
}
}
import pulumi
import pulumi_azure as azure
example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe")
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",
tags={
"environment": "staging",
})
example_container = azure.storage.Container("exampleContainer",
storage_account_name=example_account.name,
container_access_type="private")
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"});
const exampleAccount = new azure.storage.Account("exampleAccount", {
resourceGroupName: exampleResourceGroup.name,
location: exampleResourceGroup.location,
accountTier: "Standard",
accountReplicationType: "LRS",
tags: {
environment: "staging",
},
});
const exampleContainer = new azure.storage.Container("exampleContainer", {
storageAccountName: exampleAccount.name,
containerAccessType: "private",
});
resources:
exampleResourceGroup:
type: azure:core:ResourceGroup
properties:
location: West Europe
exampleAccount:
type: azure:storage:Account
properties:
resourceGroupName: ${exampleResourceGroup.name}
location: ${exampleResourceGroup.location}
accountTier: Standard
accountReplicationType: LRS
tags:
environment: staging
exampleContainer:
type: azure:storage:Container
properties:
storageAccountName: ${exampleAccount.name}
containerAccessType: private
Create Container Resource
new Container(name: string, args: ContainerArgs, opts?: CustomResourceOptions);
@overload
def Container(resource_name: str,
opts: Optional[ResourceOptions] = None,
container_access_type: Optional[str] = None,
metadata: Optional[Mapping[str, str]] = None,
name: Optional[str] = None,
storage_account_name: Optional[str] = None)
@overload
def Container(resource_name: str,
args: ContainerArgs,
opts: Optional[ResourceOptions] = None)
func NewContainer(ctx *Context, name string, args ContainerArgs, opts ...ResourceOption) (*Container, error)
public Container(string name, ContainerArgs args, CustomResourceOptions? opts = null)
public Container(String name, ContainerArgs args)
public Container(String name, ContainerArgs args, CustomResourceOptions options)
type: azure:storage:Container
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ContainerArgs
- 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 ContainerArgs
- 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 ContainerArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ContainerArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ContainerArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Container 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 Container resource accepts the following input properties:
- Storage
Account stringName The name of the Storage Account where the Container should be created. Changing this forces a new resource to be created.
- Container
Access stringType The Access Level configured for this Container. Possible values are
blob
,container
orprivate
. Defaults toprivate
.- Metadata Dictionary<string, string>
A mapping of MetaData for this Container. All metadata keys should be lowercase.
- Name string
The name of the Container which should be created within the Storage Account. Changing this forces a new resource to be created.
- Storage
Account stringName The name of the Storage Account where the Container should be created. Changing this forces a new resource to be created.
- Container
Access stringType The Access Level configured for this Container. Possible values are
blob
,container
orprivate
. Defaults toprivate
.- Metadata map[string]string
A mapping of MetaData for this Container. All metadata keys should be lowercase.
- Name string
The name of the Container which should be created within the Storage Account. Changing this forces a new resource to be created.
- storage
Account StringName The name of the Storage Account where the Container should be created. Changing this forces a new resource to be created.
- container
Access StringType The Access Level configured for this Container. Possible values are
blob
,container
orprivate
. Defaults toprivate
.- metadata Map<String,String>
A mapping of MetaData for this Container. All metadata keys should be lowercase.
- name String
The name of the Container which should be created within the Storage Account. Changing this forces a new resource to be created.
- storage
Account stringName The name of the Storage Account where the Container should be created. Changing this forces a new resource to be created.
- container
Access stringType The Access Level configured for this Container. Possible values are
blob
,container
orprivate
. Defaults toprivate
.- metadata {[key: string]: string}
A mapping of MetaData for this Container. All metadata keys should be lowercase.
- name string
The name of the Container which should be created within the Storage Account. Changing this forces a new resource to be created.
- storage_
account_ strname The name of the Storage Account where the Container should be created. Changing this forces a new resource to be created.
- container_
access_ strtype The Access Level configured for this Container. Possible values are
blob
,container
orprivate
. Defaults toprivate
.- metadata Mapping[str, str]
A mapping of MetaData for this Container. All metadata keys should be lowercase.
- name str
The name of the Container which should be created within the Storage Account. Changing this forces a new resource to be created.
- storage
Account StringName The name of the Storage Account where the Container should be created. Changing this forces a new resource to be created.
- container
Access StringType The Access Level configured for this Container. Possible values are
blob
,container
orprivate
. Defaults toprivate
.- metadata Map<String>
A mapping of MetaData for this Container. All metadata keys should be lowercase.
- name String
The name of the Container which should be created within the Storage Account. Changing this forces a new resource to be created.
Outputs
All input properties are implicitly available as output properties. Additionally, the Container resource produces the following output properties:
- Has
Immutability boolPolicy Is there an Immutability Policy configured on this Storage Container?
- Has
Legal boolHold Is there a Legal Hold configured on this Storage Container?
- Id string
The provider-assigned unique ID for this managed resource.
- Resource
Manager stringId The Resource Manager ID of this Storage Container.
- Has
Immutability boolPolicy Is there an Immutability Policy configured on this Storage Container?
- Has
Legal boolHold Is there a Legal Hold configured on this Storage Container?
- Id string
The provider-assigned unique ID for this managed resource.
- Resource
Manager stringId The Resource Manager ID of this Storage Container.
- has
Immutability BooleanPolicy Is there an Immutability Policy configured on this Storage Container?
- has
Legal BooleanHold Is there a Legal Hold configured on this Storage Container?
- id String
The provider-assigned unique ID for this managed resource.
- resource
Manager StringId The Resource Manager ID of this Storage Container.
- has
Immutability booleanPolicy Is there an Immutability Policy configured on this Storage Container?
- has
Legal booleanHold Is there a Legal Hold configured on this Storage Container?
- id string
The provider-assigned unique ID for this managed resource.
- resource
Manager stringId The Resource Manager ID of this Storage Container.
- has_
immutability_ boolpolicy Is there an Immutability Policy configured on this Storage Container?
- has_
legal_ boolhold Is there a Legal Hold configured on this Storage Container?
- id str
The provider-assigned unique ID for this managed resource.
- resource_
manager_ strid The Resource Manager ID of this Storage Container.
- has
Immutability BooleanPolicy Is there an Immutability Policy configured on this Storage Container?
- has
Legal BooleanHold Is there a Legal Hold configured on this Storage Container?
- id String
The provider-assigned unique ID for this managed resource.
- resource
Manager StringId The Resource Manager ID of this Storage Container.
Look up Existing Container Resource
Get an existing Container 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?: ContainerState, opts?: CustomResourceOptions): Container
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
container_access_type: Optional[str] = None,
has_immutability_policy: Optional[bool] = None,
has_legal_hold: Optional[bool] = None,
metadata: Optional[Mapping[str, str]] = None,
name: Optional[str] = None,
resource_manager_id: Optional[str] = None,
storage_account_name: Optional[str] = None) -> Container
func GetContainer(ctx *Context, name string, id IDInput, state *ContainerState, opts ...ResourceOption) (*Container, error)
public static Container Get(string name, Input<string> id, ContainerState? state, CustomResourceOptions? opts = null)
public static Container get(String name, Output<String> id, ContainerState 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.
- Container
Access stringType The Access Level configured for this Container. Possible values are
blob
,container
orprivate
. Defaults toprivate
.- Has
Immutability boolPolicy Is there an Immutability Policy configured on this Storage Container?
- Has
Legal boolHold Is there a Legal Hold configured on this Storage Container?
- Metadata Dictionary<string, string>
A mapping of MetaData for this Container. All metadata keys should be lowercase.
- Name string
The name of the Container which should be created within the Storage Account. Changing this forces a new resource to be created.
- Resource
Manager stringId The Resource Manager ID of this Storage Container.
- Storage
Account stringName The name of the Storage Account where the Container should be created. Changing this forces a new resource to be created.
- Container
Access stringType The Access Level configured for this Container. Possible values are
blob
,container
orprivate
. Defaults toprivate
.- Has
Immutability boolPolicy Is there an Immutability Policy configured on this Storage Container?
- Has
Legal boolHold Is there a Legal Hold configured on this Storage Container?
- Metadata map[string]string
A mapping of MetaData for this Container. All metadata keys should be lowercase.
- Name string
The name of the Container which should be created within the Storage Account. Changing this forces a new resource to be created.
- Resource
Manager stringId The Resource Manager ID of this Storage Container.
- Storage
Account stringName The name of the Storage Account where the Container should be created. Changing this forces a new resource to be created.
- container
Access StringType The Access Level configured for this Container. Possible values are
blob
,container
orprivate
. Defaults toprivate
.- has
Immutability BooleanPolicy Is there an Immutability Policy configured on this Storage Container?
- has
Legal BooleanHold Is there a Legal Hold configured on this Storage Container?
- metadata Map<String,String>
A mapping of MetaData for this Container. All metadata keys should be lowercase.
- name String
The name of the Container which should be created within the Storage Account. Changing this forces a new resource to be created.
- resource
Manager StringId The Resource Manager ID of this Storage Container.
- storage
Account StringName The name of the Storage Account where the Container should be created. Changing this forces a new resource to be created.
- container
Access stringType The Access Level configured for this Container. Possible values are
blob
,container
orprivate
. Defaults toprivate
.- has
Immutability booleanPolicy Is there an Immutability Policy configured on this Storage Container?
- has
Legal booleanHold Is there a Legal Hold configured on this Storage Container?
- metadata {[key: string]: string}
A mapping of MetaData for this Container. All metadata keys should be lowercase.
- name string
The name of the Container which should be created within the Storage Account. Changing this forces a new resource to be created.
- resource
Manager stringId The Resource Manager ID of this Storage Container.
- storage
Account stringName The name of the Storage Account where the Container should be created. Changing this forces a new resource to be created.
- container_
access_ strtype The Access Level configured for this Container. Possible values are
blob
,container
orprivate
. Defaults toprivate
.- has_
immutability_ boolpolicy Is there an Immutability Policy configured on this Storage Container?
- has_
legal_ boolhold Is there a Legal Hold configured on this Storage Container?
- metadata Mapping[str, str]
A mapping of MetaData for this Container. All metadata keys should be lowercase.
- name str
The name of the Container which should be created within the Storage Account. Changing this forces a new resource to be created.
- resource_
manager_ strid The Resource Manager ID of this Storage Container.
- storage_
account_ strname The name of the Storage Account where the Container should be created. Changing this forces a new resource to be created.
- container
Access StringType The Access Level configured for this Container. Possible values are
blob
,container
orprivate
. Defaults toprivate
.- has
Immutability BooleanPolicy Is there an Immutability Policy configured on this Storage Container?
- has
Legal BooleanHold Is there a Legal Hold configured on this Storage Container?
- metadata Map<String>
A mapping of MetaData for this Container. All metadata keys should be lowercase.
- name String
The name of the Container which should be created within the Storage Account. Changing this forces a new resource to be created.
- resource
Manager StringId The Resource Manager ID of this Storage Container.
- storage
Account StringName The name of the Storage Account where the Container should be created. Changing this forces a new resource to be created.
Import
Storage Containers can be imported using the resource id
, e.g.
$ pulumi import azure:storage/container:Container container1 https://example.blob.core.windows.net/container
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
azurerm
Terraform Provider.