Skip to content

Commit

Permalink
Merge pull request #153 from ehowe/encrypted-rds-mock
Browse files Browse the repository at this point in the history
encrypted storage on rds
  • Loading branch information
lanej committed Jul 10, 2015
2 parents b932a1c + 60ace7f commit a9d0d37
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
21 changes: 11 additions & 10 deletions lib/fog/aws/models/rds/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -116,27 +116,28 @@ def attributes_to_params
options = {
'AllocatedStorage' => allocated_storage,
'AutoMinorVersionUpgrade' => auto_minor_version_upgrade,
'AvailabilityZone' => availability_zone,
'BackupRetentionPeriod' => backup_retention_period,
'DBInstanceClass' => flavor_id,
'DBInstanceIdentifier' => id,
'DBName' => db_name,
'DBParameterGroupName' => parameter_group_name || attributes['DBParameterGroupName'],
'DBSecurityGroups' => security_group_names,
'DBInstanceIdentifier' => id,
'AvailabilityZone' => availability_zone,
'DBInstanceClass' => flavor_id,
'Port' => port || attributes['Port'],
'DBSubnetGroupName' => db_subnet_group_name,
'Engine' => engine,
'EngineVersion' => engine_version,
'StorageEncrypted' => storage_encrypted,
'Iops' => iops,
'MasterUsername' => master_username,
'LicenseModel' => license_model,
'MasterUserPassword' => password || attributes['MasterUserPassword'],
'PreferredMaintenanceWindow' => preferred_maintenance_window,
'PreferredBackupWindow' => preferred_backup_window,
'MasterUsername' => master_username,
'MultiAZ' => multi_az,
'LicenseModel' => license_model,
'DBSubnetGroupName' => db_subnet_group_name,
'Port' => port || attributes['Port'],
'PreferredBackupWindow' => preferred_backup_window,
'PreferredMaintenanceWindow' => preferred_maintenance_window,
'PubliclyAccessible' => publicly_accessible,
'VpcSecurityGroups' => vpc_security_groups,
'StorageType' => storage_type,
'VpcSecurityGroups' => vpc_security_groups,
}

options.delete_if {|key, value| value.nil?}
Expand Down
2 changes: 1 addition & 1 deletion lib/fog/aws/requests/rds/create_db_instance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def create_db_instance(db_name, options={})
"PreferredMaintenanceWindow" => options["PreferredMaintenanceWindow"] || "mon:04:30-mon:05:00",
"PubliclyAccessible" => !!options["PubliclyAccessible"],
"ReadReplicaDBInstanceIdentifiers" => [],
"StorageEncrypted" => false,
"StorageEncrypted" => options["StorageEncrypted"] || false,
"StorageType" => options["StorageType"] || "standard",
"VpcSecurityGroups" => options["VpcSecurityGroups"],
}
Expand Down
6 changes: 6 additions & 0 deletions tests/models/rds/server_tests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@
model_tests(Fog::AWS[:rds].servers, rds_default_server_params) do
# We'll need this later; create it early to avoid waiting
@instance_with_final_snapshot = Fog::AWS[:rds].servers.create(rds_default_server_params.merge(:id => uniq_id("fog-snapshot-test"), :backup_retention_period => 1))
@instance_with_encrypted_storage = Fog::AWS[:rds].servers.create(rds_default_server_params.merge(:storage_encrypted => true))

@instance.wait_for(20*60) { ready? }
@instance_with_encrypted_storage.wait_for(20*60) { ready? }

tests("#storage_encrypted") do
returns(true) { @instance_with_encrypted_storage.storage_encrypted }
end

test('#read_replica_identifiers is []') do
returns([]) { @instance.read_replica_identifiers }
Expand Down

0 comments on commit a9d0d37

Please sign in to comment.