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

Changes to Add Inspec for Spanner instance and database #2484

Closed
wants to merge 45 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
7d26dcf
Changes to Add Inspec for Spanner instance and database
Oct 17, 2019
6de4f67
Merge branch 'master' into inspec-spanner-db
Oct 17, 2019
b0a2e8e
Inspec.yaml override issue
Oct 17, 2019
17cbdad
Merge branch 'master' into inspec-spanner-db
Oct 17, 2019
c2c8731
Fixed Typo Error
Oct 17, 2019
bbd5489
implemented ddl recommendation
Oct 17, 2019
9c85db6
Added ddl to exclude
Oct 17, 2019
5f407f4
Merge branch 'master' into inspec-spanner-db
Oct 18, 2019
462605d
Merge branch 'master' into inspec-spanner-db
Oct 18, 2019
8745c0b
Merge branch 'master' into inspec-spanner-db
Oct 21, 2019
4cd3ae9
Added changes as per comment on 10/21
Oct 21, 2019
6f49a82
Merge branch 'master' into inspec-spanner-db
Oct 21, 2019
73fd434
fixed typo issue
Oct 21, 2019
626e4f0
fixed typo issue
Oct 21, 2019
df53852
Merge branch 'master' into inspec-spanner-db
Oct 22, 2019
baa3c68
Merge branch 'master' into inspec-spanner-db
Oct 22, 2019
49d3c3f
Bump GKE node pool GPU disk to an appropriate size. (#2505)
rileykarson Oct 22, 2019
aa7ede4
add ip_configuration to dataflow_job (#2504)
megan07 Oct 22, 2019
19a8a89
Replace some unnecessary checks with import tests (#2500)
c2thorn Oct 22, 2019
38796a4
add forcenew on shielded instance config (#2509)
megan07 Oct 22, 2019
211fc75
Fix version behaviour in `google_compute_instance_group` (#2506)
rileykarson Oct 22, 2019
ab2fe78
Fix erronous lowercase c character (#2490)
Hyde46 Oct 22, 2019
28c2961
Add support for compute_router_nat to inspec (#2510)
slevenick Oct 22, 2019
e831cb9
Added Recent changes
Oct 23, 2019
f103450
Added Recent changes
Oct 23, 2019
939c0c0
Extract Bigtable instance type from InstanceInfo instead of deriving …
nickmoorman Oct 23, 2019
c7e8f13
Added oidcToken to pubsub api. (#2440)
Tony-Proum Oct 23, 2019
f685d5f
Modify health check functionality to match description (#2494)
slevenick Oct 23, 2019
5fbf88b
made changes for node_count
Oct 23, 2019
3bec798
Changes to Add Inspec for Spanner instance and database
Oct 17, 2019
4afbcf2
Inspec.yaml override issue
Oct 17, 2019
73aa593
Fixed Typo Error
Oct 17, 2019
8a5dab8
implemented ddl recommendation
Oct 17, 2019
6509a14
Added ddl to exclude
Oct 17, 2019
ad345a0
Added changes as per comment on 10/21
Oct 21, 2019
e63a776
fixed typo issue
Oct 21, 2019
eb8d018
fixed typo issue
Oct 21, 2019
05e43b1
Added Recent changes
Oct 23, 2019
5a74da8
Added Recent changes
Oct 23, 2019
4d30f6c
made changes for node_count
Oct 23, 2019
1ba0f04
Rebase
Oct 23, 2019
14c14d1
Rebase
Oct 23, 2019
4ba309e
Revert "Rebase"
Oct 23, 2019
50205ee
Revert "made changes for node_count"
Oct 23, 2019
ee9e48a
Revert "Added Recent changes"
Oct 23, 2019
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
44 changes: 44 additions & 0 deletions products/spanner/inspec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Copyright 2017 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

--- !ruby/object:Provider::Inspec::Config
legacy_name: appengine
overrides: !ruby/object:Overrides::ResourceOverrides
ApplicationUrlDispatchRules: !ruby/object:Overrides::Inspec::ResourceOverride
callppatel marked this conversation as resolved.
Show resolved Hide resolved
exclude: true
DomainMapping: !ruby/object:Overrides::Inspec::ResourceOverride
exclude: true
FirewallRule: !ruby/object:Overrides::Inspec::ResourceOverride
exclude: true
StandardAppVersion: !ruby/object:Overrides::Inspec::ResourceOverride
exclude: false
properties:
id: !ruby/object:Overrides::Inspec::PropertyOverride
name: "version_id"
runtimeApiVersion: !ruby/object:Overrides::Inspec::PropertyOverride
exclude: true
handlers: !ruby/object:Overrides::Inspec::PropertyOverride
exclude: true
libraries: !ruby/object:Overrides::Inspec::PropertyOverride
exclude: true
envVariables: !ruby/object:Overrides::Inspec::PropertyOverride
exclude: true
deployment: !ruby/object:Overrides::Inspec::PropertyOverride
exclude: true
entrypoint: !ruby/object:Overrides::Inspec::PropertyOverride
exclude: true
service: !ruby/object:Overrides::Inspec::PropertyOverride
exclude: true
Service: !ruby/object:Overrides::Inspec::ResourceOverride
exclude: true

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<% gcp_project_id = "#{external_attribute('gcp_project_id', doc_generation)}" -%>
<% spannerdatabase = grab_attributes['spannerdatabase'] -%>

describe google_spanner_database(project: <%= gcp_project_id -%>, , instance: <%= doc_generation ? "'#{spannerdatabase['instance']}'" : "spannerdatabase['instance']" -%>, name: <%= doc_generation ? "'#{spannerdatabase['name']}'" : "spannerdatabase['name']" -%>) do
callppatel marked this conversation as resolved.
Show resolved Hide resolved
it { should exist }
its('name') { should eq <%= doc_generation ? "'#{spannerdatabase['name']}'" : "spannerdatabase['name']" -%> }
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
gcp_project_id = attribute(:gcp_project_id, default: '<%= external_attribute('gcp_project_id') -%>', description: 'The GCP project identifier.')
spannerdatabase = attribute('spannerdatabase', default: <%= JSON.pretty_generate(grab_attributes['spannerdatabase']) -%>, description: 'Cloud Spanner definition')
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<% gcp_project_id = "#{external_attribute('gcp_project_id', doc_generation)}" -%>
<% spannerdatabase = grab_attributes['spannerdatabase'] -%>

describe google_spanner_databases(project: <%= gcp_project_id -%>, , instance: <%= doc_generation ? "'#{spannerdatabase['instance']}'" : "spannerdatabase['instance']" -%>) do
callppatel marked this conversation as resolved.
Show resolved Hide resolved
its('instance') { should eq <%= doc_generation ? "'#{spannerdatabase['instance']}'" : "spannerdatabase['instance']" -%> }
callppatel marked this conversation as resolved.
Show resolved Hide resolved
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<% gcp_project_id = "#{external_attribute('gcp_project_id', doc_generation)}" -%>
<% spannerinstance = grab_attributes['spannerinstance'] -%>

describe google_spanner_instance(project: <%= gcp_project_id -%>, name: <%= doc_generation ? "'#{spannerinstance['name']}'" : "spannerinstance['name']" -%>, config: <%= doc_generation ? "'#{spannerinstance['config']}'" : "spannerinstance['config']" -%>) do
it { should exist }
its('config') { should eq <%= doc_generation ? "'projects/#{gcp_project_id}/instanceConfigs/#{spannerinstance['config']}'" : "projects/#{gcp_project_id}/instanceConfigs/spannerinstance['config']" -%> }
callppatel marked this conversation as resolved.
Show resolved Hide resolved
its('name') { should eq <%= doc_generation ? "'#{spannerinstance['name']}'" : "spannerinstance['name']" -%> }
its('display_name') { should eq <%= doc_generation ? "'#{spannerinstance['display_name']}'" : "spannerinstance['display_name']" -%> }
its('node_count') { should eq <%= doc_generation ? "'#{spannerinstance['node_count']}'" : "spannerinstance['node_count']" -%> }
its('labels') { should eq <%= doc_generation ? "'#{spannerinstance['labels']}'" : "spannerinstance['labels']" -%> }
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
gcp_project_id = attribute(:gcp_project_id, default: '<%= external_attribute('gcp_project_id') -%>', description: 'The GCP project identifier.')
spannerinstance = attribute('spannerinstance', default: <%= JSON.pretty_generate(grab_attributes['spannerinstance']) -%>, description: 'Cloud Spanner definition')
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<% gcp_project_id = "#{external_attribute('gcp_project_id', doc_generation)}" -%>
<% spannerinstance = grab_attributes['spannerinstance'] -%>

describe google_spanner_instances(project: <%= gcp_project_id -%>, config: <%= doc_generation ? "'#{spannerinstance['config']}'" : "spannerinstance['config']" -%>) do
its('config') { should eq <%= doc_generation ? "'#{spannerinstance['config']}'" : "spannerinstance['config']" -%> }
callppatel marked this conversation as resolved.
Show resolved Hide resolved
end
18 changes: 18 additions & 0 deletions templates/inspec/tests/integration/build/gcp-mm.tf
Original file line number Diff line number Diff line change
Expand Up @@ -836,3 +836,21 @@ resource "google_compute_node_group" "inspec-node-group" {
size = var.node_group["size"]
node_template = "${google_compute_node_template.inspec-template.self_link}"
}

resource "google_spanner_instance" "spanner_instance" {
project = "${var.gcp_project_id}"
config = "${var.spannerinstance["config"]}"
callppatel marked this conversation as resolved.
Show resolved Hide resolved
name = "${var.spannerinstance["name"]}"
display_name = "${var.spannerinstance["display_name"]}"
node_count = "${var.spannerinstance["node_count"]}"
labels = {
"${var.spannerinstance["label_key"]}" = "${var.spannerinstance["label_value"]}"
}
}

resource "google_spanner_instance" "database" {
callppatel marked this conversation as resolved.
Show resolved Hide resolved
project = "${var.gcp_project_id}"
instance = "${google_spanner_instance.spanner_instance.name}"
name = "${var.spannerdatabase["name"]}"
ddl = "${split("\n", file("ddl.sql"))}"
callppatel marked this conversation as resolved.
Show resolved Hide resolved
}
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -315,4 +315,17 @@ node_template:
node_group:
name: inspec-node-group
description: A description of the node group
size: 0
size: 0

spannerinstance:
config: regional-us-east1
name: spinstance
display_name: inspectest
node_count: 2
callppatel marked this conversation as resolved.
Show resolved Hide resolved
label_key: env
label_value: test

spannerdatabase:
name: spdatabase
instance: spinstance