Skip to content

Commit

Permalink
Mark location field required in v2 Cloud Run resources (#9292) (#16311
Browse files Browse the repository at this point in the history
)

[upstream:485e6c2e7db6d64288fc505996a8cb0cdca1384c]

Signed-off-by: Modular Magician <magic-modules@google.com>
  • Loading branch information
modular-magician committed Oct 19, 2023
1 parent 21ea9bc commit c19ae5a
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 20 deletions.
6 changes: 6 additions & 0 deletions .changelog/9292.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
```release-note:breaking-change
cloudrunv2: marked `location` field as required in resource `google_cloud_run_v2_job`. Any configuration without `location` specified will cause resource creation fail
```
```release-note:breaking-change
cloudrunv2: marked `location` field as required in resource `google_cloud_run_v2_service`. Any configuration without `location` specified will cause resource creation fail
```
12 changes: 6 additions & 6 deletions google/services/cloudrunv2/resource_cloud_run_v2_job.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ func ResourceCloudRunV2Job() *schema.Resource {
),

Schema: map[string]*schema.Schema{
"location": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
Description: `The location of the cloud run job`,
},
"name": {
Type: schema.TypeString,
Required: true,
Expand Down Expand Up @@ -494,12 +500,6 @@ If no value is specified, GA is assumed. Set the launch stage to a preview stage
For example, if ALPHA is provided as input, but only BETA and GA-level features are used, this field will be BETA on output. Possible values: ["UNIMPLEMENTED", "PRELAUNCH", "EARLY_ACCESS", "ALPHA", "BETA", "GA", "DEPRECATED"]`,
},
"location": {
Type: schema.TypeString,
Optional: true,
ForceNew: true,
Description: `The location of the cloud run job`,
},
"conditions": {
Type: schema.TypeList,
Computed: true,
Expand Down
12 changes: 6 additions & 6 deletions google/services/cloudrunv2/resource_cloud_run_v2_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ func ResourceCloudRunV2Service() *schema.Resource {
),

Schema: map[string]*schema.Schema{
"location": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
Description: `The location of the cloud run service`,
},
"name": {
Type: schema.TypeString,
Required: true,
Expand Down Expand Up @@ -746,12 +752,6 @@ If no value is specified, GA is assumed. Set the launch stage to a preview stage
For example, if ALPHA is provided as input, but only BETA and GA-level features are used, this field will be BETA on output. Possible values: ["UNIMPLEMENTED", "PRELAUNCH", "EARLY_ACCESS", "ALPHA", "BETA", "GA", "DEPRECATED"]`,
},
"location": {
Type: schema.TypeString,
Optional: true,
ForceNew: true,
Description: `The location of the cloud run service`,
},
"traffic": {
Type: schema.TypeList,
Computed: true,
Expand Down
8 changes: 4 additions & 4 deletions website/docs/r/cloud_run_v2_job.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,10 @@ The following arguments are supported:
The template used to create executions for this Job.
Structure is [documented below](#nested_template).

* `location` -
(Required)
The location of the cloud run job


<a name="nested_template"></a>The `template` block supports:

Expand Down Expand Up @@ -679,10 +683,6 @@ The following arguments are supported:
Settings for the Binary Authorization feature.
Structure is [documented below](#nested_binary_authorization).

* `location` -
(Optional)
The location of the cloud run job

* `project` - (Optional) The ID of the project in which the resource belongs.
If it is not provided, the provider project is used.

Expand Down
8 changes: 4 additions & 4 deletions website/docs/r/cloud_run_v2_service.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,10 @@ The following arguments are supported:
The template used to create revisions for this Service.
Structure is [documented below](#nested_template).

* `location` -
(Required)
The location of the cloud run service


<a name="nested_template"></a>The `template` block supports:

Expand Down Expand Up @@ -886,10 +890,6 @@ The following arguments are supported:
Specifies how to distribute traffic over a collection of Revisions belonging to the Service. If traffic is empty or not provided, defaults to 100% traffic to the latest Ready Revision.
Structure is [documented below](#nested_traffic).

* `location` -
(Optional)
The location of the cloud run service

* `project` - (Optional) The ID of the project in which the resource belongs.
If it is not provided, the provider project is used.

Expand Down

0 comments on commit c19ae5a

Please sign in to comment.