Skip to content

Commit 363290e

Browse files
committed
docs: added updated to the readme to indicate the subnet sharing feature
1 parent 118d6bc commit 363290e

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

README.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,13 +216,57 @@ module "vpc" {
216216
}
217217
```
218218

219+
## Sharing Subnets via RAM
220+
221+
VPC sharing allows multiple AWS accounts to create their application resources, such as Amazon EC2 instances, Amazon RDS databases, and Amazon Redshift clusters, into a shared, centrally managed VPC. The benefits of VPC sharing include:
222+
223+
- **Cost Savings**: By sharing a single VPC across multiple accounts, you can reduce the number of VPCs needed, which can lead to cost savings.
224+
- **Simplified Network Management**: Centralized management of network resources simplifies the administration and monitoring of network configurations.
225+
- **Improved Security**: VPC sharing allows for consistent security policies and monitoring across multiple accounts, enhancing the overall security posture.
226+
219227
Remember to:
220228

221229
1. Ensure CIDR blocks don't overlap
222230
2. Consider your IP address space requirements
223231
3. Follow your organization's IP addressing scheme
224232
4. Update route tables and network ACLs accordingly
225233

234+
The module include a convenient way to share subnets using AWS Resource Access Manager (RAM). Here is an example configuration:
235+
236+
```hcl
237+
## Alternatively you specify the subnets directly
238+
module "vpc" {
239+
source = "../.."
240+
241+
availability_zones = 3
242+
name = "development"
243+
tags = local.tags
244+
vpc_cidr = "10.90.0.0/16"
245+
246+
subnets = {
247+
prod = {
248+
netmask = 24
249+
}
250+
"dev" = {
251+
netmask = 24
252+
}
253+
}
254+
}
255+
256+
## Note, due to the arns being dynamic this will be need to perform with a target,
257+
## i.e vpc must exist before the share can be applied.
258+
module "share_dev" {
259+
source = "../../modules/shared"
260+
261+
name = "dev"
262+
share = { accounts = ["123456789012"] }
263+
subnet_arns = module.vpc.all_subnets_by_name["dev"].arns
264+
tags = local.tags
265+
266+
depends_on = [module.vpc]
267+
}
268+
```
269+
226270
## Update Documentation
227271

228272
The `terraform-docs` utility is used to generate this README. Follow the below steps to update:
@@ -299,3 +343,7 @@ The `terraform-docs` utility is used to generate this README. Follow the below s
299343
| <a name="output_vpc_cidr"></a> [vpc\_cidr](#output\_vpc\_cidr) | The CIDR block of the VPC |
300344
| <a name="output_vpc_id"></a> [vpc\_id](#output\_vpc\_id) | The ID of the VPC |
301345
<!-- END_TF_DOCS -->
346+
347+
```
348+
349+
```

0 commit comments

Comments
 (0)