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 BigQuery, Source Repositories #113

Merged
merged 57 commits into from
Mar 1, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
e87bd0f
Add InSpec support for backend service
slevenick Jan 25, 2019
6a8728b
Merge pull request #87 from modular-magician/codegen-pr-1300
slevenick Jan 25, 2019
9ecfaaa
Add HTTP health check for InSpec
slevenick Jan 25, 2019
0942279
Merge pull request #88 from modular-magician/codegen-pr-1303
slevenick Jan 25, 2019
98a2d36
Add HTTPS health check to InSpec
slevenick Jan 25, 2019
f0be43a
Merge pull request #89 from modular-magician/codegen-pr-1305
slevenick Jan 25, 2019
e4f5d3e
Add compute instance template for InSpec
slevenick Jan 26, 2019
2e55d45
Merge pull request #90 from modular-magician/codegen-pr-1308
slevenick Jan 28, 2019
0a10a32
Add compute global address to InSpec
slevenick Jan 28, 2019
752a463
Merge pull request #91 from modular-magician/codegen-pr-1309
slevenick Jan 28, 2019
2f6ded5
Inspec url map
slevenick Jan 28, 2019
9d387eb
Merge pull request #92 from modular-magician/codegen-pr-1310
slevenick Jan 28, 2019
adb5a42
Add InSpec support for HTTP proxy
slevenick Jan 28, 2019
226fac4
Merge pull request #94 from modular-magician/codegen-pr-1314
slevenick Jan 28, 2019
67a8582
Add global forwarding rule generation to InSpec
slevenick Jan 29, 2019
1753ef9
Merge pull request #95 from modular-magician/codegen-pr-1319
slevenick Jan 29, 2019
9ce89f7
Add support for target TCP proxy in InSpec
slevenick Jan 29, 2019
2c51de4
Merge pull request #96 from modular-magician/codegen-pr-1321
slevenick Jan 30, 2019
bf0e504
Inspec regional cluster
slevenick Jan 30, 2019
a562de7
Merge pull request #97 from modular-magician/codegen-pr-1295
slevenick Jan 30, 2019
ec04e25
Add InSpec support for compute routes
slevenick Jan 30, 2019
c18dd70
Merge pull request #98 from modular-magician/codegen-pr-1331
slevenick Jan 31, 2019
a167f4c
Update InSpec doc template to use underscored name in title box
slevenick Jan 31, 2019
7aceed0
Merge pull request #100 from modular-magician/codegen-pr-1333
slevenick Jan 31, 2019
73aaadb
Add router support in InSpec
slevenick Jan 31, 2019
df79fb9
Merge pull request #99 from modular-magician/codegen-pr-1332
slevenick Jan 31, 2019
507ad5c
Add support for InSpec disk snapshot
slevenick Feb 1, 2019
c3d9a69
Merge pull request #101 from modular-magician/codegen-pr-1343
slevenick Feb 1, 2019
858fa89
Inspec ssl certificate
slevenick Feb 2, 2019
55558ec
Merge pull request #102 from modular-magician/codegen-pr-1347
slevenick Feb 5, 2019
280de46
Fix InSpec pubsub subscription test
slevenick Feb 6, 2019
3608612
Merge pull request #103 from modular-magician/codegen-pr-1357
slevenick Feb 6, 2019
ed63fb1
InSpec add support for BigQuery Dataset
slevenick Feb 6, 2019
e12467d
Merge pull request #104 from modular-magician/codegen-pr-1358
slevenick Feb 8, 2019
a3bbe4b
Retrieve SOA record using DNS zone instead of building it from record…
matco Feb 12, 2019
ac3d1fd
Inspec nested refactor
slevenick Feb 13, 2019
8360494
Merge pull request #105 from modular-magician/codegen-pr-1368
slevenick Feb 13, 2019
009f814
Remove old nested objects with bad namespaces
slevenick Feb 13, 2019
c268f98
Add VCR back for unit testing in InSpec
slevenick Feb 13, 2019
a8cc444
Merge branch 'master' of https://github.com/inspec/inspec-gcp
slevenick Feb 13, 2019
e24b30c
Merge pull request #107 from modular-magician/codegen-pr-1373
slevenick Feb 13, 2019
519ebca
Add terraform upgrade to Rakefile
slevenick Feb 15, 2019
bf0cbf2
Templates, inspec.yaml for bigquery table
slevenick Feb 15, 2019
a9b2537
Merge pull request #110 from modular-magician/codegen-pr-1399
slevenick Feb 15, 2019
2688372
Retrieve SOA record using DNS zone instead of building it from record…
rambleraptor Feb 15, 2019
fb2b900
Add InSpec support for source repositories
slevenick Feb 19, 2019
28ec6a7
Add labels to Pubsub Subscription/Topics (#109)
modular-magician Feb 19, 2019
f5b6860
Update display names across products based on cloud.google.com (#106)
modular-magician Feb 19, 2019
3cf9d74
Merge branch 'master' into codegen-pr-1411
slevenick Feb 20, 2019
d627f42
Merge pull request #112 from modular-magician/codegen-pr-1411
slevenick Feb 20, 2019
b68cb8b
Add convenience outputs for public/private IP in Cloud SQL
rileykarson Feb 20, 2019
c5b2dec
Merge pull request #116 from modular-magician/codegen-pr-1417
nat-henderson Feb 20, 2019
1f43702
Merge remote-tracking branch 'origin/master' into gcp-master
slevenick Feb 25, 2019
e591cf4
Reset merge issues
slevenick Feb 25, 2019
bce4ef4
Add notes on API requirements to markdown docs for InSpec generated r…
slevenick Feb 28, 2019
a7b11d4
Merge pull request #119 from modular-magician/codegen-pr-1449
slevenick Feb 28, 2019
0c000e9
Improve docs for Cloud Build (#118)
modular-magician Mar 1, 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
52 changes: 52 additions & 0 deletions docs/resources/google_compute_ssl_certificate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
title: About the google_compute_ssl_certificate resource
platform: gcp
---

## Syntax
A `google_compute_ssl_certificate` is used to test a Google SslCertificate resource

## Examples
```
describe google_compute_ssl_certificate(project: 'chef-gcp-inspec', name: 'inspec-gcp-ssl-certificate') do
it { should exist }
its('description') { should eq 'A fake ssl certificate (DO NOT USE)' }
its('certificate') { should eq '-----BEGIN CERTIFICATE-----
MIICqjCCAk+gAwIBAgIJAIuJ+0352Kq4MAoGCCqGSM49BAMCMIGwMQswCQYDVQQG
EwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjERMA8GA1UEBwwIS2lya2xhbmQxFTAT
BgNVBAoMDEdvb2dsZSwgSW5jLjEeMBwGA1UECwwVR29vZ2xlIENsb3VkIFBsYXRm
b3JtMR8wHQYDVQQDDBZ3d3cubXktc2VjdXJlLXNpdGUuY29tMSEwHwYJKoZIhvcN
AQkBFhJuZWxzb25hQGdvb2dsZS5jb20wHhcNMTcwNjI4MDQ1NjI2WhcNMjcwNjI2
MDQ1NjI2WjCBsDELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24xETAP
BgNVBAcMCEtpcmtsYW5kMRUwEwYDVQQKDAxHb29nbGUsIEluYy4xHjAcBgNVBAsM
FUdvb2dsZSBDbG91ZCBQbGF0Zm9ybTEfMB0GA1UEAwwWd3d3Lm15LXNlY3VyZS1z
aXRlLmNvbTEhMB8GCSqGSIb3DQEJARYSbmVsc29uYUBnb29nbGUuY29tMFkwEwYH
KoZIzj0CAQYIKoZIzj0DAQcDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ
4mzkzTv0dXyB750fOGN02HtkpBOZzzvUARTR10JQoSe2/5PIwaNQME4wHQYDVR0O
BBYEFKIQC3A2SDpxcdfn0YLKineDNq/BMB8GA1UdIwQYMBaAFKIQC3A2SDpxcdfn
0YLKineDNq/BMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhALs4vy+O
M3jcqgA4fSW/oKw6UJxp+M6a+nGMX+UJR3YgAiEAvvl39QRVAiv84hdoCuyON0lJ
zqGNhIPGq2ULqXKK8BY=
-----END CERTIFICATE-----
' }
end

describe google_compute_ssl_certificate(project: 'chef-gcp-inspec', name: 'nonexistent') do
it { should_not exist }
end
```

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

* `certificate`: The certificate in PEM format. The certificate chain must be no greater than 5 certs long. The chain must include at least one intermediate cert.

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

* `description`: An optional description of this resource.

* `id`: The unique identifier 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.

* `private_key`: The write-only private key in PEM format.
49 changes: 49 additions & 0 deletions docs/resources/google_compute_ssl_certificates.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
title: About the google_compute_ssl_certificates resource
platform: gcp
---

## Syntax
A `google_compute_ssl_certificates` is used to test a Google SslCertificate resource

## Examples
```
describe google_compute_ssl_certificates(project: 'chef-gcp-inspec') do

its('names') { should include 'inspec-gcp-ssl-certificate' }
its('descriptions') { should include 'A fake ssl certificate (DO NOT USE)' }
its('certificates') { should include '-----BEGIN CERTIFICATE-----
MIICqjCCAk+gAwIBAgIJAIuJ+0352Kq4MAoGCCqGSM49BAMCMIGwMQswCQYDVQQG
EwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjERMA8GA1UEBwwIS2lya2xhbmQxFTAT
BgNVBAoMDEdvb2dsZSwgSW5jLjEeMBwGA1UECwwVR29vZ2xlIENsb3VkIFBsYXRm
b3JtMR8wHQYDVQQDDBZ3d3cubXktc2VjdXJlLXNpdGUuY29tMSEwHwYJKoZIhvcN
AQkBFhJuZWxzb25hQGdvb2dsZS5jb20wHhcNMTcwNjI4MDQ1NjI2WhcNMjcwNjI2
MDQ1NjI2WjCBsDELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24xETAP
BgNVBAcMCEtpcmtsYW5kMRUwEwYDVQQKDAxHb29nbGUsIEluYy4xHjAcBgNVBAsM
FUdvb2dsZSBDbG91ZCBQbGF0Zm9ybTEfMB0GA1UEAwwWd3d3Lm15LXNlY3VyZS1z
aXRlLmNvbTEhMB8GCSqGSIb3DQEJARYSbmVsc29uYUBnb29nbGUuY29tMFkwEwYH
KoZIzj0CAQYIKoZIzj0DAQcDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ
4mzkzTv0dXyB750fOGN02HtkpBOZzzvUARTR10JQoSe2/5PIwaNQME4wHQYDVR0O
BBYEFKIQC3A2SDpxcdfn0YLKineDNq/BMB8GA1UdIwQYMBaAFKIQC3A2SDpxcdfn
0YLKineDNq/BMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhALs4vy+O
M3jcqgA4fSW/oKw6UJxp+M6a+nGMX+UJR3YgAiEAvvl39QRVAiv84hdoCuyON0lJ
zqGNhIPGq2ULqXKK8BY=
-----END CERTIFICATE-----
' }
end
```

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

See [google_compute_ssl_certificate.md](google_compute_ssl_certificate.md) for more detailed information
* `certificates`: an array of `google_compute_ssl_certificate` certificate
* `creation_timestamps`: an array of `google_compute_ssl_certificate` creation_timestamp
* `descriptions`: an array of `google_compute_ssl_certificate` description
* `ids`: an array of `google_compute_ssl_certificate` id
* `names`: an array of `google_compute_ssl_certificate` name
* `private_keys`: an array of `google_compute_ssl_certificate` private_key

## 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.
32 changes: 32 additions & 0 deletions docs/resources/google_compute_target_https_proxies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
title: About the google_compute_target_https_proxies resource
platform: gcp
---

## Syntax
A `google_compute_target_https_proxies` is used to test a Google TargetHttpsProxy resource

## Examples
```
describe google_compute_target_https_proxies(project: 'chef-gcp-inspec') do
its('names') { should include 'inspec-gcp-https-proxy' }
its('descriptions') { should include 'A HTTPS target proxy' }
end
```

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

See [google_compute_target_https_proxy.md](google_compute_target_https_proxy.md) for more detailed information
* `creation_timestamps`: an array of `google_compute_target_https_proxy` creation_timestamp
* `descriptions`: an array of `google_compute_target_https_proxy` description
* `ids`: an array of `google_compute_target_https_proxy` id
* `names`: an array of `google_compute_target_https_proxy` name
* `quic_overrides`: an array of `google_compute_target_https_proxy` quic_override
* `ssl_certificates`: an array of `google_compute_target_https_proxy` ssl_certificates
* `ssl_policies`: an array of `google_compute_target_https_proxy` ssl_policy
* `url_maps`: an array of `google_compute_target_https_proxy` url_map

## 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.
39 changes: 39 additions & 0 deletions docs/resources/google_compute_target_https_proxy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
title: About the google_compute_target_https_proxy resource
platform: gcp
---

## Syntax
A `google_compute_target_https_proxy` is used to test a Google TargetHttpsProxy resource

## Examples
```
describe google_compute_target_https_proxy(project: 'chef-gcp-inspec', name: 'inspec-gcp-https-proxy') do
it { should exist }
its('url_map') { should match /\/inspec-gcp-url-map$/ }
its('description') { should eq 'A HTTPS target proxy' }
end

describe google_compute_target_https_proxy(project: 'chef-gcp-inspec', name: 'nonexistent') do
it { should_not exist }
end
```

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

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

* `description`: An optional description of this resource.

* `id`: The unique identifier 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.

* `quic_override`: Specifies the QUIC override policy for this resource. This determines whether the load balancer will attempt to negotiate QUIC with clients or not. Can specify one of NONE, ENABLE, or DISABLE. If NONE is specified, uses the QUIC policy with no user overrides, which is equivalent to DISABLE. Not specifying this field is equivalent to specifying NONE.

* `ssl_certificates`: A list of SslCertificate resources that are used to authenticate connections between users and the load balancer. Currently, exactly one SSL certificate must be specified.

* `ssl_policy`: A reference to the SslPolicy resource that will be associated with the TargetHttpsProxy resource. If not set, the TargetHttpsProxy resource will not have any SSL policy configured.

* `url_map`: A reference to the UrlMap resource that defines the mapping from URL to the BackendService.
61 changes: 61 additions & 0 deletions libraries/google_compute_ssl_certificate.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.
#
# ----------------------------------------------------------------------------
require 'gcp_backend'

# A provider to manage Google Compute Engine resources.
class SslCertificate < GcpResourceBase
name 'google_compute_ssl_certificate'
desc 'SslCertificate'
supports platform: 'gcp'

attr_reader :certificate
attr_reader :creation_timestamp
attr_reader :description
attr_reader :id
attr_reader :name
attr_reader :private_key
def base
'https://www.googleapis.com/compute/v1/'
end

def url
'projects/{{project}}/global/sslCertificates/{{name}}'
end

def initialize(params)
super(params.merge({ use_http_transport: true }))
@fetched = @connection.fetch(base, url, params)
parse unless @fetched.nil?
end

def parse
@certificate = @fetched['certificate']
@creation_timestamp = parse_time_string(@fetched['creationTimestamp'])
@description = @fetched['description']
@id = @fetched['id']
@name = @fetched['name']
@private_key = @fetched['privateKey']
end

# Handles parsing RFC3339 time string
def parse_time_string(time_string)
time_string ? Time.parse(time_string) : nil
end

def exists?
[email protected]?
end
end
92 changes: 92 additions & 0 deletions libraries/google_compute_ssl_certificates.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# 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 'gcp_backend'
class SslCertificates < GcpResourceBase
name 'google_compute_ssl_certificates'
desc 'SslCertificate plural resource'
supports platform: 'gcp'

attr_reader :table

filter_table_config = FilterTable.create

filter_table_config.add(:certificates, field: :certificate)
filter_table_config.add(:creation_timestamps, field: :creation_timestamp)
filter_table_config.add(:descriptions, field: :description)
filter_table_config.add(:ids, field: :id)
filter_table_config.add(:names, field: :name)
filter_table_config.add(:private_keys, field: :private_key)

filter_table_config.connect(self, :table)

def base
'https://www.googleapis.com/compute/v1/'
end

def url
'projects/{{project}}/global/sslCertificates'
end

def initialize(params = {})
super(params.merge({ use_http_transport: true }))
@params = params
@table = fetch_wrapped_resource('items')
end

def fetch_wrapped_resource(wrap_path)
# fetch_resource returns an array of responses (to handle pagination)
result = @connection.fetch_all(base, url, @params)
return if result.nil?

# Conversion of string -> object hash to symbol -> object hash that InSpec needs
converted = []
result.each do |response|
next if response.nil? || !response.key?(wrap_path)
response[wrap_path].each do |hash|
hash_with_symbols = {}
hash.each_key do |key|
name, value = transform(key, hash)
hash_with_symbols[name] = value
end
converted.push(hash_with_symbols)
end
end

converted
end

def transform(key, value)
return transformers[key].call(value) if transformers.key?(key)

[key.to_sym, value]
end

def transformers
{
'certificate' => ->(obj) { return :certificate, obj['certificate'] },
'creationTimestamp' => ->(obj) { return :creation_timestamp, parse_time_string(obj['creationTimestamp']) },
'description' => ->(obj) { return :description, obj['description'] },
'id' => ->(obj) { return :id, obj['id'] },
'name' => ->(obj) { return :name, obj['name'] },
'privateKey' => ->(obj) { return :private_key, obj['privateKey'] },
}
end

# Handles parsing RFC3339 time string
def parse_time_string(time_string)
time_string ? Time.parse(time_string) : nil
end
end
Loading