File tree 4 files changed +51
-2
lines changed
templates/terraform/examples
4 files changed +51
-2
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,12 @@ examples:
42
42
vars :
43
43
topic_name : ' example-topic'
44
44
subscription_name : ' example-subscription'
45
+ - !ruby/object:Provider::Terraform::Examples
46
+ name : ' pubsub_subscription_pull_filter'
47
+ primary_resource_id : ' example'
48
+ vars :
49
+ topic_name : ' example-topic'
50
+ subscription_name : ' example-subscription'
45
51
- !ruby/object:Provider::Terraform::Examples
46
52
name : ' pubsub_subscription_dead_letter'
47
53
primary_resource_id : ' example'
@@ -396,7 +402,7 @@ properties:
396
402
name : ' filter'
397
403
required : false
398
404
validation : !ruby/object:Provider::Terraform::Validation
399
- regex : ' ^. {0,256}$'
405
+ regex : ' ^[\s\S] {0,256}$'
400
406
description : |
401
407
The subscription only delivers the messages that match the filter.
402
408
Pub/Sub automatically acknowledges the messages that don't match the filter. You can filter messages
Original file line number Diff line number Diff line change @@ -56,6 +56,11 @@ examples:
56
56
vars :
57
57
topic_name : ' example-topic'
58
58
subscription_name : ' example-subscription'
59
+ - name : ' pubsub_subscription_pull_filter'
60
+ primary_resource_id : ' example'
61
+ vars :
62
+ topic_name : ' example-topic'
63
+ subscription_name : ' example-subscription'
59
64
- name : ' pubsub_subscription_dead_letter'
60
65
primary_resource_id : ' example'
61
66
vars :
@@ -402,7 +407,7 @@ properties:
402
407
required : false
403
408
immutable : true
404
409
validation :
405
- regex : ' ^. {0,256}$'
410
+ regex : ' ^[\s\S] {0,256}$'
406
411
- name : ' deadLetterPolicy'
407
412
type : NestedObject
408
413
description : |
Original file line number Diff line number Diff line change
1
+ resource "google_pubsub_topic" "{{$.PrimaryResourceId}}" {
2
+ name = "{{index $.Vars "topic_name"}}"
3
+ }
4
+
5
+ resource "google_pubsub_subscription" "{{$.PrimaryResourceId}}" {
6
+ name = "{{index $.Vars "subscription_name"}}"
7
+ topic = google_pubsub_topic.{{$.PrimaryResourceId}}.id
8
+
9
+ labels = {
10
+ foo = "bar"
11
+ }
12
+
13
+ filter = <<EOF
14
+ attributes.foo = "foo"
15
+ AND attributes.bar = "bar"
16
+ EOF
17
+
18
+ ack_deadline_seconds = 20
19
+ }
Original file line number Diff line number Diff line change
1
+ resource "google_pubsub_topic" "<%= ctx[:primary_resource_id] %> " {
2
+ name = "<%= ctx[:vars]['topic_name'] %> "
3
+ }
4
+
5
+ resource "google_pubsub_subscription" "<%= ctx[:primary_resource_id] %> " {
6
+ name = "<%= ctx[:vars]['subscription_name'] %> "
7
+ topic = google_pubsub_topic.<%= ctx[:primary_resource_id] %> .id
8
+
9
+ labels = {
10
+ foo = "bar"
11
+ }
12
+
13
+ filter = < < EOF
14
+ attributes.foo = "foo "
15
+ AND attributes.bar = "bar "
16
+ EOF
17
+
18
+ ack_deadline_seconds = 20
19
+ }
You can’t perform that action at this time.
0 commit comments