Skip to content

Commit

Permalink
Add API Gateway resources (#4066) (#7626)
Browse files Browse the repository at this point in the history
Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
modular-magician authored Oct 23, 2020
1 parent 6655ef4 commit b14de27
Show file tree
Hide file tree
Showing 12 changed files with 1,053 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .changelog/4066.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
```release-note:new-resource
`google_api_gateway_api`
```
```release-note:new-resource
`google_api_gateway_api_config`
```
```release-note:new-resource
`google_api_gateway_gateway`
```
```release-note:new-resource
`google_api_gateway_api_iam_binding`
```
```release-note:new-resource
`google_api_gateway_api_iam_member`
```
```release-note:new-resource
`google_api_gateway_api_iam_policy`
```
```release-note:new-resource
`google_api_gateway_api_config_iam_binding`
```
```release-note:new-resource
`google_api_gateway_api_config_iam_member`
```
```release-note:new-resource
`google_api_gateway_api_config_iam_policy`
```
```release-note:new-resource
`google_api_gateway_gateway_iam_binding`
```
```release-note:new-resource
`google_api_gateway_gateway_iam_member`
```
```release-note:new-resource
`google_api_gateway_gateway_iam_policy`
```
1 change: 1 addition & 0 deletions google/resource_api_gateway_api_config_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package google
1 change: 1 addition & 0 deletions google/resource_api_gateway_api_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package google
1 change: 1 addition & 0 deletions google/resource_api_gateway_gateway_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package google
21 changes: 21 additions & 0 deletions google/test-fixtures/apigateway/openapi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
swagger: '2.0'
info:
title: dev
description: Sample API on API Gateway with a Cloud Run backend
version: 1.0.0
schemes:
- https
produces:
- application/json
paths:
/hello:
get:
summary: Greet a user
operationId: hello
x-google-backend:
address: https://google.com
responses:
'200':
description: A successful response
schema:
type: string
134 changes: 134 additions & 0 deletions website/docs/r/api_gateway_api.html.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
---
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
# ----------------------------------------------------------------------------
#
# This file is automatically generated by Magic Modules and manual
# changes will be clobbered when the file is regenerated.
#
# Please read more about how to change this file in
# .github/CONTRIBUTING.md.
#
# ----------------------------------------------------------------------------
subcategory: "API Gateway"
layout: "google"
page_title: "Google: google_api_gateway_api"
sidebar_current: "docs-google-api-gateway-api"
description: |-
A consumable API that can be used by multiple Gateways.
---

# google\_api\_gateway\_api

A consumable API that can be used by multiple Gateways.

~> **Warning:** This resource is in beta, and should be used with the terraform-provider-google-beta provider.
See [Provider Versions](https://terraform.io/docs/providers/google/guides/provider_versions.html) for more details on beta resources.

To get more information about Api, see:

* [API documentation](https://cloud.google.com/api-gateway/docs/reference/rest/v1beta/projects.locations.apis)
* How-to Guides
* [Official Documentation](https://cloud.google.com/api-gateway/docs/quickstart)

<div class = "oics-button" style="float: right; margin: 0 0 -15px">
<a href="https://console.cloud.google.com/cloudshell/open?cloudshell_git_repo=https%3A%2F%2Fgithub.com%2Fterraform-google-modules%2Fdocs-examples.git&cloudshell_working_dir=apigateway_api_basic&cloudshell_image=gcr.io%2Fgraphite-cloud-shell-images%2Fterraform%3Alatest&open_in_editor=main.tf&cloudshell_print=.%2Fmotd&cloudshell_tutorial=.%2Ftutorial.md" target="_blank">
<img alt="Open in Cloud Shell" src="//gstatic.com/cloudssh/images/open-btn.svg" style="max-height: 44px; margin: 32px auto; max-width: 100%;">
</a>
</div>
## Example Usage - Apigateway Api Basic


```hcl
resource "google_api_gateway_api" "api" {
provider = google-beta
api_id = "api"
}
```
<div class = "oics-button" style="float: right; margin: 0 0 -15px">
<a href="https://console.cloud.google.com/cloudshell/open?cloudshell_git_repo=https%3A%2F%2Fgithub.com%2Fterraform-google-modules%2Fdocs-examples.git&cloudshell_working_dir=apigateway_api_full&cloudshell_image=gcr.io%2Fgraphite-cloud-shell-images%2Fterraform%3Alatest&open_in_editor=main.tf&cloudshell_print=.%2Fmotd&cloudshell_tutorial=.%2Ftutorial.md" target="_blank">
<img alt="Open in Cloud Shell" src="//gstatic.com/cloudssh/images/open-btn.svg" style="max-height: 44px; margin: 32px auto; max-width: 100%;">
</a>
</div>
## Example Usage - Apigateway Api Full


```hcl
resource "google_api_gateway_api" "api" {
provider = google-beta
api_id = "api"
display_name = "MM Dev API"
labels = {
environment = "dev"
}
}
```

## Argument Reference

The following arguments are supported:


* `api_id` -
(Required)
Identifier to assign to the API. Must be unique within scope of the parent resource(project)


- - -


* `display_name` -
(Optional)
A user-visible name for the API.

* `managed_service` -
(Optional)
Immutable. The name of a Google Managed Service ( https://cloud.google.com/service-infrastructure/docs/glossary#managed).
If not specified, a new Service will automatically be created in the same project as this API.

* `labels` -
(Optional)
Resource labels to represent user-provided metadata.

* `project` - (Optional) The ID of 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:

* `id` - an identifier for the resource with format `projects/{{project}}/locations/global/apis/{{api_id}}`

* `name` -
The resource name of the API. Format `projects/{{project}}/locations/global/apis/{{apiId}}`

* `create_time` -
Creation timestamp in RFC3339 text format.


## Timeouts

This resource provides the following
[Timeouts](/docs/configuration/resources.html#timeouts) configuration options:

- `create` - Default is 6 minutes.
- `update` - Default is 6 minutes.
- `delete` - Default is 6 minutes.

## Import


Api can be imported using any of these accepted formats:

```
$ terraform import google_api_gateway_api.default projects/{{project}}/locations/global/apis/{{name}}
$ terraform import google_api_gateway_api.default {{project}}/{{name}}
$ terraform import google_api_gateway_api.default {{name}}
```

## User Project Overrides

This resource supports [User Project Overrides](https://www.terraform.io/docs/providers/google/guides/provider_reference.html#user_project_override).
Loading

0 comments on commit b14de27

Please sign in to comment.