Skip to content
Browse files

Remove specific references to PA instance from infrastructure config (


* Remove references to DistrictBuilder PA from infrastructure

In bringing over some infrastructure updates from the PA instance
of DistrictBuilder, we introduced a few references to variables in
the PA instance infrastructure. Either make these generic, or revert
them to refer to Virginia where appropriate.

* Remove CloudFormation template

Now that the deployment infrastructure is fully migrated to
Terraform, there's no reason to keep a CloudFormation template
file in this repository.
  • Loading branch information...
jeancochrane authored and rbreslow committed Dec 7, 2018
1 parent ef556c3 commit 9cf774ba1ef72715c878d5183280caea27bc5617
@@ -23,7 +23,7 @@ MAILER_PASSWORD=
@@ -11,6 +11,7 @@ sld


# Terraform
@@ -21,4 +22,4 @@ deployment/terraform/.terraform

# User data
@@ -18,13 +18,13 @@ install:
- cp django/publicmapping/config/config.dist.xml django/publicmapping/config/config.xml
- "./scripts/update"
- wget -qO ./data/
- wget -qO ./data/
- "./scripts/test"
- mkdir -p ~/.ssh
- openssl aes-256-cbc -K $encrypted_c49e2c465c08_key -iv $encrypted_c49e2c465c08_iv
-in district-builder-pa.pem.enc -out ~/.ssh/district-builder-pa.pem -d
-in district-builder.pem.enc -out ~/.ssh/district-builder.pem -d
- cp django/publicmapping/config/config.xml deployment/user-data/config.xml
- mv ./data/ deployment/user-data/
@@ -42,4 +42,4 @@ deploy:
branch: develop
- docker-compose -f run --rm --entrypoint git terraform clean -fdx
- rm -f ~/.ssh/district-builder-pa.pem
- rm -f ~/.ssh/district-builder.pem
@@ -1,6 +1,6 @@
# DistrictBuilder

[![Build Status](](
[![Build Status](](

[DistrictBuilder]( is software created by the [Public Mapping Project](

@@ -38,9 +38,9 @@ $ vagrant ssh
$ ./scripts/update

If you want to get DistrictBuilder up and running quickly with PA data, you can then run
If you want to get DistrictBuilder up and running quickly with demo data, you can then run
$ ./scripts/configure_pa_data
$ ./scripts/configure_va_data

Otherwise, you'll need to provide your own shapefiles and config.xml file. Put your zipped shapefile in
@@ -80,13 +80,13 @@ From there, running `./scripts/update` builds containers. The rest of the setup
directly or indirectly through a setup management command. To get started, run
`./scripts/setup`, followed by `vagrant ssh`, followed by `./scripts/update`.

Then, run `./scripts/configure_pa_data`. It is not fast. Currently, it takes several hours, with the exact
Then, run `./scripts/configure_va_data`. It is not fast. Currently, it takes several hours, with the exact
time depending on hardware. We are working on ways to improve the speed of loading data.

The script will do several things

- Fetch zipped shapefile data for Pennsylvania into a specific location
- Drop and recreate the `district_builder**
- Fetch zipped shapefile data for Virginia into a specific location
- Drop and recreate the `district_builder` database
- Run database migrations: create the relationships that data will be loaded into
- Load shapes from shapefiles at different levels: create records for the shapes and characteristics
in the configured shapefiles

This file was deleted.

Oops, something went wrong.
@@ -23,7 +23,7 @@ Amazon Web Services deployment is driven by [Terraform](,

#### SSH Keys

You'll need to download the `district-builder-pa` SSH Keypair from the fileshare, and store it at `~/.ssh/district-builder-pa.pem`.
- You'll need to generate an SSH Keypair using the AWS EC2 console. Download the private key, and store it at `~/.ssh/district-builder.pem`.


@@ -36,16 +36,16 @@ You will upload your own DistrictBuilder `config.xml` and shapefile zip to the A
#### `scripts/infra`
Once the settings bucket and User Data are configured, you can run the deployment. To deploy the infrastructure for a DistrictBuilder instance (EC2, Route53 records, etc.) resources, use the `infra` wrapper script to lookup the remote state of the infrastructure and assemble a plan for work to be done. You can run `scripts/infra` inside of the `terraform` Docker container defined in ``, which contains all of the necessary software dependencies for deployments.

First, obtain your account's AWS API keypair, and configure your `district-builder-pa` AWS profile. Then, set `DB_SETTINGS_BUCKET` and `IMAGE_VERSION`, and run `scripts/infra`:
First, obtain your account's AWS API keypair, and configure your `district-builder` AWS profile. Then, set `DB_SETTINGS_BUCKET` and `IMAGE_VERSION`, and run `scripts/infra`:

$ aws --profile district-builder-pa configure
$ aws --profile district-builder configure
AWS Access Key ID [None]: ****************BWCA
AWS Secret Access Key [None]: ****************hlS4
Default region name [None]: us-east-1
Default output format [None]:
$ export AWS_PROFILE=district-builder-pa
$ export AWS_PROFILE=district-builder
$ export DB_SETTINGS_BUCKET="district-builder-dtl-staging-config-us-east-1"
# IMAGE_VERSION can be a git SHA, or version tag
$ export IMAGE_VERSION=123456"
@@ -85,11 +85,11 @@ $ ./scripts/load_configured_data --production
Depending on the configuration changes, staging will sometimes get into a bad state after deployment as we do not handle all types of config changes perfectly. As a result, you may need to "wipe the slate clean" in staging to see your changes. You can do this by ssh-ing into the staging app server, downloading the appropriate script, and running it, like so (**NOTE: the database will be dropped and recreated!**):
$ ssh-add ~/.ssh/district-builder-pa.pem
$ ssh-add ~/.ssh/district-builder.pem
$ ssh -A
$ ssh -A ec2-user@bastion.staging.<state>
$ ssh ec2-user@pa.districtbuilder.internal
$ ssh ec2-user@$<state>.districtbuilder.internal
$ docker exec -ti districtbuilder-django bash
@@ -29,7 +29,7 @@ variable "remote_state_bucket_prefix" {
variable "is_subdomain" {}

variable "ssh_identity_file_path" {
default = "~/.ssh/district-builder-pa.pem"
default = "~/.ssh/district-builder.pem"

variable "cloudfront_aliases" {
Binary file not shown.
Binary file not shown.
@@ -98,10 +98,6 @@

"geojson": "django.contrib.gis.serializers.geojson",

ROOT_URLCONF = 'publicmapping.urls'

@@ -4,6 +4,6 @@ services:
- AWS_PROFILE=${AWS_PROFILE:-district-builder-pa}
- AWS_PROFILE=${AWS_PROFILE:-district-builder}
- ~/.aws:/root/.aws
@@ -14,7 +14,7 @@ services:
- DB_SETTINGS_BUCKET=${DB_SETTINGS_BUCKET:-districtbuilder-staging-config-us-east-1}
- ./:/usr/local/src
- ~/.ssh:/root/.ssh
@@ -59,7 +59,6 @@ services:
- reports:/opt/reports
- tmp:/tmp
- translations:/usr/src/app/locale
entrypoint: /usr/local/bin/celery
- "worker"

0 comments on commit 9cf774b

Please sign in to comment.
You can’t perform that action at this time.