Package com.pulumi.aws.sqs
Class RedrivePolicy
- java.lang.Object
-
- com.pulumi.resources.Resource
-
- com.pulumi.resources.CustomResource
-
- com.pulumi.aws.sqs.RedrivePolicy
-
public class RedrivePolicy extends com.pulumi.resources.CustomResource
Allows you to set a redrive policy of an SQS Queue while referencing ARN of the dead letter queue inside the redrive policy. This is useful when you want to set a dedicated dead letter queue for a standard or FIFO queue, but need the dead letter queue to exist before setting the redrive policy. ## Example Usage ```java package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.aws.sqs.Queue; import com.pulumi.aws.sqs.QueueArgs; import com.pulumi.aws.sqs.RedrivePolicy; import com.pulumi.aws.sqs.RedrivePolicyArgs; import static com.pulumi.codegen.internal.Serialization.*; 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 queue = new Queue("queue"); var ddl = new Queue("ddl", QueueArgs.builder() .redriveAllowPolicy(queue.arn().applyValue(arn -> serializeJson( jsonObject( jsonProperty("redrivePermission", "byQueue"), jsonProperty("sourceQueueArns", jsonArray(arn)) )))) .build()); var redrivePolicy = new RedrivePolicy("redrivePolicy", RedrivePolicyArgs.builder() .queueUrl(queue.id()) .redrivePolicy(ddl.arn().applyValue(arn -> serializeJson( jsonObject( jsonProperty("deadLetterTargetArn", arn), jsonProperty("maxReceiveCount", 4) )))) .build()); } } ``` ## Import Using `pulumi import`, import SQS Queue Redrive Policies using the queue URL. For example: ```sh $ pulumi import aws:sqs/redrivePolicy:RedrivePolicy test https://queue.amazonaws.com/0123456789012/myqueue ```
-
-
Constructor Summary
Constructors Constructor Description RedrivePolicy(java.lang.String name)
RedrivePolicy(java.lang.String name, RedrivePolicyArgs args)
RedrivePolicy(java.lang.String name, RedrivePolicyArgs args, com.pulumi.resources.CustomResourceOptions options)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static RedrivePolicy
get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, RedrivePolicyState state, com.pulumi.resources.CustomResourceOptions options)
Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.com.pulumi.core.Output<java.lang.String>
queueUrl()
com.pulumi.core.Output<java.lang.String>
redrivePolicy()
-
-
-
Constructor Detail
-
RedrivePolicy
public RedrivePolicy(java.lang.String name)
- Parameters:
name
- The _unique_ name of the resulting resource.
-
RedrivePolicy
public RedrivePolicy(java.lang.String name, RedrivePolicyArgs args)
- Parameters:
name
- The _unique_ name of the resulting resource.args
- The arguments to use to populate this resource's properties.
-
RedrivePolicy
public RedrivePolicy(java.lang.String name, RedrivePolicyArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options)
- Parameters:
name
- The _unique_ name of the resulting resource.args
- The arguments to use to populate this resource's properties.options
- A bag of options that control this resource's behavior.
-
-
Method Detail
-
queueUrl
public com.pulumi.core.Output<java.lang.String> queueUrl()
- Returns:
- The URL of the SQS Queue to which to attach the policy
-
redrivePolicy
public com.pulumi.core.Output<java.lang.String> redrivePolicy()
- Returns:
- The JSON redrive policy for the SQS queue. Accepts two key/val pairs: `deadLetterTargetArn` and `maxReceiveCount`. Learn more in the [Amazon SQS dead-letter queues documentation](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html).
-
get
public static RedrivePolicy get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, @Nullable RedrivePolicyState state, @Nullable com.pulumi.resources.CustomResourceOptions options)
Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.- Parameters:
name
- The _unique_ name of the resulting resource.id
- The _unique_ provider ID of the resource to lookup.state
-options
- Optional settings to control the behavior of the CustomResource.
-
-