Skip to content

Commit e977ba7

Browse files
author
Bill Wang
committed
Better README
1 parent 61345cd commit e977ba7

File tree

4 files changed

+74
-6
lines changed

4 files changed

+74
-6
lines changed

Makefile

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,29 @@
1-
.PHONY: all lint test
1+
REGION ?= us-west-2
2+
ENV ?= stage
3+
ARGS ?= --interactive
24

3-
all: lint test
5+
.PHONY: all lint test build
6+
7+
all: lint test build
8+
9+
# run one time only
10+
prerequisite:
11+
sudo pip install stacker_blueprints
412

513
lint:
614
flake8 stacker_blueprints
715

816
test:
917
python setup.py test
18+
19+
build:
20+
stacker build --region ${REGION} ${ARGS} conf/${ENV}.env conf/example.yaml
21+
22+
diff:
23+
stacker diff --region ${REGION} ${ARGS} conf/${ENV}.env conf/example.yaml
24+
25+
info:
26+
stacker info --region ${REGION} ${ARGS} conf/${ENV}.env conf/example.yaml
27+
28+
destroy:
29+
stacker destroy --region ${REGION} ${ARGS} conf/${ENV}.env conf/example.yaml

README.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
stacker_blueprints
2+
==================
3+
4+
[![circleci](https://circleci.com/gh/cloudtools/stacker_blueprints.svg?style=shield)](https://circleci.com/gh/cloudtools/stacker_blueprints)
5+
[![pypi package](https://badge.fury.io/py/stacker_blueprints.svg)](https://badge.fury.io/py/stacker_blueprints)
6+
[![slack](https://empire-slack.herokuapp.com/badge.svg)](https://empire-slack.herokuapp.com)
7+
8+
An attempt at a common Blueprint library for use with `stacker <https://github.com/cloudtools/stacker>`_.
9+
10+
If you're new to stacker you may use `stacker_cookiecutter <https://github.com/cloudtools/stacker_cookiecutter>`_ to setup your project.
11+
12+
# Quick start
13+
14+
>NOTES: it will create aws resources and generate cost on your aws account. `make destroy` them all if not required any more.
15+
16+
Make sure you have permission to access aws, review below files if you need change anything.
17+
18+
1) Adjust namespace to a global unique name, the name in example will be used in s3 bucket name, and has been used.
19+
2) I have issue to start with pre_build task, if you get same problem, comment that session.
20+
21+
config/stage.env
22+
config/example.yaml
23+
24+
### Build the stacks
25+
26+
Build full stacks (vpc, bastion, myDB, myWeb)
27+
28+
$ git clone https://github.com/cloudtools/stacker_blueprints.git
29+
$ cd stacker_blueprints
30+
$ make build
31+
32+
# If you have other environment files, such as prod.env
33+
$ make build ENV=prod
34+
35+
# If you want to create stacks in other region
36+
$ make build REGION=ap-southeast-2
37+
38+
### Other commands
39+
40+
$ make info
41+
$ make diff
42+
$ make destroy
43+
44+
### Try other examples
45+
46+
There are examples under folder `conf`, for example, you want to run test on rds stack, you can easily play with below command
47+
48+
stacker build --region us-west-2 conf/rds/mysql.env conf/rds/mysql.yaml

conf/example.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ stacks:
5757
- name: bastion
5858
class_path: stacker_blueprints.bastion.Bastion
5959
enabled: true
60-
parameters:
60+
variables:
6161
# Extends the parameters dict with the contents of the vpc_parameters
6262
# anchor. Basically we're including all VPC Outputs in the parameters
6363
# of the bastion stack. Note: Stacker figures out, automatically, which
@@ -77,7 +77,7 @@ stacks:
7777
# stack name "myDB" on the command line with --force
7878
locked: true
7979
enabled: true
80-
parameters:
80+
variables:
8181
<< : *vpc_parameters
8282
InstanceType: db.m3.medium
8383
AllocatedStorage: 10
@@ -93,7 +93,7 @@ stacks:
9393
- name: myWeb
9494
class_path: stacker_blueprints.asg.AutoscalingGroup
9595
enabled: true
96-
parameters:
96+
variables:
9797
<< : *vpc_parameters
9898
InstanceType: m3.medium
9999
ImageName: ubuntu1404

conf/stage.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
# will be used to prefix the CloudFormation stack names as well as the s3
77
# bucket that contains revisions of the stacker templates. This is the only
88
# required environment variable.
9-
namespace:
9+
namespace: stacker_blueprints

0 commit comments

Comments
 (0)