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

Subnet iam policy #142

Merged
merged 6 commits into from
Apr 30, 2019
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
2 changes: 1 addition & 1 deletion docs/resources/google_compute_backend_service.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Properties that can be accessed from the `google_compute_backend_service` resour

* `oauth2_client_secret_sha256`: OAuth2 Client Secret SHA-256 for IAP

* `load_balancing_scheme`: Indicates whether the backend service will be used with internal or external load balancing. A backend service created for one type of load balancing cannot be used with the other.
* `load_balancing_scheme`: Indicates whether the backend service will be used with internal or external load balancing. A backend service created for one type of load balancing cannot be used with the other. One of `INTERNAL` or `EXTERNAL`. Defaults to `EXTERNAL`.

* `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.

Expand Down
4 changes: 2 additions & 2 deletions docs/resources/google_compute_global_address.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ Properties that can be accessed from the `google_compute_global_address` resourc

* `creation_timestamp`: Creation timestamp in RFC3339 text format.

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

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

* `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.

* `ip_version`: The IP Version that will be used by this address. Valid options are IPV4 or IPV6. The default value is IPV4.
* `ip_version`: The IP Version that will be used by this address. Valid options are `IPV4` or `IPV6`. The default value is `IPV4`.

* `region`: A reference to the region where the regional address resides.

Expand Down
2 changes: 1 addition & 1 deletion docs/resources/google_compute_instance_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe google_compute_instance_template(project: 'chef-gcp-inspec', name: 'ins
it { should exist }
its('description') { should eq 'A description of the instance template' }
its('properties.description') { should eq 'A description of the instance itself' }
its('properties.machine_type') { should eq 'n1-standard-1' }
its('properties.machine_type') { should eq 'f1-micro' }
its('properties.tags.items') { should include 'foo' }
its('properties.disks.count') { should eq 1 }
its('properties.disks.first.auto_delete') { should eq 'true' }
Expand Down
39 changes: 39 additions & 0 deletions docs/resources/google_compute_subnetwork_iam_policy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
title: About the google_compute_subnetwork_iam_policy resource
platform: gcp
---

## Syntax
A `google_compute_subnetwork_iam_policy` is used to test a Google Subnetwork Iam Policy resource

## Examples
```
describe google_compute_subnetwork_iam_policy(project: "project", region: "region", name: "name") do
it { should exist }
end

describe google_compute_subnetwork_iam_policy(project: "project", region: "region", name: "name").bindings do |binding|
its('role') { should_not eq 'roles/owner' }
end
```

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

* `bindings`: Associates a list of members to a role.

* `role`: Role that is assigned to members. For example, roles/viewer, roles/editor, or roles/owner.

* `members`: Specifies the identities requesting access for a Cloud Platform resource.

* `audit_configs`: Specifies cloud audit logging configuration for this policy.

* `service`: Specifies a service that will be enabled for audit logging. For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a special value that covers all services.

* `audit_log_configs`: The configuration for logging of each type of permission.



## GCP Permissions

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

## Syntax
A `google_container_regional_node_pool` is used to test a Google RegionalNodePool resource

## Examples
```
describe google_container_regional_node_pool(project: 'chef-gcp-inspec', location: 'europe-west2', cluster: 'inspec-gcp-regional-cluster', name: 'inspec-gcp-regional-node-pool') do
it { should exist }
its('initial_node_count') { should eq '1'}
end

describe google_container_regional_node_pool(project: 'chef-gcp-inspec', location: 'europe-west2', cluster: 'inspec-gcp-regional-cluster', name: 'nonexistent') do
it { should_not exist }
end
```

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

* `name`: The name of the node pool.

* `config`: The node configuration of the pool.

* `machine_type`: The name of a Google Compute Engine machine type (e.g. n1-standard-1). If unspecified, the default machine type is n1-standard-1.

* `disk_size_gb`: Size of the disk attached to each node, specified in GB. The smallest allowed disk size is 10GB. If unspecified, the default disk size is 100GB.

* `oauth_scopes`: The set of Google API scopes to be made available on all of the node VMs under the "default" service account. The following scopes are recommended, but not required, and by default are not included: https://www.googleapis.com/auth/compute is required for mounting persistent storage on your nodes. https://www.googleapis.com/auth/devstorage.read_only is required for communicating with gcr.io (the Google Container Registry). If unspecified, no scopes are added, unless Cloud Logging or Cloud Monitoring are enabled, in which case their required scopes will be added.

* `service_account`: The Google Cloud Platform Service Account to be used by the node VMs. If no Service Account is specified, the "default" service account is used.

* `metadata`: The metadata key/value pairs assigned to instances in the cluster. Keys must conform to the regexp [a-zA-Z0-9-_]+ and be less than 128 bytes in length. These are reflected as part of a URL in the metadata server. Additionally, to avoid ambiguity, keys must not conflict with any other metadata keys for the project or be one of the four reserved keys: "instance-template", "kube-env", "startup-script", and "user-data" Values are free-form strings, and only have meaning as interpreted by the image running in the instance. The only restriction placed on them is that each value's size must be less than or equal to 32 KB. The total size of all keys and values must be less than 512 KB. An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

* `image_type`: The image type to use for this node. Note that for a given image type, the latest version of it will be used.

* `labels`: The map of Kubernetes labels (key/value pairs) to be applied to each node. These will added in addition to any default label(s) that Kubernetes may apply to the node. In case of conflict in label keys, the applied set may differ depending on the Kubernetes version -- it's best to assume the behavior is undefined and conflicts should be avoided. For more information, including usage and the valid values, see: http://kubernetes.io/v1.1/docs/user-guide/labels.html An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

* `local_ssd_count`: The number of local SSD disks to be attached to the node. The limit for this value is dependant upon the maximum number of disks available on a machine per zone. See: https://cloud.google.com/compute/docs/disks/local-ssd#local_ssd_limits for more information.

* `tags`: The list of instance tags applied to all nodes. Tags are used to identify valid sources or targets for network firewalls and are specified by the client during cluster or node pool creation. Each tag within the list must comply with RFC1035.

* `preemptible`: Whether the nodes are created as preemptible VM instances. See: https://cloud.google.com/compute/docs/instances/preemptible for more information about preemptible VM instances.

* `initial_node_count`: The initial node count for the pool. You must ensure that your Compute Engine resource quota is sufficient for this number of instances. You must also have available firewall and routes quota.

* `version`: The version of the Kubernetes of this node.

* `autoscaling`: Autoscaler configuration for this NodePool. Autoscaler is enabled only if a valid configuration is present.

* `enabled`: Is autoscaling enabled for this node pool.

* `min_node_count`: Minimum number of nodes in the NodePool. Must be >= 1 and <= maxNodeCount.

* `max_node_count`: Maximum number of nodes in the NodePool. Must be >= minNodeCount. There has to enough quota to scale up the cluster.

* `management`: Management configuration for this NodePool.

* `auto_upgrade`: A flag that specifies whether node auto-upgrade is enabled for the node pool. If enabled, node auto-upgrade helps keep the nodes in your node pool up to date with the latest release version of Kubernetes.

* `auto_repair`: A flag that specifies whether the node auto-repair is enabled for the node pool. If enabled, the nodes in this node pool will be monitored and, if they fail health checks too many times, an automatic repair action will be triggered.

* `upgrade_options`: Specifies the Auto Upgrade knobs for the node pool.

* `cluster`: The cluster this node pool belongs to.

* `location`: The location where the node pool is deployed



## GCP Permissions

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

## Syntax
A `google_container_regional_node_pools` is used to test a Google RegionalNodePool resource

## Examples
```
describe google_container_regional_node_pools(project: 'chef-gcp-inspec', location: 'europe-west2', cluster: 'inspec-gcp-regional-cluster') do
its('initial_node_counts') { should include '1'}
end
```

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

See [google_container_regional_node_pool.md](google_container_regional_node_pool.md) for more detailed information
* `names`: an array of `google_container_regional_node_pool` name
* `configs`: an array of `google_container_regional_node_pool` config
* `initial_node_counts`: an array of `google_container_regional_node_pool` initial_node_count
* `versions`: an array of `google_container_regional_node_pool` version
* `autoscalings`: an array of `google_container_regional_node_pool` autoscaling
* `managements`: an array of `google_container_regional_node_pool` management
* `clusters`: an array of `google_container_regional_node_pool` cluster
* `locations`: an array of `google_container_regional_node_pool` location

## 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 [Kubernetes Engine API](https://console.cloud.google.com/apis/library/container.googleapis.com/) is enabled for the current project.
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# frozen_string_literal: false

# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
# ----------------------------------------------------------------------------
#
# 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 Container
module Property
class RegionalNodePoolAutoscaling
attr_reader :enabled

attr_reader :min_node_count

attr_reader :max_node_count

def initialize(args = nil, parent_identifier = nil)
return if args.nil?
@parent_identifier = parent_identifier
@enabled = args['enabled']
@min_node_count = args['minNodeCount']
@max_node_count = args['maxNodeCount']
end

def to_s
"#{@parent_identifier} RegionalNodePoolAutoscaling"
end
end
end
end
end
61 changes: 61 additions & 0 deletions libraries/google/container/property/regionalnodepool_config.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# frozen_string_literal: false

# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
# ----------------------------------------------------------------------------
#
# 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 Container
module Property
class RegionalNodePoolConfig
attr_reader :machine_type

attr_reader :disk_size_gb

attr_reader :oauth_scopes

attr_reader :service_account

attr_reader :metadata

attr_reader :image_type

attr_reader :labels

attr_reader :local_ssd_count

attr_reader :tags

attr_reader :preemptible

def initialize(args = nil, parent_identifier = nil)
return if args.nil?
@parent_identifier = parent_identifier
@machine_type = args['machineType']
@disk_size_gb = args['diskSizeGb']
@oauth_scopes = args['oauthScopes']
@service_account = args['serviceAccount']
@metadata = args['metadata']
@image_type = args['imageType']
@labels = args['labels']
@local_ssd_count = args['localSsdCount']
@tags = args['tags']
@preemptible = args['preemptible']
end

def to_s
"#{@parent_identifier} RegionalNodePoolConfig"
end
end
end
end
end
41 changes: 41 additions & 0 deletions libraries/google/container/property/regionalnodepool_management.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# frozen_string_literal: false

# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
# ----------------------------------------------------------------------------
#
# 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.
#
# ----------------------------------------------------------------------------
require 'google/container/property/regionalnodepool_management_upgrade_options'
module GoogleInSpec
module Container
module Property
class RegionalNodePoolManagement
attr_reader :auto_upgrade

attr_reader :auto_repair

attr_reader :upgrade_options

def initialize(args = nil, parent_identifier = nil)
return if args.nil?
@parent_identifier = parent_identifier
@auto_upgrade = args['autoUpgrade']
@auto_repair = args['autoRepair']
@upgrade_options = GoogleInSpec::Container::Property::RegionalNodePoolManagementUpgradeOptions.new(args['upgradeOptions'], to_s)
end

def to_s
"#{@parent_identifier} RegionalNodePoolManagement"
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 *** AUTO GENERATED CODE ***
#
# ----------------------------------------------------------------------------
#
# 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 Container
module Property
class RegionalNodePoolManagementUpgradeOptions
attr_reader :auto_upgrade_start_time

attr_reader :description

def initialize(args = nil, parent_identifier = nil)
return if args.nil?
@parent_identifier = parent_identifier
@auto_upgrade_start_time = parse_time_string(args['autoUpgradeStartTime'])
@description = args['description']
end

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