Skip to content

Commit

Permalink
Merge eb11508 into 54d585e
Browse files Browse the repository at this point in the history
  • Loading branch information
nat-henderson authored Jan 2, 2019
2 parents 54d585e + eb11508 commit 1d66634
Show file tree
Hide file tree
Showing 10 changed files with 164 additions and 561 deletions.
4 changes: 4 additions & 0 deletions products/compute/ansible.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,10 @@ overrides: !ruby/object:Provider::ResourceOverrides
timeoutSec: !ruby/object:Provider::Ansible::PropertyOverride
aliases:
- timeout_seconds
Image: !ruby/object:Provider::Ansible::ResourceOverride
properties:
labels: !ruby/object:Provider::Ansible::PropertyOverride
version_added: '2.8'
InstanceGroup: !ruby/object:Provider::Ansible::ResourceOverride
properties:
instances: !ruby/object:Provider::Ansible::PropertyOverride
Expand Down
21 changes: 21 additions & 0 deletions products/compute/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1639,9 +1639,17 @@ objects:
name: 'Image'
kind: 'compute#image'
base_url: projects/{{project}}/global/images
input: true
exports:
- !ruby/object:Api::Type::SelfLink
name: 'selfLink'
collection_url_response: !ruby/object:Api::Resource::ResponseList
kind: 'compute#imageList'
items: 'items'
references: !ruby/object:Api::Resource::ReferenceLinks
guides:
'Official Documentation': 'https://cloud.google.com/compute/docs/images'
api: 'https://cloud.google.com/compute/docs/reference/latest/images'
description: |
Represents an Image resource.
Expand Down Expand Up @@ -1795,6 +1803,18 @@ objects:
min_version: beta
description: |
The name of the encryption key that is stored in Google Cloud KMS.
- !ruby/object:Api::Type::KeyValuePairs
name: 'labels'
description: Labels to apply to this Image.
update_verb: :POST
update_url: 'projects/{{project}}/global/images/{{name}}/setLabels'
- !ruby/object:Api::Type::Fingerprint
name: 'labelFingerprint'
description: |
The fingerprint used for optimistic locking of this resource. Used
internally during updates.
update_url: 'projects/{{project}}/global/images/{{name}}/setLabels'
update_verb: :POST
# TODO(alexstephen): Change to ResourceRef with array support
- !ruby/object:Api::Type::Array
name: 'licenses'
Expand Down Expand Up @@ -1832,6 +1852,7 @@ objects:
# TODO(alexstephen): Figure out cross-module ResourceRefs
- !ruby/object:Api::Type::String
name: 'source'
required: true
description: |
The full Google Cloud Storage URL where disk storage is stored
You must provide either this property or the sourceDisk property
Expand Down
18 changes: 15 additions & 3 deletions products/compute/terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -392,26 +392,38 @@ overrides: !ruby/object:Provider::ResourceOverrides
sslHealthCheck.port: !ruby/object:Provider::Terraform::PropertyOverride
default_value: 443
Image: !ruby/object:Provider::Terraform::ResourceOverride
exclude: true
example:
- !ruby/object:Provider::Terraform::Examples
name: "image_basic"
primary_resource_id: "example"
version: <%= version_name %>
vars:
image_name: "example-image"
properties:
id: !ruby/object:Provider::Terraform::PropertyOverride
exclude: true
diskSizeGb: !ruby/object:Provider::Terraform::PropertyOverride
default_from_api: true
deprecated: !ruby/object:Provider::Terraform::PropertyOverride
exclude: true
guestOsFeatures: !ruby/object:Provider::Terraform::PropertyOverride
exclude: true
imageEncryptionKey: !ruby/object:Provider::Terraform::PropertyOverride
exclude: true
licenses: !ruby/object:Provider::Terraform::PropertyOverride
default_from_api: true
rawDisk.sha1Checksum: !ruby/object:Provider::Terraform::PropertyOverride
name: 'sha1'
rawDisk.containerType: !ruby/object:Provider::Terraform::PropertyOverride
default_value: "TAR"
rawDisk: !ruby/object:Provider::Terraform::PropertyOverride
ignore_read: true
sourceDiskEncryptionKey: !ruby/object:Provider::Terraform::PropertyOverride
exclude: true
sourceDiskId: !ruby/object:Provider::Terraform::PropertyOverride
exclude: true
sourceType: !ruby/object:Provider::Terraform::PropertyOverride
exclude: true
licenses: !ruby/object:Provider::Terraform::PropertyOverride
exclude: true
Instance: !ruby/object:Provider::Terraform::ResourceOverride
exclude: true
InstanceGroup: !ruby/object:Provider::Terraform::ResourceOverride
Expand Down
5 changes: 4 additions & 1 deletion templates/terraform/examples/base_configs/test_file.go.erb
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,13 @@ func testAcc<%= test_slug -%>(val string) string {
<%- end %>

func testAccCheck<%= resource_name -%>Destroy(s *terraform.State) error {
for _, rs := range s.RootModule().Resources {
for name, rs := range s.RootModule().Resources {
if rs.Type != "<%= terraform_name -%>" {
continue
}
if strings.HasPrefix(name, "data.") {
continue
}

config := testAccProvider.Meta().(*Config)

Expand Down
7 changes: 7 additions & 0 deletions templates/terraform/examples/image_basic.tf.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
resource "google_compute_image" "example" {
name = "<%= ctx[:vars]['image_name'] %>"

raw_disk {
source = "https://storage.googleapis.com/bosh-cpi-artifacts/bosh-stemcell-3262.4-google-kvm-ubuntu-trusty-go_agent-raw.tar.gz"
}
}
Loading

0 comments on commit 1d66634

Please sign in to comment.