Skip to content

Commit b32d913

Browse files
author
vijay-stephen
committed
Merge pull request #1 from sourcefuse/feature/api-gw-1
API Gateway
1 parent d777228 commit b32d913

File tree

1 file changed

+136
-0
lines changed
  • docs/arc-iac-docs/modules/terraform-aws-arc-api-gateway/docs/module-usage-guide

1 file changed

+136
-0
lines changed
Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
# Terraform AWS ARC API Gateway Module Usage Guide
2+
3+
## Introduction
4+
5+
### Purpose of the Document
6+
7+
This document provides guidelines and instructions for users looking to create api-gateway using the module.
8+
9+
### Module Overview
10+
11+
The API Gateway Terraform module provides an easy way to create and manage REST APIs on AWS. It supports defining resources, methods (GET, POST, etc.), and integrations with Lambda functions or other AWS services. The module also supports adding usage plans and API keys, enabling you to manage access, throttle requests, and monitor API usage. This helps ensure secure, scalable, and well-governed API deployments.
12+
13+
### Prerequisites
14+
15+
Before using this module, ensure you have the following:
16+
17+
- AWS credentials configured.
18+
- Terraform installed.
19+
- A working knowledge of AWS VPC, API Gateway and Terraform concepts.
20+
21+
## Getting Started
22+
23+
### Module Source
24+
25+
To use the module in your Terraform configuration, include the following source block:
26+
27+
28+
```hcl
29+
module "api_gateway" {
30+
source = "sourcefuse/arc-api-gateway/aws"
31+
version = "0.0.1"
32+
33+
name = "arc-app"
34+
stage_name = "dev"
35+
endpoint_type = "REGIONAL"
36+
open_api_json = file("${path.module}/openapi.json")
37+
38+
enable_cloudwatch_logs = true
39+
40+
# Custom domain (optional)
41+
api_gateway_domain = {
42+
create = true
43+
domain = "arc-api.${local.domain}"
44+
certificate_arn = data.aws_acm_certificate.this.arn
45+
route53_root_domain = local.domain
46+
}
47+
}
48+
```
49+
50+
Refer to the [Terraform Registry](https://registry.terraform.io/modules/sourcefuse/arc-api-gateway/aws/latest) for the latest version.
51+
52+
### Integration with Existing Terraform Configurations
53+
54+
Refer to the Terraform Registry for the latest version.
55+
56+
## Integration with Existing Terraform Configurations
57+
Integrate the module with your existing Terraform mono repo configuration, follow the steps below:
58+
59+
- Create a new folder in terraform/api-gateway named .
60+
- Create the required files, see the examples to base off of.
61+
- Configure with your backend:
62+
- Create the environment backend configuration file: config.<environment>.hcl
63+
- region: Where the backend resides
64+
- key: <working_directory>/terraform.tfstate
65+
- bucket: Bucket name where the terraform state will reside
66+
- dynamodb_table: Lock table so there are not duplicate tfplans in the mix
67+
- encrypt: Encrypt all traffic to and from the backend
68+
69+
### Required AWS Permissions
70+
71+
Ensure that the AWS credentials used to execute Terraform have the necessary permissions to create, list and modify:
72+
73+
- All api-gateway services
74+
- VPC and networking configuration
75+
76+
## Module Configuration
77+
78+
### Input Variables
79+
80+
For a list of input variables, see the README [Inputs](https://github.com/sourcefuse/terraform-aws-arc-api-gateway#inputs) section.
81+
82+
### Output Values
83+
84+
For a list of outputs, see the README [Outputs](https://github.com/sourcefuse/terraform-aws-arc-api-gateway?tab=readme-ov-file#outputs) section.
85+
86+
## Module Usage
87+
88+
### Basic Usage
89+
90+
For basic usage, see the [examples](https://github.com/sourcefuse/terraform-aws-arc-api-gateway/tree/main/examples) folder.
91+
92+
This example will create:
93+
94+
- **api-gateway Studio Domain**: Complete
95+
96+
### Tips and Recommendations
97+
98+
- The module focuses on provisioning api-gateway. The convention-based approach enables downstream services to easily attach to the api-gateway. Adjust the configuration parameters as needed for your specific use case.
99+
100+
## Troubleshooting
101+
102+
### Reporting Issues
103+
104+
If you encounter a bug or issue, please report it on the [GitHub repository](https://github.com/sourcefuse/terraform-aws-arc-api-gateway/issues).
105+
106+
## Security Considerations
107+
108+
### AWS VPC
109+
110+
Understand the security considerations related to api-gateway on AWS when using this module.
111+
112+
### Best Practices for AWS api-gateway
113+
114+
Follow best practices to ensure secure api-gateway configurations:
115+
116+
- [AWS api-gateway Security Best Practices](https://docs.aws.amazon.com/apigateway/latest/developerguide/security-best-practices.html)
117+
118+
## Contributing and Community Support
119+
120+
### Contributing Guidelines
121+
122+
Contribute to the module by following the guidelines outlined in the [CONTRIBUTING.md](https://github.com/sourcefuse/terraform-aws-arc-api-gateway/blob/main/CONTRIBUTING.md) file.
123+
124+
### Reporting Bugs and Issues
125+
126+
If you find a bug or issue, report it on the [GitHub repository](https://github.com/sourcefuse/terraform-aws-arc-api-gateway/issues).
127+
128+
## License
129+
130+
### License Information
131+
132+
This module is licensed under the Apache 2.0 license. Refer to the [LICENSE](https://github.com/sourcefuse/terraform-aws-arc-api-gateway/blob/main/LICENSE) file for more details.
133+
134+
### Open Source Contribution
135+
136+
Contribute to open source by using and enhancing this module. Your contributions are welcome!

0 commit comments

Comments
 (0)