-
Notifications
You must be signed in to change notification settings - Fork 2
/
README.tfdoc.hcl
1004 lines (896 loc) · 37.7 KB
/
README.tfdoc.hcl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
header {
image = "https://raw.githubusercontent.com/mineiros-io/brand/3bffd30e8bdbbde32c143e2650b2faa55f1df3ea/mineiros-primary-logo.svg"
url = "https://mineiros.io/?ref=terraform-google-pubsub-topic"
badge "build" {
image = "https://github.com/mineiros-io/terraform-google-pubsub-topic/workflows/Tests/badge.svg"
url = "https://github.com/mineiros-io/terraform-google-pubsub-topic/actions"
text = "Build Status"
}
badge "semver" {
image = "https://img.shields.io/github/v/tag/mineiros-io/terraform-google-pubsub-topic.svg?label=latest&sort=semver"
url = "https://github.com/mineiros-io/terraform-google-pubsub-topic/releases"
text = "GitHub tag (latest SemVer)"
}
badge "terraform" {
image = "https://img.shields.io/badge/Terraform-1.x-623CE4.svg?logo=terraform"
url = "https://github.com/hashicorp/terraform/releases"
text = "Terraform Version"
}
badge "tf-gcp-provider" {
image = "https://img.shields.io/badge/google-4-1A73E8.svg?logo=terraform"
url = "https://github.com/terraform-providers/terraform-provider-google/releases"
text = "Google Provider Version"
}
badge "slack" {
image = "https://img.shields.io/badge/slack-@mineiros--community-f32752.svg?logo=slack"
url = "https://mineiros.io/slack"
text = "Join Slack"
}
}
section {
title = "terraform-google-pubsub-topic"
toc = true
content = <<-END
A [Terraform](https://www.terraform.io) module for creating and managing a
[Cloud Pub/Sub](https://cloud.google.com/pubsub) resource on
[Google Cloud](https://cloud.google.com/)
**_This module supports Terraform version 1
and is compatible with the Terraform Google Provider version 5_**
This module is part of our Infrastructure as Code (IaC) framework
that enables our users and customers to easily deploy and manage reusable,
secure, and production-grade cloud infrastructure.
END
section {
title = "Module Features"
content = <<-END
This module implements the following Terraform resources
- [`google_pubsub_topic`](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/pubsub_topic)
- [`google_pubsub_schema`](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/pubsub_schema)
and supports additional features of the following modules:
- [mineiros-io/terraform-google-pubsub-topic-iam](https://github.com/mineiros-io/terraform-google-pubsub-topic-iam)
- [mineiros-io/terraform-google-pubsub-subscription](https://github.com/mineiros-io/terraform-google-pubsub-subscription)
END
}
section {
title = "Getting Started"
content = <<-END
Most common usage of the module:
```hcl
module "terraform-google-pubsub-topic" {
source = "github.com/mineiros-io/terraform-google-pubsub-topic?ref=v1.2.0"
name = "pub-sub-topic-name"
project = "id-of-project"
}
```
END
}
section {
title = "Module Argument Reference"
content = <<-END
See [variables.tf] and [examples/] for details and use-cases.
END
section {
title = "Main Resource Configuration"
variable "name" {
required = true
type = string
description = <<-END
The name of the Cloud Pub/Sub Topic.
END
}
variable "project" {
required = true
type = string
description = <<-END
The project in which the resource belongs. If it is not provided, the
provider project is used.
END
}
variable "labels" {
type = map(string)
default = {}
description = <<-END
A map of labels to assign to the Pub/Sub topic.
END
}
variable "kms_key_name" {
type = string
description = <<-END
The resource name of the Cloud KMS CryptoKey to be used to protect
access to messages published on this topic. Your project's PubSub
service account
(`service-{{PROJECT_NUMBER}}@gcp-sa-pubsub.iam.gserviceaccount.com`)
must have `roles/cloudkms.cryptoKeyEncrypterDecrypter` to use this
feature. The expected format is
`projects/*/locations/*/keyRings/*/cryptoKeys/*`
END
}
variable "message_retention_duration" {
type = string
description = <<-END
Indicates the minimum duration to retain a message after it is published to the topic.
If this field is set, messages published to the topic in the last messageRetentionDuration are always available to subscribers.
For instance, it allows any attached subscription to seek to a timestamp that is up to messageRetentionDuration in the past.
If this field is not set, message retention is controlled by settings on individual subscriptions.
Cannot be more than 7 days or less than 10 minutes.
END
}
variable "allowed_persistence_regions" {
type = set(string)
default = []
description = <<-END
A list of IDs of GCP regions where messages that are published to the
topic may be persisted in storage. Messages published by publishers
running in non-allowed GCP regions (or running outside of GCP
altogether) will be routed for storage in one of the allowed regions.
An empty list means that no regions are allowed, and is not a valid
configuration.
END
}
}
section {
title = "Extended Resource Configuration"
variable "iam" {
type = list(iam)
default = []
description = <<-END
List of IAM access roles to grant to a set of identities on the topic.
END
attribute "role" {
type = string
description = <<-END
The role that should be applied. Only one
`google_pubsub_subscription_iam_binding` can be used per role.
Note that custom roles must be of the format
`[projects|organizations]/{parent-name}/roles/{role-name}`.
END
}
attribute "roles" {
type = list(string)
description = <<-END
A list of roles that should be applied.
This is a shortcut if a set of members should be assigned to the same roles.
If `role` is set in addition, the list will be extended by the role.
Each role can only be defined once withing the list of IAM objects.
Note that custom roles must be of the format `[projects|organizations]/{parent-name}/roles/{role-name}`.
END
}
attribute "members" {
type = set(string)
default = []
description = <<-END
Identities that will be granted the privilege in role. Each entry
can have one of the following values:
- `allUsers`: A special identifier that represents anyone who is on
the internet; with or without a Google account.
- `allAuthenticatedUsers`: A special identifier that represents
anyone who is authenticated with a Google account or a service
account.
- `user:{emailid}`: An email address that represents a specific
Google account. For example, `alice@gmail.com` or `joe@example.com`.
- `serviceAccount:{emailid}`: An email address that represents a
service account. For example,
`my-other-app@appspot.gserviceaccount.com`.
- `group:{emailid}`: An email address that represents a Google
group. For example, `admins@example.com`.
- `domain:{domain}`: A G Suite domain (primary, instead of alias)
name that represents all the users of that domain. For example,
`google.com` or `example.com`.
- `computed:{identifier}`: An existing key from `var.computed_members_map`.
END
}
attribute "authoritative" {
type = bool
default = true
description = <<-END
Whether to exclusively set (authoritative mode) or add
(non-authoritative/additive mode) members to the role.
END
}
}
variable "computed_members_map" {
type = map(string)
description = <<-END
A map of members to replace in `members` of various IAM settings to handle terraform computed values.
END
default = {}
}
variable "schema" {
type = object(schema)
description = <<-END
A schema is a format that messages must follow, creating a contract between publisher and subscriber that Pub/Sub will enforce.
END
readme_example = <<-END
schema = {
name = "example"
type = "AVRO"
encoding = "JSON"
definition = jsonencode({
type = "record"
name = "Avro"
fields = [
{
name = "StringField"
type = "string"
},
{
name = "IntField"
type = "int"
}
]
})
}
END
attribute "id" {
type = string
description = <<-END
The resource ID of an existing schema to use.
Conflicts with `schema.name` and will be ignored if `schema.name` is set.
END
}
attribute "encoding" {
type = string
description = <<-END
The encoding of messages validated against schema.
Possible values are ENCODING_UNSPECIFIED, JSON, and BINARY.
END
default = "ENCODING_UNSPECIFIED"
}
attribute "name" {
type = string
description = <<-END
The ID to use for the schema, which will become the final component of the schema's resource name.
Conflicts with `schema.id`. If set a new schema resource will be created.
END
}
attribute "type" {
type = string
description = <<-END
The type of the schema definition Default value is TYPE_UNSPECIFIED. Possible values are TYPE_UNSPECIFIED, PROTOCOL_BUFFER, and AVRO.
Ignored if `schema.name` is not set.
END
}
attribute "definition" {
type = string
description = <<-END
The definition of the schema. This should contain a string representing the full definition of the schema that is a valid schema definition of the type specified in type.
Ignored if `schema.name` is not set.
END
}
}
variable "policy_bindings" {
type = list(policy_binding)
description = <<-END
A list of IAM policy bindings.
END
readme_example = <<-END
policy_bindings = [{
role = "roles/viewer"
members = ["user:member@example.com"]
}]
END
attribute "role" {
required = true
type = string
description = <<-END
The role that should be applied.
END
}
attribute "members" {
required = true
type = set(string)
description = <<-END
Identities that will be granted the privilege in `role`.
END
}
attribute "condition" {
type = object(condition)
description = <<-END
An IAM Condition for a given binding.
END
readme_example = <<-END
condition = {
expression = "request.time < timestamp(\"2022-01-01T00:00:00Z\")"
title = "expires_after_2021_12_31"
}
END
attribute "expression" {
required = true
type = string
description = <<-END
Textual representation of an expression in Common Expression Language syntax.
END
}
attribute "title" {
required = true
type = string
description = <<-END
A title for the expression, i.e. a short string describing its purpose.
END
}
attribute "description" {
type = string
description = <<-END
An optional description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.
END
}
}
}
variable "subscriptions" {
type = list(subscription)
default = []
description = <<-END
The list of the subscriptions that will be created for the PubSub
topic.
END
readme_example = <<-END
subscriptions = [
{
name = "my-subs"
# subscription settings
labels = {..}
ack_deadline_seconds = null
message_retention_duration = "604800s"
retain_acked_messages = null
filter = null
enable_message_ordering = null
# iam access (roles to grant identities on the subscription)
iam = [
{
role = "roles/pubsub.subscriber"
members = [...]
authoritative = true
}
]
},
]
END
attribute "name" {
required = true
type = string
description = <<-END
Name of the subscription.
END
}
attribute "labels" {
type = map(string)
description = <<-END
A set of key/value label pairs to assign to this Subscription.
END
}
attribute "ack_deadline_seconds" {
type = number
description = <<-END
This value is the maximum time after a subscriber receives a message
before the subscriber should acknowledge the message. After message
delivery but before the ack deadline expires and before the message
is acknowledged, it is an outstanding message and will not be
delivered again during that time (on a best-effort basis). For pull
subscriptions, this value is used as the initial value for the ack
deadline. To override this value for a given message, call
`subscriptions.modifyAckDeadline` with the corresponding `ackId` if
using pull. The minimum custom deadline you can specify is `10`
seconds. The maximum custom deadline you can specify is `600` seconds
(10 minutes). If this parameter is 0, a default value of `10` seconds
is used. For push delivery, this value is also used to set the
request timeout for the call to the push endpoint. If the subscriber
never acknowledges the message, the Pub/Sub system will eventually
redeliver the message.
END
}
attribute "message_retention_duration" {
type = string
description = <<-END
How long to retain unacknowledged messages in the subscription's
backlog, from the moment a message is published. If
`retainAckedMessages` is `true`, then this also configures the
retention of acknowledged messages, and thus configures how far back
in time a `subscriptions.seek` can be done. Defaults to 7 days.
Cannot be more than 7 days (`604800s`) or less than 10 minutes
(`600s`). A duration in seconds with up to nine fractional digits,
terminated by `s`.
END
}
attribute "retain_acked_messages" {
type = bool
description = <<-END
Indicates whether to retain acknowledged messages. If `true`, then
messages are not expunged from the subscription's backlog, even if
they are acknowledged, until they fall out of the
`messageRetentionDuration` window.
END
}
attribute "filter" {
type = string
description = <<-END
The subscription only delivers the messages that match the filter.
Pub/Sub automatically acknowledges the messages that don't match the
filter. You can filter messages by their attributes. The maximum
length of a filter is 256 bytes. After creating the subscription,
you can't modify the filter.
END
}
attribute "enable_message_ordering" {
type = bool
description = <<-END
If `true`, messages published with the same `orderingKey` in
`PubsubMessage` will be delivered to the subscribers in the order
in which they are received by the Pub/Sub system. Otherwise, they
may be delivered in any order.
END
}
attribute "expiration_policy_ttl" {
type = string
description = <<-END
A policy that specifies the conditions for this subscription's
expiration. A subscription is considered active as long as any
connected subscriber is successfully consuming messages from the
subscription or is issuing operations on the subscription. If
`expirationPolicy` is not set, a default policy with ttl of 31 days
will be used. If it is set but ttl is "", the resource never expires.
The minimum allowed value for `expirationPolicy.ttl` is 1 day.
END
}
attribute "dead_letter_policy" {
type = object(dead_letter_policy)
description = <<-END
A policy that specifies the conditions for dead lettering messages
in this subscription. If `dead_letter_policy` is not set, dead
lettering is disabled. The Cloud Pub/Sub service account associated
with this subscription's parent project (i.e.,
`service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com)`
must have permission to `Acknowledge()` messages on this
subscription.
END
attribute "dead_letter_topic" {
type = string
description = <<-END
The name of the topic to which dead letter messages should be
published. Format is `projects/{project}/topics/{topic}`. The Cloud
Pub/Sub service account associated with the enclosing subscription's
parent project (i.e.,
`service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com`)
must have permission to `Publish()` to this topic. The operation
will fail if the topic does not exist. Users should ensure that
there is a subscription attached to this topic since messages
published to a topic with no subscriptions are lost.
END
}
attribute "max_delivery_attempts" {
type = number
description = <<-END
The maximum number of delivery attempts for any message. The value
must be between 5 and 100. The number of delivery attempts is
defined as 1 + (the sum of number of NACKs and number of times the
acknowledgement deadline has been exceeded for the message). A NACK
is any call to `ModifyAckDeadline` with a 0 deadline. Note that
client libraries may automatically extend `ack_deadlines`. This
field will be honored on a best effort basis. If this parameter is
0, a default value of 5 is used.
END
}
}
attribute "retry_policy" {
type = object(retry_policy)
description = <<-END
A policy that specifies how Pub/Sub retries message delivery for this
subscription. If not set, the default retry policy is applied. This
generally implies that messages will be retried as soon as possible
for healthy subscribers. `RetryPolicy` will be triggered on NACKs or
acknowledgement deadline exceeded events for a given message.
END
attribute "minimum_backoff" {
type = string
description = <<-END
The minimum delay between consecutive deliveries of a given message.
Value should be between 0 and 600 seconds. A duration in seconds
with up to nine fractional digits, terminated by `s`.
END
readme_example = "3.5s"
}
attribute "maximum_backoff" {
type = string
description = <<-END
The maximum delay between consecutive deliveries of a given message.
Value should be between 0 and 600 seconds. A duration in seconds
with up to nine fractional digits, terminated by `s`.
END
readme_example = "3.5s"
}
}
attribute "push_config" {
type = object(push_config)
description = <<-END
If push delivery is used with this subscription, this field is used to
configure it. An empty `pushConfig` signifies that the subscriber will
pull and ack messages using API methods.
END
attribute "oidc_token" {
type = object(oidc_token)
description = <<-END
If specified, Pub/Sub will generate and attach an OIDC JWT token as
an Authorization header in the HTTP request for every pushed
message.
END
attribute "service_account_email" {
required = true
type = string
description = <<-END
Service account email to be used for generating the OIDC token.
The caller (for `subscriptions.create`, `subscriptions.patch`, and
`subscriptions.modifyPushConfig` RPCs) must have the
`iam.serviceAccounts.actAs` permission for the service account.
END
}
attribute "audience" {
type = string
description = <<-END
Audience to be used when generating OIDC token. The audience claim
identifies the recipients that the JWT is intended for. The
audience value is a single case-sensitive string. Having multiple
values (array) for the audience field is not supported. More info
about the OIDC JWT token audience here:
https://tools.ietf.org/html/rfc7519#section-4.1.3 Note: if not
specified, the Push endpoint URL will be used.
END
}
}
attribute "push_endpoint" {
required = true
type = string
description = <<-END
A URL locating the endpoint to which messages should be pushed. For
example, a Webhook endpoint might use "https://example.com/push".
END
}
attribute "attributes" {
required = true
type = string
description = <<-END
Endpoint configuration attributes. Every endpoint has a set of API
supported attributes that can be used to control different aspects
of the message delivery. The currently supported attribute is
`x-goog-version`, which you can use to change the format of the
pushed message. This attribute indicates the version of the data
expected by the endpoint. This controls the shape of the pushed
message (i.e., its fields and metadata). The endpoint version is
based on the version of the Pub/Sub API. If not present during the
`subscriptions.create` call, it will default to the version of the
API used to make such call. If not present during a
`subscriptions.modifyPushConfig` call, its value will not be
changed. `subscriptions.get` calls will always return a valid
version, even if the subscription was created without this
attribute. The possible values for this attribute are:
- v1beta1: uses the push format defined in the v1beta1 Pub/Sub API.
- v1 or v1beta2: uses the push format defined in the v1 Pub/Sub API.
END
}
attribute "bigquery_config" {
type = object(bigquery_config)
description = <<-END
If delivery to BigQuery is used with this subscription, this field is used to configure it.
Either `push_config` or `bigquery_config` can be set, but not both.
If both are empty, then the subscriber will pull and ack messages using API methods."
END
attribute "table" {
type = string
required = true
description = <<-END
The name of the table to which to write data, of the form `{projectId}.{datasetId}.{tableId}`
END
}
attribute "use_topic_schema" {
type = bool
description = <<-END
When `true`, use the topic's schema as the columns to write to in BigQuery, if it exists. Only one of use_topic_schema and use_table_schema can be set.
END
}
attribute "use_table_schema" {
type = bool
description = <<-END
When true, use the BigQuery table's schema as the columns to write to in BigQuery. Messages must be published in JSON format. Only one of use_topic_schema and use_table_schema can be set.
END
}
attribute "write_metadata" {
type = bool
description = <<-END
When `true`, write the subscription name, messageId, publishTime, attributes, and orderingKey to additional columns in the table. The subscription name, messageId, and publishTime fields are put in their own columns while all other message properties (other than data) are written to a JSON object in the attributes column.
END
}
attribute "drop_unknown_fields" {
type = bool
description = <<-END
When `true` and `use_topic_schema` is `true`, any fields that are a part of the topic schema that are not part of the BigQuery table schema are dropped when writing to BigQuery. Otherwise, the schemas must be kept in sync and any messages with extra fields are not written and remain in the subscription's backlog.
END
}
attribute "service_account_email" {
type = string
description = <<-END
The service account to use to write to BigQuery. If not specified, the Pub/Sub service agent, service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used.
END
}
}
}
attribute "cloud_storage_config" {
type = object(cloud_storage_config)
description = <<-END
If delivery to Cloud Storage is used with this subscription, this field is used to configure it. Either pushConfig, bigQueryConfig or cloudStorageConfig can be set, but not combined. If all three are empty, then the subscriber will pull and ack messages using API methods.
END
attribute "bucket" {
type = string
required = true
description = <<-END
User-provided name for the Cloud Storage bucket. The bucket must be created by the user.
The bucket name must be without any prefix like "gs://".
END
}
attribute "filename_prefix" {
type = string
description = <<-END
(Optional) User-provided prefix for Cloud Storage filename.
END
}
attribute "filename_suffix" {
type = string
description = <<-END
(Optional) User-provided suffix for Cloud Storage filename. Must not end in "/".
END
}
attribute "max_duration" {
type = string
description = <<-END
(Optional) The maximum duration that can elapse before a new Cloud Storage file is created.
Min 1 minute, max 10 minutes, default 5 minutes. May not exceed the subscription's acknowledgement deadline.
A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".
END
}
attribute "max_bytes" {
type = number
description = <<-END
(Optional) The maximum bytes that can be written to a Cloud Storage file before a new file is created.
Min 1 KB, max 10 GiB. The maxBytes limit may be exceeded in cases where messages are larger than the limit.
END
}
attribute "avro_config" {
type = object(avro_config)
description = <<-END
If set, message data will be written to Cloud Storage in Avro format.
END
attribute "write_metadata" {
type = bool
description = <<-END
When true, write the subscription name, messageId, publishTime, attributes, and orderingKey as additional fields in the output.
END
}
}
}
attribute "iam" {
type = list(iam)
default = []
description = <<-END
List of IAM access roles to grant to a set of identities on the subscription.
END
attribute "role" {
type = string
description = <<-END
The role that should be applied. Only one
`google_pubsub_subscription_iam_binding` can be used per role.
Note that custom roles must be of the format
`[projects|organizations]/{parent-name}/roles/{role-name}`.
END
}
attribute "members" {
type = set(string)
default = []
description = <<-END
Identities that will be granted the privilege in role. Each entry
can have one of the following values:
- `allUsers`: A special identifier that represents anyone who is on
the internet; with or without a Google account.
- `allAuthenticatedUsers`: A special identifier that represents
anyone who is authenticated with a Google account or a service
account.
- `user:{emailid}`: An email address that represents a specific
Google account. For example, `alice@gmail.com` or `joe@example.com`.
- `serviceAccount:{emailid}`: An email address that represents a
service account. For example,
`my-other-app@appspot.gserviceaccount.com`.
- `group:{emailid}`: An email address that represents a Google
group. For example, `admins@example.com`.
- `domain:{domain}`: A G Suite domain (primary, instead of alias)
name that represents all the users of that domain. For example,
`google.com` or `example.com`.
END
}
attribute "authoritative" {
type = bool
default = true
description = <<-END
Whether to exclusively set (authoritative mode) or add
(non-authoritative/additive mode) members to the role.
END
}
}
}
}
section {
title = "Module Configuration"
variable "module_enabled" {
type = bool
default = true
description = <<-END
Specifies whether resources in the module will be created.
END
}
variable "module_depends_on" {
type = list(dependency)
description = <<-END
A list of dependencies.
Any object can be _assigned_ to this list to define a hidden external dependency.
END
default = []
readme_example = <<-END
module_depends_on = [
null_resource.name
]
END
}
}
}
section {
title = "Module Outputs"
content = <<-END
The following attributes are exported in the outputs of the module:
END
output "topic" {
type = object(topic)
description = <<-END
The created pub sub resource.
END
}
output "iam" {
type = list(iam)
description = <<-END
The iam resource objects that define access to the GCS bucket.
END
}
output "subscription" {
type = object(subscription)
description = <<-END
All attributes of the created subscription.
END
}
output "module_enabled" {
type = bool
description = <<-END
Whether this module is enabled.
END
}
}
section {
title = "External Documentation"
section {
title = "Google Documentation"
content = <<-END
- https://cloud.google.com/pubsub
END
}
section {
title = "Terraform GCP Provider Documentation"
content = <<-END
- https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/pubsub_topic
END
}
}
section {
title = "Module Versioning"
content = <<-END
This Module follows the principles of [Semantic Versioning (SemVer)].
Given a version number `MAJOR.MINOR.PATCH`, we increment the:
1. `MAJOR` version when we make incompatible changes,
2. `MINOR` version when we add functionality in a backwards compatible manner, and
3. `PATCH` version when we make backwards compatible bug fixes.
END
section {
title = "Backwards compatibility in `0.0.z` and `0.y.z` version"
content = <<-END
- Backwards compatibility in versions `0.0.z` is **not guaranteed** when `z` is increased. (Initial development)
- Backwards compatibility in versions `0.y.z` is **not guaranteed** when `y` is increased. (Pre-release)
END
}
}
section {
title = "About Mineiros"
content = <<-END
[Mineiros][homepage] is a remote-first company headquartered in Berlin, Germany
that solves development, automation and security challenges in cloud infrastructure.
Our vision is to massively reduce time and overhead for teams to manage and
deploy production-grade and secure cloud infrastructure.
We offer commercial support for all of our modules and encourage you to reach out
if you have any questions or need help. Feel free to email us at [hello@mineiros.io] or join our
[Community Slack channel][slack].
END
}
section {
title = "Reporting Issues"
content = <<-END
We use GitHub [Issues] to track community reported issues and missing features.
END
}
section {
title = "Contributing"
content = <<-END
Contributions are always encouraged and welcome! For the process of accepting changes, we use
[Pull Requests]. If you'd like more information, please see our [Contribution Guidelines].
END
}
section {
title = "Makefile Targets"
content = <<-END
This repository comes with a handy [Makefile].
Run `make help` to see details on each available target.
END
}
section {
title = "License"
content = <<-END
[![license][badge-license]][apache20]
This module is licensed under the Apache License Version 2.0, January 2004.
Please see [LICENSE] for full details.
Copyright © 2020-2022 [Mineiros GmbH][homepage]
END
}
}
references {
ref "homepage" {
value = "https://mineiros.io/?ref=terraform-google-pubsub-topic"
}
ref "hello@mineiros.io" {
value = " mailto:hello@mineiros.io"
}
ref "badge-license" {
value = "https://img.shields.io/badge/license-Apache%202.0-brightgreen.svg"
}
ref "releases-terraform" {
value = "https://github.com/hashicorp/terraform/releases"
}
ref "releases-aws-provider" {
value = "https://github.com/terraform-providers/terraform-provider-aws/releases"
}
ref "apache20" {
value = "https://opensource.org/licenses/Apache-2.0"
}
ref "slack" {
value = "https://mineiros.io/slack"
}
ref "terraform" {
value = "https://www.terraform.io"
}
ref "aws" {
value = "https://aws.amazon.com/"
}
ref "semantic versioning (semver)" {
value = "https://semver.org/"
}
ref "variables.tf" {
value = "https://github.com/mineiros-io/terraform-google-pubsub-topic/blob/main/variables.tf"
}
ref "examples/" {
value = "https://github.com/mineiros-io/terraform-google-pubsub-topic/blob/main/examples"
}
ref "issues" {
value = "https://github.com/mineiros-io/terraform-google-pubsub-topic/issues"
}
ref "license" {
value = "https://github.com/mineiros-io/terraform-google-pubsub-topic/blob/main/LICENSE"
}
ref "makefile" {
value = "https://github.com/mineiros-io/terraform-google-pubsub-topic/blob/main/Makefile"
}
ref "pull requests" {
value = "https://github.com/mineiros-io/terraform-google-pubsub-topic/pulls"
}