Skip to content

Commit 10c789a

Browse files
authored
Merge pull request #36 from caktus/develop
Release 1.3.0
2 parents 4388846 + 75d879c commit 10c789a

31 files changed

+963
-86
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
*.pyc
22
content/
3+
_build/

CHANGELOG.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,25 @@
11
Change Log
22
==========
33

4+
`1.3.0`_ (2018-09-13)
5+
---------------------
6+
7+
Features:
8+
9+
* Allow overriding parameter defaults at template creation time without having to change the
10+
Python code. See `the README
11+
<https://github.com/caktus/aws-web-stacks/blob/master/README.rst#dokku>`_.
12+
* Add a parameter to control whether certificates are validated by DNS or email, and default
13+
to DNS since GDPR has made email validation less likely to work.
14+
* The database type of the RDS instance can now be configured (previously, only Postgres could
15+
be used). Note that, for backwards-compatibility reasons, the resources in the CloudFormation
16+
stack is still named ``PostgreSQL`` (this avoids unnecessarily recreating the RDS instance
17+
on pre-existing stacks). See: PR #32
18+
* The RDS instance now supports all allowable special characters in the password field. See: PR #31
19+
* The CloudFront distribution linked to the S3 assets bucket can now be disabled / enabled at the
20+
time a stack is created or updated; the CloudFront distribution now supports a custom domain name
21+
and SSL certificate. See: PR #30
22+
423

524
`1.2.0`_ (2017-09-27)
625
---------------------
@@ -115,6 +134,7 @@ Backwards-incompatible changes:
115134
* Initial public release
116135

117136

137+
.. _1.3.0: https://aws-web-stacks.s3.amazonaws.com/index.html?prefix=1.3.0/
118138
.. _1.2.0: https://aws-web-stacks.s3.amazonaws.com/index.html?prefix=1.2.0/
119139
.. _1.1.2: https://aws-web-stacks.s3.amazonaws.com/index.html?prefix=1.1.2/
120140
.. _1.1.1: https://aws-web-stacks.s3.amazonaws.com/index.html?prefix=1.1.1/

CONTRIBUTING.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,16 @@ Compile JSON Templates
3131
3232
The templates will be saved to the ``content/`` directory.
3333

34+
Building the documentation
35+
--------------------------
36+
37+
.. code-block:: bash
38+
39+
cd docs
40+
make html
41+
42+
The docs will be available in the ``docs/_build/html/`` directory.
43+
3444
Submitting Pull Requests
3545
------------------------
3646

README.rst

Lines changed: 66 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ AWS Web Stacks
77
AWS Web Stacks is a library of CloudFormation templates that dramatically simplify hosting web applications
88
on AWS. The library supports using Elastic Container Service (ECS), Elastic Beanstalk (EB), EC2 instances
99
(via an AMI you specify), or `Dokku <http://dokku.viewdocs.io/dokku/>`_ for the application server(s) and
10-
provides auxilary managed services such as a Postgres RDS instance, Redis instance, Elasticsearch instance
10+
provides auxilary managed services such as an RDS instance, ElastiCache instance, Elasticsearch instance
1111
(free) SSL certificate via AWS Certificate Manager, S3 bucket for static assets, ECS repository for hosting
12-
Docker images, etc. All resources (except Elasticsearch, which does not support VPCs) are created in a
13-
self-contained VPC, which may use a NAT gateway (if you want to pay for that) or not.
12+
Docker images, etc. All resources (that support VPCs) are created in a self-contained VPC, which may use a
13+
NAT gateway (if you want to pay for that) or not, and resources that require API authentication (such as
14+
S3 or Elasticsearch) are granted permissions via the IAM instance role and profile assigned to the
15+
application servers created in the stack.
1416

1517
The CloudFormation templates are written in `troposphere <https://github.com/cloudtools/troposphere>`_,
1618
which allows for some validation at build time and simplifies the management of several related
@@ -67,6 +69,12 @@ wish to use the JSON template directly:
6769
.. _Dokku-No-NAT: https://console.aws.amazon.com/cloudformation/home?#/stacks/new?stackName=dokku-no-nat&templateURL=https://s3.amazonaws.com/aws-web-stacks/dokku-no-nat.json
6870
.. _dokku-no-nat.json: https://s3.amazonaws.com/aws-web-stacks/dokku-no-nat.json
6971

72+
Documentation
73+
-------------
74+
75+
In addition to this README, there is additional documentation at
76+
http://aws-web-stacks.readthedocs.io/
77+
7078

7179
Elastic Beanstalk, Elastic Container Service, EC2, or Dokku?
7280
------------------------------------------------------------
@@ -90,8 +98,8 @@ it appear unhealthy, e.g.::
9098

9199
For very simple, Heroku-like deploys, choose the **Dokku** option. This will give you a single EC2 instance
92100
based on Ubuntu 16.04 LTS with `Dokku <http://dokku.viewdocs.io/dokku/>`_ pre-installed and global environment
93-
variables configured that will allow your app to find the Postgres, Redis or Memcached, and Elasticsearch nodes
94-
created with this stack.
101+
variables configured that will allow your app to find the RDS, ElastiCache, and Elasticsearch nodes created
102+
with this stack.
95103

96104
NAT Gateways
97105
------------
@@ -140,8 +148,10 @@ The following is a partial list of resources created by this stack, when Elastic
140148
which will be pre-configured with the environment variables specified below.
141149
* **Elasticsearch** (``AWS::Elasticsearch::Domain``): An Elasticsearch instance, which your
142150
application may use for full-text search, logging, etc.
143-
* **PostgreSQL** (``AWS::RDS::DBInstance``): The Postgres RDS instance for your application.
144-
Includes a security group to allow access only from your EB or ECS instances in this stack.
151+
* **PostgreSQL** (``AWS::RDS::DBInstance``): The RDS instance for your application.
152+
Includes a security group to allow access only from your EB or ECS instances in this stack. Note:
153+
this CloudFormation resource is named "PostgreSQL" for backwards-compatibility reasons, but the
154+
RDS instance can be configured with any database engine supported by RDS.
145155
* **Redis** (``AWS::ElastiCache::CacheCluster``): The Redis ElasticCache instance for your
146156
application. Includes a cache security group to allow access only from your EB or ECS instances in
147157
this stack.
@@ -183,8 +193,8 @@ application on the specified port, with all of the necessary secrets and environ
183193
Note that the Elastic Load Balancer will not direct traffic to your instances until the health
184194
check you specify during stack creation returns a successful response.
185195

186-
Environment Variables
187-
---------------------
196+
Environment Variables within your server instances
197+
--------------------------------------------------
188198

189199
Once your environment is created you'll have an Elastic Beanstalk (EB) or Elastic Compute Service
190200
(ECS) environment with the environment variables you need to run a containerized web application.
@@ -380,11 +390,57 @@ job to automatically renew the cert as needed::
380390

381391
The Python sample app should now be accessible over HTTPS at https://python-sample.your.domain/
382392

393+
Creating or updating templates
394+
------------------------------
395+
396+
Templates built from the latest release of aws-web-stacks will be available in
397+
S3 (see links near the top of this file). They're built with generic defaults.
398+
399+
Templates are built by setting some environment variables with your preferences
400+
and then running ``python -c 'import stack'`` (see the Makefile).
401+
The template file is output to standard output. It's easy to do this on one line::
402+
403+
USE_EC2=on python -c 'import stack' >my_ec2_stack_template.json
404+
405+
Here are the environment variables that control the template creation.
406+
407+
USE_EC2=on
408+
Create EC2 instances directly.
409+
USE_GOVCLOUD=on
410+
Create EC2 instances directly, but disables AWS services that aren't available
411+
in GovCloud like the AWS Certificate Manager and Elastic Search.
412+
USE_EB=on
413+
Create an Elastic Beanstalk application
414+
USE_ECS=on
415+
Create an Elastic Container Service.
416+
USE_DOKKU=on
417+
Create an EC2 instance containing a Dokku server
418+
419+
I believe those environment variables are mutually exclusive. The remaining
420+
ones can be used in combination with each other or one of the above.
421+
422+
USE_NAT_GATEWAY=on
423+
Don't put the services inside your VPC onto the public internet, and
424+
add a NAT gateway to the stack to the services can make connections out.
425+
DEFAULTS_FILE=<path to JSON file>
426+
Changes the default values for parameters. The JSON file should just be
427+
a dictionary mapping parameter names to default values, e.g.::
428+
429+
{
430+
"AMI": "ami-078c57a94e9bdc6e0",
431+
"AssetsUseCloudFront": "false"
432+
}
433+
434+
One more example, creating EC2 instances without a NAT gateway and overriding
435+
the parameter defaults::
436+
437+
USE_EC2=on DEFAULTS_FILE=stack_defaults.json python -c 'import stack' >stack.json
438+
383439
Contributing
384440
------------
385441

386442
Please read `contributing guidelines here <https://github.com/caktus/aws-web-stacks/blob/develop/CONTRIBUTING.rst>`_.
387443

388444
Good luck and have fun!
389445

390-
Copyright 2017 Jean-Phillipe Serafin, Tobias McNulty.
446+
Copyright 2017, 2018 Jean-Phillipe Serafin, Tobias McNulty.

docs/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line.
5+
SPHINXOPTS =
6+
SPHINXBUILD = sphinx-build
7+
SPHINXPROJ = AWSWebStacks
8+
SOURCEDIR = .
9+
BUILDDIR = _build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/conf.py

Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
#!/usr/bin/env python3
2+
# -*- coding: utf-8 -*-
3+
#
4+
# AWS Web Stacks documentation build configuration file, created by
5+
# sphinx-quickstart on Wed Feb 7 15:37:19 2018.
6+
#
7+
# This file is execfile()d with the current directory set to its
8+
# containing dir.
9+
#
10+
# Note that not all possible configuration values are present in this
11+
# autogenerated file.
12+
#
13+
# All configuration values have a default; values that are commented out
14+
# serve to show the default.
15+
16+
# If extensions (or modules to document with autodoc) are in another directory,
17+
# add these directories to sys.path here. If the directory is relative to the
18+
# documentation root, use os.path.abspath to make it absolute, like shown here.
19+
#
20+
# import os
21+
# import sys
22+
# sys.path.insert(0, os.path.abspath('.'))
23+
24+
25+
# -- General configuration ------------------------------------------------
26+
27+
# If your documentation needs a minimal Sphinx version, state it here.
28+
#
29+
# needs_sphinx = '1.0'
30+
31+
# Add any Sphinx extension module names here, as strings. They can be
32+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
33+
# ones.
34+
extensions = []
35+
36+
# Add any paths that contain templates here, relative to this directory.
37+
templates_path = ['_templates']
38+
39+
# The suffix(es) of source filenames.
40+
# You can specify multiple suffix as a list of string:
41+
#
42+
# source_suffix = ['.rst', '.md']
43+
source_suffix = '.rst'
44+
45+
# The master toctree document.
46+
master_doc = 'index'
47+
48+
# General information about the project.
49+
project = 'AWS Web Stacks'
50+
copyright = '2018, Caktus Group'
51+
author = 'Caktus Group'
52+
53+
# The version info for the project you're documenting, acts as replacement for
54+
# |version| and |release|, also used in various other places throughout the
55+
# built documents.
56+
#
57+
# The short X.Y version.
58+
version = ''
59+
# The full version, including alpha/beta/rc tags.
60+
release = ''
61+
62+
# The language for content autogenerated by Sphinx. Refer to documentation
63+
# for a list of supported languages.
64+
#
65+
# This is also used if you do content translation via gettext catalogs.
66+
# Usually you set "language" from the command line for these cases.
67+
language = None
68+
69+
# List of patterns, relative to source directory, that match files and
70+
# directories to ignore when looking for source files.
71+
# This patterns also effect to html_static_path and html_extra_path
72+
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
73+
74+
# The name of the Pygments (syntax highlighting) style to use.
75+
pygments_style = 'sphinx'
76+
77+
# If true, `todo` and `todoList` produce output, else they produce nothing.
78+
todo_include_todos = False
79+
80+
81+
# -- Options for HTML output ----------------------------------------------
82+
83+
# The theme to use for HTML and HTML Help pages. See the documentation for
84+
# a list of builtin themes.
85+
#
86+
html_theme = 'alabaster'
87+
88+
# Theme options are theme-specific and customize the look and feel of a theme
89+
# further. For a list of options available for each theme, see the
90+
# documentation.
91+
#
92+
# html_theme_options = {}
93+
94+
# Add any paths that contain custom static files (such as style sheets) here,
95+
# relative to this directory. They are copied after the builtin static files,
96+
# so a file named "default.css" will overwrite the builtin "default.css".
97+
html_static_path = ['_static']
98+
99+
# Custom sidebar templates, must be a dictionary that maps document names
100+
# to template names.
101+
#
102+
# This is required for the alabaster theme
103+
# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars
104+
html_sidebars = {
105+
'**': [
106+
'relations.html', # needs 'show_related': True theme option to display
107+
'searchbox.html',
108+
]
109+
}
110+
111+
112+
# -- Options for HTMLHelp output ------------------------------------------
113+
114+
# Output file base name for HTML help builder.
115+
htmlhelp_basename = 'AWSWebStacksdoc'
116+
117+
118+
# -- Options for LaTeX output ---------------------------------------------
119+
120+
latex_elements = {
121+
# The paper size ('letterpaper' or 'a4paper').
122+
#
123+
# 'papersize': 'letterpaper',
124+
125+
# The font size ('10pt', '11pt' or '12pt').
126+
#
127+
# 'pointsize': '10pt',
128+
129+
# Additional stuff for the LaTeX preamble.
130+
#
131+
# 'preamble': '',
132+
133+
# Latex figure (float) alignment
134+
#
135+
# 'figure_align': 'htbp',
136+
}
137+
138+
# Grouping the document tree into LaTeX files. List of tuples
139+
# (source start file, target name, title,
140+
# author, documentclass [howto, manual, or own class]).
141+
latex_documents = [
142+
(master_doc, 'AWSWebStacks.tex', 'AWS Web Stacks Documentation',
143+
'Caktus Group', 'manual'),
144+
]
145+
146+
147+
# -- Options for manual page output ---------------------------------------
148+
149+
# One entry per manual page. List of tuples
150+
# (source start file, name, description, authors, manual section).
151+
man_pages = [
152+
(master_doc, 'awswebstacks', 'AWS Web Stacks Documentation',
153+
[author], 1)
154+
]
155+
156+
157+
# -- Options for Texinfo output -------------------------------------------
158+
159+
# Grouping the document tree into Texinfo files. List of tuples
160+
# (source start file, target name, title, author,
161+
# dir menu entry, description, category)
162+
texinfo_documents = [
163+
(master_doc, 'AWSWebStacks', 'AWS Web Stacks Documentation',
164+
author, 'AWSWebStacks', 'One line description of project.',
165+
'Miscellaneous'),
166+
]
167+
168+
169+

0 commit comments

Comments
 (0)