import * as core from "@terrascript/core"; export interface TopicSubscriptionArgs extends core.ResourceArgs { /** * (Optional) Integer indicating number of minutes to wait in retrying mode for fetching subscription a * rn before marking it as failure. Only applicable for http and https protocols. Default is `1`. */ confirmationTimeoutInMinutes?: number | core.NumberOut; /** * (Optional) JSON String with the delivery policy (retries, backoff, etc.) that will be used in the su * bscription - this only applies to HTTP/S subscriptions. Refer to the [SNS docs](https://docs.aws.ama * zon.com/sns/latest/dg/DeliveryPolicies.html) for more details. */ deliveryPolicy?: string | core.StringOut; /** * (Required) Endpoint to send data to. The contents vary with the protocol. See details below. */ endpoint: string | core.StringOut; /** * (Optional) Whether the endpoint is capable of [auto confirming subscription](http://docs.aws.amazon. * com/sns/latest/dg/SendMessageToHttp.html#SendMessageToHttp.prepare) (e.g., PagerDuty). Default is `f * alse`. */ endpointAutoConfirms?: boolean | core.BooleanOut; /** * (Optional) JSON String with the filter policy that will be used in the subscription to filter messag * es seen by the target resource. Refer to the [SNS docs](https://docs.aws.amazon.com/sns/latest/dg/me * ssage-filtering.html) for more details. */ filterPolicy?: string | core.StringOut; /** * (Required) Protocol to use. Valid values are: `sqs`, `sms`, `lambda`, `firehose`, and `application`. * Protocols `email`, `email-json`, `http` and `https` are also valid but partially supported. See det * ails below. */ protocol: string | core.StringOut; /** * (Optional) Whether to enable raw message delivery (the original message is directly passed, not wrap * ped in JSON with the original message in the message property). Default is `false`. */ rawMessageDelivery?: boolean | core.BooleanOut; /** * (Optional) JSON String with the redrive policy that will be used in the subscription. Refer to the [ * SNS docs](https://docs.aws.amazon.com/sns/latest/dg/sns-dead-letter-queues.html#how-messages-moved-i * nto-dead-letter-queue) for more details. */ redrivePolicy?: string | core.StringOut; /** * (Required if `protocol` is `firehose`) ARN of the IAM role to publish to Kinesis Data Firehose deliv * ery stream. Refer to [SNS docs](https://docs.aws.amazon.com/sns/latest/dg/sns-firehose-as-subscriber * .html). */ subscriptionRoleArn?: string | core.StringOut; /** * (Required) ARN of the SNS topic to subscribe to. */ topicArn: string | core.StringOut; } export class TopicSubscription extends core.Resource { /** * ARN of the subscription. */ @core.attr(String, { computed: true }) public arn!: string | core.StringOut; /** * (Optional) Integer indicating number of minutes to wait in retrying mode for fetching subscription a * rn before marking it as failure. Only applicable for http and https protocols. Default is `1`. */ @core.attr(Number) public confirmationTimeoutInMinutes?: number | core.NumberOut; /** * Whether the subscription confirmation request was authenticated. */ @core.attr(Boolean, { computed: true }) public confirmationWasAuthenticated!: boolean | core.BooleanOut; /** * (Optional) JSON String with the delivery policy (retries, backoff, etc.) that will be used in the su * bscription - this only applies to HTTP/S subscriptions. Refer to the [SNS docs](https://docs.aws.ama * zon.com/sns/latest/dg/DeliveryPolicies.html) for more details. */ @core.attr(String) public deliveryPolicy?: string | core.StringOut; /** * (Required) Endpoint to send data to. The contents vary with the protocol. See details below. */ @core.attr(String) public endpoint!: string | core.StringOut; /** * (Optional) Whether the endpoint is capable of [auto confirming subscription](http://docs.aws.amazon. * com/sns/latest/dg/SendMessageToHttp.html#SendMessageToHttp.prepare) (e.g., PagerDuty). Default is `f * alse`. */ @core.attr(Boolean) public endpointAutoConfirms?: boolean | core.BooleanOut; /** * (Optional) JSON String with the filter policy that will be used in the subscription to filter messag * es seen by the target resource. Refer to the [SNS docs](https://docs.aws.amazon.com/sns/latest/dg/me * ssage-filtering.html) for more details. */ @core.attr(String) public filterPolicy?: string | core.StringOut; /** * ARN of the subscription. */ @core.attr(String, { computed: true }) public id!: string | core.StringOut; /** * AWS account ID of the subscription's owner. */ @core.attr(String, { computed: true }) public ownerId!: string | core.StringOut; /** * Whether the subscription has not been confirmed. */ @core.attr(Boolean, { computed: true }) public pendingConfirmation!: boolean | core.BooleanOut; /** * (Required) Protocol to use. Valid values are: `sqs`, `sms`, `lambda`, `firehose`, and `application`. * Protocols `email`, `email-json`, `http` and `https` are also valid but partially supported. See det * ails below. */ @core.attr(String) public protocol!: string | core.StringOut; /** * (Optional) Whether to enable raw message delivery (the original message is directly passed, not wrap * ped in JSON with the original message in the message property). Default is `false`. */ @core.attr(Boolean) public rawMessageDelivery?: boolean | core.BooleanOut; /** * (Optional) JSON String with the redrive policy that will be used in the subscription. Refer to the [ * SNS docs](https://docs.aws.amazon.com/sns/latest/dg/sns-dead-letter-queues.html#how-messages-moved-i * nto-dead-letter-queue) for more details. */ @core.attr(String) public redrivePolicy?: string | core.StringOut; /** * (Required if `protocol` is `firehose`) ARN of the IAM role to publish to Kinesis Data Firehose deliv * ery stream. Refer to [SNS docs](https://docs.aws.amazon.com/sns/latest/dg/sns-firehose-as-subscriber * .html). */ @core.attr(String) public subscriptionRoleArn?: string | core.StringOut; /** * (Required) ARN of the SNS topic to subscribe to. */ @core.attr(String) public topicArn!: string | core.StringOut; constructor(name: string, args?: TopicSubscriptionArgs) { super(name, "aws_sns_topic_subscription", args); } public override getNamespace(): string { return "aws_sns"; } }