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

Add Support for App Engine #162

Closed
callppatel opened this issue Aug 8, 2019 · 10 comments
Closed

Add Support for App Engine #162

callppatel opened this issue Aug 8, 2019 · 10 comments

Comments

@callppatel
Copy link
Contributor

🎛 Description

Choose one: is this 🙋 feature request?
Current App Engine Validation is not supported by the inspec. I would like to know if there is plan. Also I would like to contribute to this for more resource like big query, dataproc and etc.

Do we have any help and guide document to add GCP inspec for any new GCP resource

@slevenick
Copy link
Collaborator

Hey @callppatel,

Thanks for your interest in contributing new resources! There are currently two types of resources in the inspec-gcp repo, handwritten and auto generated. I have written most of the auto generated resources using this tool: https://github.com/GoogleCloudPlatform/magic-modules

I'm happy to help you through the process if you want to use magic modules. Otherwise, hand writing the resource using a gcp client library is probably the easiest path forward.

@callppatel
Copy link
Contributor Author

Hi @slevenick - I am trying to create Inpsec for AppEngine resource. I have set-up environment as well. It will be better if we have any specific guideline for inspec resource, one my team member is already adding terraform resource with magic module. I would like to know more specifics steps for inspec resource.

@slevenick
Copy link
Collaborator

Here is an example of adding a new resource via Magic Modules: https://github.com/GoogleCloudPlatform/magic-modules/pull/1545/files

You will need to write a test for both the plural and singular resource which are used for both integration tests as well as documentation. Also add configuration to the .tf file and the attributes file so that terraform can construct the resource that will be tested.

You may have to add a description of the API you want the resource written against. This will go in this file: https://github.com/GoogleCloudPlatform/magic-modules/blob/master/products/appengine/api.yaml which currently only supports the AppEngine firewall rule. This should be based off of the REST API that the resource will use.

I'm happy to help if you have further questions

@callppatel
Copy link
Contributor Author

Thanks a lot for info, its very useful. I am getting below error

_**root@dd1b3f476d1e:/mm/magic-modules# bundle exec compiler -p products/appengine -e inspec -o build/inspec
I, [2019-08-13T01:33:37.057041 #3580] INFO -- : Skipping product 'products/accesscontextmanager' as no inspec.yaml file exists
I, [2019-08-13T01:33:37.062041 #3580] INFO -- : Loading 'products/appengine' (at ga)'
I, [2019-08-13T01:33:37.141163 #3580] INFO -- : Compiling 'products/appengine' (at ga) output to 'build/inspec'
I, [2019-08-13T01:33:37.141243 #3580] INFO -- : Generating types: ALL
I, [2019-08-13T01:33:37.360857 #3580] INFO -- : Excluding FirewallRule per API catalog
I, [2019-08-13T01:33:37.360948 #3580] INFO -- : Excluding Service per API catalog
I, [2019-08-13T01:33:37.361143 #3580] INFO -- : Generating StandardAppVersion
Error compiling file: templates/inspec/doc_template.md.erb
bundler: failed to load command: compiler (compiler)
NoMethodError: undefined method []' for nil:NilClass (erb):5:in provider_binding'
/root/.rbenv/versions/2.6.0/lib/ruby/2.6.0/erb.rb:901:in eval' /root/.rbenv/versions/2.6.0/lib/ruby/2.6.0/erb.rb:901:in result'
/mm/magic-modules/compile/core.rb:127:in compile' (erb):14:in provider_binding'
/root/.rbenv/versions/2.6.0/lib/ruby/2.6.0/erb.rb:901:in eval' /root/.rbenv/versions/2.6.0/lib/ruby/2.6.0/erb.rb:901:in result'
/mm/magic-modules/compile/core.rb:216:in compile_string' /mm/magic-modules/compile/core.rb:151:in compile_file'
/mm/magic-modules/provider/file_template.rb:64:in block in generate' /mm/magic-modules/provider/file_template.rb:64:in open'
/mm/magic-modules/provider/file_template.rb:64:in generate' /mm/magic-modules/provider/inspec.rb:156:in generate_documentation'
/mm/magic-modules/provider/inspec.rb:80:in generate_resource' /mm/magic-modules/provider/core.rb:216:in generate_object'
/mm/magic-modules/provider/core.rb:207:in `block in generate_object

s'
/mm/magic-modules/provider/core.rb:186:in each' /mm/magic-modules/provider/core.rb:186:in generate_objects'
/mm/magic-modules/provider/core.rb:70:in generate' compiler:202:in block in <top (required)>'
compiler:117:in each' compiler:117:in <top (required)>'
root@dd1b3f476d1e:/mm/magic-modules#**_

I am attaching my changed file. New to ruby, not sure where this error is coming
google_appengine_standard_app_version.zip
mm-attributes.zip
gcp-mm.zip
product-terraform.zip

@slevenick
Copy link
Collaborator

Could you push a branch to github and send me a link? I'd prefer that over downloading zips!

@callppatel
Copy link
Contributor Author

callppatel commented Aug 13, 2019

Please check this repo https://github.com/callppatel/magic-modules
my changes are there. Looks like something may be wrong in mm-attributes.yml
One of my colleague has already added terraform resource in app engine. I am trying to add inspec for StandardAppVersion resource. His pull request is GoogleCloudPlatform/magic-modules#1884

@slevenick
Copy link
Collaborator

slevenick commented Aug 22, 2019

Looks like there is an issue compiling the documentation template at doc_template.md.erb. It expects the api description to have a field called apis_required. A sample of this can be seen here:

apis_required:
  - !ruby/object:Api::Product::ApiReference
    name: BigQuery API
    url: https://console.cloud.google.com/apis/library/bigquery-json.googleapis.com/

It's also reasonable to add a nil check on the line in doc_template.rb that would allow this to not exist, like:
<% unless @api.apis_required.empty? -%>
and
<% @api.apis_required&.each do |api| -%>

@khanali21
Copy link

@rileykarson @slevenick I have been working on this, here are some new errors after getting over this issue with <% unless @api.apis_required.nil? -%>

  1. when executing compiler for inspec
bundle exec compiler -a -v "ga" -e inspec -o "$GOPATH/build/inspec"

I get this :

I, [2019-08-23T19:17:57.630191 #10378]  INFO -- : Generating MM output to '/mm/magic-modules/build/inspec'
I, [2019-08-23T19:17:57.630433 #10378]  INFO -- : Using ga version
I, [2019-08-23T19:17:57.720789 #10378]  INFO -- : products/resourcemanager: Compiling provider config
I, [2019-08-23T19:17:58.265158 #10378]  INFO -- : products/resourcemanager: Generating types: ALL
I, [2019-08-23T19:17:58.265333 #10378]  INFO -- : Excluding Project per API catalog
I, [2019-08-23T19:17:58.265445 #10378]  INFO -- : Excluding Lien per API catalog
I, [2019-08-23T19:17:58.265639 #10378]  INFO -- : Generating Folder
I, [2019-08-23T19:17:59.014078 #10378]  INFO -- : Excluding Organization per API catalog
I, [2019-08-23T19:17:59.192615 #10378]  INFO -- : products/cloudfunctions: Compiling provider config
I, [2019-08-23T19:17:59.966239 #10378]  INFO -- : products/cloudfunctions: Generating types: ALL
I, [2019-08-23T19:17:59.966427 #10378]  INFO -- : Generating CloudFunction
I, [2019-08-23T19:18:01.058229 #10378]  INFO -- : products/binaryauthorization: Skipped as no inspec.yaml file exists
I, [2019-08-23T19:18:01.076658 #10378]  INFO -- : products/kms: Skipped as no inspec.yaml file exists
I, [2019-08-23T19:18:01.146435 #10378]  INFO -- : products/vpcaccess: Skipped as no inspec.yaml file exists
I, [2019-08-23T19:18:01.178729 #10378]  INFO -- : products/bigtable: Skipped as no inspec.yaml file exists
I, [2019-08-23T19:18:01.192473 #10378]  INFO -- : products/securitycenter: Skipped as no inspec.yaml file exists
I, [2019-08-23T19:18:01.215397 #10378]  INFO -- : products/firestore: Skipped as no inspec.yaml file exists
I, [2019-08-23T19:18:01.228696 #10378]  INFO -- : products/redis: Skipped as no inspec.yaml file exists
I, [2019-08-23T19:18:01.243910 #10378]  INFO -- : products/mlengine: Skipped as no inspec.yaml file exists
I, [2019-08-23T19:18:01.266593 #10378]  INFO -- : products/healthcare: Skipped as no inspec.yaml file exists
I, [2019-08-23T19:18:01.480164 #10378]  INFO -- : products/appengine: Compiling provider config
I, [2019-08-23T19:18:02.070436 #10378]  INFO -- : products/appengine: Generating types: ALL
I, [2019-08-23T19:18:02.070609 #10378]  INFO -- : Excluding FirewallRule per API catalog
I, [2019-08-23T19:18:02.070713 #10378]  INFO -- : Excluding Service per API catalog
I, [2019-08-23T19:18:02.070849 #10378]  INFO -- : Generating StandardAppVersion
start_time is 2019-08-23 19:17:57 +0000
I, [2019-08-23T19:18:03.213470 #10378]  INFO -- : products/filestore: Skipped as no inspec.yaml file exists
I, [2019-08-23T19:18:03.342192 #10378]  INFO -- : products/cloudbuild: Compiling provider config
I, [2019-08-23T19:18:03.885351 #10378]  INFO -- : products/cloudbuild: Generating types: ALL
I, [2019-08-23T19:18:03.885552 #10378]  INFO -- : Generating Trigger
I, [2019-08-23T19:18:04.863955 #10378]  INFO -- : products/accesscontextmanager: Skipped as no inspec.yaml file exists
I, [2019-08-23T19:18:05.330152 #10378]  INFO -- : products/bigquery: Compiling provider config
I, [2019-08-23T19:18:07.068150 #10378]  INFO -- : products/bigquery: Generating types: ALL
I, [2019-08-23T19:18:07.068564 #10378]  INFO -- : Generating Dataset
I, [2019-08-23T19:18:07.785116 #10378]  INFO -- : Generating Table
I, [2019-08-23T19:18:09.248821 #10378]  INFO -- : products/sourcerepo: Compiling provider config
I, [2019-08-23T19:18:09.909372 #10378]  INFO -- : products/sourcerepo: Generating types: ALL
I, [2019-08-23T19:18:09.911717 #10378]  INFO -- : Generating Repository
I, [2019-08-23T19:18:10.872023 #10378]  INFO -- : products/storage: Skipped as no inspec.yaml file exists
I, [2019-08-23T19:18:10.889439 #10378]  INFO -- : products/cloudrun: Skipped as no inspec.yaml file exists
I, [2019-08-23T19:18:11.474804 #10378]  INFO -- : products/container: Compiling provider config
I, [2019-08-23T19:18:11.974184 #10378]  INFO -- : products/container: Generating types: ALL
I, [2019-08-23T19:18:11.974374 #10378]  INFO -- : Generating RegionalCluster
I, [2019-08-23T19:18:13.050116 #10378]  INFO -- : Generating RegionalNodePool
I, [2019-08-23T19:18:14.041720 #10378]  INFO -- : products/iam: Skipped as no inspec.yaml file exists
I, [2019-08-23T19:18:18.175602 #10378]  INFO -- : products/compute: Compiling provider config
I, [2019-08-23T19:18:18.695986 #10378]  INFO -- : products/compute: Generating types: ALL
I, [2019-08-23T19:18:18.696222 #10378]  INFO -- : Excluding Address per API catalog
I, [2019-08-23T19:18:18.696448 #10378]  INFO -- : Generating Autoscaler
I, [2019-08-23T19:18:19.461670 #10378]  INFO -- : Generating BackendBucket
I, [2019-08-23T19:18:20.629918 #10378]  INFO -- : Excluding BackendBucketSignedUrlKey per API catalog
I, [2019-08-23T19:18:20.630231 #10378]  INFO -- : Generating BackendService
I, [2019-08-23T19:18:21.657796 #10378]  INFO -- : Generating RegionBackendService
I, [2019-08-23T19:18:22.315435 #10378]  INFO -- : Excluding BackendServiceSignedUrlKey per API catalog
I, [2019-08-23T19:18:22.315768 #10378]  INFO -- : Excluding DiskType per API catalog
I, [2019-08-23T19:18:22.316200 #10378]  INFO -- : Generating Disk
I, [2019-08-23T19:18:22.905098 #10378]  INFO -- : Excluding Firewall per API catalog
I, [2019-08-23T19:18:22.905261 #10378]  INFO -- : Excluding ForwardingRule per API catalog
I, [2019-08-23T19:18:22.905341 #10378]  INFO -- : Generating GlobalAddress
I, [2019-08-23T19:18:23.594819 #10378]  INFO -- : Generating GlobalForwardingRule
I, [2019-08-23T19:18:24.962954 #10378]  INFO -- : Generating HttpHealthCheck
I, [2019-08-23T19:18:25.489082 #10378]  INFO -- : Generating HttpsHealthCheck
I, [2019-08-23T19:18:25.965829 #10378]  INFO -- : Generating HealthCheck
I, [2019-08-23T19:18:26.665999 #10378]  INFO -- : Generating InstanceTemplate
I, [2019-08-23T19:18:27.525581 #10378]  INFO -- : Excluding License per API catalog
I, [2019-08-23T19:18:27.525920 #10378]  INFO -- : Excluding Image per API catalog
I, [2019-08-23T19:18:27.526164 #10378]  INFO -- : Excluding Instance per API catalog
I, [2019-08-23T19:18:27.526347 #10378]  INFO -- : Excluding InstanceGroup per API catalog
I, [2019-08-23T19:18:27.526499 #10378]  INFO -- : Generating InstanceGroupManager
I, [2019-08-23T19:18:28.353532 #10378]  INFO -- : Excluding InterconnectAttachment per API catalog
I, [2019-08-23T19:18:28.355494 #10378]  INFO -- : Excluding MachineType per API catalog
I, [2019-08-23T19:18:28.356713 #10378]  INFO -- : Excluding Network per API catalog
I, [2019-08-23T19:18:28.358370 #10378]  INFO -- : Excluding NetworkEndpoint per API catalog
I, [2019-08-23T19:18:28.359953 #10378]  INFO -- : Excluding NetworkEndpointGroup per API catalog
I, [2019-08-23T19:18:28.361376 #10378]  INFO -- : Excluding NodeGroup per API catalog
I, [2019-08-23T19:18:28.361859 #10378]  INFO -- : Excluding NodeTemplate per API catalog
I, [2019-08-23T19:18:28.362710 #10378]  INFO -- : Generating Region
I, [2019-08-23T19:18:29.140726 #10378]  INFO -- : Excluding RegionAutoscaler per API catalog
I, [2019-08-23T19:18:29.141342 #10378]  INFO -- : Excluding RegionDiskType per API catalog
I, [2019-08-23T19:18:29.142455 #10378]  INFO -- : Excluding RegionDisk per API catalog
I, [2019-08-23T19:18:29.144244 #10378]  INFO -- : Excluding ResourcePolicy per API version
I, [2019-08-23T19:18:29.145385 #10378]  INFO -- : Generating Route
I, [2019-08-23T19:18:29.807240 #10378]  INFO -- : Generating Router
I, [2019-08-23T19:18:30.565305 #10378]  INFO -- : Generating Snapshot
I, [2019-08-23T19:18:31.611159 #10378]  INFO -- : Generating SslCertificate
I, [2019-08-23T19:18:32.628644 #10378]  INFO -- : Excluding ManagedSslCertificate per API version
I, [2019-08-23T19:18:32.628968 #10378]  INFO -- : Generating SslPolicy
I, [2019-08-23T19:18:33.295694 #10378]  INFO -- : Generating Subnetwork
I, [2019-08-23T19:18:33.360960 #10378]  INFO -- : Generating TargetHttpProxy
I, [2019-08-23T19:18:34.065247 #10378]  INFO -- : Generating TargetHttpsProxy
I, [2019-08-23T19:18:34.789389 #10378]  INFO -- : Excluding TargetInstance per API catalog
I, [2019-08-23T19:18:34.789551 #10378]  INFO -- : Generating TargetPool
I, [2019-08-23T19:18:35.635968 #10378]  INFO -- : Excluding TargetSslProxy per API catalog
I, [2019-08-23T19:18:35.636233 #10378]  INFO -- : Generating TargetTcpProxy
I, [2019-08-23T19:18:36.536699 #10378]  INFO -- : Excluding TargetVpnGateway per API catalog
I, [2019-08-23T19:18:36.537151 #10378]  INFO -- : Excluding VpnGateway per API version
I, [2019-08-23T19:18:36.537257 #10378]  INFO -- : Excluding ExternalVpnGateway per API catalog
I, [2019-08-23T19:18:36.537374 #10378]  INFO -- : Generating UrlMap
I, [2019-08-23T19:18:37.714183 #10378]  INFO -- : Excluding VpnTunnel per API catalog
I, [2019-08-23T19:18:37.714351 #10378]  INFO -- : Excluding Zone per API catalog
I, [2019-08-23T19:18:37.727408 #10378]  INFO -- : products/containeranalysis: Skipped as no inspec.yaml file exists
I, [2019-08-23T19:18:37.740338 #10378]  INFO -- : products/cloudtasks: Skipped as no inspec.yaml file exists
I, [2019-08-23T19:18:37.816321 #10378]  INFO -- : products/pubsub: Compiling provider config
I, [2019-08-23T19:18:38.323378 #10378]  INFO -- : products/pubsub: Generating types: ALL
I, [2019-08-23T19:18:38.323598 #10378]  INFO -- : Generating Topic
I, [2019-08-23T19:18:39.168295 #10378]  INFO -- : Generating Subscription
I, [2019-08-23T19:18:39.929897 #10378]  INFO -- : products/spanner: Skipped as no inspec.yaml file exists
I, [2019-08-23T19:18:39.946780 #10378]  INFO -- : products/securityscanner: Skipped as no inspec.yaml file exists
I, [2019-08-23T19:18:39.961067 #10378]  INFO -- : products/tpu: Skipped as no inspec.yaml file exists
I, [2019-08-23T19:18:39.973551 #10378]  INFO -- : products/monitoring: Skipped as no inspec.yaml file exists
I, [2019-08-23T19:18:39.986569 #10378]  INFO -- : products/cloudscheduler: Skipped as no inspec.yaml file exists
I, [2019-08-23T19:18:40.168394 #10378]  INFO -- : products/dns: Compiling provider config
I, [2019-08-23T19:18:40.691171 #10378]  INFO -- : products/dns: Generating types: ALL
I, [2019-08-23T19:18:40.691589 #10378]  INFO -- : Excluding ManagedZone per API catalog
I, [2019-08-23T19:18:40.691985 #10378]  INFO -- : Excluding Policy per API version
I, [2019-08-23T19:18:40.692848 #10378]  INFO -- : Excluding Project per API catalog
I, [2019-08-23T19:18:40.693197 #10378]  INFO -- : Generating ResourceRecordSet
I, [2019-08-23T19:18:41.829130 #10378]  INFO -- : products/logging: Skipped as no inspec.yaml file exists
I, [2019-08-23T19:18:41.868300 #10378]  INFO -- : products/bigquerydatatransfer: Skipped as no inspec.yaml file exists
I, [2019-08-23T19:18:41.897585 #10378]  INFO -- : products/dataproc: Skipped as no inspec.yaml file exists
I, [2019-08-23T19:18:41.928047 #10378]  INFO -- : products/sql: Skipped as no inspec.yaml file exists
I, [2019-08-23T19:18:41.936984 #10378]  INFO -- : Copying common files for inspec
start_time is 2019-08-23 19:17:57 +0000
/mm/magic-modules/build/inspec/Gemfile was already modified during this run. 2019-08-23 19:18:03 +0000

You see there were twice "start_time is ..." I am not sure why the Gemfile is being generated twice.
I work around this by changing raise to puts

After that I was able to compile, but when I try to run the inspec, I get the following error:

root@186ca4085b8a:~/test/my-profile# inspec exec . -t gcp:// --attrs attributes.yml
Your application has authenticated using end user credentials from Google Cloud SDK. We recommend that most server applications use service accounts instead. If your application continues to use end user credentials from Cloud SDK, you might receive a "quota exceeded" or "API not enabled" error. For more information about service accounts, see https://cloud.google.com/docs/authentication/.
[2019-08-23T19:03:51+00:00] WARN: DEPRECATION: InSpec Attributes are being renamed to InSpec Inputs to avoid confusion with Chef Attributes. Use --input-file on the command line instead of --attrs.
[2019-08-23T19:03:51+00:00] WARN: Input 'gcp_project_id' does not have a value. Use --input-file to provide a value for 'gcp_project_id' or specify a  value with `attribute('gcp_project_id', value: 'somevalue', ...)`.
Traceback (most recent call last):
	33: from /usr/bin/inspec:186:in `<main>'
	32: from /usr/bin/inspec:186:in `load'
	31: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/inspec-bin-4.12.0/bin/inspec:11:in `<top (required)>'
	30: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/inspec-4.12.0/lib/inspec/base_cli.rb:33:in `start'
	29: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/thor-0.20.3/lib/thor/base.rb:466:in `start'
	28: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
	27: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
	26: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
	25: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/inspec-4.12.0/lib/inspec/cli.rb:293:in `exec'
	24: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/inspec-4.12.0/lib/inspec/runner.rb:122:in `run'
	23: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/inspec-4.12.0/lib/inspec/runner.rb:94:in `load'
	22: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/inspec-4.12.0/lib/inspec/runner.rb:94:in `each'
	21: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/inspec-4.12.0/lib/inspec/runner.rb:100:in `block in load'
	20: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/inspec-4.12.0/lib/inspec/profile.rb:237:in `load_libraries'
	19: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/inspec-4.12.0/lib/inspec/profile.rb:237:in `each_with_index'
	18: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/inspec-4.12.0/lib/inspec/profile.rb:237:in `each'
	17: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/inspec-4.12.0/lib/inspec/profile.rb:252:in `block in load_libraries'
	16: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/inspec-4.12.0/lib/inspec/profile.rb:260:in `load_libraries'
	15: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/inspec-4.12.0/lib/inspec/profile_context.rb:134:in `load_libraries'
	14: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/inspec-4.12.0/lib/inspec/profile_context.rb:134:in `each'
	13: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/inspec-4.12.0/lib/inspec/profile_context.rb:137:in `block in load_libraries'
	12: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/inspec-4.12.0/lib/inspec/profile_context.rb:150:in `load_library_file'
	11: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/inspec-4.12.0/lib/inspec/profile_context.rb:161:in `load_with_context'
	10: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/inspec-4.12.0/lib/inspec/profile_context.rb:161:in `instance_eval'
	 9: from libraries/google_bigquery_table.rb:18:in `load_with_context'
	 8: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/inspec-4.12.0/lib/inspec/dsl_shared.rb:26:in `require'
	 7: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/inspec-4.12.0/lib/inspec/dsl_shared.rb:26:in `eval'
	 6: from libraries/google/bigquery/property/table_external_data_configuration.rb:16:in `create'
	 5: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/inspec-4.12.0/lib/inspec/dsl_shared.rb:26:in `require'
	 4: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/inspec-4.12.0/lib/inspec/dsl_shared.rb:26:in `eval'
	 3: from libraries/google/bigquery/property/table_external_data_configuration_bigtable_options.rb:16:in `create'
	 2: from /opt/inspec/embedded/lib/ruby/gems/2.6.0/gems/inspec-4.12.0/lib/inspec/dsl_shared.rb:13:in `require'
	 1: from /opt/inspec/embedded/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/opt/inspec/embedded/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- google/bigquery/property/table_external_data_configuration_bigtable_options_column_families (LoadError)

I have debugged the issue with no success, when I try this with

  url: https://github.com/inspec/inspec-gcp/archive/master.tar.gz

it is perfectly fine, but when I run this with newly generated inspec-gcp in build/inspec it fails with the above error.

@rileykarson
Copy link
Contributor

rileykarson commented Aug 23, 2019

If you've included the following lines in your inspec.yaml, they'll need to be removed:

https://github.com/GoogleCloudPlatform/magic-modules/pull/2204/files#diff-1a4aaefced93b4d18bc0e5c3e6baf3d3L16-L18

I added a check that copied files didn't clobber other files recently (previously I'd added a check for compiled and generated files but it didn't work for copied ones) and it caught that Gemfile which was copied over by each product.

The start_time being logged was a debug line, oops. Removing with GoogleCloudPlatform/magic-modules#2238.

@slevenick
Copy link
Collaborator

Added in #178

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants