Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing EBS Raid creation and adding Encryption option to Raid #130

Closed
wants to merge 29 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
356f4ec
Bring our fork up to date with AWS 2.7.0
Apr 10, 2015
5bb87e4
Fixing Raid creation issue with Snapshot_id and adding encryption pas…
Apr 10, 2015
b0c28ca
Updated README.md to include Encryption parameters for ebs_raid
Apr 13, 2015
e7c950c
Merge pull request #162 from miketheman/miketheman/correct_berks_syntax
miketheman Jul 4, 2015
4f9f679
Fixed permissions
Apr 10, 2015
0943615
Fixing Raid creation issue with Snapshot_id and adding encryption pas…
Apr 10, 2015
742fb62
Updated README.md to include Encryption parameters for ebs_raid
Apr 13, 2015
867a94d
Bring our fork up to date with AWS 2.7.0
Apr 10, 2015
35e6ddb
Pulled code from https://github.com/opscode-cookbooks/aws/pull/99
Apr 28, 2015
db20874
Comment cleanup
Apr 28, 2015
f575705
Property format standardization
Apr 28, 2015
48e21e7
Bring our fork up to date with AWS 2.7.0
Apr 10, 2015
1740c23
Fixed permissions
Apr 10, 2015
a9c7335
Fixing Raid creation issue with Snapshot_id and adding encryption pas…
Apr 10, 2015
4b7e4c8
Pulled code from https://github.com/opscode-cookbooks/aws/pull/99
Apr 28, 2015
11aa400
Bumped version to 14.1.0
Apr 28, 2015
a336900
Comment cleanup
Apr 28, 2015
e44412d
Property format standardization
Apr 28, 2015
d36629a
Rebased Fork on Current AWS Book (2.7.2) and reversioned to our 14.2.0
Jul 21, 2015
ed49272
Missing source/issues urls from metadata
Jul 21, 2015
07327df
Rebase to Current AWS Master
Jul 21, 2015
5dfe14a
Rebase to Current AWS Master
Jul 21, 2015
e34171b
Bring our fork up to date with AWS 2.7.0
Apr 10, 2015
5e8626e
Rebased Fork on Current AWS Book (2.7.2) and reversioned to our 14.2.0
Jul 21, 2015
a4b631c
Merge branch 'EbsRaid' of github.com:needle-cookbooks/chef-opscode-aw…
Jul 21, 2015
d867c28
Bring our fork up to date with AWS 2.7.0
Apr 10, 2015
995625c
# This is a combination of 4 commits.
Jul 21, 2015
9953a01
merge
Jul 21, 2015
9f05020
Merge branch 'EbsRaid' of github.com:needle-cookbooks/chef-opscode-aw…
Jul 21, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,10 @@ Attribute Parameters:
* `disk_type` - "standard" or "io1" (io1 is the type for IOPS volume)
* `disk_piops` - number of Provisioned IOPS to provision per disk,
must be > 100
* `disk_encrypted` - specify if the EBS volumes should be encrypted
* `disk_kms_key_id` - the full ARN of the AWS Key Management Service
(AWS KMS) master key to use when creating the encrypted volumes
(defaults to master key if not specified)

## elastic_ip.rb

Expand Down
8 changes: 6 additions & 2 deletions providers/ebs_raid.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@
@new_resource.snapshots,
@new_resource.disk_type,
@new_resource.disk_piops,
@new_resource.existing_raid)
@new_resource.existing_raid,
@new_resource.disk_encrypted,
@new_resource.disk_kms_key_id)

@new_resource.updated_by_last_action(true)
end
Expand Down Expand Up @@ -317,7 +319,7 @@ def attach_volume(disk_dev, volume_id)
# If it's not nil, must have exactly <num_disks> elements

def create_raid_disks(mount_point, mount_point_owner, mount_point_group, mount_point_mode, num_disks, disk_size,
level, filesystem, filesystem_options, snapshots, disk_type, disk_piops, existing_raid)
level, filesystem, filesystem_options, snapshots, disk_type, disk_piops, existing_raid, disk_encrypted, disk_kms_key_id)

creating_from_snapshot = !(snapshots.nil? || snapshots.size == 0)

Expand Down Expand Up @@ -347,6 +349,8 @@ def create_raid_disks(mount_point, mount_point_owner, mount_point_group, mount_p
action [:create, :attach]
snapshot_id creating_from_snapshot ? snapshots[i - 1] : nil
provider 'aws_ebs_volume'
encrypted disk_encrypted
kms_key_id disk_kms_key_id

# set up our data bag info
devices[disk_dev_path] = 'pending'
Expand Down
6 changes: 5 additions & 1 deletion resources/ebs_raid.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
:mount_point_group,
:mount_point_mode,
:mount_point_owner,
:snapshots
:snapshots,
:disk_encrypted,
:disk_kms_key_id

attribute :aws_access_key, kind_of: String
attribute :aws_secret_access_key, kind_of: String
Expand All @@ -32,3 +34,5 @@
attribute :disk_type, kind_of: String, default: 'standard'
attribute :disk_piops, kind_of: Integer, default: 0
attribute :existing_raid, kind_of: [TrueClass, FalseClass]
attribute :disk_encrypted, kind_of: [TrueClass, FalseClass], default: false
attribute :disk_kms_key_id, kind_of: String
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the :disk_kms_key_id be marked as a required parameter?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope @juliandunn aws-sdk will default to one:

Default master key that protects my EBS volumes when no other key is defined

This master key is used by default if you don't define a master key when you create an encrypted resource in this service. Settings on this key cannot be modified to ensure the availability, durability and security of this key.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What he said.

I tested it with the default key (read: no attribute provided) and it worked fine using the master key.