Skip to content

Commit

Permalink
Merge branch 'main' into CHEF-MAGIC-MODULE-compute-Project
Browse files Browse the repository at this point in the history
  • Loading branch information
balasubramanian-s committed Jan 22, 2024
2 parents 429779c + 616d4b1 commit 88d3f09
Show file tree
Hide file tree
Showing 47 changed files with 2,305 additions and 16 deletions.
29 changes: 27 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,36 @@
# Change Log

<!-- latest_release 1.11.69 -->
<!-- latest_release 1.11.74 -->
## [v1.11.74](https://github.com/inspec/inspec-gcp/tree/v1.11.74) (2024-01-22)

#### Merged Pull Requests
- CHEF-7362-Inspec-gcp-cloud-kms-key-rings-crypto-keys-crypto-key-versions [#428](https://github.com/inspec/inspec-gcp/pull/428) ([sa-progress](https://github.com/sa-progress))
<!-- latest_release -->

## [v1.11.73](https://github.com/inspec/inspec-gcp/tree/v1.11.73) (2024-01-19)

#### Merged Pull Requests
- CHEF-7375: SecretManager - Project Secrets [#569](https://github.com/inspec/inspec-gcp/pull/569) ([balasubramanian-s](https://github.com/balasubramanian-s))

## [v1.11.72](https://github.com/inspec/inspec-gcp/tree/v1.11.72) (2024-01-18)

#### Merged Pull Requests
- CHEF-7386-compute-RegionNetworkEndpointGroup - Resource Implementation [#537](https://github.com/inspec/inspec-gcp/pull/537) ([sa-progress](https://github.com/sa-progress))

## [v1.11.71](https://github.com/inspec/inspec-gcp/tree/v1.11.71) (2024-01-18)

#### Merged Pull Requests
- CHEF-8912- MAGIC-MODULE-apigee-Organizations__api - Resource Implementation [#542](https://github.com/inspec/inspec-gcp/pull/542) ([sa-progress](https://github.com/sa-progress))

## [v1.11.70](https://github.com/inspec/inspec-gcp/tree/v1.11.70) (2024-01-18)

#### Merged Pull Requests
- CHEF-3309-InSpec GCP Http error fixes [#568](https://github.com/inspec/inspec-gcp/pull/568) ([balasubramanian-s](https://github.com/balasubramanian-s))

## [v1.11.69](https://github.com/inspec/inspec-gcp/tree/v1.11.69) (2024-01-11)

#### Merged Pull Requests
- Refactor Long to Short Name Conversion [#565](https://github.com/inspec/inspec-gcp/pull/565) ([sa-progress](https://github.com/sa-progress))
<!-- latest_release -->

## [v1.11.68](https://github.com/inspec/inspec-gcp/tree/v1.11.68) (2024-01-08)

Expand Down
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ The following resources are available in the InSpec GCP Profile
| [google_kms_crypto_key](docs/resources/google_kms_crypto_key.md) | [google_kms_crypto_keys](docs/resources/google_kms_crypto_keys.md) |
| [google_kms_crypto_key_iam_binding](docs/resources/google_kms_crypto_key_iam_binding.md) | [google_kms_crypto_key_iam_bindings](docs/resources/google_kms_crypto_key_iam_bindings.md) |
| [google_kms_crypto_key_iam_policy](docs/resources/google_kms_crypto_key_iam_policy.md) | No Plural Resource |
| [google_kms_crypto_key_version](docs/resources/google_kms_crypto_key_version.md) | [google_kms_crypto_key_versions](docs/resources/google_kms_crypto_key_versions.md) |
| [google_kms_ekm_connection](docs/resources/google_kms_ekm_connection.md) | [google_kms_ekm_connections](docs/resources/google_kms_ekm_connections.md) |
| [google_kms_key_ring](docs/resources/google_kms_key_ring.md) | [google_kms_key_rings](docs/resources/google_kms_key_rings.md) |
| [google_kms_key_ring_iam_binding](docs/resources/google_kms_key_ring_iam_binding.md) | [google_kms_key_ring_iam_bindings](docs/resources/google_kms_key_ring_iam_bindings.md) |
Expand Down Expand Up @@ -377,6 +378,7 @@ The following resources are available in the InSpec GCP Profile
| [google_vertex_ai_training_pipeline](docs/resources/google_vertex_ai_training_pipeline.md) | [google_vertex_ai_training_pipelines](docs/resources/google_vertex_ai_training_pipelines.md) |
| [google_composer_project_location_environment](docs/resources/google_composer_project_location_environment.md) | [google_composer_project_location_environments](docs/resources/google_composer_project_location_environments.md) |
| [google_compute_service_attachment](docs/resources/google_compute_service_attachment.md) | [google_compute_service_attachments](docs/resources/google_compute_service_attachments.md) |
| [google_secret_manager_secret](docs/resources/google_secret_manager_secret.md) | [google_secret_manager_secrets](docs/resources/google_secret_manager_secrets.md) |

## Examples

Expand Down Expand Up @@ -426,6 +428,23 @@ control 'gcp-projects-zones-vm-label-loop-1.0' do
end
end
```
This example verifies there are sufficient privileges to list all regions.

```
next unless google_compute_regions(project: gcp_project_id).resource_failed?
google_compute_regions(project: gcp_project_id).region_names.each do |region_name|
describe google_compute_region(project: gcp_project_id, region: region_name) do
it { should be_up }
end
end

if google_compute_regions(project: gcp_project_id).resource_failed?
puts google_compute_regions(project: gcp_project_id).resource_exception_message
puts google_compute_regions(project: gcp_project_id,name: region_name).pretty_inspect
end
```
This example assumes there are sufficient privileges to list all GCP projects.
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.11.69
1.11.74
57 changes: 57 additions & 0 deletions docs/resources/google_apigee_organization_api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
title: About the google_apigee_organization_api resource
platform: gcp
---

## Syntax
A `google_apigee_organization_api` is used to test a Google OrganizationApi resource

## Examples
```
describe google_apigee_organization_api(parent: ' value_parent', name: ' value_name') do
it { should exist }
its('latest_revision_id') { should cmp 'value_latestrevisionid' }
its('api_proxy_type') { should cmp 'value_apiproxytype' }
its('name') { should cmp 'value_name' }
end
describe google_apigee_organization_api(parent: ' value_parent', name: "does_not_exit") do
it { should_not exist }
end
```

## Properties
Properties that can be accessed from the `google_apigee_organization_api` resource:


* `revision`: Output only. List of revisions defined for the API proxy.

* `latest_revision_id`: Output only. The id of the most recently created revision for this api proxy.

* `meta_data`: Metadata common to many entities in this API.

* `last_modified_at`: Time at which the API proxy was most recently modified, in milliseconds since epoch.

* `created_at`: Time at which the API proxy was created, in milliseconds since epoch.

* `sub_type`: The type of entity described

* `api_proxy_type`: Output only. The type of the API proxy.
Possible values:
* API_PROXY_TYPE_UNSPECIFIED
* PROGRAMMABLE
* CONFIGURABLE

* `read_only`: Output only. Whether this proxy is read-only. A read-only proxy cannot have new revisions created through calls to CreateApiProxyRevision. A proxy is read-only if it was generated by an archive.

* `labels`: User labels applied to this API Proxy.

* `additional_properties`:

* `name`: Output only. Name of the API proxy.


## GCP Permissions

Ensure the [Apigee API](https://console.cloud.google.com/apis/library/apigee.googleapis.com/) is enabled for the current project.
34 changes: 34 additions & 0 deletions docs/resources/google_apigee_organization_apis.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
title: About the google_apigee_organization_apis resource
platform: gcp
---

## Syntax
A `google_apigee_organization_apis` is used to test a Google OrganizationApi resource

## Examples
```
describe google_apigee_organization_apis(parent: ' value_parent') do
it { should exist }
end
```

## Properties
Properties that can be accessed from the `google_apigee_organization_apis` resource:

See [google_apigee_organization_api.md](google_apigee_organization_api.md) for more detailed information
* `revisions`: an array of `google_apigee_organization_api` revision
* `latest_revision_ids`: an array of `google_apigee_organization_api` latest_revision_id
* `meta_data`: an array of `google_apigee_organization_api` meta_data
* `api_proxy_types`: an array of `google_apigee_organization_api` api_proxy_type
* `read_onlies`: an array of `google_apigee_organization_api` read_only
* `labels`: an array of `google_apigee_organization_api` labels
* `names`: an array of `google_apigee_organization_api` name

## Filter Criteria
This resource supports all of the above properties as filter criteria, which can be used
with `where` as a block or a method.

## GCP Permissions

Ensure the [Apigee API](https://console.cloud.google.com/apis/library/apigee.googleapis.com/) is enabled for the current project.
117 changes: 117 additions & 0 deletions docs/resources/google_compute_region_network_endpoint_group.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
---
title: About the google_compute_region_network_endpoint_group resource
platform: gcp
---

## Syntax
A `google_compute_region_network_endpoint_group` is used to test a Google RegionNetworkEndpointGroup resource

## Examples
```
describe google_compute_region_network_endpoint_group(network_endpoint_group: ' ', project: 'chef-gcp-inspec', region: ' value_region') do
it { should exist }
its('kind') { should cmp 'value_kind' }
its('id') { should cmp 'value_id' }
its('creation_timestamp') { should cmp 'value_creationtimestamp' }
its('self_link') { should cmp 'value_selflink' }
its('name') { should cmp 'value_name' }
its('description') { should cmp 'value_description' }
its('network_endpoint_type') { should cmp 'value_networkendpointtype' }
its('region') { should cmp 'value_region' }
its('zone') { should cmp 'value_zone' }
its('network') { should cmp 'value_network' }
its('subnetwork') { should cmp 'value_subnetwork' }
its('psc_target_service') { should cmp 'value_psctargetservice' }
end
describe google_compute_region_network_endpoint_group(network_endpoint_group: ' ', project: 'chef-gcp-inspec', region: ' value_region') do
it { should_not exist }
end
```

## Properties
Properties that can be accessed from the `google_compute_region_network_endpoint_group` resource:


* `kind`: [Output Only] Type of the resource. Always compute#networkEndpointGroup for network endpoint group.

* `id`: [Output Only] The unique identifier for the resource. This identifier is defined by the server.

* `creation_timestamp`: [Output Only] Creation timestamp in RFC3339 text format.

* `self_link`: [Output Only] Server-defined URL for the resource.

* `name`: Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

* `description`: An optional description of this resource. Provide this property when you create the resource.

* `network_endpoint_type`: Type of network endpoints in this network endpoint group. Can be one of GCE_VM_IP, GCE_VM_IP_PORT, NON_GCP_PRIVATE_IP_PORT, INTERNET_FQDN_PORT, INTERNET_IP_PORT, SERVERLESS, PRIVATE_SERVICE_CONNECT.
Possible values:
* GCE_VM_IP
* GCE_VM_IP_PORT
* INTERNET_FQDN_PORT
* INTERNET_IP_PORT
* NON_GCP_PRIVATE_IP_PORT
* PRIVATE_SERVICE_CONNECT
* SERVERLESS

* `size`: [Output only] Number of network endpoints in the network endpoint group.

* `region`: [Output Only] The URL of the region where the network endpoint group is located.

* `zone`: [Output Only] The URL of the zone where the network endpoint group is located.

* `network`: The URL of the network to which all network endpoints in the NEG belong. Uses "default" project network if unspecified.

* `subnetwork`: Optional URL of the subnetwork to which all network endpoints in the NEG belong.

* `default_port`: The default port used if the port number is not specified in the network endpoint.

* `annotations`: Metadata defined as annotations on the network endpoint group.

* `additional_properties`:

* `cloud_run`: Configuration for a Cloud Run network endpoint group (NEG). The service must be provided explicitly or in the URL mask. The tag is optional, may be provided explicitly or in the URL mask. Note: Cloud Run service must be in the same project and located in the same region as the Serverless NEG.

* `service`: Cloud Run service is the main resource of Cloud Run. The service must be 1-63 characters long, and comply with RFC1035. Example value: "run-service".

* `tag`: Optional Cloud Run tag represents the "named-revision" to provide additional fine-grained traffic routing information. The tag must be 1-63 characters long, and comply with RFC1035. Example value: "revision-0010".

* `url_mask`: A template to parse <service> and <tag> fields from a request URL. URL mask allows for routing to multiple Run services without having to create multiple network endpoint groups and backend services. For example, request URLs "foo1.domain.com/bar1" and "foo1.domain.com/bar2" can be backed by the same Serverless Network Endpoint Group (NEG) with URL mask "<tag>.domain.com/<service>". The URL mask will parse them to { service="bar1", tag="foo1" } and { service="bar2", tag="foo2" } respectively.

* `app_engine`: Configuration for an App Engine network endpoint group (NEG). The service is optional, may be provided explicitly or in the URL mask. The version is optional and can only be provided explicitly or in the URL mask when service is present. Note: App Engine service must be in the same project and located in the same region as the Serverless NEG.

* `service`: Optional serving service. The service name is case-sensitive and must be 1-63 characters long. Example value: "default", "my-service".

* `version`: Optional serving version. The version name is case-sensitive and must be 1-100 characters long. Example value: "v1", "v2".

* `url_mask`: A template to parse service and version fields from a request URL. URL mask allows for routing to multiple App Engine services without having to create multiple Network Endpoint Groups and backend services. For example, the request URLs "foo1-dot-appname.appspot.com/v1" and "foo1-dot-appname.appspot.com/v2" can be backed by the same Serverless NEG with URL mask "<service>-dot-appname.appspot.com/<version>". The URL mask will parse them to { service = "foo1", version = "v1" } and { service = "foo1", version = "v2" } respectively.

* `cloud_function`: Configuration for a Cloud Function network endpoint group (NEG). The function must be provided explicitly or in the URL mask. Note: Cloud Function must be in the same project and located in the same region as the Serverless NEG.

* `function`: A user-defined name of the Cloud Function. The function name is case-sensitive and must be 1-63 characters long. Example value: "func1".

* `url_mask`: A template to parse function field from a request URL. URL mask allows for routing to multiple Cloud Functions without having to create multiple Network Endpoint Groups and backend services. For example, request URLs " mydomain.com/function1" and "mydomain.com/function2" can be backed by the same Serverless NEG with URL mask "/<function>". The URL mask will parse them to { function = "function1" } and { function = "function2" } respectively.

* `psc_target_service`: The target service url used to set up private service connection to a Google API or a PSC Producer Service Attachment. An example value is: "asia-northeast3-cloudkms.googleapis.com"

* `psc_data`: All data that is specifically relevant to only network endpoint groups of type PRIVATE_SERVICE_CONNECT.

* `consumer_psc_address`: [Output Only] Address allocated from given subnetwork for PSC. This IP address acts as a VIP for a PSC NEG, allowing it to act as an endpoint in L7 PSC-XLB.

* `psc_connection_id`: [Output Only] The PSC connection id of the PSC Network Endpoint Group Consumer.

* `psc_connection_status`: [Output Only] The connection status of the PSC Forwarding Rule.
Possible values:
* ACCEPTED
* CLOSED
* NEEDS_ATTENTION
* PENDING
* REJECTED
* STATUS_UNSPECIFIED


## GCP Permissions

Ensure the [Compute Engine API](https://console.cloud.google.com/apis/library/compute.googleapis.com/) is enabled for the current project.
46 changes: 46 additions & 0 deletions docs/resources/google_compute_region_network_endpoint_groups.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
title: About the google_compute_region_network_endpoint_groups resource
platform: gcp
---

## Syntax
A `google_compute_region_network_endpoint_groups` is used to test a Google RegionNetworkEndpointGroup resource

## Examples
```
describe google_compute_region_network_endpoint_groups(project: 'chef-gcp-inspec', region: ' value_region') do
it { should exist }
end
```

## Properties
Properties that can be accessed from the `google_compute_region_network_endpoint_groups` resource:

See [google_compute_region_network_endpoint_group.md](google_compute_region_network_endpoint_group.md) for more detailed information
* `kinds`: an array of `google_compute_region_network_endpoint_group` kind
* `ids`: an array of `google_compute_region_network_endpoint_group` id
* `creation_timestamps`: an array of `google_compute_region_network_endpoint_group` creation_timestamp
* `self_links`: an array of `google_compute_region_network_endpoint_group` self_link
* `names`: an array of `google_compute_region_network_endpoint_group` name
* `descriptions`: an array of `google_compute_region_network_endpoint_group` description
* `network_endpoint_types`: an array of `google_compute_region_network_endpoint_group` network_endpoint_type
* `sizes`: an array of `google_compute_region_network_endpoint_group` size
* `regions`: an array of `google_compute_region_network_endpoint_group` region
* `zones`: an array of `google_compute_region_network_endpoint_group` zone
* `networks`: an array of `google_compute_region_network_endpoint_group` network
* `subnetworks`: an array of `google_compute_region_network_endpoint_group` subnetwork
* `default_ports`: an array of `google_compute_region_network_endpoint_group` default_port
* `annotations`: an array of `google_compute_region_network_endpoint_group` annotations
* `cloud_runs`: an array of `google_compute_region_network_endpoint_group` cloud_run
* `app_engines`: an array of `google_compute_region_network_endpoint_group` app_engine
* `cloud_functions`: an array of `google_compute_region_network_endpoint_group` cloud_function
* `psc_target_services`: an array of `google_compute_region_network_endpoint_group` psc_target_service
* `psc_data`: an array of `google_compute_region_network_endpoint_group` psc_data

## Filter Criteria
This resource supports all of the above properties as filter criteria, which can be used
with `where` as a block or a method.

## GCP Permissions

Ensure the [Compute Engine API](https://console.cloud.google.com/apis/library/compute.googleapis.com/) is enabled for the current project.
Loading

0 comments on commit 88d3f09

Please sign in to comment.