We recommend using Azure Native.
azure.storage.Queue
Manages a Queue within an Azure Storage Account.
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 exampleAccount = new azure.storage.Account("example", {
name: "examplestorageacc",
resourceGroupName: example.name,
location: example.location,
accountTier: "Standard",
accountReplicationType: "LRS",
});
const exampleQueue = new azure.storage.Queue("example", {
name: "mysamplequeue",
storageAccountName: exampleAccount.name,
});
import pulumi
import pulumi_azure as azure
example = azure.core.ResourceGroup("example",
name="example-resources",
location="West Europe")
example_account = azure.storage.Account("example",
name="examplestorageacc",
resource_group_name=example.name,
location=example.location,
account_tier="Standard",
account_replication_type="LRS")
example_queue = azure.storage.Queue("example",
name="mysamplequeue",
storage_account_name=example_account.name)
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/storage"
"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
}
exampleAccount, err := storage.NewAccount(ctx, "example", &storage.AccountArgs{
Name: pulumi.String("examplestorageacc"),
ResourceGroupName: example.Name,
Location: example.Location,
AccountTier: pulumi.String("Standard"),
AccountReplicationType: pulumi.String("LRS"),
})
if err != nil {
return err
}
_, err = storage.NewQueue(ctx, "example", &storage.QueueArgs{
Name: pulumi.String("mysamplequeue"),
StorageAccountName: exampleAccount.Name,
})
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 exampleAccount = new Azure.Storage.Account("example", new()
{
Name = "examplestorageacc",
ResourceGroupName = example.Name,
Location = example.Location,
AccountTier = "Standard",
AccountReplicationType = "LRS",
});
var exampleQueue = new Azure.Storage.Queue("example", new()
{
Name = "mysamplequeue",
StorageAccountName = exampleAccount.Name,
});
});
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.Queue;
import com.pulumi.azure.storage.QueueArgs;
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 exampleAccount = new Account("exampleAccount", AccountArgs.builder()
.name("examplestorageacc")
.resourceGroupName(example.name())
.location(example.location())
.accountTier("Standard")
.accountReplicationType("LRS")
.build());
var exampleQueue = new Queue("exampleQueue", QueueArgs.builder()
.name("mysamplequeue")
.storageAccountName(exampleAccount.name())
.build());
}
}
resources:
example:
type: azure:core:ResourceGroup
properties:
name: example-resources
location: West Europe
exampleAccount:
type: azure:storage:Account
name: example
properties:
name: examplestorageacc
resourceGroupName: ${example.name}
location: ${example.location}
accountTier: Standard
accountReplicationType: LRS
exampleQueue:
type: azure:storage:Queue
name: example
properties:
name: mysamplequeue
storageAccountName: ${exampleAccount.name}
API Providers
This resource uses the following Azure API Providers:
Microsoft.Storage- 2023-05-01
Create Queue Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Queue(name: string, args?: QueueArgs, opts?: CustomResourceOptions);@overload
def Queue(resource_name: str,
args: Optional[QueueArgs] = None,
opts: Optional[ResourceOptions] = None)
@overload
def Queue(resource_name: str,
opts: Optional[ResourceOptions] = None,
metadata: Optional[Mapping[str, str]] = None,
name: Optional[str] = None,
storage_account_id: Optional[str] = None,
storage_account_name: Optional[str] = None)func NewQueue(ctx *Context, name string, args *QueueArgs, opts ...ResourceOption) (*Queue, error)public Queue(string name, QueueArgs? args = null, CustomResourceOptions? opts = null)type: azure:storage:Queue
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 QueueArgs
- 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 QueueArgs
- 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 QueueArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args QueueArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args QueueArgs
- 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 azureQueueResource = new Azure.Storage.Queue("azureQueueResource", new()
{
Metadata =
{
{ "string", "string" },
},
Name = "string",
StorageAccountId = "string",
});
example, err := storage.NewQueue(ctx, "azureQueueResource", &storage.QueueArgs{
Metadata: pulumi.StringMap{
"string": pulumi.String("string"),
},
Name: pulumi.String("string"),
StorageAccountId: pulumi.String("string"),
})
var azureQueueResource = new com.pulumi.azure.storage.Queue("azureQueueResource", com.pulumi.azure.storage.QueueArgs.builder()
.metadata(Map.of("string", "string"))
.name("string")
.storageAccountId("string")
.build());
azure_queue_resource = azure.storage.Queue("azureQueueResource",
metadata={
"string": "string",
},
name="string",
storage_account_id="string")
const azureQueueResource = new azure.storage.Queue("azureQueueResource", {
metadata: {
string: "string",
},
name: "string",
storageAccountId: "string",
});
type: azure:storage:Queue
properties:
metadata:
string: string
name: string
storageAccountId: string
Queue Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The Queue resource accepts the following input properties:
- Metadata Dictionary<string, string>
- A mapping of MetaData which should be assigned to this Storage Queue.
- Name string
- The name of the Queue which should be created within the Storage Account. Must be unique within the storage account the queue is located. Changing this forces a new resource to be created.
- Storage
Account stringId The name of the Storage Account where the Storage Queue should be created. Changing this forces a new resource to be created.
Note: One of
storage_account_nameorstorage_account_idmust be specified. When specifyingstorage_account_idthe resource will use the Resource Manager API, rather than the Data Plane API.- Storage
Account stringName - The name of the Storage Account where the Storage Queue should be created. Changing this forces a new resource to be created. This property is deprecated in favour of
storage_account_id.
- Metadata map[string]string
- A mapping of MetaData which should be assigned to this Storage Queue.
- Name string
- The name of the Queue which should be created within the Storage Account. Must be unique within the storage account the queue is located. Changing this forces a new resource to be created.
- Storage
Account stringId The name of the Storage Account where the Storage Queue should be created. Changing this forces a new resource to be created.
Note: One of
storage_account_nameorstorage_account_idmust be specified. When specifyingstorage_account_idthe resource will use the Resource Manager API, rather than the Data Plane API.- Storage
Account stringName - The name of the Storage Account where the Storage Queue should be created. Changing this forces a new resource to be created. This property is deprecated in favour of
storage_account_id.
- metadata Map<String,String>
- A mapping of MetaData which should be assigned to this Storage Queue.
- name String
- The name of the Queue which should be created within the Storage Account. Must be unique within the storage account the queue is located. Changing this forces a new resource to be created.
- storage
Account StringId The name of the Storage Account where the Storage Queue should be created. Changing this forces a new resource to be created.
Note: One of
storage_account_nameorstorage_account_idmust be specified. When specifyingstorage_account_idthe resource will use the Resource Manager API, rather than the Data Plane API.- storage
Account StringName - The name of the Storage Account where the Storage Queue should be created. Changing this forces a new resource to be created. This property is deprecated in favour of
storage_account_id.
- metadata {[key: string]: string}
- A mapping of MetaData which should be assigned to this Storage Queue.
- name string
- The name of the Queue which should be created within the Storage Account. Must be unique within the storage account the queue is located. Changing this forces a new resource to be created.
- storage
Account stringId The name of the Storage Account where the Storage Queue should be created. Changing this forces a new resource to be created.
Note: One of
storage_account_nameorstorage_account_idmust be specified. When specifyingstorage_account_idthe resource will use the Resource Manager API, rather than the Data Plane API.- storage
Account stringName - The name of the Storage Account where the Storage Queue should be created. Changing this forces a new resource to be created. This property is deprecated in favour of
storage_account_id.
- metadata Mapping[str, str]
- A mapping of MetaData which should be assigned to this Storage Queue.
- name str
- The name of the Queue which should be created within the Storage Account. Must be unique within the storage account the queue is located. Changing this forces a new resource to be created.
- storage_
account_ strid The name of the Storage Account where the Storage Queue should be created. Changing this forces a new resource to be created.
Note: One of
storage_account_nameorstorage_account_idmust be specified. When specifyingstorage_account_idthe resource will use the Resource Manager API, rather than the Data Plane API.- storage_
account_ strname - The name of the Storage Account where the Storage Queue should be created. Changing this forces a new resource to be created. This property is deprecated in favour of
storage_account_id.
- metadata Map<String>
- A mapping of MetaData which should be assigned to this Storage Queue.
- name String
- The name of the Queue which should be created within the Storage Account. Must be unique within the storage account the queue is located. Changing this forces a new resource to be created.
- storage
Account StringId The name of the Storage Account where the Storage Queue should be created. Changing this forces a new resource to be created.
Note: One of
storage_account_nameorstorage_account_idmust be specified. When specifyingstorage_account_idthe resource will use the Resource Manager API, rather than the Data Plane API.- storage
Account StringName - The name of the Storage Account where the Storage Queue should be created. Changing this forces a new resource to be created. This property is deprecated in favour of
storage_account_id.
Outputs
All input properties are implicitly available as output properties. Additionally, the Queue resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Resource
Manager stringId - The Resource Manager ID of this Storage Queue.
- Url string
- The data plane URL of the Storage Queue in the format of
<storage queue endpoint>/<queue name>. E.g.https://example.queue.core.windows.net/queue1.
- Id string
- The provider-assigned unique ID for this managed resource.
- Resource
Manager stringId - The Resource Manager ID of this Storage Queue.
- Url string
- The data plane URL of the Storage Queue in the format of
<storage queue endpoint>/<queue name>. E.g.https://example.queue.core.windows.net/queue1.
- id String
- The provider-assigned unique ID for this managed resource.
- resource
Manager StringId - The Resource Manager ID of this Storage Queue.
- url String
- The data plane URL of the Storage Queue in the format of
<storage queue endpoint>/<queue name>. E.g.https://example.queue.core.windows.net/queue1.
- id string
- The provider-assigned unique ID for this managed resource.
- resource
Manager stringId - The Resource Manager ID of this Storage Queue.
- url string
- The data plane URL of the Storage Queue in the format of
<storage queue endpoint>/<queue name>. E.g.https://example.queue.core.windows.net/queue1.
- id str
- The provider-assigned unique ID for this managed resource.
- resource_
manager_ strid - The Resource Manager ID of this Storage Queue.
- url str
- The data plane URL of the Storage Queue in the format of
<storage queue endpoint>/<queue name>. E.g.https://example.queue.core.windows.net/queue1.
- id String
- The provider-assigned unique ID for this managed resource.
- resource
Manager StringId - The Resource Manager ID of this Storage Queue.
- url String
- The data plane URL of the Storage Queue in the format of
<storage queue endpoint>/<queue name>. E.g.https://example.queue.core.windows.net/queue1.
Look up Existing Queue Resource
Get an existing Queue 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?: QueueState, opts?: CustomResourceOptions): Queue@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
metadata: Optional[Mapping[str, str]] = None,
name: Optional[str] = None,
resource_manager_id: Optional[str] = None,
storage_account_id: Optional[str] = None,
storage_account_name: Optional[str] = None,
url: Optional[str] = None) -> Queuefunc GetQueue(ctx *Context, name string, id IDInput, state *QueueState, opts ...ResourceOption) (*Queue, error)public static Queue Get(string name, Input<string> id, QueueState? state, CustomResourceOptions? opts = null)public static Queue get(String name, Output<String> id, QueueState state, CustomResourceOptions options)resources: _: type: azure:storage:Queue get: id: ${id}- 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.
- Metadata Dictionary<string, string>
- A mapping of MetaData which should be assigned to this Storage Queue.
- Name string
- The name of the Queue which should be created within the Storage Account. Must be unique within the storage account the queue is located. Changing this forces a new resource to be created.
- Resource
Manager stringId - The Resource Manager ID of this Storage Queue.
- Storage
Account stringId The name of the Storage Account where the Storage Queue should be created. Changing this forces a new resource to be created.
Note: One of
storage_account_nameorstorage_account_idmust be specified. When specifyingstorage_account_idthe resource will use the Resource Manager API, rather than the Data Plane API.- Storage
Account stringName - The name of the Storage Account where the Storage Queue should be created. Changing this forces a new resource to be created. This property is deprecated in favour of
storage_account_id. - Url string
- The data plane URL of the Storage Queue in the format of
<storage queue endpoint>/<queue name>. E.g.https://example.queue.core.windows.net/queue1.
- Metadata map[string]string
- A mapping of MetaData which should be assigned to this Storage Queue.
- Name string
- The name of the Queue which should be created within the Storage Account. Must be unique within the storage account the queue is located. Changing this forces a new resource to be created.
- Resource
Manager stringId - The Resource Manager ID of this Storage Queue.
- Storage
Account stringId The name of the Storage Account where the Storage Queue should be created. Changing this forces a new resource to be created.
Note: One of
storage_account_nameorstorage_account_idmust be specified. When specifyingstorage_account_idthe resource will use the Resource Manager API, rather than the Data Plane API.- Storage
Account stringName - The name of the Storage Account where the Storage Queue should be created. Changing this forces a new resource to be created. This property is deprecated in favour of
storage_account_id. - Url string
- The data plane URL of the Storage Queue in the format of
<storage queue endpoint>/<queue name>. E.g.https://example.queue.core.windows.net/queue1.
- metadata Map<String,String>
- A mapping of MetaData which should be assigned to this Storage Queue.
- name String
- The name of the Queue which should be created within the Storage Account. Must be unique within the storage account the queue is located. Changing this forces a new resource to be created.
- resource
Manager StringId - The Resource Manager ID of this Storage Queue.
- storage
Account StringId The name of the Storage Account where the Storage Queue should be created. Changing this forces a new resource to be created.
Note: One of
storage_account_nameorstorage_account_idmust be specified. When specifyingstorage_account_idthe resource will use the Resource Manager API, rather than the Data Plane API.- storage
Account StringName - The name of the Storage Account where the Storage Queue should be created. Changing this forces a new resource to be created. This property is deprecated in favour of
storage_account_id. - url String
- The data plane URL of the Storage Queue in the format of
<storage queue endpoint>/<queue name>. E.g.https://example.queue.core.windows.net/queue1.
- metadata {[key: string]: string}
- A mapping of MetaData which should be assigned to this Storage Queue.
- name string
- The name of the Queue which should be created within the Storage Account. Must be unique within the storage account the queue is located. Changing this forces a new resource to be created.
- resource
Manager stringId - The Resource Manager ID of this Storage Queue.
- storage
Account stringId The name of the Storage Account where the Storage Queue should be created. Changing this forces a new resource to be created.
Note: One of
storage_account_nameorstorage_account_idmust be specified. When specifyingstorage_account_idthe resource will use the Resource Manager API, rather than the Data Plane API.- storage
Account stringName - The name of the Storage Account where the Storage Queue should be created. Changing this forces a new resource to be created. This property is deprecated in favour of
storage_account_id. - url string
- The data plane URL of the Storage Queue in the format of
<storage queue endpoint>/<queue name>. E.g.https://example.queue.core.windows.net/queue1.
- metadata Mapping[str, str]
- A mapping of MetaData which should be assigned to this Storage Queue.
- name str
- The name of the Queue which should be created within the Storage Account. Must be unique within the storage account the queue is located. Changing this forces a new resource to be created.
- resource_
manager_ strid - The Resource Manager ID of this Storage Queue.
- storage_
account_ strid The name of the Storage Account where the Storage Queue should be created. Changing this forces a new resource to be created.
Note: One of
storage_account_nameorstorage_account_idmust be specified. When specifyingstorage_account_idthe resource will use the Resource Manager API, rather than the Data Plane API.- storage_
account_ strname - The name of the Storage Account where the Storage Queue should be created. Changing this forces a new resource to be created. This property is deprecated in favour of
storage_account_id. - url str
- The data plane URL of the Storage Queue in the format of
<storage queue endpoint>/<queue name>. E.g.https://example.queue.core.windows.net/queue1.
- metadata Map<String>
- A mapping of MetaData which should be assigned to this Storage Queue.
- name String
- The name of the Queue which should be created within the Storage Account. Must be unique within the storage account the queue is located. Changing this forces a new resource to be created.
- resource
Manager StringId - The Resource Manager ID of this Storage Queue.
- storage
Account StringId The name of the Storage Account where the Storage Queue should be created. Changing this forces a new resource to be created.
Note: One of
storage_account_nameorstorage_account_idmust be specified. When specifyingstorage_account_idthe resource will use the Resource Manager API, rather than the Data Plane API.- storage
Account StringName - The name of the Storage Account where the Storage Queue should be created. Changing this forces a new resource to be created. This property is deprecated in favour of
storage_account_id. - url String
- The data plane URL of the Storage Queue in the format of
<storage queue endpoint>/<queue name>. E.g.https://example.queue.core.windows.net/queue1.
Import
Storage Queue’s can be imported using the resource id, e.g.
If storage_account_name is used:
$ pulumi import azure:storage/queue:Queue queue1 https://example.queue.core.windows.net/queue1
If storage_account_id is used:
$ pulumi import azure:storage/queue:Queue queue1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup/providers/Microsoft.Storage/storageAccounts/myaccount/queueServices/default/queues
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
azurermTerraform Provider.
