Skip to content
This repository has been archived by the owner on Oct 6, 2023. It is now read-only.

Minor schema/docs update to SslCertificate. #92

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
19 changes: 11 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -945,9 +945,9 @@ gcompute_zone { 'us-central1-a':
persistent disk faster and at a much lower cost than if you regularly
created a full image of the disk.
* [`gcompute_ssl_certificate`][]:
An SslCertificate resource. This resource provides a mechanism to upload
an SSL key and certificate to the load balancer to serve secure
connections from the user.
An SslCertificate resource, used for HTTPS load balancing. This resource
provides a mechanism to upload an SSL key and certificate to
the load balancer to serve secure connections from the user.
* [`gcompute_subnetwork`][]:
A VPC network is a virtual version of the traditional physical networks
that exist within and between physical data centers. A VPC network
Expand Down Expand Up @@ -5280,10 +5280,13 @@ Output only. The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied

#### `gcompute_ssl_certificate`

An SslCertificate resource. This resource provides a mechanism to upload
an SSL key and certificate to the load balancer to serve secure
connections from the user.
An SslCertificate resource, used for HTTPS load balancing. This resource
provides a mechanism to upload an SSL key and certificate to
the load balancer to serve secure connections from the user.

#### Reference Guides
* [API Reference](https://cloud.google.com/compute/docs/reference/rest/v1/sslCertificates)
* [Official Documentation](https://cloud.google.com/load-balancing/docs/ssl-certificates)

#### Example

Expand Down Expand Up @@ -5350,7 +5353,7 @@ gcompute_ssl_certificate { 'id-of-resource':

##### `certificate`

The certificate in PEM format.
Required. 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.

Expand All @@ -5370,7 +5373,7 @@ gcompute_ssl_certificate { 'id-of-resource':

##### `private_key`

The private key in PEM format.
Required. The write-only private key in PEM format.


##### Output-only properties
Expand Down
2 changes: 1 addition & 1 deletion lib/google/compute/property/disktype_selflink.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def resource
return entry.exports[:self_link] if entry.title == @title
end

unless /https:\/\/www.googleapis.com\/compute\/v1\/projects\/.*\/zones\/{{zone}}\/diskTypes\/[a-z1-9\-]*/.match(@title)
unless /https:\/\/www.googleapis.com\/compute\/v1\/projects\/.*\/zones\/[a-z1-9\-]*\/diskTypes\/[a-z1-9\-]*/.match(@title)
# We'll asssmble the self_link for the user.
# We need to get the project name to assemble the self_link

Expand Down
2 changes: 1 addition & 1 deletion lib/google/compute/property/machinetype_selflink.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def resource
return entry.exports[:self_link] if entry.title == @title
end

unless /https:\/\/www.googleapis.com\/compute\/v1\/projects\/.*\/zones\/{{zone}}\/machineTypes\/[a-z1-9\-]*/.match(@title)
unless /https:\/\/www.googleapis.com\/compute\/v1\/projects\/.*\/zones\/[a-z1-9\-]*\/machineTypes\/[a-z1-9\-]*/.match(@title)
# We'll asssmble the self_link for the user.
# We need to get the project name to assemble the self_link

Expand Down
6 changes: 1 addition & 5 deletions lib/puppet/provider/gcompute_ssl_certificate/google.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,7 @@ def flush
debug('flush')
# return on !@dirty is for aiding testing (puppet already guarantees that)
return if @created || @deleted || !@dirty
update_req = Google::Compute::Network::Put.new(self_link(@resource),
fetch_auth(@resource),
'application/json',
resource_to_request)
@fetched = wait_for_operation update_req.send, @resource
raise 'SslCertificate cannot be edited.'
end

def dirty(field, from, to)
Expand Down
7 changes: 4 additions & 3 deletions lib/puppet/type/gcompute_ssl_certificate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@

Puppet::Type.newtype(:gcompute_ssl_certificate) do
@doc = <<-DOC
An SslCertificate resource. This resource provides a mechanism to upload an SSL key and
certificate to the load balancer to serve secure connections from the user.
An SslCertificate resource, used for HTTPS load balancing. This resource provides a mechanism
to upload an SSL key and certificate to the load balancer to serve secure connections from the
user.
DOC

autorequire(:gauth_credential) do
Expand Down Expand Up @@ -91,7 +92,7 @@
end

newproperty(:private_key, parent: Google::Compute::Property::String) do
desc 'The private key in PEM format.'
desc 'The write-only private key in PEM format.'
end

# Returns all properties that a provider can export to other resources
Expand Down
36 changes: 22 additions & 14 deletions spec/gcompute_ssl_certificate_provider_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -392,9 +392,11 @@
apply_with_error_check(
<<-MANIFEST
gcompute_ssl_certificate { 'title0':
ensure => absent,
project => 'test project#0 data',
credential => 'cred0',
ensure => absent,
certificate => 'test certificate#0 data',
private_key => 'test private_key#0 data',
project => 'test project#0 data',
credential => 'cred0',
}
MANIFEST
).catalog.resource('Gcompute_ssl_certificate[title0]')
Expand Down Expand Up @@ -424,10 +426,12 @@
apply_with_error_check(
<<-MANIFEST
gcompute_ssl_certificate { 'title0':
ensure => absent,
name => 'test name#0 data',
project => 'test project#0 data',
credential => 'cred0',
ensure => absent,
certificate => 'test certificate#0 data',
name => 'test name#0 data',
private_key => 'test private_key#0 data',
project => 'test project#0 data',
credential => 'cred0',
}
MANIFEST
).catalog.resource('Gcompute_ssl_certificate[title0]')
Expand Down Expand Up @@ -461,9 +465,11 @@
apply_with_error_check(
<<-MANIFEST
gcompute_ssl_certificate { 'title0':
ensure => absent,
project => 'test project#0 data',
credential => 'cred0',
ensure => absent,
certificate => 'test certificate#0 data',
private_key => 'test private_key#0 data',
project => 'test project#0 data',
credential => 'cred0',
}
MANIFEST
).catalog.resource('Gcompute_ssl_certificate[title0]')
Expand Down Expand Up @@ -495,10 +501,12 @@
apply_with_error_check(
<<-MANIFEST
gcompute_ssl_certificate { 'title0':
ensure => absent,
name => 'test name#0 data',
project => 'test project#0 data',
credential => 'cred0',
ensure => absent,
certificate => 'test certificate#0 data',
name => 'test name#0 data',
private_key => 'test private_key#0 data',
project => 'test project#0 data',
credential => 'cred0',
}
MANIFEST
).catalog.resource('Gcompute_ssl_certificate[title0]')
Expand Down
120 changes: 72 additions & 48 deletions spec/gcompute_target_https_proxy_provider_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,24 +69,30 @@
apply_with_error_check(
<<-MANIFEST
gcompute_ssl_certificate { 'resource(ssl_certificate,0)':
ensure => present,
name => 'test name#0 data',
project => 'test project#0 data',
credential => 'cred0',
ensure => present,
certificate => 'test certificate#0 data',
name => 'test name#0 data',
private_key => 'test private_key#0 data',
project => 'test project#0 data',
credential => 'cred0',
}

gcompute_ssl_certificate { 'resource(ssl_certificate,1)':
ensure => present,
name => 'test name#1 data',
project => 'test project#1 data',
credential => 'cred1',
ensure => present,
certificate => 'test certificate#1 data',
name => 'test name#1 data',
private_key => 'test private_key#1 data',
project => 'test project#1 data',
credential => 'cred1',
}

gcompute_ssl_certificate { 'resource(ssl_certificate,2)':
ensure => present,
name => 'test name#2 data',
project => 'test project#2 data',
credential => 'cred2',
ensure => present,
certificate => 'test certificate#2 data',
name => 'test name#2 data',
private_key => 'test private_key#2 data',
project => 'test project#2 data',
credential => 'cred2',
}

gcompute_backend_service { 'resource(backend_service,0)':
Expand Down Expand Up @@ -271,24 +277,30 @@
apply_with_error_check(
<<-MANIFEST
gcompute_ssl_certificate { 'resource(ssl_certificate,0)':
ensure => present,
name => 'test name#0 data',
project => 'test project#0 data',
credential => 'cred0',
ensure => present,
certificate => 'test certificate#0 data',
name => 'test name#0 data',
private_key => 'test private_key#0 data',
project => 'test project#0 data',
credential => 'cred0',
}

gcompute_ssl_certificate { 'resource(ssl_certificate,1)':
ensure => present,
name => 'test name#1 data',
project => 'test project#1 data',
credential => 'cred1',
ensure => present,
certificate => 'test certificate#1 data',
name => 'test name#1 data',
private_key => 'test private_key#1 data',
project => 'test project#1 data',
credential => 'cred1',
}

gcompute_ssl_certificate { 'resource(ssl_certificate,2)':
ensure => present,
name => 'test name#2 data',
project => 'test project#2 data',
credential => 'cred2',
ensure => present,
certificate => 'test certificate#2 data',
name => 'test name#2 data',
private_key => 'test private_key#2 data',
project => 'test project#2 data',
credential => 'cred2',
}

gcompute_backend_service { 'resource(backend_service,0)':
Expand Down Expand Up @@ -515,10 +527,12 @@
apply_with_error_check(
<<-MANIFEST
gcompute_ssl_certificate { 'resource(ssl_certificate,0)':
ensure => present,
name => 'test name#0 data',
project => 'test project#0 data',
credential => 'cred0',
ensure => present,
certificate => 'test certificate#0 data',
name => 'test name#0 data',
private_key => 'test private_key#0 data',
project => 'test project#0 data',
credential => 'cred0',
}

gcompute_backend_service { 'resource(backend_service,0)':
Expand Down Expand Up @@ -586,10 +600,12 @@
apply_with_error_check(
<<-MANIFEST
gcompute_ssl_certificate { 'resource(ssl_certificate,0)':
ensure => present,
name => 'test name#0 data',
project => 'test project#0 data',
credential => 'cred0',
ensure => present,
certificate => 'test certificate#0 data',
name => 'test name#0 data',
private_key => 'test private_key#0 data',
project => 'test project#0 data',
credential => 'cred0',
}

gcompute_backend_service { 'resource(backend_service,0)':
Expand Down Expand Up @@ -651,10 +667,12 @@
apply_with_error_check(
<<-MANIFEST
gcompute_ssl_certificate { 'resource(ssl_certificate,0)':
ensure => present,
name => 'test name#0 data',
project => 'test project#0 data',
credential => 'cred0',
ensure => present,
certificate => 'test certificate#0 data',
name => 'test name#0 data',
private_key => 'test private_key#0 data',
project => 'test project#0 data',
credential => 'cred0',
}

gcompute_backend_service { 'resource(backend_service,0)':
Expand Down Expand Up @@ -710,10 +728,12 @@
apply_with_error_check(
<<-MANIFEST
gcompute_ssl_certificate { 'resource(ssl_certificate,0)':
ensure => present,
name => 'test name#0 data',
project => 'test project#0 data',
credential => 'cred0',
ensure => present,
certificate => 'test certificate#0 data',
name => 'test name#0 data',
private_key => 'test private_key#0 data',
project => 'test project#0 data',
credential => 'cred0',
}

gcompute_backend_service { 'resource(backend_service,0)':
Expand Down Expand Up @@ -774,10 +794,12 @@
apply_with_error_check(
<<-MANIFEST
gcompute_ssl_certificate { 'resource(ssl_certificate,0)':
ensure => present,
name => 'test name#0 data',
project => 'test project#0 data',
credential => 'cred0',
ensure => present,
certificate => 'test certificate#0 data',
name => 'test name#0 data',
private_key => 'test private_key#0 data',
project => 'test project#0 data',
credential => 'cred0',
}

gcompute_backend_service { 'resource(backend_service,0)':
Expand Down Expand Up @@ -835,10 +857,12 @@
apply_with_error_check(
<<-MANIFEST
gcompute_ssl_certificate { 'resource(ssl_certificate,0)':
ensure => present,
name => 'test name#0 data',
project => 'test project#0 data',
credential => 'cred0',
ensure => present,
certificate => 'test certificate#0 data',
name => 'test name#0 data',
private_key => 'test private_key#0 data',
project => 'test project#0 data',
credential => 'cred0',
}

gcompute_backend_service { 'resource(backend_service,0)':
Expand Down
Loading