diff --git a/deployment/gcpresources/terraform/main.tf b/deployment/gcpresources/terraform/main.tf index 1cab8c9a..86aeaf31 100644 --- a/deployment/gcpresources/terraform/main.tf +++ b/deployment/gcpresources/terraform/main.tf @@ -100,6 +100,24 @@ resource "google_pubsub_subscription" "inventory_subscription" { enable_message_ordering = false } +resource "google_pubsub_subscription" "shipment_subscription" { + name = "shipment_subscription" + topic = google_pubsub_topic.shipment-notification.name + + # 20 minutes + message_retention_duration = "1200s" + retain_acked_messages = true + + ack_deadline_seconds = 20 + expiration_policy { + ttl = "300000.5s" + } + retry_policy { + minimum_backoff = "10s" + } + enable_message_ordering = false +} + #-----------------------GKE Cluster for applications---------------------------- resource "google_container_cluster" "car-demo-gke" { name = "car-demo-gke"