Skip to content

Commit

Permalink
Merge pull request #19 from anyscale/brent/update-cors
Browse files Browse the repository at this point in the history
feat: update cors rules in google-anyscale-cloudstorage module
  • Loading branch information
kylehh authored Feb 13, 2024
2 parents 60b1109 + c29bdad commit 1174c44
Show file tree
Hide file tree
Showing 6 changed files with 180 additions and 159 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
## 0.10.1 (Released)
FEATURES:
- Bucket CORS Rules updates to support additional Anyscale UI functionality

BUG FIXES:

BREAKING CHANGES:

OTHER:
- Documentation updates

## 0.10.0 (Released)
FEATURES:
- Support for shared VPC
Expand Down
302 changes: 154 additions & 148 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion modules/google-anyscale-cloudstorage/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ No modules.
| <a name="input_bucket_storage_class"></a> [bucket\_storage\_class](#input\_bucket\_storage\_class) | (Optional)<br>The bucket storage class.<br>Must be one of: STANDARD, MULTI\_REGIONAL, REGIONAL, NEARLINE, COLDLINE, ARCHIVE<br>Default is `STANDARD` | `string` | `"STANDARD"` | no |
| <a name="input_bucket_uniform_level_access"></a> [bucket\_uniform\_level\_access](#input\_bucket\_uniform\_level\_access) | (Optional) Determines if the bucket will have uniform bucket-level access. Default is `true`. | `bool` | `true` | no |
| <a name="input_bucket_versioning"></a> [bucket\_versioning](#input\_bucket\_versioning) | (Optional) Determines if object versioning is enabled on the bucket.<br>If enabled, consider also using a object lifecycle to remove older versions after a period of time.<br>Default is `false`. | `bool` | `false` | no |
| <a name="input_cors_rules"></a> [cors\_rules](#input\_cors\_rules) | (Optional) List of CORS rules to configure.<br>Format is the same as described in provider documentation https://www.terraform.io/docs/providers/google/r/storage_bucket.html#cors except max\_age\_seconds should be a number.<br>Default is:<br>[<br> {<br> origins = ["https://console.anyscale.com"]<br> methods = ["GET"]<br> response\_headers = ["*"]<br> max\_age\_seconds = 3600<br> }<br>] | <pre>set(object({<br> # Object with keys:<br> # - origins - (Required) List of values, with wildcards, of the Origin header in the request that an incoming OPTIONS request will be matched against.<br> # - methods - (Required) Lilst of values, with wildcards, of the Access-Control-Request-Method header in the request that an incoming OPTIONS request will be matched against.<br> # - response_headers - (Required) List of values, with wildcards, of the Access-Control-Request-Headers header in the request that an incoming OPTIONS request will be matched against.<br> # - max_age_seconds - (Optional) The value, in seconds, to return in the Access-Control-Max-Age header used in preflight responses.<br> origins = list(string)<br> methods = list(string)<br> response_headers = list(string)<br> max_age_seconds = number<br> }))</pre> | <pre>[<br> {<br> "max_age_seconds": 3600,<br> "methods": [<br> "GET"<br> ],<br> "origins": [<br> "https://console.anyscale.com"<br> ],<br> "response_headers": [<br> "*"<br> ]<br> }<br>]</pre> | no |
| <a name="input_cors_rules"></a> [cors\_rules](#input\_cors\_rules) | (Optional) List of CORS rules to configure.<br>Format is the same as described in provider documentation https://www.terraform.io/docs/providers/google/r/storage_bucket.html#cors except max\_age\_seconds should be a number.<br><br>ex:<pre>cors_rules =<br>[<br> {<br> origins = ["https://*.anyscale.com"]<br> methods = ["GET", "POST", "PUT", "HEAD", "DELETE"]<br> response_headers = ["*"]<br> max_age_seconds = 3600<br> }<br>]</pre> | <pre>set(object({<br> # Object with keys:<br> # - origins - (Required) List of values, with wildcards, of the Origin header in the request that an incoming OPTIONS request will be matched against.<br> # - methods - (Required) Lilst of values, with wildcards, of the Access-Control-Request-Method header in the request that an incoming OPTIONS request will be matched against.<br> # - response_headers - (Required) List of values, with wildcards, of the Access-Control-Request-Headers header in the request that an incoming OPTIONS request will be matched against.<br> # - max_age_seconds - (Optional) The value, in seconds, to return in the Access-Control-Max-Age header used in preflight responses.<br> origins = list(string)<br> methods = list(string)<br> response_headers = list(string)<br> max_age_seconds = number<br> }))</pre> | <pre>[<br> {<br> "max_age_seconds": 3600,<br> "methods": [<br> "GET",<br> "POST",<br> "PUT",<br> "HEAD",<br> "DELETE"<br> ],<br> "origins": [<br> "https://*.anyscale.com"<br> ],<br> "response_headers": [<br> "*"<br> ]<br> }<br>]</pre> | no |
| <a name="input_enable_random_name_suffix"></a> [enable\_random\_name\_suffix](#input\_enable\_random\_name\_suffix) | (Optional) Determines if a suffix of random characters will be added to the `anyscale_bucket_prefix` or `anyscale_bucket_name`.<br>Default is `true` | `bool` | `true` | no |
| <a name="input_labels"></a> [labels](#input\_labels) | (Optional) A map of labels to all resources that accept labels. Default is an empty map. | `map(string)` | `{}` | no |
| <a name="input_lifecycle_rules"></a> [lifecycle\_rules](#input\_lifecycle\_rules) | (Optional) List of lifecycle rules to configure.<br>Format is the same as described in provider documentation https://www.terraform.io/docs/providers/google/r/storage_bucket.html#lifecycle_rule except condition.matches\_storage\_class should be a comma delimited string.<br>Default is an empty list. | <pre>set(object({<br> # Object with keys:<br> # - type - The type of the action of this Lifecycle Rule. Supported values: Delete and SetStorageClass.<br> # - storage_class - (Required if action type is SetStorageClass) The target Storage Class of objects affected by this Lifecycle Rule.<br> action = map(string)<br><br> # Object with keys:<br> # - age - (Optional) Minimum age of an object in days to satisfy this condition.<br> # - created_before - (Optional) Creation date of an object in RFC 3339 (e.g. 2017-06-13) to satisfy this condition.<br> # - with_state - (Optional) Match to live and/or archived objects. Supported values include: "LIVE", "ARCHIVED", "ANY".<br> # - matches_storage_class - (Optional) Comma delimited string for storage class of objects to satisfy this condition. Supported values include: MULTI_REGIONAL, REGIONAL, NEARLINE, COLDLINE, STANDARD, DURABLE_REDUCED_AVAILABILITY.<br> # - matches_prefix - (Optional) One or more matching name prefixes to satisfy this condition.<br> # - matches_suffix - (Optional) One or more matching name suffixes to satisfy this condition.<br> # - num_newer_versions - (Optional) Relevant only for versioned objects. The number of newer versions of an object to satisfy this condition.<br> # - custom_time_before - (Optional) A date in the RFC 3339 format YYYY-MM-DD. This condition is satisfied when the customTime metadata for the object is set to an earlier date than the date used in this lifecycle condition.<br> # - days_since_custom_time - (Optional) The number of days from the Custom-Time metadata attribute after which this condition becomes true.<br> # - days_since_noncurrent_time - (Optional) Relevant only for versioned objects. Number of days elapsed since the noncurrent timestamp of an object.<br> # - noncurrent_time_before - (Optional) Relevant only for versioned objects. The date in RFC 3339 (e.g. 2017-06-13) when the object became nonconcurrent.<br> condition = map(string)<br> }))</pre> | `[]` | no |
Expand Down
14 changes: 9 additions & 5 deletions modules/google-anyscale-cloudstorage/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -152,15 +152,19 @@ variable "cors_rules" {
description = <<-EOT
(Optional) List of CORS rules to configure.
Format is the same as described in provider documentation https://www.terraform.io/docs/providers/google/r/storage_bucket.html#cors except max_age_seconds should be a number.
Default is:
ex:
```
cors_rules =
[
{
origins = ["https://console.anyscale.com"]
methods = ["GET"]
origins = ["https://*.anyscale.com"]
methods = ["GET", "POST", "PUT", "HEAD", "DELETE"]
response_headers = ["*"]
max_age_seconds = 3600
}
]
```
EOT

type = set(object({
Expand All @@ -176,8 +180,8 @@ variable "cors_rules" {
}))
default = [
{
origins = ["https://console.anyscale.com"]
methods = ["GET"]
origins = ["https://*.anyscale.com"]
methods = ["GET", "POST", "PUT", "HEAD", "DELETE"]
response_headers = ["*"]
max_age_seconds = 3600
}
Expand Down
2 changes: 1 addition & 1 deletion test/anyscale-v2-e2e-public-test/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ module "google_anyscale_v2_commonname" {

anyscale_workload_identity_account_id = var.workload_identity_account_id

common_prefix = "anyscale-tf-"
common_prefix = "anyscale-tftst-"
use_common_name = true
# Project Related
anyscale_project_billing_account = var.billing_account_id
Expand Down
8 changes: 4 additions & 4 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -780,8 +780,8 @@ variable "anyscale_bucket_cors_rules" {
```
anyscale_bucket_cors_rules = [
{
origins = ["https://console.anyscale.com"]
methods = ["GET"]
origins = ["https://*.anyscale.com"]
methods = ["GET", "HEAD, "PUT", "POST", "DELETE"]
response_headers = ["*"]
max_age_seconds = 3600
}
Expand All @@ -801,8 +801,8 @@ variable "anyscale_bucket_cors_rules" {
}))
default = [
{
origins = ["https://console.anyscale.com"]
methods = ["GET"]
origins = ["https://*.anyscale.com"]
methods = ["GET", "POST", "PUT", "HEAD", "DELETE"]
response_headers = ["*"]
max_age_seconds = 3600
}
Expand Down

0 comments on commit 1174c44

Please sign in to comment.