-
Notifications
You must be signed in to change notification settings - Fork 910
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into hybrid-gke-updates
- Loading branch information
Showing
79 changed files
with
1,807 additions
and
1,362 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Api Gateway | ||
# API Gateway | ||
This module allows creating an API with its associated API config and API gateway. It also allows you grant IAM roles on the created resources. | ||
|
||
# Examples | ||
|
@@ -15,46 +15,46 @@ module "gateway" { | |
# ... | ||
EOT | ||
} | ||
# tftest modules=1 resources=4 | ||
# tftest modules=1 resources=4 inventory=basic.yaml | ||
``` | ||
|
||
## Basic example + customer service account | ||
## Use existing service account | ||
```hcl | ||
module "gateway" { | ||
source = "./fabric/modules/api-gateway" | ||
project_id = "my-project" | ||
api_id = "api" | ||
region = "europe-west1" | ||
spec = <<EOT | ||
# The OpenAPI spec contents | ||
# ... | ||
EOT | ||
service_account_email = "[email protected]" | ||
iam = { | ||
"roles/apigateway.admin" = ["user:[email protected]"] | ||
} | ||
spec = <<EOT | ||
# The OpenAPI spec contents | ||
# ... | ||
EOT | ||
} | ||
# tftest modules=1 resources=7 | ||
# tftest modules=1 resources=7 inventory=existing-sa.yaml | ||
``` | ||
|
||
## Basic example + service account creation | ||
## Create service account | ||
```hcl | ||
module "gateway" { | ||
source = "./fabric/modules/api-gateway" | ||
project_id = "my-project" | ||
api_id = "api" | ||
region = "europe-west1" | ||
spec = <<EOT | ||
# The OpenAPI spec contents | ||
# ... | ||
EOT | ||
service_account_create = true | ||
iam = { | ||
"roles/apigateway.admin" = ["user:[email protected]"] | ||
"roles/apigateway.viewer" = ["user:[email protected]"] | ||
} | ||
spec = <<EOT | ||
# The OpenAPI spec contents | ||
# ... | ||
EOT | ||
} | ||
# tftest modules=1 resources=11 | ||
# tftest modules=1 resources=11 inventory=create-sa.yaml | ||
``` | ||
<!-- BEGIN TFDOC --> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,50 +8,46 @@ module "bucket" { | |
project_id = "myproject" | ||
prefix = "test" | ||
name = "my-bucket" | ||
versioning = true | ||
iam = { | ||
"roles/storage.admin" = ["group:[email protected]"] | ||
} | ||
labels = { | ||
cost-center = "devops" | ||
} | ||
} | ||
# tftest modules=1 resources=2 | ||
# tftest modules=1 resources=2 inventory=simple.yaml | ||
``` | ||
|
||
### Example with Cloud KMS | ||
|
||
```hcl | ||
module "bucket" { | ||
source = "./fabric/modules/gcs" | ||
project_id = "myproject" | ||
prefix = "test" | ||
name = "my-bucket" | ||
iam = { | ||
"roles/storage.admin" = ["group:[email protected]"] | ||
} | ||
source = "./fabric/modules/gcs" | ||
project_id = "myproject" | ||
name = "my-bucket" | ||
encryption_key = "my-encryption-key" | ||
} | ||
# tftest modules=1 resources=2 | ||
# tftest modules=1 resources=1 inventory=cmek.yaml | ||
``` | ||
|
||
### Example with retention policy | ||
### Example with retention policy and logging | ||
|
||
```hcl | ||
module "bucket" { | ||
source = "./fabric/modules/gcs" | ||
project_id = "myproject" | ||
prefix = "test" | ||
name = "my-bucket" | ||
iam = { | ||
"roles/storage.admin" = ["group:[email protected]"] | ||
} | ||
retention_policy = { | ||
retention_period = 100 | ||
is_locked = true | ||
} | ||
logging_config = { | ||
log_bucket = var.bucket | ||
log_bucket = "log-bucket" | ||
log_object_prefix = null | ||
} | ||
} | ||
# tftest modules=1 resources=2 | ||
# tftest modules=1 resources=1 inventory=retention-logging.yaml | ||
``` | ||
|
||
### Example with lifecycle rule | ||
|
@@ -60,11 +56,7 @@ module "bucket" { | |
module "bucket" { | ||
source = "./fabric/modules/gcs" | ||
project_id = "myproject" | ||
prefix = "test" | ||
name = "my-bucket" | ||
iam = { | ||
"roles/storage.admin" = ["group:[email protected]"] | ||
} | ||
lifecycle_rules = { | ||
lr-0 = { | ||
action = { | ||
|
@@ -77,7 +69,7 @@ module "bucket" { | |
} | ||
} | ||
} | ||
# tftest modules=1 resources=2 | ||
# tftest modules=1 resources=1 inventory=lifecycle.yaml | ||
``` | ||
|
||
### Minimal example with GCS notifications | ||
|
@@ -86,7 +78,6 @@ module "bucket" { | |
module "bucket-gcs-notification" { | ||
source = "./fabric/modules/gcs" | ||
project_id = "myproject" | ||
prefix = "test" | ||
name = "my-bucket" | ||
notification_config = { | ||
enabled = true | ||
|
@@ -97,7 +88,7 @@ module "bucket-gcs-notification" { | |
custom_attributes = {} | ||
} | ||
} | ||
# tftest modules=1 resources=4 | ||
# tftest modules=1 resources=4 inventory=notification.yaml | ||
``` | ||
<!-- BEGIN TFDOC --> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.