![]() ![]() Application endpoints are also the endpoint ARN for the mobile app and device.SQS endpoints come in the form of the SQS queue's ARN (not the URL of the queue) e.g: arn:aws:sqs:us-west-2:432981146916:terraform-queue-too.Specifying endpointsĮndpoints have different format requirements according to the protocol that is chosen. This breaks the Terraform model and as a result are not currently supported. These are unsupported because the endpoint needs to be authorized and does not generate an ARN until the target email address has been validated. email-json - delivery of JSON-encoded message via SMTP.Unsupported protocols include the following: Supported only for the end points that auto confirms the subscription. https - delivery of JSON-encoded messages via HTTPS. ![]() http - delivery of JSON-encoded messages via HTTP.Partially supported SNS protocols include: application - delivery of JSON-encoded message to an EndpointArn for a mobile app and device.sqs - delivery of JSON-encoded message to an Amazon SQS queue.lambda - delivery of JSON-encoded message to a lambda function.filter_policy - (Optional) The text of a filter policy to the topic subscription.raw_message_delivery - (Optional) Boolean indicating whether or not to enable raw message delivery (the original message is directly passed, not wrapped in JSON with the original message in the message property) (default is false).Only applicable for http and https protocols (default is 1 minute). confirmation_timeout_in_minutes - (Optional) Integer indicating number of minutes to wait in retying mode for fetching subscription arn before marking it as failure.endpoint_auto_confirms - (Optional) Boolean indicating whether the end point is capable of auto confirming subscription e.g., PagerDuty (default is false).endpoint - (Required) The endpoint to send data to, the contents will vary with the protocol. ![]() ( http or https are partially supported, see below) ( email is option but unsupported, see below). The possible values for this are: sqs, sms, lambda, application. protocol - (Required) The protocol to use.topic_arn - (Required) The ARN of the SNS topic to subscribe to.You can directly supply a topic and ARN by hand in the topic_arn property along with the queue ARN: resource "aws_sns_topic_subscription" "user_updates_sqs_target" " ![]() NOTE: If SNS topic and SQS queue are in different AWS accounts and different AWS regions it is important to recognize that the subscription needs to be initiated from the account with the SQS queue but in the region of the SNS topic. If "aws_sns_topic_subscription" is using a Provider with a different account than the SNS topic, terraform creates the subscriptions but does not keep state and tries to re-create the subscription at every apply. NOTE: If SNS topic and SQS queue are in different AWS accounts but the same region it is important for the "aws_sns_topic_subscription" to use the AWS provider of the account with the SQS queue. NOTE: Setup of cross-account subscriptions from SNS topics to SQS queues requires Terraform to have access to BOTH accounts. If the "aws_sns_topic_subscription" is using a provider with a different region than the SNS topic, terraform will fail to create the subscription. NOTE: If the SNS topic and SQS queue are in different AWS regions, it is important for the "aws_sns_topic_subscription" to use an AWS provider that is in the same region of the SNS topic. The most likely use case for Terraform users will probably be SQS queues. This resource allows you to automatically place messages sent to SNS topics in SQS queues, send them as HTTP(S) POST requests to a given endpoint, send SMS messages, or notify devices / applications. Requires that an SNS topic exist for the subscription to attach to. Github Link: File: main.Provides a resource for subscribing to SNS topics. You will find the code on my Github repo on the following link. This will create an SQS in “ region = eu-west-3“, but if you want to create a queue in another region then you can change its value. Let’s create a file “ main.tf” that will contain the resource definition mentioned below. Write Terraform configuration files for SQS Queue
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |