Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

Commit

Permalink
Terraform: Support for (Regional)Disk physicalBlockSizeBytes (#126)
Browse files Browse the repository at this point in the history
<!-- This change is generated by MagicModules. -->
/cc @drebes
  • Loading branch information
modular-magician authored and rileykarson committed Mar 13, 2019
1 parent 8b24d8b commit f882deb
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/resources/google_compute_disk.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ Properties that can be accessed from the `google_compute_disk` resource:

* `users`: Links to the users of the disk (attached instances) in form: project/zones/zone/instances/instance

* `physical_block_size_bytes`: Physical block size of the persistent disk, in bytes. If not present in a request, a default value is used. Currently supported sizes are 4096 and 16384, other sizes may be added in the future. If an unsupported value is requested, the error message will list the supported values for the caller's project.

* `type`: URL of the disk type resource describing which disk type to use to create the disk. Provide this when creating the disk.

* `source_image`: The source image used to create this disk. If the source image is deleted, this field will not be set. To create a disk with one of the public operating system images, specify the image by its family name. For example, specify family/debian-8 to use the latest Debian 8 image: projects/debian-cloud/global/images/family/debian-8 Alternatively, use a specific version of a public operating system image: projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD To create a disk with a private image that you created, specify the image name in the following format: global/images/my-private-image You can also specify a private image by its image family, which returns the latest version of the image in that family. Replace the image name with family/family-name: global/images/family/my-private-family
Expand Down
1 change: 1 addition & 0 deletions docs/resources/google_compute_disks.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ See [google_compute_disk.md](google_compute_disk.md) for more detailed informati
* `names`: an array of `google_compute_disk` name
* `size_gbs`: an array of `google_compute_disk` size_gb
* `users`: an array of `google_compute_disk` users
* `physical_block_size_bytes`: an array of `google_compute_disk` physical_block_size_bytes
* `types`: an array of `google_compute_disk` type
* `source_images`: an array of `google_compute_disk` source_image
* `zones`: an array of `google_compute_disk` zone
Expand Down
2 changes: 2 additions & 0 deletions libraries/google_compute_disk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class Disk < GcpResourceBase
attr_reader :name
attr_reader :size_gb
attr_reader :users
attr_reader :physical_block_size_bytes
attr_reader :type
attr_reader :source_image
attr_reader :zone
Expand Down Expand Up @@ -63,6 +64,7 @@ def parse
@name = @fetched['name']
@size_gb = @fetched['sizeGb']
@users = @fetched['users']
@physical_block_size_bytes = @fetched['physicalBlockSizeBytes']
@type = @fetched['type']
@source_image = @fetched['sourceImage']
@zone = @fetched['zone']
Expand Down
2 changes: 2 additions & 0 deletions libraries/google_compute_disks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class Disks < GcpResourceBase
filter_table_config.add(:names, field: :name)
filter_table_config.add(:size_gbs, field: :size_gb)
filter_table_config.add(:users, field: :users)
filter_table_config.add(:physical_block_size_bytes, field: :physical_block_size_bytes)
filter_table_config.add(:types, field: :type)
filter_table_config.add(:source_images, field: :source_image)
filter_table_config.add(:zones, field: :zone)
Expand Down Expand Up @@ -93,6 +94,7 @@ def transformers
'name' => ->(obj) { return :name, obj['name'] },
'sizeGb' => ->(obj) { return :size_gb, obj['sizeGb'] },
'users' => ->(obj) { return :users, obj['users'] },
'physicalBlockSizeBytes' => ->(obj) { return :physical_block_size_bytes, obj['physicalBlockSizeBytes'] },
'type' => ->(obj) { return :type, obj['type'] },
'sourceImage' => ->(obj) { return :source_image, obj['sourceImage'] },
'zone' => ->(obj) { return :zone, obj['zone'] },
Expand Down

0 comments on commit f882deb

Please sign in to comment.