cfn-flow 0.5.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a8a7c12f98182c07a7961ddca970637d6454275a
4
- data.tar.gz: 4af32ae281b4a00f55eb9a7263d56eb40fefb678
3
+ metadata.gz: 8e00390b3fd3c7698003efd85d99fc576e885ba3
4
+ data.tar.gz: 881bb3936515feb3db9801637767c13db1b2ab9e
5
5
  SHA512:
6
- metadata.gz: 012e7d1fd2c3d517ef83725ef4a29ed4165669cf235a744be0481ac09cb18479b5a5e77b350b76e810b6e2eb52daa2264c0999f784bd57dcb0a2d2b59d1fb0a6
7
- data.tar.gz: 1f6bfd0cb3466afa28c054dcd7c03a3dae04bc729578fb475af346f18ecb699dbf258ec306caf8c657088b09c48a3db1dcc02edd400f910d896c8a19a1749106
6
+ metadata.gz: 511ada328d1a675b712cb20ad14d94e01a1940fedfb5da0e196609d9dfd2845a155c09932115c1858a13c831684d1f03d316106d2bdb87ccc28f8b0c906c6eed
7
+ data.tar.gz: b3e5baf4a020bc72e6ada19e6e16ae758a678e3c3aded9973ced8bd6bc84b71d3ee576035cd9f35ee8d1c3bdfea1da4a44dd91f65f53b09d450a62ef5c2d43a3
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # cfn-flow
2
2
  An opinionated command-line workflow for developing [AWS CloudFormation](https://aws.amazon.com/cloudformation/) templates and deploying stacks.
3
3
 
4
- Track template changes in git and upload versioned releases to AWS S3.
4
+ Track template changes in git and publish versioned releases to AWS S3.
5
5
 
6
6
  Deploy stacks using a standard, reliable process with extensible
7
7
  configuration in git.
@@ -10,7 +10,7 @@ configuration in git.
10
10
 
11
11
  1. *Optimize for onboarding.* The workflow should be simple to learn & understand.
12
12
  2. *Optimize for happiness.* The workflow should be easy and enjoyable to use.
13
- 3. *Auditable history.* Know who changed what when. Leverage git for auditing.
13
+ 3. *Auditable changes.* Know who changed what when. Leverage git change history.
14
14
  4. *Immutable releases.* The code in a release never changes.
15
15
 
16
16
  ## Installation
@@ -27,6 +27,81 @@ The `git` command is also needed.
27
27
  Poke around:
28
28
  ```
29
29
  cfn-flow help
30
+
31
+ cfn-flow help COMMAND
32
+ # E.g.:
33
+ cfn-flow help deploy
34
+ ```
35
+
36
+ Launching a CloudFormation stack:
37
+ ```
38
+ cfn-flow deploy production
39
+ ```
40
+
41
+ ## Configuration
42
+
43
+ `cfn-flow` looks for `./cfn-flow.yml` for stack and template configuration.
44
+ You can override this path by setting the `CFN_FLOW_CONFIG_PATH` environment
45
+ variable to another path.
46
+
47
+ Here's a minimal `cfn-flow.yml` config file:
48
+
49
+ ```yaml
50
+ # Required service name
51
+ service: MyService
52
+
53
+ # Minimal configuration for launching the stack.
54
+ stack:
55
+ # Stack name uses embedded ruby to support dynamic values
56
+ stack_name: MyService-<%= Time.now.to_i %>
57
+ # Required: *either* template_url or template_body
58
+ template_body: path/to/template.json
59
+ # Alternatively:
60
+ # template_url: https://MyS3Bucket.s3.amazonaws.com/MyPrefix/release/abc123/template.json
61
+ ```
62
+
63
+ And here's a maximal config file:
64
+
65
+ ```yaml
66
+ ---
67
+ # Example cfn-flow.yml
68
+
69
+ service: MyService
70
+
71
+ # Set the AWS region here to override or avoid setting the AWS_REGION env var
72
+ region: us-east-1
73
+
74
+ ##
75
+ # Templates
76
+ #
77
+ # These define where templates will get published.
78
+ # $ cfn-flow publish --release my-cfn-template.json
79
+ # Published url: https://MyS3Bucket.s3.amazonaws.com/My/S3/Prefix/<git sha>/my-cfn-template.json
80
+ templates:
81
+ bucket: MyS3Bucket
82
+ s3_prefix: 'My/S3/Prefix'
83
+
84
+ stack:
85
+ stack_name: MyService-<%= Time.now.to_i %>
86
+ template_body: path/to/template.yml
87
+ template_url: http://...
88
+ parameters:
89
+ # Your parameters, e.g.:
90
+ vpcid: vpc-1234
91
+ ami: ami-abcd
92
+ disable_rollback: true,
93
+ timeout_in_minutes: 1,
94
+ notification_arns: ["NotificationARN"],
95
+ capabilities: ["CAPABILITY_IAM"], # This stack does IAM stuff
96
+ on_failure: "DO_NOTHING", # either DO_NOTHING, ROLLBACK, DELETE
97
+ stack_policy_body: "StackPolicyBody",
98
+ stack_policy_url: "StackPolicyURL",
99
+ tags:
100
+ TagKey: TagValue
101
+ # Who launched this stack
102
+ Deployer: <%= ENV['USER'] %>
103
+ # Tag production and development environments for accounting
104
+ BillingType: <%= ENV['CFN_FLOW_ENVIRONMENT'] == 'production' ? 'production' : 'development' %>
30
105
  ```
31
106
 
32
107
  #### Dev mode (default)
@@ -54,6 +54,8 @@ module CfnFlow
54
54
  desc 'deploy ENVIRONMENT', 'Launch a stack'
55
55
  method_option :cleanup, type: :boolean, desc: 'Prompt to shutdown other stacks in ENVIRONMENT after launching'
56
56
  def deploy(environment)
57
+ # Export environment as an env var so it can be interpolated in config
58
+ ENV['CFN_FLOW_ENVIRONMENT'] = environment
57
59
 
58
60
  begin
59
61
  params = CfnFlow.stack_params(environment)
@@ -1,3 +1,3 @@
1
1
  module CfnFlow
2
- VERSION = '0.5.0'
2
+ VERSION = '0.7.0'
3
3
  end
@@ -117,6 +117,17 @@ describe 'CfnFlow::CLI' do
117
117
  err.must_equal ''
118
118
  end
119
119
 
120
+ it 'exposes the environmont as an env var' do
121
+ Aws.config[:cloudformation]= {
122
+ stub_responses: {
123
+ describe_stacks: { stacks: [ stub_stack_data(stack_name: 'cfn-flow-spec-stack') ] },
124
+ describe_stack_events: { stack_events: [ stub_event_data ] },
125
+ }
126
+ }
127
+ _ = capture_io { cli.start [:deploy, 'test-env'] }
128
+ ENV['CFN_FLOW_ENVIRONMENT'].must_equal 'test-env'
129
+ end
130
+
120
131
  it 'can fail with a validation error' do
121
132
  Aws.config[:cloudformation]= {
122
133
  stub_responses: { create_stack: 'ValidationError' }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cfn-flow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Suggs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-27 00:00:00.000000000 Z
11
+ date: 2015-08-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk