Merge branch 'master' into cloud_router

This commit is contained in:
Paddy 2017-05-03 16:00:13 -07:00 committed by GitHub
commit 95ae7b0173
5 changed files with 148 additions and 10 deletions

View File

@ -46,6 +46,10 @@ The following keys can be used to configure the provider.
* `GOOGLE_CLOUD_KEYFILE_JSON`
* `GCLOUD_KEYFILE_JSON`
The [`GOOGLE_APPLICATION_CREDENTIALS`](https://developers.google.com/identity/protocols/application-default-credentials#howtheywork)
environment variable can also contain the path of a file to obtain credentials
from.
* `project` - (Required) The ID of the project to apply any resources to. This
can be specified using any of the following environment variables (listed in
order of precedence):

View File

@ -0,0 +1,52 @@
---
layout: "google"
page_title: "Google: google_compute_backend_bucket"
sidebar_current: "docs-google-compute-backend-bucket"
description: |-
Creates a Backend Bucket resource for Google Compute Engine.
---
# google\_compute\_backend\_bucket
A Backend Bucket defines a Google Cloud Storage bucket that will serve traffic through Google Cloud
Load Balancer.
## Example Usage
```hcl
resource "google_compute_backend_bucket" "foobar" {
name = "image-backend-bucket"
description = "Contains beautiful images"
bucket_name = "${google_storage_bucket.image_bucket.name}"
enable_cdn = true
}
resource "google_storage_bucket" "image_bucket" {
name = "image-store-bucket"
location = "EU"
}
```
## Argument Reference
The following arguments are supported:
* `name` - (Required) The name of the backend bucket.
* `bucket_name` - (Required) The name of the Google Cloud Storage bucket to be used as a backend
bucket.
- - -
* `description` - (Optional) The textual description for the backend bucket.
* `enable_cdn` - (Optional) Whether or not to enable the Cloud CDN on the backend bucket.
* `project` - (Optional) The project in which the resource belongs. If it is not provided, the
provider project is used.
## Attributes Reference
In addition to the arguments listed above, the following computed attributes are exported:
* `self_link` - The URI of the created resource.

View File

@ -80,7 +80,9 @@ The following arguments are supported:
* `description` - (Optional) Textual description field.
* `ip_address` - (Optional) The static IP. (if not set, an ephemeral IP is
used).
used). This should be the literal IP address to be used, not the `self_link`
to a `google_compute_address` resource. (If using a `google_compute_address`
resource, use the `address` property instead of the `self_link` property.)
* `ip_protocol` - (Optional) The IP protocol to route, one of "TCP" "UDP" "AH"
"ESP" or "SCTP". (default "TCP").

View File

@ -0,0 +1,66 @@
---
layout: "google"
page_title: "Google: google_compute_snapshot"
sidebar_current: "docs-google-compute-snapshot"
description: |-
Creates a new snapshot of a disk within GCE.
---
# google\_compute\_snapshot
Creates a new snapshot of a disk within GCE.
## Example Usage
```js
resource "google_compute_snapshot" "default" {
name = "test-snapshot"
source_disk = "test-disk"
zone = "us-central1-a"
}
```
## Argument Reference
The following arguments are supported:
* `name` - (Required) A unique name for the resource, required by GCE.
Changing this forces a new resource to be created.
* `zone` - (Required) The zone where the source disk is located.
* `source_disk` - (Required) The disk which will be used as the source of the snapshot.
- - -
* `source_disk_encryption_key_raw` - (Optional) A 256-bit [customer-supplied encryption key]
(https://cloud.google.com/compute/docs/disks/customer-supplied-encryption),
encoded in [RFC 4648 base64](https://tools.ietf.org/html/rfc4648#section-4)
to decrypt the source disk.
* `snapshot_encryption_key_raw` - (Optional) A 256-bit [customer-supplied encryption key]
(https://cloud.google.com/compute/docs/disks/customer-supplied-encryption),
encoded in [RFC 4648 base64](https://tools.ietf.org/html/rfc4648#section-4)
to encrypt this snapshot.
* `project` - (Optional) The project in which the resource belongs. If it
is not provided, the provider project is used.
## Attributes Reference
In addition to the arguments listed above, the following computed attributes are
exported:
* `snapshot_encryption_key_sha256` - The [RFC 4648 base64]
(https://tools.ietf.org/html/rfc4648#section-4) encoded SHA-256 hash of the
[customer-supplied encryption key](https://cloud.google.com/compute/docs/disks/customer-supplied-encryption)
that protects this resource.
* `source_disk_encryption_key_sha256` - The [RFC 4648 base64]
(https://tools.ietf.org/html/rfc4648#section-4) encoded SHA-256 hash of the
[customer-supplied encryption key](https://cloud.google.com/compute/docs/disks/customer-supplied-encryption)
that protects the source disk.
* `source_disk_link` - The URI of the source disk.
* `self_link` - The URI of the created resource.

View File

@ -41,6 +41,11 @@ resource "google_compute_url_map" "foobar" {
paths = ["/login"]
service = "${google_compute_backend_service.login.self_link}"
}
path_rule {
paths = ["/static"]
service = "${google_compute_backend_bucket.static.self_link}"
}
}
test {
@ -55,7 +60,6 @@ resource "google_compute_backend_service" "login" {
port_name = "http"
protocol = "HTTP"
timeout_sec = 10
region = "us-central1"
health_checks = ["${google_compute_http_health_check.default.self_link}"]
}
@ -65,7 +69,6 @@ resource "google_compute_backend_service" "home" {
port_name = "http"
protocol = "HTTP"
timeout_sec = 10
region = "us-central1"
health_checks = ["${google_compute_http_health_check.default.self_link}"]
}
@ -76,14 +79,25 @@ resource "google_compute_http_health_check" "default" {
check_interval_sec = 1
timeout_sec = 1
}
resource "google_compute_backend_bucket" "static" {
name = "static-asset-backend-bucket"
bucket_name = "${google_storage_bucket.static.name}"
enable_cdn = true
}
resource "google_storage_bucket" "static" {
name = "static-asset-bucket"
location = "US"
}
```
## Argument Reference
The following arguments are supported:
* `default_service` - (Required) The URL of the backend service to use when none
of the given rules match. See the documentation for formatting the service
* `default_service` - (Required) The URL of the backend service or backend bucket to use when none
of the given rules match. See the documentation for formatting the service/bucket
URL
[here](https://cloud.google.com/compute/docs/reference/latest/urlMaps#defaultService)
@ -118,8 +132,8 @@ The `host_rule` block supports: (This block can be defined multiple times).
The `path_matcher` block supports: (This block can be defined multiple times)
* `default_service` - (Required) The URL for the backend service to use if none
of the given paths match. See the documentation for formatting the service
* `default_service` - (Required) The URL for the backend service or backend bucket to use if none
of the given paths match. See the documentation for formatting the service/bucket
URL [here](https://cloud.google.com/compute/docs/reference/latest/urlMaps#pathMatcher.defaultService)
* `name` - (Required) The name of the `path_matcher` resource. Used by the
@ -133,13 +147,13 @@ multiple times)
* `paths` - (Required) The list of paths to match against. See the
documentation for formatting these [here](https://cloud.google.com/compute/docs/reference/latest/urlMaps#pathMatchers.pathRules.paths)
* `default_service` - (Required) The URL for the backend service to use if any
of the given paths match. See the documentation for formatting the service
* `service` - (Required) The URL for the backend service or backend bucket to use if any
of the given paths match. See the documentation for formatting the service/bucket
URL [here](https://cloud.google.com/compute/docs/reference/latest/urlMaps#pathMatcher.defaultService)
The optional `test` block supports: (This block can be defined multiple times)
* `service` - (Required) The service that should be matched by this test.
* `service` - (Required) The backend service or backend bucket that should be matched by this test.
* `host` - (Required) The host component of the URL being tested.