Show / Hide Table of Contents

Class QueuePolicy

Allows you to set a policy of an SQS Queue while referencing ARN of the queue within the policy.

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
public MyStack()
{
    var queue = new Aws.Sqs.Queue("queue", new Aws.Sqs.QueueArgs
    {
    });
    var test = new Aws.Sqs.QueuePolicy("test", new Aws.Sqs.QueuePolicyArgs
    {
        Policy = queue.Arn.Apply(arn => @$"{{
""Version"": ""2012-10-17"",
""Id"": ""sqspolicy"",
""Statement"": [
{{
  ""Sid"": ""First"",
  ""Effect"": ""Allow"",
  ""Principal"": ""*"",
  ""Action"": ""sqs:SendMessage"",
  ""Resource"": ""{arn}"",
  ""Condition"": {{
    ""ArnEquals"": {{
      ""aws:SourceArn"": ""{aws_sns_topic.Example.Arn}""
    }}
  }}
}}
]
}}

"),
        QueueUrl = queue.Id,
    });
}

}
Inheritance
System.Object
Resource
CustomResource
QueuePolicy
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
Resource.Urn
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.Aws.Sqs
Assembly: Pulumi.Aws.dll
Syntax
public class QueuePolicy : CustomResource

Constructors

View Source

QueuePolicy(String, QueuePolicyArgs, CustomResourceOptions)

Create a QueuePolicy resource with the given unique name, arguments, and options.

Declaration
public QueuePolicy(string name, QueuePolicyArgs args, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resource

QueuePolicyArgs args

The arguments used to populate this resource's properties

CustomResourceOptions options

A bag of options that control this resource's behavior

Properties

View Source

Policy

The JSON policy for the SQS queue.

Declaration
public Output<string> Policy { get; }
Property Value
Type Description
Output<System.String>
View Source

QueueUrl

The URL of the SQS Queue to which to attach the policy

Declaration
public Output<string> QueueUrl { get; }
Property Value
Type Description
Output<System.String>

Methods

View Source

Get(String, Input<String>, QueuePolicyState, CustomResourceOptions)

Get an existing QueuePolicy resource's state with the given name, ID, and optional extra properties used to qualify the lookup.

Declaration
public static QueuePolicy Get(string name, Input<string> id, QueuePolicyState state = null, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resulting resource.

Input<System.String> id

The unique provider ID of the resource to lookup.

QueuePolicyState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

Returns
Type Description
QueuePolicy
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.