kitchen-cloudformation 1.0.3 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +17 -17
- data/kitchen-cloudformation.gemspec +0 -1
- data/lib/kitchen/driver/aws/cf_client.rb +0 -1
- data/lib/kitchen/driver/aws/stack_generator.rb +11 -2
- data/lib/kitchen/driver/cloudformation.rb +11 -10
- data/lib/kitchen/driver/cloudformation_version.rb +1 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b8b6413186cf620aa770f3edf0a0cd0e43423a69
|
4
|
+
data.tar.gz: a796500599de24d644660dcabfde361374e85335
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 510c8df116dd61765534720551462e496e465ca097c07aacfd353c6524b202dc5db0bb919502166855dd6295d2fe31fe18f54195493bdbb09c964edf7efd8b58
|
7
|
+
data.tar.gz: 25581e9e976e8cd093da2ead699f8a7e038bea8ca5397d4b90a40caa94fdf8620fd786f051b67b6f40906d56726905651b70c82a45979682cc325ca85ae3a436
|
data/README.md
CHANGED
@@ -8,12 +8,12 @@ A Test Kitchen Driver for Amazon AWS Cloudformation.
|
|
8
8
|
This driver uses the [aws sdk gem][aws_sdk_gem] to create and delete Amazon AWS Cloudformation stacks to orchestrate your cloud resources for your infrastructure testing, dev or production setup.
|
9
9
|
|
10
10
|
It works best using AWS VPC where the servers have fixed IP addresses or in AWS Clasic using known Elastic IP Addresses.
|
11
|
-
This allow the IP address of each of the servers to be specified as a hostname in the
|
11
|
+
This allow the IP address of each of the servers to be specified as a hostname in the converge step.
|
12
12
|
|
13
13
|
So you can deploy and test say a Mongodb High Availability cluster by using cloud formation to create the servers
|
14
14
|
and then converge each of the servers in the cluster and run tests.
|
15
15
|
|
16
|
-
|
16
|
+
This can be used with [kitchen-verifier-awspec](https://github.com/neillturner/kitchen-verifier-awspec) to do verification of AWS infrastructure.
|
17
17
|
|
18
18
|
## Requirements
|
19
19
|
|
@@ -25,19 +25,25 @@ will need access to an [AWS][aws_site] account.
|
|
25
25
|
|
26
26
|
key | default value | Notes
|
27
27
|
----|---------------|--------
|
28
|
-
|
28
|
+
capabilities||Array of capabilities that must be specified before creating or updating certain stacks accepts CAPABILITY_IAM, CAPABILITY_NAMED_IAM
|
29
|
+
disable_rollback||If the template gets an error don't rollback changes. true/false. default false.
|
30
|
+
notification_arns| [] |The Simple Notification Service (SNS) topic ARNs to publish stack related events. Array of Strings.
|
31
|
+
on_failure||Determines what action will be taken if stack creation fails. accepts DO_NOTHING, ROLLBACK, DELETE. You can specify either on_failure or disable_rollback, but not both.
|
32
|
+
parameters|{}|Hash of parameters {key: value} to apply to the templates
|
33
|
+
resource_types| [] |The template resource types that you have permissions to work with. Array of Strings.
|
34
|
+
role_arn||The Amazon Resource Name (ARN) of an AWS Identity and Access Management (IAM) role that AWS CloudFormation assumes to create the stack.
|
29
35
|
shared_credentials_profile| nil|Specify Credentials Using a Profile Name
|
30
|
-
aws_access_key_id|nil|Deprecated see Authenticating with AWS
|
31
|
-
aws_secret_access_key|nil|Deprecated see Authenticating with AWS
|
32
|
-
aws_session_token|nil|Deprecated see Authenticating with AWS
|
33
36
|
ssl_cert_file| ENV["SSL_CERT_FILE"]|SSL Certificate required on Windows platforms
|
34
37
|
stack_name ||Name of the Cloud Formation Stack to create
|
38
|
+
stack_policy_body||Structure containing the stack policy body.
|
39
|
+
stack_policy_url||Location of a file containing the stack policy.
|
40
|
+
tags|{}|Hash of tags for stack TagKey: TagValue
|
35
41
|
template_file||File containing the Cloudformation template to run
|
36
42
|
template_url||URL of the file containing the Cloudformation template to run
|
37
|
-
parameters|{}|Hash of parameters {key: value} to apply to the templates
|
38
|
-
disable_rollback|false|If the template gets an error don't rollback changes
|
39
43
|
timeout_in_minutes|0|Timeout if the stack is not created in the time
|
40
44
|
|
45
|
+
See http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_CreateStack.html for parameter details.
|
46
|
+
|
41
47
|
## Authenticating with AWS
|
42
48
|
|
43
49
|
There are 3 ways you can authenticate against AWS, and we will try them in the
|
@@ -61,7 +67,7 @@ This precedence order is taken from http://docs.aws.amazon.com/sdkforruby/api/in
|
|
61
67
|
In summary it searches the following locations for credentials:
|
62
68
|
|
63
69
|
ENV['AWS_ACCESS_KEY_ID'] and ENV['AWS_SECRET_ACCESS_KEY']
|
64
|
-
The shared credentials ini file at ~/.aws/credentials
|
70
|
+
The shared credentials ini file at ~/.aws/credentials
|
65
71
|
From an instance profile when running on EC2
|
66
72
|
|
67
73
|
and it searches the following locations for a region:
|
@@ -103,7 +109,7 @@ driver:
|
|
103
109
|
stack_name: mystack
|
104
110
|
template_file: /test/example.template
|
105
111
|
parameters:
|
106
|
-
|
112
|
+
base_package: wget
|
107
113
|
|
108
114
|
provisioner:
|
109
115
|
name: chef_zero
|
@@ -120,8 +126,6 @@ suites:
|
|
120
126
|
hostname: '10.53.191.70'
|
121
127
|
```
|
122
128
|
|
123
|
-
## <a name="license"></a> License
|
124
|
-
|
125
129
|
Apache 2.0 (see [LICENSE][license])
|
126
130
|
|
127
131
|
|
@@ -143,8 +147,4 @@ Apache 2.0 (see [LICENSE][license])
|
|
143
147
|
|
144
148
|
-implement all the options of cloud formation.
|
145
149
|
|
146
|
-
|
147
|
-
OpenStack Heat
|
148
|
-
Azure Resource Manager
|
149
|
-
Google Cloud Deployment Manager
|
150
|
-
but i'm not aware of any ruby sdks for these yet.
|
150
|
+
|
@@ -1,4 +1,3 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
1
|
#
|
3
2
|
#
|
4
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -39,13 +38,23 @@ module Kitchen
|
|
39
38
|
if config[:template_file]
|
40
39
|
s[:template_body] = File.open(config[:template_file], 'rb') { |file| file.read }
|
41
40
|
end
|
42
|
-
s[:capabilities] = config[:capabilities] if !config[:capabilities].nil? && (config[:capabilities].is_a? Array)
|
41
|
+
s[:capabilities] = config[:capabilities] if !config[:capabilities].nil? && (config[:capabilities].is_a? Array) && !config[:capabilities].empty?
|
43
42
|
s[:timeout_in_minutes] = config[:timeout_in_minutes] if !config[:timeout_in_minutes].nil? && config[:timeout_in_minutes] > 0
|
44
43
|
s[:disable_rollback] = config[:disable_rollback] if !config[:disable_rollback].nil? && config[:disable_rollback] == true || config[:disable_rollback] == false
|
45
44
|
s[:parameters] = []
|
46
45
|
config[:parameters].each do |k, v|
|
47
46
|
s[:parameters].push(parameter_key: k.to_s, parameter_value: v.to_s)
|
48
47
|
end
|
48
|
+
s[:notification_arns] = config[:notification_arns] if !config[:notification_arns].nil? && (config[:notification_arns].is_a? Array) && !config[:notification_arns].empty?
|
49
|
+
s[:resource_types] = config[:resource_types] if !config[:resource_types].nil? && (config[:resource_types].is_a? Array) && !config[:resource_types].empty?
|
50
|
+
s[:role_arn] = config[:role_arn] unless config[:role_arn].nil?
|
51
|
+
s[:on_failure] = config[:on_failure] unless config[:on_failure].nil? # accepts DO_NOTHING, ROLLBACK, DELETE
|
52
|
+
s[:stack_policy_body] = config[:stack_policy_body] unless config[:stack_policy_body].nil?
|
53
|
+
s[:stack_policy_url] = config[:stack_policy_url] unless config[:stack_policy_url].nil?
|
54
|
+
s[:tags] = []
|
55
|
+
config[:tags].each do |k, v|
|
56
|
+
s[:tags].push(key: k.to_s, value: v.to_s)
|
57
|
+
end
|
49
58
|
s
|
50
59
|
end
|
51
60
|
end
|
@@ -1,4 +1,3 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
1
|
#
|
3
2
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
3
|
# you may not use this file except in compliance with the License.
|
@@ -31,24 +30,26 @@ module Kitchen
|
|
31
30
|
|
32
31
|
plugin_version Kitchen::Driver::CLOUDFORMATION_VERSION
|
33
32
|
|
34
|
-
default_config :region, ENV['AWS_REGION'] || 'us-east-1'
|
35
33
|
default_config :shared_credentials_profile, nil
|
36
|
-
default_config :aws_access_key_id, nil
|
37
|
-
default_config :aws_secret_access_key, nil
|
38
|
-
default_config :aws_session_token, nil
|
39
34
|
default_config :ssl_cert_file, ENV['SSL_CERT_FILE']
|
40
35
|
default_config :stack_name, nil
|
41
36
|
default_config :template_file, nil
|
42
37
|
default_config :capabilities, nil
|
43
38
|
default_config :parameters, {}
|
44
|
-
default_config :disable_rollback,
|
39
|
+
default_config :disable_rollback, nil
|
45
40
|
default_config :timeout_in_minutes, 0
|
46
41
|
default_config :parameters, {}
|
47
42
|
|
48
43
|
default_config :ssh_key, nil
|
49
44
|
default_config :username, 'root'
|
50
45
|
default_config :hostname, nil
|
51
|
-
|
46
|
+
default_config :notification_arns, []
|
47
|
+
default_config :resource_types, []
|
48
|
+
default_config :role_arn, nil
|
49
|
+
default_config :on_failure, nil # accepts DO_NOTHING, ROLLBACK, DELETE
|
50
|
+
default_config :stack_policy_body, nil
|
51
|
+
default_config :stack_policy_url, nil
|
52
|
+
default_config :tags, {}
|
52
53
|
|
53
54
|
required_config :ssh_key
|
54
55
|
required_config :stack_name
|
@@ -118,11 +119,11 @@ module Kitchen
|
|
118
119
|
|
119
120
|
def cf
|
120
121
|
@cf ||= Aws::CfClient.new(
|
121
|
-
|
122
|
+
'',
|
122
123
|
config[:shared_credentials_profile],
|
123
124
|
config[:ssl_cert_file],
|
124
|
-
{ access_key_id:
|
125
|
-
|
125
|
+
{ access_key_id: nil, secret_access_key: nil },
|
126
|
+
nil
|
126
127
|
)
|
127
128
|
end
|
128
129
|
|
@@ -1,4 +1,3 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
1
|
#
|
3
2
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
3
|
# you may not use this file except in compliance with the License.
|
@@ -15,6 +14,6 @@
|
|
15
14
|
module Kitchen
|
16
15
|
module Driver
|
17
16
|
# Version string for CloudFormation Test Kitchen driver
|
18
|
-
CLOUDFORMATION_VERSION = '1.0
|
17
|
+
CLOUDFORMATION_VERSION = '1.1.0'.freeze
|
19
18
|
end
|
20
19
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kitchen-cloudformation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Neill Turner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-01-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: test-kitchen
|