WikiWatershed / mmw-micro

Micro Site Storm Model
Apache License 2.0
1 stars 0 forks source link

Setup base project and support to manage AWS resources #1

Closed hectcastro closed 8 years ago

hectcastro commented 8 years ago

Add base project structure, including a stub NPM package configuration and scripts to manipulate the project. Also, add support for driving all of the AWS resources necessary to deploy the micro site across multiple environments.

Resolves parts of:


Testing

vagrant@vagrant-ubuntu-trusty-64:/vagrant$ ./scripts/infra plan
/vagrant/deployment/terraform /vagrant
Remote configuration updated
Remote state configured and pulled.
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but
will not be persisted to local or remote state storage.

data.template_file.read_only_bucket_policy: Refreshing state...
data.template_file.server_side_encryption_policy: Refreshing state...
aws_s3_bucket.mmw_micro_logs: Refreshing state... (ID: staging-mmw-micro-logs-us-east-1)
aws_s3_bucket.mmw_micro: Refreshing state... (ID: staging-mmw-micro-origin-us-east-1)
aws_cloudfront_distribution.mmw_micro: Refreshing state... (ID: EXUCNSJRVZI4W)
aws_route53_record.mmw_micro: Refreshing state... (ID: ZURQREPIGC39W_micro.staging.app.wikiwatershed.org_A)

No changes. Infrastructure is up-to-date. This means that Terraform
could not detect any differences between your configuration and
the real physical resources that exist. As a result, Terraform
doesn't need to do anything.
(dryrun) upload: ../../dist/index.html to s3://staging-mmw-micro-origin-us-east-1/index.html
/vagrant

Note: The last bit referencing index.html may not exist. I create a stub index.html file inside dist/ to test.

kdeloach commented 8 years ago

We use the script extension on all projects (./scripts/server.sh rather than ./scripts/server). Consider adding it for consistency.

Agreed.

hectcastro commented 8 years ago

Scripts file extension addressed in https://github.com/WikiWatershed/mmw-micro/pull/1/commits/3e5f58426202347676bd63b8ff76d3d1332d56d7.

For the record, the reasoning for omitting the extension is to leave the door open for alternate scripting languages. For example, it may be easier to do something that needs to interact with AWS with Python/Boto vs. Bash script/AWS CLI. The interpreter used to evaluate the script can be controlled via #!.