Skip to content

A simple AWS-based web server for demos

Notifications You must be signed in to change notification settings

danbarr/tf-aws-webapp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Terraform config aws-webapp

Provisions a simple nginx webserver with sample HashiCafe website in AWS EC2, using a base AMI registered in HCP Packer.

Default Packer bucket name matches the Ubuntu 22.04 Nginx image built with my Packer example.

Requirements

Name Version
terraform >= 1.5
aws ~> 5.0
hcp ~> 0.82
null ~> 3.2
random ~> 3.4
tls ~> 4.0

Providers

Name Version
aws ~> 5.0
hcp ~> 0.82
null ~> 3.2
random ~> 3.4
tls ~> 4.0

Modules

No modules.

Resources

Name Type
aws_eip.hashicafe resource
aws_eip_association.hashicafe resource
aws_instance.hashicafe resource
aws_internet_gateway.hashicafe resource
aws_key_pair.hashicafe resource
aws_route_table.hashicafe resource
aws_route_table_association.hashicafe resource
aws_security_group.hashicafe resource
aws_security_group_rule.ingress resource
aws_subnet.hashicafe resource
aws_vpc.hashicafe resource
null_resource.configure-web-app resource
random_integer.product resource
tls_private_key.hashicafe resource
hcp_packer_artifact.ubuntu-webserver data source

Inputs

Name Description Type Default Required
address_space The address space that is used by the virtual network. You can supply more than one address space. Changing this forces a new resource to be created. string "10.0.0.0/16" no
department Value for the department tag. string "WebDev" no
env Value for the environment tag. string n/a yes
hashi_products n/a
list(object({
name = string
color = string
image_file = string
}))
[
{
"color": "#dc477d",
"image_file": "hashicafe_art_consul.png",
"name": "Consul"
},
{
"color": "#ffffff",
"image_file": "hashicafe_art_hcp.png",
"name": "HCP"
},
{
"color": "#60dea9",
"image_file": "hashicafe_art_nomad.png",
"name": "Nomad"
},
{
"color": "#63d0ff",
"image_file": "hashicafe_art_packer.png",
"name": "Packer"
},
{
"color": "#844fba",
"image_file": "hashicafe_art_terraform.png",
"name": "Terraform"
},
{
"color": "#2e71e5",
"image_file": "hashicafe_art_vagrant.png",
"name": "Vagrant"
},
{
"color": "#ffec6e",
"image_file": "hashicafe_art_vault.png",
"name": "Vault"
}
]
no
instance_type Specifies the AWS instance type. string "t3.micro" no
owner Value for the owner tag. string "web.developer" no
packer_bucket HCP Packer bucket name containing the source image. string "ubuntu22-nginx" 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
region The region where the resources are created. string "us-east-2" no
subnet_prefix The address prefix to use for the subnet. string "10.0.10.0/24" no

Outputs

Name Description
ami_id ID of the AMI resolved from HCP Packer.
app_url URL of the deployed webapp.
product The product which was randomly selected.

About

A simple AWS-based web server for demos

Resources

Stars

Watchers

Forks

Packages

No packages published