/terraform-aws-nocode-rds-postgres

Terraform no-code enabled module for a PostgreSQL RDS DB in AWS

Primary LanguageHCLMIT LicenseMIT

Terraform module aws-nocode-rds-postgres

Provisions an AWS VPC with a PostgreSQL RDS instance and an EC2 bastion host. The bastion uses a base AMI registered in HCP Packer.

Enabled for Terraform Cloud no-code provisioning.

Prerequisites

For no-code provisioning, AWS credentials must be supplied to the workspace via environment variables (e.g. AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY) or using dynamic provider credentials.

Also requires environment variables containing an HCP service principal credential (HCP_CLIENT_ID and HCP_CLIENT_SECRET). It is recommende to attach these globally or to projects where no-code workspaces will be provisioned.

Requirements

Name Version
terraform >= 1.2
aws ~> 5.0
hcp ~> 0.57

Providers

Name Version
aws ~> 5.0
hcp ~> 0.57

Modules

No modules.

Resources

Name Type
aws_db_instance.hashidb resource
aws_db_subnet_group.hashidb resource
aws_instance.bastion resource
aws_internet_gateway.hashidb resource
aws_route_table.hashidb_public resource
aws_route_table_association.hashidb resource
aws_security_group.bastion resource
aws_security_group.hashidb resource
aws_subnet.hashidb_private_primary resource
aws_subnet.hashidb_private_secondary resource
aws_subnet.hashidb_public resource
aws_vpc.hashidb resource
aws_availability_zones.available data source
aws_rds_engine_version.selected data source
hcp_packer_image.ubuntu data source

Inputs

Name Description Type Default Required
address_space The address space that is used by the VPC. string "10.0.0.0/16" no
bastion_instance_type Specifies the EC2 instance type for the bastion host. string "t3.micro" no
db_instance_type Specifies the RDS instance type. string "db.t4g.micro" no
db_name Name of the initial database. string "hashicafe" no
db_password Password for the DB admin. string n/a yes
db_username The DB admin username. string "postgres" no
department Value for the department tag. string "DBA" no
env Value for the environment tag. string n/a yes
packer_bucket HCP Packer image bucket name for the bastion instance. string "ubuntu22-base" no
packer_channel HCP Packer image channel. string "production" no
prefix This prefix will be included in the name of most resources. string n/a yes
private_subnet_cidr_primary The address prefix to use for the primary private subnet. string "10.0.20.0/24" no
private_subnet_cidr_secondary The address prefix to use for the secondary private subnet. string "10.0.21.0/24" no
public_subnet_cidr The address prefix to use for the public subnet. string "10.0.10.0/24" no
region The region where the resources are created. string n/a yes

Outputs

Name Description
bastion_ip IP address of the bastion host.
db_endpoint Endpoint of the database instance.
db_name Name of the initial database.
db_username Username of the DB admin.
db_version Version of the DB engine.