An open API service indexing awesome lists of open source software.

https://github.com/honestbank/terraform-aws-subnet

Terraform-managed repo.
https://github.com/honestbank/terraform-aws-subnet

workspace-code-infrastructure-prod

Last synced: 4 months ago
JSON representation

Terraform-managed repo.

Awesome Lists containing this project

README

          

# Terraform AWS Subnet module

A simple module that creates subnets for you.

## How to use:

Make sure you have a VPC and know what region you are in.

Apply below module:

```terraform
module "aws-subnet" {
source = "./aws-subnet"

subnet_cidr_block = var.subnet_cidr_block
vpc_id = aws_vpc.main.id
subnet_name = var.subnet_name
aws_region = var.aws_region
aws_role_arn = var.aws_role_arn
subnet_tags = var.subnet_tags
}
```

`aws_role_arn` is optional and can be set to null (or omitted)

## Some built in features

- We automatically add the tag `CreatedBy = "terraform-aws-subnet"` to all subnets. As of now, this can't be turned off.

## Requirements

| Name | Version |
|------|---------|
| [terraform](#requirement\_terraform) | ~> 1.0 |
| [aws](#requirement\_aws) | >= 5.0 |

## Providers

| Name | Version |
|------|---------|
| [aws](#provider\_aws) | >= 5.0 |

## Modules

| Name | Source | Version |
|------|--------|---------|
| [aws-subnet](#module\_aws-subnet) | ./aws-subnet | n/a |

## Resources

| Name | Type |
|------|------|
| [aws_vpc.main](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/vpc) | resource |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| [aws\_region](#input\_aws\_region) | AWS Region | `any` | `null` | no |
| [aws\_role\_arn](#input\_aws\_role\_arn) | AWS Role ARN | `any` | `null` | no |
| [subnet\_az](#input\_subnet\_az) | availability zone | `string` | `null` | no |
| [subnet\_cidr\_block](#input\_subnet\_cidr\_block) | CIDR block for subnet | `string` | `null` | no |
| [subnet\_name](#input\_subnet\_name) | Name for subnet | `string` | `null` | no |
| [subnet\_tags](#input\_subnet\_tags) | Tags | `map(any)` |

{
"CreatedBy": "terraform-aws-subnet"
}
| no |
| [vpc\_cidr](#input\_vpc\_cidr) | CIDR block for VPC | `string` | `"10.0.0.0/16"` | no |
| [vpc\_id](#input\_vpc\_id) | VPC ID | `any` | `null` | no |

## Outputs

| Name | Description |
|------|-------------|
| [vpc\_id](#output\_vpc\_id) | n/a |