mirror of
https://github.com/letic/terraform-provider-google.git
synced 2024-07-03 08:42:39 +00:00
Update README and run fmt.
This commit is contained in:
parent
e2a7bf1cf7
commit
010c0f3288
|
@ -18,8 +18,8 @@ This provider plugin is maintained by:
|
||||||
Requirements
|
Requirements
|
||||||
------------
|
------------
|
||||||
|
|
||||||
- [Terraform](https://www.terraform.io/downloads.html) 0.10.x
|
- [Terraform](https://www.terraform.io/downloads.html) 0.10+
|
||||||
- [Go](https://golang.org/doc/install) 1.9 (to build the provider plugin)
|
- [Go](https://golang.org/doc/install) 1.11.0 or higher
|
||||||
|
|
||||||
Building The Provider
|
Building The Provider
|
||||||
---------------------
|
---------------------
|
||||||
|
@ -51,7 +51,7 @@ To upgrade to the latest stable version of the Google provider run `terraform in
|
||||||
Developing the Provider
|
Developing the Provider
|
||||||
---------------------------
|
---------------------------
|
||||||
|
|
||||||
If you wish to work on the provider, you'll first need [Go](http://www.golang.org) installed on your machine (version 1.9+ is *required*). You'll also need to correctly setup a [GOPATH](http://golang.org/doc/code.html#GOPATH), as well as adding `$GOPATH/bin` to your `$PATH`.
|
If you wish to work on the provider, you'll first need [Go](http://www.golang.org) installed on your machine (version 1.11+ is *required*). You'll also need to correctly setup a [GOPATH](http://golang.org/doc/code.html#GOPATH), as well as adding `$GOPATH/bin` to your `$PATH`.
|
||||||
|
|
||||||
To compile the provider, run `make build`. This will build the provider and put the provider binary in the `$GOPATH/bin` directory.
|
To compile the provider, run `make build`. This will build the provider and put the provider binary in the `$GOPATH/bin` directory.
|
||||||
|
|
||||||
|
|
|
@ -77,12 +77,12 @@ func testAccCheckComputeImageResolution(n string) resource.TestCheckFunc {
|
||||||
|
|
||||||
"global/images/" + name: "global/images/" + name,
|
"global/images/" + name: "global/images/" + name,
|
||||||
"global/images/family/" + family: "global/images/family/" + family,
|
"global/images/family/" + family: "global/images/family/" + family,
|
||||||
name: "global/images/" + name,
|
name: "global/images/" + name,
|
||||||
family: "global/images/family/" + family,
|
family: "global/images/family/" + family,
|
||||||
"family/" + family: "global/images/family/" + family,
|
"family/" + family: "global/images/family/" + family,
|
||||||
project + "/" + name: "projects/" + project + "/global/images/" + name,
|
project + "/" + name: "projects/" + project + "/global/images/" + name,
|
||||||
project + "/" + family: "projects/" + project + "/global/images/family/" + family,
|
project + "/" + family: "projects/" + project + "/global/images/family/" + family,
|
||||||
link: link,
|
link: link,
|
||||||
}
|
}
|
||||||
|
|
||||||
for input, expectation := range images {
|
for input, expectation := range images {
|
||||||
|
|
|
@ -281,8 +281,8 @@ func flattenBinaryAuthorizationAttestorAttestationAuthorityNotePublicKeys(v inte
|
||||||
for _, raw := range l {
|
for _, raw := range l {
|
||||||
original := raw.(map[string]interface{})
|
original := raw.(map[string]interface{})
|
||||||
transformed = append(transformed, map[string]interface{}{
|
transformed = append(transformed, map[string]interface{}{
|
||||||
"comment": flattenBinaryAuthorizationAttestorAttestationAuthorityNotePublicKeysComment(original["comment"]),
|
"comment": flattenBinaryAuthorizationAttestorAttestationAuthorityNotePublicKeysComment(original["comment"]),
|
||||||
"id": flattenBinaryAuthorizationAttestorAttestationAuthorityNotePublicKeysId(original["id"]),
|
"id": flattenBinaryAuthorizationAttestorAttestationAuthorityNotePublicKeysId(original["id"]),
|
||||||
"ascii_armored_pgp_public_key": flattenBinaryAuthorizationAttestorAttestationAuthorityNotePublicKeysAsciiArmoredPgpPublicKey(original["asciiArmoredPgpPublicKey"]),
|
"ascii_armored_pgp_public_key": flattenBinaryAuthorizationAttestorAttestationAuthorityNotePublicKeysAsciiArmoredPgpPublicKey(original["asciiArmoredPgpPublicKey"]),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -156,7 +156,7 @@ func TestAccComputeInstanceMigrateState_bootDisk(t *testing.T) {
|
||||||
"disk.0.device_name": "persistent-disk-0",
|
"disk.0.device_name": "persistent-disk-0",
|
||||||
"disk.0.disk_encryption_key_raw": "encrypt-key",
|
"disk.0.disk_encryption_key_raw": "encrypt-key",
|
||||||
"disk.0.disk_encryption_key_sha256": "encrypt-key-sha",
|
"disk.0.disk_encryption_key_sha256": "encrypt-key-sha",
|
||||||
"zone": zone,
|
"zone": zone,
|
||||||
}
|
}
|
||||||
expected := map[string]string{
|
expected := map[string]string{
|
||||||
"boot_disk.#": "1",
|
"boot_disk.#": "1",
|
||||||
|
@ -223,7 +223,7 @@ func TestAccComputeInstanceMigrateState_v4FixBootDisk(t *testing.T) {
|
||||||
"disk.0.device_name": "persistent-disk-0",
|
"disk.0.device_name": "persistent-disk-0",
|
||||||
"disk.0.disk_encryption_key_raw": "encrypt-key",
|
"disk.0.disk_encryption_key_raw": "encrypt-key",
|
||||||
"disk.0.disk_encryption_key_sha256": "encrypt-key-sha",
|
"disk.0.disk_encryption_key_sha256": "encrypt-key-sha",
|
||||||
"zone": zone,
|
"zone": zone,
|
||||||
}
|
}
|
||||||
expected := map[string]string{
|
expected := map[string]string{
|
||||||
"boot_disk.#": "1",
|
"boot_disk.#": "1",
|
||||||
|
@ -305,7 +305,7 @@ func TestAccComputeInstanceMigrateState_attachedDiskFromSource(t *testing.T) {
|
||||||
"disk.0.device_name": "persistent-disk-1",
|
"disk.0.device_name": "persistent-disk-1",
|
||||||
"disk.0.disk_encryption_key_raw": "encrypt-key",
|
"disk.0.disk_encryption_key_raw": "encrypt-key",
|
||||||
"disk.0.disk_encryption_key_sha256": "encrypt-key-sha",
|
"disk.0.disk_encryption_key_sha256": "encrypt-key-sha",
|
||||||
"zone": zone,
|
"zone": zone,
|
||||||
}
|
}
|
||||||
expected := map[string]string{
|
expected := map[string]string{
|
||||||
"boot_disk.#": "1",
|
"boot_disk.#": "1",
|
||||||
|
@ -385,7 +385,7 @@ func TestAccComputeInstanceMigrateState_v4FixAttachedDiskFromSource(t *testing.T
|
||||||
"disk.0.device_name": "persistent-disk-1",
|
"disk.0.device_name": "persistent-disk-1",
|
||||||
"disk.0.disk_encryption_key_raw": "encrypt-key",
|
"disk.0.disk_encryption_key_raw": "encrypt-key",
|
||||||
"disk.0.disk_encryption_key_sha256": "encrypt-key-sha",
|
"disk.0.disk_encryption_key_sha256": "encrypt-key-sha",
|
||||||
"zone": zone,
|
"zone": zone,
|
||||||
}
|
}
|
||||||
expected := map[string]string{
|
expected := map[string]string{
|
||||||
"boot_disk.#": "1",
|
"boot_disk.#": "1",
|
||||||
|
@ -452,7 +452,7 @@ func TestAccComputeInstanceMigrateState_attachedDiskFromEncryptionKey(t *testing
|
||||||
"disk.0.image": "projects/debian-cloud/global/images/family/debian-9",
|
"disk.0.image": "projects/debian-cloud/global/images/family/debian-9",
|
||||||
"disk.0.disk_encryption_key_raw": "SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0=",
|
"disk.0.disk_encryption_key_raw": "SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0=",
|
||||||
"disk.0.disk_encryption_key_sha256": "esTuF7d4eatX4cnc4JsiEiaI+Rff78JgPhA/v1zxX9E=",
|
"disk.0.disk_encryption_key_sha256": "esTuF7d4eatX4cnc4JsiEiaI+Rff78JgPhA/v1zxX9E=",
|
||||||
"zone": zone,
|
"zone": zone,
|
||||||
}
|
}
|
||||||
expected := map[string]string{
|
expected := map[string]string{
|
||||||
"boot_disk.#": "1",
|
"boot_disk.#": "1",
|
||||||
|
@ -520,7 +520,7 @@ func TestAccComputeInstanceMigrateState_v4FixAttachedDiskFromEncryptionKey(t *te
|
||||||
"disk.0.image": "projects/debian-cloud/global/images/family/debian-9",
|
"disk.0.image": "projects/debian-cloud/global/images/family/debian-9",
|
||||||
"disk.0.disk_encryption_key_raw": "SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0=",
|
"disk.0.disk_encryption_key_raw": "SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0=",
|
||||||
"disk.0.disk_encryption_key_sha256": "esTuF7d4eatX4cnc4JsiEiaI+Rff78JgPhA/v1zxX9E=",
|
"disk.0.disk_encryption_key_sha256": "esTuF7d4eatX4cnc4JsiEiaI+Rff78JgPhA/v1zxX9E=",
|
||||||
"zone": zone,
|
"zone": zone,
|
||||||
}
|
}
|
||||||
expected := map[string]string{
|
expected := map[string]string{
|
||||||
"boot_disk.#": "1",
|
"boot_disk.#": "1",
|
||||||
|
@ -600,8 +600,8 @@ func TestAccComputeInstanceMigrateState_attachedDiskFromAutoDeleteAndImage(t *te
|
||||||
"attached_disk.0.device_name": "persistent-disk-2",
|
"attached_disk.0.device_name": "persistent-disk-2",
|
||||||
"attached_disk.1.source": "https://www.googleapis.com/compute/v1/projects/" + config.Project + "/zones/" + zone + "/disks/" + instanceName + "-1",
|
"attached_disk.1.source": "https://www.googleapis.com/compute/v1/projects/" + config.Project + "/zones/" + zone + "/disks/" + instanceName + "-1",
|
||||||
"attached_disk.1.device_name": "persistent-disk-1",
|
"attached_disk.1.device_name": "persistent-disk-1",
|
||||||
"zone": zone,
|
"zone": zone,
|
||||||
"create_timeout": "4",
|
"create_timeout": "4",
|
||||||
}
|
}
|
||||||
|
|
||||||
runInstanceMigrateTest(t, instanceName, "migrate disk to attached disk", 2 /* state version */, attributes, expected, config)
|
runInstanceMigrateTest(t, instanceName, "migrate disk to attached disk", 2 /* state version */, attributes, expected, config)
|
||||||
|
@ -672,7 +672,7 @@ func TestAccComputeInstanceMigrateState_v4FixAttachedDiskFromAutoDeleteAndImage(
|
||||||
"attached_disk.0.device_name": "persistent-disk-2",
|
"attached_disk.0.device_name": "persistent-disk-2",
|
||||||
"attached_disk.1.source": "https://www.googleapis.com/compute/v1/projects/" + config.Project + "/zones/" + zone + "/disks/" + instanceName + "-1",
|
"attached_disk.1.source": "https://www.googleapis.com/compute/v1/projects/" + config.Project + "/zones/" + zone + "/disks/" + instanceName + "-1",
|
||||||
"attached_disk.1.device_name": "persistent-disk-1",
|
"attached_disk.1.device_name": "persistent-disk-1",
|
||||||
"zone": zone,
|
"zone": zone,
|
||||||
}
|
}
|
||||||
|
|
||||||
runInstanceMigrateTest(t, instanceName, "migrate disk to attached disk", 4 /* state version */, attributes, expected, config)
|
runInstanceMigrateTest(t, instanceName, "migrate disk to attached disk", 4 /* state version */, attributes, expected, config)
|
||||||
|
@ -735,8 +735,8 @@ func TestAccComputeInstanceMigrateState_scratchDisk(t *testing.T) {
|
||||||
"boot_disk.#": "1",
|
"boot_disk.#": "1",
|
||||||
"scratch_disk.#": "1",
|
"scratch_disk.#": "1",
|
||||||
"scratch_disk.0.interface": "SCSI",
|
"scratch_disk.0.interface": "SCSI",
|
||||||
"zone": zone,
|
"zone": zone,
|
||||||
"create_timeout": "4",
|
"create_timeout": "4",
|
||||||
}
|
}
|
||||||
|
|
||||||
runInstanceMigrateTest(t, instanceName, "migrate disk to scratch disk", 2 /* state version */, attributes, expected, config)
|
runInstanceMigrateTest(t, instanceName, "migrate disk to scratch disk", 2 /* state version */, attributes, expected, config)
|
||||||
|
@ -799,7 +799,7 @@ func TestAccComputeInstanceMigrateState_v4FixScratchDisk(t *testing.T) {
|
||||||
"boot_disk.#": "1",
|
"boot_disk.#": "1",
|
||||||
"scratch_disk.#": "1",
|
"scratch_disk.#": "1",
|
||||||
"scratch_disk.0.interface": "SCSI",
|
"scratch_disk.0.interface": "SCSI",
|
||||||
"zone": zone,
|
"zone": zone,
|
||||||
}
|
}
|
||||||
|
|
||||||
runInstanceMigrateTest(t, instanceName, "migrate disk to scratch disk", 4 /* state version */, attributes, expected, config)
|
runInstanceMigrateTest(t, instanceName, "migrate disk to scratch disk", 4 /* state version */, attributes, expected, config)
|
||||||
|
|
|
@ -95,7 +95,7 @@ func resourceComputeNetworkCreate(d *schema.ResourceData, meta interface{}) erro
|
||||||
|
|
||||||
// Build the network parameter
|
// Build the network parameter
|
||||||
network := &compute.Network{
|
network := &compute.Network{
|
||||||
Name: d.Get("name").(string),
|
Name: d.Get("name").(string),
|
||||||
AutoCreateSubnetworks: autoCreateSubnetworks,
|
AutoCreateSubnetworks: autoCreateSubnetworks,
|
||||||
Description: d.Get("description").(string),
|
Description: d.Get("description").(string),
|
||||||
}
|
}
|
||||||
|
|
|
@ -1225,7 +1225,7 @@ func flattenAuthorizedNetworks(entries []*sqladmin.AclEntry) interface{} {
|
||||||
func flattenLocationPreference(locationPreference *sqladmin.LocationPreference) interface{} {
|
func flattenLocationPreference(locationPreference *sqladmin.LocationPreference) interface{} {
|
||||||
data := map[string]interface{}{
|
data := map[string]interface{}{
|
||||||
"follow_gae_application": locationPreference.FollowGaeApplication,
|
"follow_gae_application": locationPreference.FollowGaeApplication,
|
||||||
"zone": locationPreference.Zone,
|
"zone": locationPreference.Zone,
|
||||||
}
|
}
|
||||||
|
|
||||||
return []map[string]interface{}{data}
|
return []map[string]interface{}{data}
|
||||||
|
|
|
@ -247,15 +247,15 @@ func TestOrEmpty(t *testing.T) {
|
||||||
ExpectValidationErrors bool
|
ExpectValidationErrors bool
|
||||||
}{
|
}{
|
||||||
"accept empty value": {
|
"accept empty value": {
|
||||||
Value: "",
|
Value: "",
|
||||||
ExpectValidationErrors: false,
|
ExpectValidationErrors: false,
|
||||||
},
|
},
|
||||||
"non empty value is accepted when valid": {
|
"non empty value is accepted when valid": {
|
||||||
Value: "valid",
|
Value: "valid",
|
||||||
ExpectValidationErrors: false,
|
ExpectValidationErrors: false,
|
||||||
},
|
},
|
||||||
"non empty value is rejected if invalid": {
|
"non empty value is rejected if invalid": {
|
||||||
Value: "invalid",
|
Value: "invalid",
|
||||||
ExpectValidationErrors: true,
|
ExpectValidationErrors: true,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user