Skip to content

Commit f9e387d

Browse files
modular-magicianRiley
andauthored
Add eventarc trigger missing field event_data_content_type (#8235) (#6032)
* upgrade dcl version to v1.43.0 * add overrides samples for trigger event_data_content_type field * Fix typo * Upgrade dcl version to v1.47.0 * Upgrade dcl version to v1.48.0 to fix issues in previous version. --------- Signed-off-by: Modular Magician <[email protected]> Co-authored-by: Riley <[email protected]>
1 parent 3cd1e34 commit f9e387d

File tree

10 files changed

+460
-61
lines changed

10 files changed

+460
-61
lines changed

.changelog/8235.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:bug
2+
eventarc: added field `event_data_content_type` to `google_eventarc_trigger`
3+
```

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ go 1.19
33

44
require (
55
cloud.google.com/go/bigtable v1.19.0
6-
github.com/GoogleCloudPlatform/declarative-resource-client-library v1.44.0
6+
github.com/GoogleCloudPlatform/declarative-resource-client-library v1.48.0
77
github.com/apparentlymart/go-cidr v1.1.0
88
github.com/davecgh/go-spew v1.1.1
99
github.com/dnaeon/go-vcr v1.0.1

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ cloud.google.com/go/longrunning v0.5.0/go.mod h1:0JNuqRShmscVAhIACGtskSAWtqtOoPk
2121
cloud.google.com/go/longrunning v0.5.1 h1:Fr7TXftcqTudoyRJa113hyaqlGdiBQkp0Gq7tErFDWI=
2222
cloud.google.com/go/longrunning v0.5.1/go.mod h1:spvimkwdz6SPWKEt/XBij79E9fiTkHSQl/fRUUQJYJc=
2323
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
24-
github.com/GoogleCloudPlatform/declarative-resource-client-library v1.44.0 h1:hASUAck0/5j84kejIHGJjipjUzFHiN5edNMobKwj2HA=
25-
github.com/GoogleCloudPlatform/declarative-resource-client-library v1.44.0/go.mod h1:pL2Qt5HT+x6xrTd806oMiM3awW6kNIXB/iiuClz6m6k=
24+
github.com/GoogleCloudPlatform/declarative-resource-client-library v1.48.0 h1:+1lMwM8ZN8IGqYnSn2qh3Kb0fBBf9SwB+7yPBtcpNsM=
25+
github.com/GoogleCloudPlatform/declarative-resource-client-library v1.48.0/go.mod h1:pL2Qt5HT+x6xrTd806oMiM3awW6kNIXB/iiuClz6m6k=
2626
github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA=
2727
github.com/Microsoft/go-winio v0.4.16 h1:FtSW/jqD+l4ba5iPBj9CODVtgfYAD8w2wS923g/cFDk=
2828
github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0=

google-beta/resource_eventarc_trigger_generated_test.go

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -322,15 +322,16 @@ func testAccCheckEventarcTriggerDestroyProducer(t *testing.T) func(s *terraform.
322322
}
323323

324324
obj := &eventarc.Trigger{
325-
Location: dcl.String(rs.Primary.Attributes["location"]),
326-
Name: dcl.String(rs.Primary.Attributes["name"]),
327-
Channel: dcl.String(rs.Primary.Attributes["channel"]),
328-
Project: dcl.StringOrNil(rs.Primary.Attributes["project"]),
329-
ServiceAccount: dcl.String(rs.Primary.Attributes["service_account"]),
330-
CreateTime: dcl.StringOrNil(rs.Primary.Attributes["create_time"]),
331-
Etag: dcl.StringOrNil(rs.Primary.Attributes["etag"]),
332-
Uid: dcl.StringOrNil(rs.Primary.Attributes["uid"]),
333-
UpdateTime: dcl.StringOrNil(rs.Primary.Attributes["update_time"]),
325+
Location: dcl.String(rs.Primary.Attributes["location"]),
326+
Name: dcl.String(rs.Primary.Attributes["name"]),
327+
Channel: dcl.String(rs.Primary.Attributes["channel"]),
328+
EventDataContentType: dcl.String(rs.Primary.Attributes["event_data_content_type"]),
329+
Project: dcl.StringOrNil(rs.Primary.Attributes["project"]),
330+
ServiceAccount: dcl.String(rs.Primary.Attributes["service_account"]),
331+
CreateTime: dcl.StringOrNil(rs.Primary.Attributes["create_time"]),
332+
Etag: dcl.StringOrNil(rs.Primary.Attributes["etag"]),
333+
Uid: dcl.StringOrNil(rs.Primary.Attributes["uid"]),
334+
UpdateTime: dcl.StringOrNil(rs.Primary.Attributes["update_time"]),
334335
}
335336

336337
client := transport_tpg.NewDCLEventarcClient(config, config.UserAgent, billingProject, 0)

google-beta/services/clouddeploy/resource_clouddeploy_delivery_pipeline.go

Lines changed: 310 additions & 8 deletions
Large diffs are not rendered by default.

google-beta/services/dataplex/resource_dataplex_asset.go

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ func ResourceDataplexAsset() *schema.Resource {
9090
"resource_spec": {
9191
Type: schema.TypeList,
9292
Required: true,
93-
ForceNew: true,
9493
Description: "Required. Immutable. Specification of the resource that is referenced by this asset.",
9594
MaxItems: 1,
9695
Elem: DataplexAssetResourceSpecSchema(),
@@ -286,6 +285,13 @@ func DataplexAssetResourceSpecSchema() *schema.Resource {
286285
ForceNew: true,
287286
Description: "Immutable. Relative name of the cloud resource that contains the data that is being managed within a lake. For example: `projects/{project_number}/buckets/{bucket_id}` `projects/{project_number}/datasets/{dataset_id}`",
288287
},
288+
289+
"read_access_mode": {
290+
Type: schema.TypeString,
291+
Computed: true,
292+
Optional: true,
293+
Description: "Optional. Determines how read permissions are handled for each asset and their associated tables. Only available to storage buckets assets. Possible values: DIRECT, MANAGED",
294+
},
289295
},
290296
}
291297
}
@@ -788,8 +794,9 @@ func expandDataplexAssetResourceSpec(o interface{}) *dataplex.AssetResourceSpec
788794
}
789795
obj := objArr[0].(map[string]interface{})
790796
return &dataplex.AssetResourceSpec{
791-
Type: dataplex.AssetResourceSpecTypeEnumRef(obj["type"].(string)),
792-
Name: dcl.String(obj["name"].(string)),
797+
Type: dataplex.AssetResourceSpecTypeEnumRef(obj["type"].(string)),
798+
Name: dcl.String(obj["name"].(string)),
799+
ReadAccessMode: dataplex.AssetResourceSpecReadAccessModeEnumRef(obj["read_access_mode"].(string)),
793800
}
794801
}
795802

@@ -798,8 +805,9 @@ func flattenDataplexAssetResourceSpec(obj *dataplex.AssetResourceSpec) interface
798805
return nil
799806
}
800807
transformed := map[string]interface{}{
801-
"type": obj.Type,
802-
"name": obj.Name,
808+
"type": obj.Type,
809+
"name": obj.Name,
810+
"read_access_mode": obj.ReadAccessMode,
803811
}
804812

805813
return []interface{}{transformed}

google-beta/services/eventarc/resource_eventarc_trigger.go

Lines changed: 49 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,12 @@ func ResourceEventarcTrigger() *schema.Resource {
9090
Description: "Optional. The name of the channel associated with the trigger in `projects/{project}/locations/{location}/channels/{channel}` format. You must provide a channel to receive events from Eventarc SaaS partners.",
9191
},
9292

93+
"event_data_content_type": {
94+
Type: schema.TypeString,
95+
Optional: true,
96+
Description: "Optional. EventDataContentType specifies the type of payload in MIME format that is expected from the CloudEvent data field. This is set to `application/json` if the value is not defined.",
97+
},
98+
9399
"labels": {
94100
Type: schema.TypeMap,
95101
Optional: true,
@@ -323,15 +329,16 @@ func resourceEventarcTriggerCreate(d *schema.ResourceData, meta interface{}) err
323329
}
324330

325331
obj := &eventarc.Trigger{
326-
Destination: expandEventarcTriggerDestination(d.Get("destination")),
327-
Location: dcl.String(d.Get("location").(string)),
328-
MatchingCriteria: expandEventarcTriggerMatchingCriteriaArray(d.Get("matching_criteria")),
329-
Name: dcl.String(d.Get("name").(string)),
330-
Channel: dcl.String(d.Get("channel").(string)),
331-
Labels: tpgresource.CheckStringMap(d.Get("labels")),
332-
Project: dcl.String(project),
333-
ServiceAccount: dcl.String(d.Get("service_account").(string)),
334-
Transport: expandEventarcTriggerTransport(d.Get("transport")),
332+
Destination: expandEventarcTriggerDestination(d.Get("destination")),
333+
Location: dcl.String(d.Get("location").(string)),
334+
MatchingCriteria: expandEventarcTriggerMatchingCriteriaArray(d.Get("matching_criteria")),
335+
Name: dcl.String(d.Get("name").(string)),
336+
Channel: dcl.String(d.Get("channel").(string)),
337+
EventDataContentType: dcl.String(d.Get("event_data_content_type").(string)),
338+
Labels: tpgresource.CheckStringMap(d.Get("labels")),
339+
Project: dcl.String(project),
340+
ServiceAccount: dcl.String(d.Get("service_account").(string)),
341+
Transport: expandEventarcTriggerTransport(d.Get("transport")),
335342
}
336343

337344
id, err := obj.ID()
@@ -379,15 +386,16 @@ func resourceEventarcTriggerRead(d *schema.ResourceData, meta interface{}) error
379386
}
380387

381388
obj := &eventarc.Trigger{
382-
Destination: expandEventarcTriggerDestination(d.Get("destination")),
383-
Location: dcl.String(d.Get("location").(string)),
384-
MatchingCriteria: expandEventarcTriggerMatchingCriteriaArray(d.Get("matching_criteria")),
385-
Name: dcl.String(d.Get("name").(string)),
386-
Channel: dcl.String(d.Get("channel").(string)),
387-
Labels: tpgresource.CheckStringMap(d.Get("labels")),
388-
Project: dcl.String(project),
389-
ServiceAccount: dcl.String(d.Get("service_account").(string)),
390-
Transport: expandEventarcTriggerTransport(d.Get("transport")),
389+
Destination: expandEventarcTriggerDestination(d.Get("destination")),
390+
Location: dcl.String(d.Get("location").(string)),
391+
MatchingCriteria: expandEventarcTriggerMatchingCriteriaArray(d.Get("matching_criteria")),
392+
Name: dcl.String(d.Get("name").(string)),
393+
Channel: dcl.String(d.Get("channel").(string)),
394+
EventDataContentType: dcl.String(d.Get("event_data_content_type").(string)),
395+
Labels: tpgresource.CheckStringMap(d.Get("labels")),
396+
Project: dcl.String(project),
397+
ServiceAccount: dcl.String(d.Get("service_account").(string)),
398+
Transport: expandEventarcTriggerTransport(d.Get("transport")),
391399
}
392400

393401
userAgent, err := tpgresource.GenerateUserAgentString(d, config.UserAgent)
@@ -427,6 +435,9 @@ func resourceEventarcTriggerRead(d *schema.ResourceData, meta interface{}) error
427435
if err = d.Set("channel", res.Channel); err != nil {
428436
return fmt.Errorf("error setting channel in state: %s", err)
429437
}
438+
if err = d.Set("event_data_content_type", res.EventDataContentType); err != nil {
439+
return fmt.Errorf("error setting event_data_content_type in state: %s", err)
440+
}
430441
if err = d.Set("labels", res.Labels); err != nil {
431442
return fmt.Errorf("error setting labels in state: %s", err)
432443
}
@@ -465,15 +476,16 @@ func resourceEventarcTriggerUpdate(d *schema.ResourceData, meta interface{}) err
465476
}
466477

467478
obj := &eventarc.Trigger{
468-
Destination: expandEventarcTriggerDestination(d.Get("destination")),
469-
Location: dcl.String(d.Get("location").(string)),
470-
MatchingCriteria: expandEventarcTriggerMatchingCriteriaArray(d.Get("matching_criteria")),
471-
Name: dcl.String(d.Get("name").(string)),
472-
Channel: dcl.String(d.Get("channel").(string)),
473-
Labels: tpgresource.CheckStringMap(d.Get("labels")),
474-
Project: dcl.String(project),
475-
ServiceAccount: dcl.String(d.Get("service_account").(string)),
476-
Transport: expandEventarcTriggerTransport(d.Get("transport")),
479+
Destination: expandEventarcTriggerDestination(d.Get("destination")),
480+
Location: dcl.String(d.Get("location").(string)),
481+
MatchingCriteria: expandEventarcTriggerMatchingCriteriaArray(d.Get("matching_criteria")),
482+
Name: dcl.String(d.Get("name").(string)),
483+
Channel: dcl.String(d.Get("channel").(string)),
484+
EventDataContentType: dcl.String(d.Get("event_data_content_type").(string)),
485+
Labels: tpgresource.CheckStringMap(d.Get("labels")),
486+
Project: dcl.String(project),
487+
ServiceAccount: dcl.String(d.Get("service_account").(string)),
488+
Transport: expandEventarcTriggerTransport(d.Get("transport")),
477489
}
478490
directive := tpgdclresource.UpdateDirective
479491
userAgent, err := tpgresource.GenerateUserAgentString(d, config.UserAgent)
@@ -516,15 +528,16 @@ func resourceEventarcTriggerDelete(d *schema.ResourceData, meta interface{}) err
516528
}
517529

518530
obj := &eventarc.Trigger{
519-
Destination: expandEventarcTriggerDestination(d.Get("destination")),
520-
Location: dcl.String(d.Get("location").(string)),
521-
MatchingCriteria: expandEventarcTriggerMatchingCriteriaArray(d.Get("matching_criteria")),
522-
Name: dcl.String(d.Get("name").(string)),
523-
Channel: dcl.String(d.Get("channel").(string)),
524-
Labels: tpgresource.CheckStringMap(d.Get("labels")),
525-
Project: dcl.String(project),
526-
ServiceAccount: dcl.String(d.Get("service_account").(string)),
527-
Transport: expandEventarcTriggerTransport(d.Get("transport")),
531+
Destination: expandEventarcTriggerDestination(d.Get("destination")),
532+
Location: dcl.String(d.Get("location").(string)),
533+
MatchingCriteria: expandEventarcTriggerMatchingCriteriaArray(d.Get("matching_criteria")),
534+
Name: dcl.String(d.Get("name").(string)),
535+
Channel: dcl.String(d.Get("channel").(string)),
536+
EventDataContentType: dcl.String(d.Get("event_data_content_type").(string)),
537+
Labels: tpgresource.CheckStringMap(d.Get("labels")),
538+
Project: dcl.String(project),
539+
ServiceAccount: dcl.String(d.Get("service_account").(string)),
540+
Transport: expandEventarcTriggerTransport(d.Get("transport")),
528541
}
529542

530543
log.Printf("[DEBUG] Deleting Trigger %q", d.Id())

website/docs/r/clouddeploy_delivery_pipeline.html.markdown

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,14 @@ The `phase_configs` block supports:
277277
(Required)
278278
Required. The ID to assign to the `Rollout` phase. This value must consist of lower-case letters, numbers, and hyphens, start with a letter and end with a letter or a number, and have a max length of 63 characters. In other words, it must match the following regex: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`.
279279

280+
* `postdeploy` -
281+
(Optional)
282+
(Beta only) Optional. Configuration for the postdeploy job of this phase. If this is not configured, postdeploy job will not be present for this phase.
283+
284+
* `predeploy` -
285+
(Optional)
286+
(Beta only) Optional. Configuration for the predeploy job of this phase. If this is not configured, predeploy job will not be present for this phase.
287+
280288
* `profiles` -
281289
(Optional)
282290
Skaffold profiles to use when rendering the manifest for this phase. These are in addition to the profiles list specified in the `DeliveryPipeline` stage.
@@ -377,16 +385,48 @@ The `canary_deployment` block supports:
377385
(Required)
378386
Required. The percentage based deployments that will occur as a part of a `Rollout`. List is expected in ascending order and each integer n is 0 <= n < 100.
379387

388+
* `postdeploy` -
389+
(Optional)
390+
(Beta only) Optional. Configuration for the postdeploy job of the last phase. If this is not configured, postdeploy job will not be present.
391+
392+
* `predeploy` -
393+
(Optional)
394+
(Beta only) Optional. Configuration for the predeploy job of the first phase. If this is not configured, predeploy job will not be present.
395+
380396
* `verify` -
381397
(Optional)
382398
Whether to run verify tests after each percentage deployment.
383399

400+
The `postdeploy` block supports:
401+
402+
* `actions` -
403+
(Optional)
404+
Optional. A sequence of skaffold custom actions to invoke during execution of the postdeploy job.
405+
406+
The `predeploy` block supports:
407+
408+
* `actions` -
409+
(Optional)
410+
Optional. A sequence of skaffold custom actions to invoke during execution of the predeploy job.
411+
384412
The `custom_canary_deployment` block supports:
385413

386414
* `phase_configs` -
387415
(Required)
388416
Required. Configuration for each phase in the canary deployment in the order executed.
389417

418+
The `postdeploy` block supports:
419+
420+
* `actions` -
421+
(Optional)
422+
Optional. A sequence of skaffold custom actions to invoke during execution of the postdeploy job.
423+
424+
The `predeploy` block supports:
425+
426+
* `actions` -
427+
(Optional)
428+
Optional. A sequence of skaffold custom actions to invoke during execution of the predeploy job.
429+
390430
The `runtime_config` block supports:
391431

392432
* `cloud_run` -
@@ -423,6 +463,10 @@ The `gateway_service_mesh` block supports:
423463
(Required)
424464
Required. Name of the Gateway API HTTPRoute.
425465

466+
* `route_update_wait_time` -
467+
(Optional)
468+
Optional. The time to wait for route updates to propagate. The maximum configurable time is 3 hours, in seconds format. If unspecified, there is no wait time.
469+
426470
* `service` -
427471
(Required)
428472
Required. Name of the Kubernetes Service.
@@ -443,10 +487,30 @@ The `service_networking` block supports:
443487

444488
The `standard` block supports:
445489

490+
* `postdeploy` -
491+
(Optional)
492+
(Beta only) Optional. Configuration for the postdeploy job. If this is not configured, postdeploy job will not be present.
493+
494+
* `predeploy` -
495+
(Optional)
496+
(Beta only) Optional. Configuration for the predeploy job. If this is not configured, predeploy job will not be present.
497+
446498
* `verify` -
447499
(Optional)
448500
Whether to verify a deployment.
449501

502+
The `postdeploy` block supports:
503+
504+
* `actions` -
505+
(Optional)
506+
Optional. A sequence of skaffold custom actions to invoke during execution of the postdeploy job.
507+
508+
The `predeploy` block supports:
509+
510+
* `actions` -
511+
(Optional)
512+
Optional. A sequence of skaffold custom actions to invoke during execution of the predeploy job.
513+
450514
## Attributes Reference
451515

452516
In addition to the arguments listed above, the following computed attributes are exported:

website/docs/r/dataplex_asset.html.markdown

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,10 @@ The `resource_spec` block supports:
148148
(Optional)
149149
Immutable. Relative name of the cloud resource that contains the data that is being managed within a lake. For example: `projects/{project_number}/buckets/{bucket_id}` `projects/{project_number}/datasets/{dataset_id}`
150150

151+
* `read_access_mode` -
152+
(Optional)
153+
Optional. Determines how read permissions are handled for each asset and their associated tables. Only available to storage buckets assets. Possible values: DIRECT, MANAGED
154+
151155
* `type` -
152156
(Required)
153157
Required. Immutable. Type of resource. Possible values: STORAGE_BUCKET, BIGQUERY_DATASET

website/docs/r/eventarc_trigger.html.markdown

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,10 @@ The `matching_criteria` block supports:
135135
(Optional)
136136
Optional. The name of the channel associated with the trigger in `projects/{project}/locations/{location}/channels/{channel}` format. You must provide a channel to receive events from Eventarc SaaS partners.
137137

138+
* `event_data_content_type` -
139+
(Optional)
140+
Optional. EventDataContentType specifies the type of payload in MIME format that is expected from the CloudEvent data field. This is set to `application/json` if the value is not defined.
141+
138142
* `labels` -
139143
(Optional)
140144
Optional. User labels attached to the triggers that can be used to group resources.

0 commit comments

Comments
 (0)