Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CHEF-7386-compute-RegionNetworkEndpointGroup - Resource Implementation #537

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# frozen_string_literal: false

# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** Type: MMv1 ***
#
# ----------------------------------------------------------------------------
#
# This file is automatically generated by Magic Modules and manual
# changes will be clobbered when the file is regenerated.
#
# Please read more about how to change this file in README.md and
# CONTRIBUTING.md located at the root of this package.
#
# ----------------------------------------------------------------------------
module GoogleInSpec
module Compute
module Property
class RegionNetworkEndpointGroupAnnotations
attr_reader :additional_properties

def initialize(args = nil, parent_identifier = nil)
return if args.nil?
@parent_identifier = parent_identifier
@additional_properties = args['additionalProperties']
end

def to_s
"#{@parent_identifier} RegionNetworkEndpointGroupAnnotations"
end
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# frozen_string_literal: false

# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** Type: MMv1 ***
#
# ----------------------------------------------------------------------------
#
# This file is automatically generated by Magic Modules and manual
# changes will be clobbered when the file is regenerated.
#
# Please read more about how to change this file in README.md and
# CONTRIBUTING.md located at the root of this package.
#
# ----------------------------------------------------------------------------
module GoogleInSpec
module Compute
module Property
class RegionNetworkEndpointGroupAppEngine
attr_reader :service

attr_reader :version

attr_reader :url_mask

def initialize(args = nil, parent_identifier = nil)
return if args.nil?
@parent_identifier = parent_identifier
@service = args['service']
@version = args['version']
@url_mask = args['urlMask']
end

def to_s
"#{@parent_identifier} RegionNetworkEndpointGroupAppEngine"
end
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# frozen_string_literal: false

# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** Type: MMv1 ***
#
# ----------------------------------------------------------------------------
#
# This file is automatically generated by Magic Modules and manual
# changes will be clobbered when the file is regenerated.
#
# Please read more about how to change this file in README.md and
# CONTRIBUTING.md located at the root of this package.
#
# ----------------------------------------------------------------------------
module GoogleInSpec
module Compute
module Property
class RegionNetworkEndpointGroupCloudFunction
attr_reader :function

attr_reader :url_mask

def initialize(args = nil, parent_identifier = nil)
return if args.nil?
@parent_identifier = parent_identifier
@function = args['function']
@url_mask = args['urlMask']
end

def to_s
"#{@parent_identifier} RegionNetworkEndpointGroupCloudFunction"
end
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# frozen_string_literal: false

# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** Type: MMv1 ***
#
# ----------------------------------------------------------------------------
#
# This file is automatically generated by Magic Modules and manual
# changes will be clobbered when the file is regenerated.
#
# Please read more about how to change this file in README.md and
# CONTRIBUTING.md located at the root of this package.
#
# ----------------------------------------------------------------------------
module GoogleInSpec
module Compute
module Property
class RegionNetworkEndpointGroupCloudRun
attr_reader :service

attr_reader :tag

attr_reader :url_mask

def initialize(args = nil, parent_identifier = nil)
return if args.nil?
@parent_identifier = parent_identifier
@service = args['service']
@tag = args['tag']
@url_mask = args['urlMask']
end

def to_s
"#{@parent_identifier} RegionNetworkEndpointGroupCloudRun"
end
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# frozen_string_literal: false

# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** Type: MMv1 ***
#
# ----------------------------------------------------------------------------
#
# This file is automatically generated by Magic Modules and manual
# changes will be clobbered when the file is regenerated.
#
# Please read more about how to change this file in README.md and
# CONTRIBUTING.md located at the root of this package.
#
# ----------------------------------------------------------------------------
module GoogleInSpec
module Compute
module Property
class RegionNetworkEndpointGroupPscData
attr_reader :consumer_psc_address

attr_reader :psc_connection_id

attr_reader :psc_connection_status

def initialize(args = nil, parent_identifier = nil)
return if args.nil?
@parent_identifier = parent_identifier
@consumer_psc_address = args['consumerPscAddress']
@psc_connection_id = args['pscConnectionId']
@psc_connection_status = args['pscConnectionStatus']
end

def to_s
"#{@parent_identifier} RegionNetworkEndpointGroupPscData"
end
end
end
end
end
Loading