Skip to content

Commit

Permalink
update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
clouddrove-ci committed Apr 24, 2024
1 parent 32d8469 commit 21be13e
Show file tree
Hide file tree
Showing 2 changed files with 252 additions and 173 deletions.
295 changes: 122 additions & 173 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
<!-- This file was automatically generated by the `geine`. Make all changes to `README.yaml` and run `make readme` to rebuild this file. -->

<p align="center"> <img src="https://user-images.githubusercontent.com/50652676/62349836-882fef80-b51e-11e9-99e3-7b974309c7e3.png" width="100" height="100"></p>


[![Banner](https://github.com/clouddrove/terraform-gcp-vpc/blob/master/docs/CloudDrove.png)][website]
<h1 align="center">
Terraform Module API-GATEWAY-V2
</h1>

<p align="center" style="font-size: 1.2rem;">
Terraform module api-gateway-v2 to create new modules using this as baseline
</p>
<p align="center" style="font-size: 1.2rem;">
With our comprehensive DevOps toolkit - streamline operations, automate workflows, enhance collaboration and, most importantly, deploy with confidence.
</p>


<p align="center">

Expand All @@ -22,6 +20,9 @@
<a href="LICENSE.md">
<img src="https://img.shields.io/badge/License-APACHE-blue.svg" alt="Licence">
</a>
<a href="CHANGELOG.md">
<img src="https://img.shields.io/badge/Changelog-blue" alt="Changelog">
</a>


</p>
Expand All @@ -30,6 +31,9 @@
<a href='https://facebook.com/sharer/sharer.php?u=https://github.com/clouddrove/terraform-aws-api-gateway'>
<img title="Share on Facebook" src="https://user-images.githubusercontent.com/50652676/62817743-4f64cb80-bb59-11e9-90c7-b057252ded50.png" />
</a>
<a href='https://www.instagram.com/cloud_drove?igsh=cHJqaDY3bGtnYmh3' title="Follow On Instagram">
<img src="https://github.com/gauravghongde/social-icons/blob/master/SVG/Color/Instagram.svg" width="23" height="23" />
</a>
<a href='https://www.linkedin.com/shareArticle?mini=true&title=Terraform+Module+API-GATEWAY-V2&url=https://github.com/clouddrove/terraform-aws-api-gateway'>
<img title="Share on LinkedIn" src="https://user-images.githubusercontent.com/50652676/62817742-4e339e80-bb59-11e9-87b9-a1f68cae1049.png" />
</a>
Expand All @@ -41,200 +45,145 @@
<hr>


We eat, drink, sleep and most importantly love **DevOps**. We are working towards strategies for standardizing architecture while ensuring security for the infrastructure. We are strong believer of the philosophy <b>Bigger problems are always solved by breaking them into smaller manageable problems</b>. Resonating with microservices architecture, it is considered best-practice to run database, cluster, storage in smaller <b>connected yet manageable pieces</b> within the infrastructure.
We are a group of DevOps engineers & architects, joining hands in this ever evolving digital landscape. With our strong belief in Automation; just like microservices, always on the lookout to split the the infrastructure into smaller connected resources (database, cluster and more) which could be standardized, are manageable, scalable, secure & follow industry best practices.

This module is basically combination of [Terraform open source](https://www.terraform.io/) and includes automatation tests and examples. It also helps to create and improve your infrastructure with minimalistic code instead of maintaining the whole infrastructure code yourself.

We have [*fifty plus terraform modules*][terraform_modules]. A few of them are comepleted and are available for open source usage while a few others are in progress.
This module includes Terraform open source, examples, and automation tests (for better understanding), which would help you create and improve your infrastructure with minimalistic coding.




## Prerequisites
## Prerequisites and Providers

This module has a few dependencies:
This table contains both Prerequisites and Providers:

| Description | Name | Version |
|:-------------:|:-------------------------------------------:|:---------:|
| **Prerequisite** | [Terraform](https://learn.hashicorp.com/terraform/getting-started/install.html) | >= 1.6.1 |
| **Provider** | [aws](https://aws.amazon.com/) | >= 5.20.0 |





## Examples

**IMPORTANT:** Since the master branch used in source varies based on new modifications, we recommend using the [release versions](https://github.com/clouddrove/terraform-aws-api-gateway/releases).

📌 For additional usage examples, check the complete list under [`examples/`](./examples) directory.



## Inputs and Outputs

Refer to complete documentation: [here](docs/io.md)


<!--
## Module Dependencies
This module has dependencies on:
- [Labels Module](https://github.com/clouddrove/terraform-aws-labels): Provides resource tagging.
- [Security Groups Module](https://github.com/clouddrove/terraform-aws-security-group): Manage security groups
- [KMS Module](https://github.com/clouddrove/terraform-aws-kms): Manage resource encryption
-->


## Module Dependencies

This module has dependencies on:
- [Labels Module](https://github.com/clouddrove/terraform-aws-labels): Provides resource tagging.


## 📑 Changelog

Refer [here](CHANGELOG.md).




## ✨ Contributors

Big thanks to our contributors for elevating our project with their dedication and expertise! But, we do not wish to stop there, would like to invite contributions from the community in improving these projects and making them more versatile for better reach. Remember, every bit of contribution is immensely valuable, as, together, we are moving in only 1 direction, i.e. forward.

<a href="https://github.com/clouddrove/terraform-aws-api-gateway/graphs/contributors">
<img src="https://contrib.rocks/image?repo=clouddrove/terraform-aws-api-gateway&max" />
</a>
<br>
<br>

If you're considering contributing to our project, here are a few quick guidelines that we have been following (Got a suggestion? We are all ears!):

- **Fork the Repository:** Create a new branch for your feature or bug fix.
- **Coding Standards:** You know the drill.
- **Clear Commit Messages:** Write clear and concise commit messages to facilitate understanding.
- **Thorough Testing:** Test your changes thoroughly before submitting a pull request.
- **Documentation Updates:** Include relevant documentation updates if your changes impact it.










**IMPORTANT:** Since the `master` branch used in `source` varies based on new modifications, we suggest that you use the release versions [here](https://github.com/clouddrove/terraform-aws-api-gateway/releases).


Here are examples of how you can use this module in your inventory structure:
### complete Example
```hcl
module "api-gateway" {
source = "clouddrove/api-gateway/aws"
version = "1.4.0"
domain_name = "example.cam"
domain_name_certificate_arn = module.acm.arn
integration_uri = module.lambda.arn
zone_id = "1234059QJ345674343"
create_vpc_link_enabled = false
cors_configuration = {
allow_credentials = true
allow_methods = ["GET", "OPTIONS", "POST"]
max_age = 5
}
integrations = {
"ANY /" = {
lambda_arn = module.lambda.arn
payload_format_version = "2.0"
timeout_milliseconds = 12000
}
"GET /some-route-with-authorizer" = {
lambda_arn = module.lambda.arn
payload_format_version = "2.0"
authorizer_key = "cognito"
}
"POST /start-step-function" = {
lambda_arn = module.lambda.arn
payload_format_version = "2.0"
authorizer_key = "cognito"
}
}
}
```
### vpc_link_api Example
```hcl
module "api-gateway" {
source = "clouddrove/api-gateway/aws"
version = "1.4.0"
name = "api"
environment = "test"
label_order = ["environment", "name"]
domain_name = "example.cam"
create_vpc_link_enabled = true
zone_id = "1`23456059QJZ25345678"
integration_uri = module.lambda.arn
domain_name_certificate_arn = module.acm.arn
subnet_ids = tolist(module.public_subnets.public_subnet_id)
security_group_ids = [module.security_group.security_group_ids]
cors_configuration = {
allow_credentials = true
allow_methods = ["GET", "OPTIONS", "POST"]
max_age = 5
}
integrations = {
"ANY /" = {
lambda_arn = module.lambda.arn
payload_format_version = "2.0"
timeout_milliseconds = 12000
}
"GET /some-route-with-authorizer" = {
lambda_arn = module.lambda.arn
payload_format_version = "2.0"
authorizer_key = "cognito"
}
"POST /start-step-function" = {
lambda_arn = module.lambda.arn
payload_format_version = "2.0"
authorizer_key = "cognito"
}
}
}
```






## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| access\_log\_settings | Settings for logging access in this stage. | `map(string)` | `{}` | no |
| api\_description | the description of the API. | `string` | `"Manages an Amazon API Gateway Version 2 API."` | no |
| api\_key\_selection\_expression | An API key selection expression. Valid values: $context.authorizer.usageIdentifierKey, $request.header.x-api-key. | `string` | `"$request.header.x-api-key"` | no |
| api\_version | A version identifier for the API | `string` | `null` | no |
| apigatewayv2\_api\_mapping\_enabled | Flag to control the mapping creation. | `bool` | `true` | no |
| attributes | Additional attributes (e.g. `1`). | `list(any)` | `[]` | no |
| authorizer\_type | The authorizer type. Valid values: JWT, REQUEST. For WebSocket APIs, specify REQUEST for a Lambda function using incoming request parameters. For HTTP APIs, specify JWT to use JSON Web Tokens. | `string` | `"JWT"` | no |
| authorizers | Map of API gateway authorizers | `map(any)` | `{}` | no |
| body | An OpenAPI specification that defines the set of routes and integrations to create as part of the HTTP APIs. Supported only for HTTP APIs. | `string` | `null` | no |
| connection\_type | Type of the network connection to the integration endpoint. Valid values: INTERNET, VPC\_LINK. Default is INTERNET. | `string` | `"INTERNET"` | no |
| cors\_configuration | The cross-origin resource sharing (CORS) configuration. Applicable for HTTP APIs. | `any` | `{}` | no |
| create\_api\_domain\_name\_enabled | Flag to control the domain creation. | `bool` | `true` | no |
| create\_api\_gateway\_enabled | Flag to control the api creation. | `bool` | `true` | no |
| create\_default\_stage\_enabled | Flag to control the stage creation. | `bool` | `true` | no |
| create\_routes\_and\_integrations\_enabled | Whether to create routes and integrations resources | `bool` | `true` | no |
| create\_vpc\_link\_enabled | Whether to create VPC links | `bool` | `true` | no |
| credentials\_arn | Part of quick create. Specifies any credentials required for the integration. Applicable for HTTP APIs. | `string` | `null` | no |
| default\_route\_settings | Default route settings for the stage. | `map(string)` | `{}` | no |
| default\_stage\_access\_log\_destination\_arn | ARN of the CloudWatch Logs log group to receive access logs. | `string` | `null` | no |
| default\_stage\_access\_log\_format | Single line format of the access logs of data. Refer to log settings for HTTP or Websocket. | `string` | `null` | no |
| domain\_name | The domain name to use for API gateway | `string` | `null` | no |
| domain\_name\_certificate\_arn | The ARN of an AWS-managed certificate that will be used by the endpoint for the domain name | `string` | `""` | no |
| domain\_name\_ownership\_verification\_certificate\_arn | ARN of the AWS-issued certificate used to validate custom domain ownership (when certificate\_arn is issued via an ACM Private CA or mutual\_tls\_authentication is configured with an ACM-imported certificate.) | `string` | `null` | no |
| enabled | Flag to control the api creation. | `bool` | `true` | no |
| environment | Environment (e.g. `prod`, `dev`, `staging`). | `string` | `"test"` | no |
| identity\_sources | The identity sources for which authorization is requested. | `list(string)` | <pre>[<br> "$request.header.Authorization"<br>]</pre> | no |
| integration\_description | Description of the integration. | `string` | `"Lambda example"` | no |
| integration\_method | Integration's HTTP method. Must be specified if integration\_type is not MOCK. | `string` | `"POST"` | no |
| integration\_type | Integration type of an integration. Valid values: AWS (supported only for WebSocket APIs), AWS\_PROXY, HTTP (supported only for WebSocket APIs), HTTP\_PROXY, MOCK (supported only for WebSocket APIs). | `string` | `"AWS_PROXY"` | no |
| integration\_uri | URI of the Lambda function for a Lambda proxy integration, when integration\_type is AWS\_PROXY. For an HTTP integration, specify a fully-qualified URL. | `string` | `""` | no |
| integrations | Map of API gateway routes with integrations | `map(any)` | `{}` | no |
| label\_order | Label order, e.g. `name`,`application`. | `list(any)` | `[]` | no |
| managedby | ManagedBy, eg 'CloudDrove' | `string` | `"hello@clouddrove.com"` | no |
| mutual\_tls\_authentication | An Amazon S3 URL that specifies the truststore for mutual TLS authentication as well as version, keyed at uri and version | `map(string)` | `{}` | no |
| name | Name (e.g. `app` or `cluster`). | `string` | `"api"` | no |
| passthrough\_behavior | Pass-through behavior for incoming requests based on the Content-Type header in the request, and the available mapping templates specified as the request\_templates attribute. | `string` | `"WHEN_NO_MATCH"` | no |
| protocol\_type | The API protocol. Valid values: HTTP, WEBSOCKET | `string` | `"HTTP"` | no |
| repository | Terraform current module repo | `string` | `""` | no |
| route\_key | Part of quick create. Specifies any route key. Applicable for HTTP APIs. | `string` | `null` | no |
| route\_selection\_expression | The route selection expression for the API. | `string` | `"$request.method $request.path"` | no |
| route\_settings | Settings for default route | `map(string)` | `{}` | no |
| security\_group\_ids | A list of security group IDs to associate with. | `list(string)` | `[]` | no |
| subnet\_ids | A list of VPC Subnet IDs to launch in. | `list(string)` | `[]` | no |
| tags | Additional tags (e.g. map(`BusinessUnit`,`XYZ`). | `map(any)` | `{}` | no |
| target | Part of quick create. Quick create produces an API with an integration, a default catch-all route, and a default stage which is configured to automatically deploy changes. For HTTP integrations, specify a fully qualified URL. For Lambda integrations, specify a function ARN. The type of the integration will be HTTP\_PROXY or AWS\_PROXY, respectively. Applicable for HTTP APIs. | `string` | `null` | no |
| vpc\_links | Map of VPC Links details to create | `map(any)` | `{}` | no |
| zone\_id | The ID of the hosted zone to contain this record. | `string` | `""` | no |

## Outputs

| Name | Description |
|------|-------------|
| api\_arn | The API identifier. |
| api\_endpoint | The URI of the API, of the form {api-id}.execute-api.{region}.amazonaws.com. |
| api\_id | The API identifier. |
| invoke\_url | URL to invoke the API pointing to the stage |




## Testing
In this module testing is performed with [terratest](https://github.com/gruntwork-io/terratest) and it creates a small piece of infrastructure, matches the output like ARN, ID and Tags name etc and destroy infrastructure in your AWS account. This testing is written in GO, so you need a [GO environment](https://golang.org/doc/install) in your system.

You need to run the following command in the testing folder:
```hcl
go test -run Test
```



## Feedback
If you come accross a bug or have any feedback, please log it in our [issue tracker](https://github.com/clouddrove/terraform-aws-api-gateway/issues), or feel free to drop us an email at [hello@clouddrove.com](mailto:hello@clouddrove.com).
Spot a bug or have thoughts to share with us? Let's squash it together! Log it in our [issue tracker](https://github.com/clouddrove/terraform-aws-api-gateway/issues), feel free to drop us an email at [hello@clouddrove.com](mailto:hello@clouddrove.com).

Show some love with a ★ on [our GitHub](https://github.com/clouddrove/terraform-aws-api-gateway)! if our work has brightened your day! – your feedback fuels our journey!


## :rocket: Our Accomplishment

We have [*100+ Terraform modules*][terraform_modules] 🙌. You could consider them finished, but, with enthusiasts like yourself, we are able to ever improve them, so we call our status - improvement in progress.

- [Terraform Module Registry:](https://registry.terraform.io/namespaces/clouddrove) Discover our Terraform modules here.

- [Terraform Modules for AWS/Azure Modules:](https://github.com/clouddrove/toc) Explore our comprehensive Table of Contents for easy navigation through our documentation for modules pertaining to AWS, Azure & GCP.

- [Terraform Modules for Digital Ocean:](https://github.com/terraform-do-modules/toc) Check out our specialized Terraform modules for Digital Ocean.




## Join Our Slack Community

Join our vibrant open-source slack community and embark on an ever-evolving journey with CloudDrove; helping you in moving upwards in your career path.
Join our vibrant Open Source Slack Community and embark on a learning journey with CloudDrove. Grow with us in the world of DevOps and set your career on a path of consistency.

🌐💬What you'll get after joining this Slack community:

- 🚀 Encouragement to upgrade your best version.
- 🌈 Learning companionship with our DevOps squad.
- 🌱 Relentless growth with daily updates on new advancements in technologies.

Join our tech elites [Join Now][slack] 🚀


## Explore Our Blogs

If you have found it worth your time, go ahead and give us a ★ on [our GitHub](https://github.com/clouddrove/terraform-aws-api-gateway)!
Click [here][blog] :books: :star2:

## About us
## Tap into our capabilities
We provide a platform for organizations to engage with experienced top-tier DevOps & Cloud services. Tap into our pool of certified engineers and architects to elevate your DevOps and Cloud Solutions.

At [CloudDrove][website], we offer expert guidance, implementation support and services to help organisations accelerate their journey to the cloud. Our services include docker and container orchestration, cloud migration and adoption, infrastructure automation, application modernisation and remediation, and performance engineering.
At [CloudDrove][website], has extensive experience in designing, building & migrating environments, securing, consulting, monitoring, optimizing, automating, and maintaining complex and large modern systems. With remarkable client footprints in American & European corridors, our certified architects & engineers are ready to serve you as per your requirements & schedule. Write to us at [business@clouddrove.com](mailto:business@clouddrove.com).

<p align="center">We are <b> The Cloud Experts!</b></p>
<hr />
<p align="center">We ❤️ <a href="https://github.com/clouddrove">Open Source</a> and you can check out <a href="https://github.com/clouddrove">our other modules</a> to get help with your new Cloud ideas.</p>
<p align="center">We ❤️ <a href="https://github.com/clouddrove">Open Source</a> and you can check out <a href="https://registry.terraform.io/namespaces/clouddrove">our other modules</a> to get help with your new Cloud ideas.</p>

[website]: https://clouddrove.com
[blog]: https://blog.clouddrove.com
[slack]: https://www.launchpass.com/devops-talks
[github]: https://github.com/clouddrove
[linkedin]: https://cpco.io/linkedin
[twitter]: https://twitter.com/clouddrove/
Expand Down
Loading

0 comments on commit 21be13e

Please sign in to comment.