Skip to content

Commit 49a57d3

Browse files
feat: [infra-manager] Infrastructure Manager supports the deployment of infrastructure from Terraform configurations in a private Git repository (#5147)
* feat: Infrastructure Manager supports the deployment of infrastructure from Terraform configurations in a private Git repository feat: Infrastructure Manager can validate and enforce quota limits, preventing infrastructure that exceeds quota limits from being deployed feat: Infrastructure manager supports the following versions of Terraform when creating a deployment: Terraform version 1.2.3, 1.3.10, 1.4.7, 1.5.7 docs: A comment for field `page_size` in message `.google.cloud.config.v1.ListDeploymentsRequest` is changed docs: A comment for field `page_size` in message `.google.cloud.config.v1.ListRevisionsRequest` is changed docs: A comment for field `page_size` in message `.google.cloud.config.v1.ListResourcesRequest` is changed docs: A comment for field `service_account` in message `.google.cloud.config.v1.Preview` is changed docs: A comment for field `page_size` in message `.google.cloud.config.v1.ListPreviewsRequest` is changed PiperOrigin-RevId: 616858321 Source-Link: googleapis/googleapis@7e02769 Source-Link: googleapis/googleapis-gen@d71ec59 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWNvbmZpZy8uT3dsQm90LnlhbWwiLCJoIjoiZDcxZWM1OWQxZDc0MjgzYzU5OTI0OTU1ZTAzYTMzOTMwODBiYWMzZiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent cd79bb0 commit 49a57d3

17 files changed

Lines changed: 23841 additions & 14740 deletions

packages/google-cloud-config/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,13 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/
150150
| Config.get_preview | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-config/samples/generated/v1/config.get_preview.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-config/samples/generated/v1/config.get_preview.js,packages/google-cloud-config/samples/README.md) |
151151
| Config.get_resource | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-config/samples/generated/v1/config.get_resource.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-config/samples/generated/v1/config.get_resource.js,packages/google-cloud-config/samples/README.md) |
152152
| Config.get_revision | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-config/samples/generated/v1/config.get_revision.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-config/samples/generated/v1/config.get_revision.js,packages/google-cloud-config/samples/README.md) |
153+
| Config.get_terraform_version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-config/samples/generated/v1/config.get_terraform_version.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-config/samples/generated/v1/config.get_terraform_version.js,packages/google-cloud-config/samples/README.md) |
153154
| Config.import_statefile | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-config/samples/generated/v1/config.import_statefile.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-config/samples/generated/v1/config.import_statefile.js,packages/google-cloud-config/samples/README.md) |
154155
| Config.list_deployments | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-config/samples/generated/v1/config.list_deployments.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-config/samples/generated/v1/config.list_deployments.js,packages/google-cloud-config/samples/README.md) |
155156
| Config.list_previews | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-config/samples/generated/v1/config.list_previews.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-config/samples/generated/v1/config.list_previews.js,packages/google-cloud-config/samples/README.md) |
156157
| Config.list_resources | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-config/samples/generated/v1/config.list_resources.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-config/samples/generated/v1/config.list_resources.js,packages/google-cloud-config/samples/README.md) |
157158
| Config.list_revisions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-config/samples/generated/v1/config.list_revisions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-config/samples/generated/v1/config.list_revisions.js,packages/google-cloud-config/samples/README.md) |
159+
| Config.list_terraform_versions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-config/samples/generated/v1/config.list_terraform_versions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-config/samples/generated/v1/config.list_terraform_versions.js,packages/google-cloud-config/samples/README.md) |
158160
| Config.lock_deployment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-config/samples/generated/v1/config.lock_deployment.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-config/samples/generated/v1/config.lock_deployment.js,packages/google-cloud-config/samples/README.md) |
159161
| Config.unlock_deployment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-config/samples/generated/v1/config.unlock_deployment.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-config/samples/generated/v1/config.unlock_deployment.js,packages/google-cloud-config/samples/README.md) |
160162
| Config.update_deployment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-config/samples/generated/v1/config.update_deployment.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-config/samples/generated/v1/config.update_deployment.js,packages/google-cloud-config/samples/README.md) |

packages/google-cloud-config/protos/google/cloud/config/v1/config.proto

Lines changed: 206 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@ syntax = "proto3";
1616

1717
package google.cloud.config.v1;
1818

19-
import "google/longrunning/operations.proto";
20-
import "google/protobuf/timestamp.proto";
21-
import "google/protobuf/struct.proto";
22-
import "google/protobuf/field_mask.proto";
2319
import "google/api/annotations.proto";
2420
import "google/api/client.proto";
2521
import "google/api/field_behavior.proto";
2622
import "google/api/field_info.proto";
2723
import "google/api/resource.proto";
24+
import "google/longrunning/operations.proto";
2825
import "google/protobuf/empty.proto";
26+
import "google/protobuf/field_mask.proto";
27+
import "google/protobuf/struct.proto";
28+
import "google/protobuf/timestamp.proto";
2929
import "google/rpc/status.proto";
3030

3131
option csharp_namespace = "Google.Cloud.Config.V1";
@@ -268,6 +268,43 @@ service Config {
268268
body: "*"
269269
};
270270
}
271+
272+
// Lists [TerraformVersion][google.cloud.config.v1.TerraformVersion]s in a
273+
// given project and location.
274+
rpc ListTerraformVersions(ListTerraformVersionsRequest)
275+
returns (ListTerraformVersionsResponse) {
276+
option (google.api.http) = {
277+
get: "/v1/{parent=projects/*/locations/*}/terraformVersions"
278+
};
279+
option (google.api.method_signature) = "parent";
280+
}
281+
282+
// Gets details about a
283+
// [TerraformVersion][google.cloud.config.v1.TerraformVersion].
284+
rpc GetTerraformVersion(GetTerraformVersionRequest)
285+
returns (TerraformVersion) {
286+
option (google.api.http) = {
287+
get: "/v1/{name=projects/*/locations/*/terraformVersions/*}"
288+
};
289+
option (google.api.method_signature) = "name";
290+
}
291+
}
292+
293+
// Enum values to control quota checks for resources in terraform
294+
// configuration files.
295+
enum QuotaValidation {
296+
// The default value.
297+
// QuotaValidation on terraform configuration files will be disabled in
298+
// this case.
299+
QUOTA_VALIDATION_UNSPECIFIED = 0;
300+
301+
// Enable computing quotas for resources in terraform configuration files to
302+
// get visibility on resources with insufficient quotas.
303+
ENABLED = 1;
304+
305+
// Enforce quota checks so deployment fails if there isn't sufficient quotas
306+
// available to deploy resources in terraform configuration files.
307+
ENFORCED = 2;
271308
}
272309

273310
// A Deployment is a group of resources and configs managed and provisioned by
@@ -459,6 +496,21 @@ message Deployment {
459496

460497
// Output only. Current lock state of the deployment.
461498
LockState lock_state = 20 [(google.api.field_behavior) = OUTPUT_ONLY];
499+
500+
// Optional. The user-specified Terraform version constraint.
501+
// Example: "=1.3.10".
502+
optional string tf_version_constraint = 21
503+
[(google.api.field_behavior) = OPTIONAL];
504+
505+
// Output only. The current Terraform version set on the deployment.
506+
// It is in the format of "Major.Minor.Patch", for example, "1.3.10".
507+
string tf_version = 22 [(google.api.field_behavior) = OUTPUT_ONLY];
508+
509+
// Optional. Input to control quota checks for resources in terraform
510+
// configuration files. There are limited resources on which quota validation
511+
// applies.
512+
QuotaValidation quota_validation = 23
513+
[(google.api.field_behavior) = OPTIONAL];
462514
}
463515

464516
// TerraformBlueprint describes the source of a Terraform root module which
@@ -523,8 +575,8 @@ message ListDeploymentsRequest {
523575
];
524576

525577
// When requesting a page of resources, 'page_size' specifies number of
526-
// resources to return. If unspecified or set to 0, all resources will be
527-
// returned.
578+
// resources to return. If unspecified, at most 500 will be returned. The
579+
// maximum value is 1000.
528580
int32 page_size = 2;
529581

530582
// Token returned by previous call to 'ListDeployments' which specifies the
@@ -594,8 +646,8 @@ message ListRevisionsRequest {
594646
];
595647

596648
// When requesting a page of resources, `page_size` specifies number of
597-
// resources to return. If unspecified or set to 0, all resources will be
598-
// returned.
649+
// resources to return. If unspecified, at most 500 will be returned. The
650+
// maximum value is 1000.
599651
int32 page_size = 2;
600652

601653
// Token returned by previous call to 'ListRevisions' which specifies the
@@ -863,6 +915,10 @@ message Revision {
863915
// Cloud Build job associated with creating or updating a deployment was
864916
// started but failed.
865917
APPLY_BUILD_RUN_FAILED = 5;
918+
919+
// quota validation failed for one or more resources in terraform
920+
// configuration files.
921+
QUOTA_VALIDATION_FAILED = 7;
866922
}
867923

868924
// Blueprint that was deployed.
@@ -949,6 +1005,26 @@ message Revision {
9491005
type: "cloudbuild.googleapis.com/WorkerPool"
9501006
}
9511007
];
1008+
1009+
// Output only. The user-specified Terraform version constraint.
1010+
// Example: "=1.3.10".
1011+
string tf_version_constraint = 18 [(google.api.field_behavior) = OUTPUT_ONLY];
1012+
1013+
// Output only. The version of Terraform used to create the Revision.
1014+
// It is in the format of "Major.Minor.Patch", for example, "1.3.10".
1015+
string tf_version = 19 [(google.api.field_behavior) = OUTPUT_ONLY];
1016+
1017+
// Output only. Cloud Storage path containing quota validation results. This
1018+
// field is set when a user sets Deployment.quota_validation field to ENABLED
1019+
// or ENFORCED. Format: `gs://{bucket}/{object}`.
1020+
string quota_validation_results = 29
1021+
[(google.api.field_behavior) = OUTPUT_ONLY];
1022+
1023+
// Optional. Input to control quota checks for resources in terraform
1024+
// configuration files. There are limited resources on which quota validation
1025+
// applies.
1026+
QuotaValidation quota_validation = 20
1027+
[(google.api.field_behavior) = OPTIONAL];
9521028
}
9531029

9541030
// Errors encountered during actuation using Terraform
@@ -1020,6 +1096,12 @@ message DeploymentOperationMetadata {
10201096

10211097
// Operation failed
10221098
FAILED = 10;
1099+
1100+
// Validating the provided repository.
1101+
VALIDATING_REPOSITORY = 11;
1102+
1103+
// Running quota validation
1104+
RUNNING_QUOTA_VALIDATION = 12;
10231105
}
10241106

10251107
// The current step the deployment operation is running.
@@ -1147,8 +1229,8 @@ message ListResourcesRequest {
11471229
];
11481230

11491231
// When requesting a page of resources, 'page_size' specifies number of
1150-
// resources to return. If unspecified or set to 0, all resources will be
1151-
// returned.
1232+
// resources to return. If unspecified, at most 500 will be returned. The
1233+
// maximum value is 1000.
11521234
int32 page_size = 2;
11531235

11541236
// Token returned by previous call to 'ListResources' which specifies the
@@ -1433,9 +1515,9 @@ message Preview {
14331515
// Optional. Current mode of preview.
14341516
PreviewMode preview_mode = 15 [(google.api.field_behavior) = OPTIONAL];
14351517

1436-
// Optional. Optional service account. If omitted, the deployment resource
1437-
// reference must be provided, and the service account attached to the
1438-
// deployment will be used.
1518+
// Optional. User-specified Service Account (SA) credentials to be used when
1519+
// previewing resources.
1520+
// Format: `projects/{projectID}/serviceAccounts/{serviceAccount}`
14391521
string service_account = 7 [
14401522
(google.api.field_behavior) = OPTIONAL,
14411523
(google.api.resource_reference) = {
@@ -1531,6 +1613,9 @@ message PreviewOperationMetadata {
15311613

15321614
// Operation failed.
15331615
FAILED = 9;
1616+
1617+
// Validating the provided repository.
1618+
VALIDATING_REPOSITORY = 10;
15341619
}
15351620

15361621
// The current step the preview operation is running.
@@ -1615,8 +1700,8 @@ message ListPreviewsRequest {
16151700
];
16161701

16171702
// Optional. When requesting a page of resources, 'page_size' specifies number
1618-
// of resources to return. If unspecified or set to 0, all resources will be
1619-
// returned.
1703+
// of resources to return. If unspecified, at most 500 will be returned. The
1704+
// maximum value is 1000.
16201705
int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
16211706

16221707
// Optional. Token returned by previous call to 'ListDeployments' which
@@ -1717,3 +1802,109 @@ message PreviewResult {
17171802
// Output only. Plan JSON signed URL
17181803
string json_signed_uri = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
17191804
}
1805+
1806+
// The request message for the GetTerraformVersion method.
1807+
message GetTerraformVersionRequest {
1808+
// Required. The name of the TerraformVersion. Format:
1809+
// 'projects/{project_id}/locations/{location}/terraformVersions/{terraform_version}'
1810+
string name = 1 [
1811+
(google.api.field_behavior) = REQUIRED,
1812+
(google.api.resource_reference) = {
1813+
type: "config.googleapis.com/TerraformVersion"
1814+
}
1815+
];
1816+
}
1817+
1818+
// The request message for the ListTerraformVersions method.
1819+
message ListTerraformVersionsRequest {
1820+
// Required. The parent in whose context the TerraformVersions are listed. The
1821+
// parent value is in the format:
1822+
// 'projects/{project_id}/locations/{location}'.
1823+
string parent = 1 [
1824+
(google.api.field_behavior) = REQUIRED,
1825+
(google.api.resource_reference) = {
1826+
type: "locations.googleapis.com/Location"
1827+
}
1828+
];
1829+
1830+
// Optional. When requesting a page of resources, 'page_size' specifies number
1831+
// of resources to return. If unspecified, at most 500 will be returned. The
1832+
// maximum value is 1000.
1833+
int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
1834+
1835+
// Optional. Token returned by previous call to 'ListTerraformVersions' which
1836+
// specifies the position in the list from where to continue listing the
1837+
// resources.
1838+
string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
1839+
1840+
// Optional. Lists the TerraformVersions that match the filter expression. A
1841+
// filter expression filters the resources listed in the response. The
1842+
// expression must be of the form '{field} {operator} {value}' where
1843+
// operators: '<', '>',
1844+
// '<=', '>=', '!=', '=', ':' are supported (colon ':' represents a HAS
1845+
// operator which is roughly synonymous with equality). {field} can refer to a
1846+
// proto or JSON field, or a synthetic field. Field names can be camelCase or
1847+
// snake_case.
1848+
string filter = 4 [(google.api.field_behavior) = OPTIONAL];
1849+
1850+
// Optional. Field to use to sort the list.
1851+
string order_by = 5 [(google.api.field_behavior) = OPTIONAL];
1852+
}
1853+
1854+
// The response message for the `ListTerraformVersions` method.
1855+
message ListTerraformVersionsResponse {
1856+
// List of [TerraformVersion][google.cloud.config.v1.TerraformVersion]s.
1857+
repeated TerraformVersion terraform_versions = 1;
1858+
1859+
// Token to be supplied to the next ListTerraformVersions request via
1860+
// `page_token` to obtain the next set of results.
1861+
string next_page_token = 2;
1862+
1863+
// Unreachable resources, if any.
1864+
repeated string unreachable = 3;
1865+
}
1866+
1867+
// A TerraformVersion represents the support state the corresponding
1868+
// Terraform version.
1869+
message TerraformVersion {
1870+
option (google.api.resource) = {
1871+
type: "config.googleapis.com/TerraformVersion"
1872+
pattern: "projects/{project}/locations/{location}/terraformVersions/{terraform_version}"
1873+
plural: "terraformVersions"
1874+
singular: "terraformVersion"
1875+
};
1876+
1877+
// Possible states of a TerraformVersion.
1878+
enum State {
1879+
// The default value. This value is used if the state is omitted.
1880+
STATE_UNSPECIFIED = 0;
1881+
1882+
// The version is actively supported.
1883+
ACTIVE = 1;
1884+
1885+
// The version is deprecated.
1886+
DEPRECATED = 2;
1887+
1888+
// The version is obsolete.
1889+
OBSOLETE = 3;
1890+
}
1891+
1892+
// Identifier. The version name is in the format:
1893+
// 'projects/{project_id}/locations/{location}/terraformVersions/{terraform_version}'.
1894+
string name = 1 [(google.api.field_behavior) = IDENTIFIER];
1895+
1896+
// Output only. The state of the version, ACTIVE, DEPRECATED or OBSOLETE.
1897+
State state = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
1898+
1899+
// Output only. When the version is supported.
1900+
google.protobuf.Timestamp support_time = 3
1901+
[(google.api.field_behavior) = OUTPUT_ONLY];
1902+
1903+
// Output only. When the version is deprecated.
1904+
optional google.protobuf.Timestamp deprecate_time = 4
1905+
[(google.api.field_behavior) = OUTPUT_ONLY];
1906+
1907+
// Output only. When the version is obsolete.
1908+
optional google.protobuf.Timestamp obsolete_time = 5
1909+
[(google.api.field_behavior) = OUTPUT_ONLY];
1910+
}

0 commit comments

Comments
 (0)