{"id":31904221,"url":"https://github.com/cloudfoundry-community/terraform-aws-cf-install","last_synced_at":"2025-10-13T13:48:07.734Z","repository":{"id":24928834,"uuid":"28346001","full_name":"cloudfoundry-community/terraform-aws-cf-install","owner":"cloudfoundry-community","description":"Repo to create a one-click Cloud Foundry install in an AWS VPC","archived":false,"fork":false,"pushed_at":"2016-11-30T15:17:23.000Z","size":174,"stargazers_count":54,"open_issues_count":14,"forks_count":24,"subscribers_count":37,"default_branch":"master","last_synced_at":"2024-04-14T22:47:43.861Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cloudfoundry-community.png","metadata":{"files":{"readme":"README.md","changelog":"Changelog.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-12-22T16:03:23.000Z","updated_at":"2024-02-09T14:24:15.000Z","dependencies_parsed_at":"2022-08-23T06:31:40.604Z","dependency_job_id":null,"html_url":"https://github.com/cloudfoundry-community/terraform-aws-cf-install","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/cloudfoundry-community/terraform-aws-cf-install","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudfoundry-community%2Fterraform-aws-cf-install","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudfoundry-community%2Fterraform-aws-cf-install/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudfoundry-community%2Fterraform-aws-cf-install/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudfoundry-community%2Fterraform-aws-cf-install/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cloudfoundry-community","download_url":"https://codeload.github.com/cloudfoundry-community/terraform-aws-cf-install/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudfoundry-community%2Fterraform-aws-cf-install/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279015342,"owners_count":26085686,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-13T13:48:00.896Z","updated_at":"2025-10-13T13:48:07.727Z","avatar_url":"https://github.com/cloudfoundry-community.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"terraform-aws-cf-install [![Build Status](https://travis-ci.org/cloudfoundry-community/terraform-aws-cf-install.svg?branch=master)](https://travis-ci.org/cloudfoundry-community/terraform-aws-cf-install)\n========================\n\nTHIS PROJECT IS NOT LONGER MAINTAINED. USE AT YOUR OWN RISK!\n\nThis is part of a project that aims to create a one click deploy of Cloud Foundry into an AWS VPC. This is (probably) the repo you want to use.\n\nArchitecture\n------------\n\nThis terraform project will deploy one of the following networking and instances (pretty diagrams from [VisualOps IDE](https://ide.visualops.io)):\n\n### CF AWS Tiny\n\n![cf-aws-tiny.png](http://cl.ly/image/232j3o2A1X2o/cf-tiny-deployment.png)\n\n### CF AWS Large\n\n![cf-aws-large.png](http://i.imgur.com/2zeEqEm.png)\n\nWe rely on two other repositories to do the bulk of the work. The [terraform-aws-vpc](https://github.com/cloudfoundry-community/terraform-aws-vpc) repo creates the base VPC infrastructure, including a bastion subnet, the`microbosh` subnet, a NAT server, various route tables, and the VPC itself. Then the [terraform-aws-cf-net](https://github.com/cloudfoundry-community/terraform-aws-cf-net) repo creates a loadbalancer subnet, two runtime subnets, `cf` related security groups, and the elastic IP used by `cf`. This gives us the flexibility to use the`terraform-aws-cf-net` module multiple times, to have a staging and production cf within the same VPC, sharing a single microbosh instance.\n\nUpstream Terraform issues\n-------------------------\n\nDuring the development of this project (including the modules above) we have discovered some terraform bugs, some things we've worked around, and some issues that would be nice to implement (removed once resolved).\n\n- [![hashicorp/terraform/issues/776](https://github-shields.com/github/hashicorp/terraform/issues/776.svg)](https://github-shields.com/github/hashicorp/terraform/issues/776) - currently, both the released version of terraform and HEAD does not work with our configs. You must compile and use https://github.com/hashicorp/terraform/commit/fd6382fbafe0be8547eabbb279bbb6f095c87096 in order for this to work.\n-\t[![hashicorp/terraform/issues/745](https://github-shields.com/github/hashicorp/terraform/issues/745.svg)](https://github-shields.com/github/hashicorp/terraform/issues/745) - currently we can only bootstrap BOSH and Cloud Foundry inside the \"resource\" for creation of the bastian VM. We'd like to reuse the bastian VM and allow these terraform projects be more modular.\n\nUpstream Cloud Foundry issues\n-----------------------------\n\nIssues/Pull Requests pending across Cloud Foundry projects:\n\n-\t[![cloudfoundry/cf-release/pull/592](https://github-shields.com/github/cloudfoundry/cf-release/pull/592.svg)](https://github-shields.com/github/cloudfoundry/cf-release/pull/592) - there is no need to pre-provision a blank VM to run errands\n\nDeploy Cloud Foundry\n--------------------\n\n### Prerequisites\n\nThe one step that isn't automated is the creation of SSH keys. We are waiting for that feature to be [added to terraform](https://github.com/hashicorp/terraform/issues/28). An AWS SSH Key need to be created in desired region prior to running the following commands. Note the name of the key and the path to the pem/private key file for use further down.\n\nYou **must** being using at least terraform version 0.5.0.\n\n```\n$ terraform -v\nTerraform v0.5.0\n```\n\nYou can install terraform 0.5.0+ via [https://www.terraform.io/downloads.html]\n\nYour chosen AWS Region must have sufficient quota to spin up **all** of the machines. While building various bits, the install process can use up to 13 VMs, settling down to use 7 machines long-term (more, if you want more runners).\n\nOptionally for using the `Unattended Install` instruction, install git.\n\n#### NOTE: Building the entire Cloud Foundry cluster will take a little over an hour! It hasn't hung (probably), it just takes a little while to do ALL THE THINGS.\n\n### Easy install\n\n```bash\nmkdir terraform-aws-cf-install\ncd terraform-aws-cf-install\nterraform apply github.com/cloudfoundry-community/terraform-aws-cf-install\n```\n\n### Unattended install\n\n```bash\ngit clone https://github.com/cloudfoundry-community/terraform-aws-cf-install\ncd terraform-aws-cf-install\ncp terraform.tfvars.example terraform.tfvars\n```\n\nNext, edit `terraform.tfvars` using your text editor and fill out the variables with your own values (AWS credentials, AWS region, etc).\n\nRun the following to create the networking, subnets, security groups, ports and create a bastion server:\n\n```bash\nmake plan\nmake apply\n```\n\nOnce the bastion server is created, run the following to create a provision script with all the variables assigned, copy the script to the Bastion server then remotely execute the script.  This allows the script to be executed multiple times, as needed, without needing to destroy the Bastion server.\n\n```bash\nmake provision\n```\n\nIf the provision script fails, run `make provision` again from your laptop.  If you want someone to help you, a full copy of the provision script is also on the Bastion server at `/home/ubuntu/provision.sh`\n\nAfter Initial Install\n---------------------\n\nAt the end of the output of the terraform run, there will be a section called `Outputs` that will have at least `bastion_ip` and an IP address. If not, or if you cleared the terminal without noting it, you can log into the AWS console and look for an instance called 'bastion', with the `bastion` security group. Use the public IP associated with that instance, and ssh in as the ubuntu user, using the ssh key listed as `aws_key_path` in your configuration (if you used the Unattended Install).\n\n```\nssh -i ~/.ssh/example.pem ubuntu@$(terraform output bastion_ip)\n```\n\nAs an alternative there is a script provided for you which will execute ssh with all the necessary parameters.  From the root of the project folder run\n\n```\nmake ssh\n```\n\nOnce in, you can look in `workspace/deployments/cf-boshworkspace/` for the bosh deployment manifest and template files. Any further updates or changes to your microbosh or Cloud Foundry environment will be done manually using this machine as your work space. Terraform provisioning scripts are not intended for long-term updates or maintenance.\n\nCloud Foundry\n-------------\n\nTo login to Cloud Foundry as an administrator:\n\n```\ncf login --skip-ssl-validation -a $(terraform output cf_api) -u admin -p $(terraform output cf_admin_pass)\n```\n\nYou can also log into the cf api from the inception server itself, though you have to manually replace the calls to terraform from above with the actual values.\n\nCleanup / Tear down\n-------------------\n\nTerraform does not yet quite cleanup after itself. You can run `make destroy` to get quite a few of the resources you created, but you will probably have to manually track down some of the bits and manually remove them. Once you have done so, run `make clean` to remove the local cache and status files, allowing you to run everything again without errors.\n\nModule Outputs\n--------------\n\nIf you wish to use this module in conjunction with `terraform-aws-cf-net` to create more than one `cf` instance in a single VPC, that is fully supported. First, uncomment the `output` for the following variables in aws-cf-install.tf. They are suitable to be used as variable inputs to the `terraform-aws-cf-net` module:\n\n```\naws_vpc_id\naws_internet_gateway_id\naws_route_table_public_id\naws_route_table_private_id\naws_subnet_bastion_availability_zone\n```\n\n### Configuration\n\nLook in `variables.tf` to see all of the variables that can be set or overriden. The mandatory variables are:\n\n```\nsource = \"github.com/cloudfoundry-community/terraform-aws-cf-install\" # Or your own source, if you fork the repo\naws_access_key = \"${var.aws_access_key}\" # Provided by Amazon\naws_secret_key = \"${var.aws_secret_key}\" # Provided by Amazon\naws_key_name = \"${var.aws_key_name}\" # The \"name\" of the ssh key to use in the AWS Console under EC2 -\u003e Network \u0026 Security -\u003e Key Pairs\naws_key_path = \"${var.aws_key_path}\" # Literal path to pem file on the computer running Terraform - /home/user/keys/exapmle.pem\nnetwork = \"${var.network}\" # The first two octects to use within the VPC, e.g. 10.0 or 10.55\n```\n\n### Example usage\n\nNote that this does not actually create the second `cf` instance, that has to be done manually. You should be able to take the resources created by the `cf-staging` module, copy the cf-boshbootstrap directory on the bastion server, and search and replace with the new values. Also, you can set the `offset` value to whatever you want, from 1 to 24.\n\n```\nprovider \"aws\" {\n  access_key = \"${var.aws_access_key}\"\n  secret_key = \"${var.aws_secret_key}\"\n  region = \"${var.aws_region}\"\n}\n\nmodule \"cf-install\" {\n  source = \"github.com/cloudfoundry-community/terraform-aws-cf-install\"\n  network = \"${var.network}\"\n  aws_key_name = \"${var.aws_key_name}\"\n  aws_access_key = \"${var.aws_access_key}\"\n  aws_secret_key = \"${var.aws_secret_key}\"\n  aws_region = \"${var.aws_region}\"\n  aws_key_path = \"${var.aws_key_path}\"\n  cf_install = \"prod.mycloudfoundry.domain\"\n}\n\nmodule \"cf-staging\" {\n  source = \"github.com/cloudfoundry-community/terraform-aws-cf-net\"\n  network = \"${var.network}\"\n  aws_key_name = \"${var.aws_key_name}\"\n  aws_access_key = \"${var.aws_access_key}\"\n  aws_secret_key = \"${var.aws_secret_key}\"\n  aws_region = \"${var.aws_region}\"\n  aws_key_path = \"${var.aws_key_path}\"\n  aws_vpc_id = \"${module.cf-install.aws_vpc_id}\"\n  aws_internet_gateway_id = \"${module.cf-install.aws_internet_gateway_id}\"\n  aws_route_table_public_id = \"${module.cf-install.aws_route_table_public_id}\"\n  aws_route_table_private_id = \"${module.cf-install.aws_route_table_private_id}\"\n  aws_subnet_lb_availability_zone = \"${module.cf-install.aws_subnet_bastion_availability_zone}\"\n  offset = \"20\"\n  cf_install = \"staging.mycloudfoundry.domain\"\n}\n```\n\nInstalling Sample Docker Services\n---------------------------------\n\nIf you would like sample services like PostgreSQL, MySQL, Rabbit MQ, Mongo, etcd, consul (and others) there is a github repo that you can clone on the Bastion server or there is a flag you can set in your `terraform.tfvars` for this project which will install these services after Cloud Foundry is installed.\n\nTo enable these services to be installed automatically, add the following line to `terraform.tfvars`:\n\n```\ninstall_docker_services = \"true\"\n```\n\nThere is already a subnet defined in `aws-cf-install.tf` where this server will be created.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudfoundry-community%2Fterraform-aws-cf-install","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcloudfoundry-community%2Fterraform-aws-cf-install","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudfoundry-community%2Fterraform-aws-cf-install/lists"}