blib/lib/VM/EC2/REST/relational_database_service.pm untested

filter: Statementstmt 0.0% 0 / 339 Branchbran 0.0% 0 / 14 Conditioncond 0.0% 0 / 229 MC/DCmcdc n/a Subroutinesub 0.0% 0 / 47 Podpod 0.0% 0 / 45 totaltotal 0.0% 0 / 674 CC 7 SCAR 22.1
CC
7
Cov
0%
modify_option_group
56.0
rds_call
2.0
add_source_identifier_to_subscription
2.0
CRAP 9.1
1 package VM::EC2::REST::relational_database_service;
2  
3 use strict;
4 use VM::EC2 ''; # important not to import anything!
5 package VM::EC2; # add methods to VM::EC2
6  
7 VM::EC2::Dispatch->register(
8 AddSourceIdentifierToSubscription => 'fetch_one_result,EventSubscription,VM::EC2::DB::Event::Subscription',
9 AuthorizeDBSecurityGroupIngress => 'fetch_one_result,DBSecurityGroup,VM::EC2::DB::SecurityGroup',
10 CopyDBSnapshot => 'fetch_one_result,DBSnapshot,VM::EC2::DB::Snapshot',
11 CreateDBInstance => 'fetch_one_result,DBInstance,VM::EC2::DB::Instance',
12 CreateDBInstanceReadReplica => 'fetch_one_result,DBInstance,VM::EC2::DB::Instance',
13 CreateDBParameterGroup => 'fetch_one_result,DBParameterGroup,VM::EC2::DB::Parameter::Group',
14 CreateDBSecurityGroup => 'fetch_one_result,DBSecurityGroup,VM::EC2::DB::SecurityGroup',
15 CreateDBSnapshot => 'fetch_one_result,DBSnapshot,VM::EC2::DB::Snapshot',
16 CreateDBSubnetGroup => 'fetch_one_result,DBSubnetGroup,VM::EC2::DB::Subnet::Group',
17 CreateEventSubscription => 'fetch_one_result,EventSubscription,VM::EC2::DB::Event::Subscription',
18 CreateOptionGroup => 'fetch_one_result,OptionGroup,VM::EC2::DB::Option::Group',
19 DescribeDBEngineVersions => 'fetch_rds_objects,DBEngineVersion,VM::EC2::DB::Engine::Version',
20 DescribeDBInstances => 'fetch_rds_objects,DBInstance,VM::EC2::DB::Instance',
21 DescribeDBParameterGroups => 'fetch_rds_objects,DBParameterGroup,VM::EC2::DB::Parameter::Group',
22 DescribeDBParameters => 'fetch_rds_objects,Parameter,VM::EC2::DB::Parameter',
23 DescribeDBSecurityGroups => 'fetch_rds_objects,DBSecurityGroup,VM::EC2::DB::SecurityGroup',
24 DescribeDBSnapshots => 'fetch_rds_objects,DBSnapshot,VM::EC2::DB::Snapshot',
25 DescribeDBSubnetGroups => 'fetch_rds_objects,DBSubnetGroup,VM::EC2::DB::Subnet::Group',
26 DescribeEngineDefaultParameters => 'fetch_one_result,EngineDefaults,VM::EC2::DB::Engine::Defaults',
27 DescribeEventCategories => 'fetch_rds_objects,EventCategoriesMap,VM::EC2::DB::Event::Category',
28 DescribeEventSubscriptions => 'fetch_rds_objects,EventSubscription,VM::EC2::DB::Event::Subscription',
29 DescribeEvents => 'fetch_rds_objects,Event,VM::EC2::DB::Event',
30 DescribeOptionGroupOptions => 'fetch_rds_objects,OptionGroupOption,VM::EC2::DB::Option::Group::Option',
31 DescribeOptionGroups => 'fetch_rds_objects,OptionGroup,VM::EC2::DB::Option::Group',
32 DescribeOrderableDBInstanceOptions=> 'fetch_rds_objects,OrderableDBInstanceOption,VM::EC2::DB::Instance::OrderableOption',
33 DescribeReservedDBInstances => 'fetch_rds_objects,ReservedDBInstance,VM::EC2::DB::Reserved::Instance',
34 DescribeReservedDBInstancesOfferings
35 => 'fetch_rds_objects,ReservedDBInstancesOffering,VM::EC2::DB::Reserved::Instance::Offering',
36 DownloadDBLogFilePortion => 'fetch_one_result,DBLogFilePortion,VM::EC2::DB::LogFilePortion',
37 ListTagsForResource => sub {
38 my @tag_list = shift->{ListTagsForResourceResult}{TagList}{Tag};
39 my %tags;
40 foreach (@tag_list) {
41 $tags{$_->{Key}} = $_->{Value}
42 }
43 return wantarray ? %tags : \%tags;
44 },
45 ModifyDBInstance => 'fetch_one_result,DBInstance,VM::EC2::DB::Instance',
46 ModifyDBParameterGroup => sub { return shift->{ModifyDBParameterGroupResult}{DBParameterGroupName} },
47 ModifyDBSubnetGroup => 'fetch_one_result,DBSubnetGroup,VM::EC2::DB::Subnet::Group',
48 ModifyEventSubscription => 'fetch_one_result,EventSubscription,VM::EC2::DB::Event::Subscription',
49 ModifyOptionGroup => 'fetch_one_result,OptionGroup,VM::EC2::DB::Option::Group',
50 PromoteReadReplica => 'fetch_one_result,DBInstance,VM::EC2::DB::Instance',
51 PurchaseReservedDBInstancesOffering
52 => 'fetch_one_result,ReservedDBInstance,VM::EC2::DB::Reserved::Instance',
53 RebootDBInstance => 'fetch_one_result,DBInstance,VM::EC2::DB::Instance',
54 RemoveSourceIdentifierFromSubscription
55 => 'fetch_one_result,EventSubscription,VM::EC2::DB::Event::Subscription',
56 ResetDBParameterGroup => sub { return shift->{ResetDBParameterGroupResult}{DBParameterGroupName} },
57 RestoreDBInstanceFromDBSnapshot => 'fetch_one_result,DBInstance,VM::EC2::DB::Instance',
58 RestoreDBInstanceToPointInTime => 'fetch_one_result,DBInstance,VM::EC2::DB::Instance',
59 RevokeDBSecurityGroupIngress => 'fetch_one_result,DBSecurityGroup,VM::EC2::DB::SecurityGroup',
60 );
61  
62 sub rds_call {
63 my $self = shift;
64 (my $endpoint = $self->{endpoint}) =~ s/ec2/rds/;
65 local $self->{endpoint} = $endpoint;
66 local $self->{version} = '2013-09-09';
67 $self->call(@_);
68 }
69  
70 my $VEP = 'VM::EC2::ParmParser';
71  
72 =head1 NAME VM::EC2::REST::relational_database_service
73  
74 =head1 SYNOPSIS
75  
76 use VM::EC2 ':rds';
77  
78 =head1 METHODS
79  
80 These methods give access and control over the AWS Relational Database Service.
81 RDS provides easy access to creating and managing an Oracle or MySQL database
82 in the AWS cloud.
83  
84 Implemented:
85 AddSourceIdentifierToSubscription
86 AddTagsToResource
87 AuthorizeDBSecurityGroupIngress
88 CopyDBSnapshot
89 CreateDBInstance
90 CreateDBInstanceReadReplica
91 CreateDBParameterGroup
92 CreateDBSecurityGroup
93 CreateDBSnapshot
94 CreateDBSubnetGroup
95 CreateEventSubscription
96 CreateOptionGroup
97 DescribeDBEngineVersions
98 DescribeDBInstances
99 DescribeDBParameterGroups
100 DescribeDBParameters
101 DescribeDBSecurityGroups
102 DescribeDBSnapshots
103 DescribeDBSubnetGroups
104 DescribeEngineDefaultParameters
105 DescribeEventCategories
106 DescribeEventSubscriptions
107 DescribeEvents
108 DescribeOptionGroupOptions
109 DescribeOptionGroups
110 DescribeOrderableDBInstanceOptions
111 DescribeReservedDBInstances
112 DescribeReservedDBInstancesOfferings
113 DownloadDBLogFilePortion
114 ListTagsForResource
115 ModifyDBInstance
116 ModifyDBParameterGroup
117 ModifyDBSubnetGroup
118 ModifyEventSubscription
119 ModifyOptionGroup
120 PromoteReadReplica
121 PurchaseReservedDBInstancesOffering
122 RebootDBInstance
123 RemoveSourceIdentifierFromSubscription
124 RemoveTagsFromResource
125 ResetDBParameterGroup
126 RestoreDBInstanceFromDBSnapshot
127 RestoreDBInstanceToPointInTime
128 RevokeDBSecurityGroupIngress
129  
130 Unimplemented:
131 (none)
132  
133 =head1 SEE ALSO
134  
135 L<VM::EC2>
136  
137 =cut
138  
139 =head2 $ec2->add_source_identifier_to_subscription(%args)
140  
141 Adds a source identifier to an existing RDS event notification subscription.
142  
143 Required arguments:
144  
145 -source_identifier The identifier of the event source to be added.
146  
147 -subscription_name The name of the RDS event notification subscription you want
148 to add a source identifier to.
149  
150 Returns a L<VM::EC2::DB::Event::Subscription> object.
151  
152 =cut
153  
154 sub add_source_identifier_to_subscription {
155 my $self = shift;
156 my %args = @_;
157 $args{-source_identifier} && $args{-subscription_name} or
158 croak "add_source_identifier_to_subscription(): -source_identifier and -subscription_name arguments required";
159 my @params = $VEP->format_parms(\%args,
160 {
161 single_parm => [qw(SourceIdentifier SubscriptionName)],
162 });
163 return $self->rds_call('AddSourceIdentifierToSubscription',@params);
164 }
165  
166 =head2 $ec2->add_tags_to_resource(-resource_name => $name, -tags => \@tags)
167  
168 Adds metadata tags to an Amazon RDS resource. These tags can also be used with cost allocation
169 reporting to track costs associated with Amazon RDS resources, or used in a Condition statement in
170 an IAM policy for Amazon RDS.
171  
172 Required arguments:
173  
174 -resource_name The Amazon RDS resource the tags will be removed from. This value is an Amazon
175 Resource Name (ARN). For information about creating an ARN, see Constructing
176 an RDS Amazon Resource Name (ARN) at:
177 http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html#USER_Tagging.ARN
178  
179 -tags hashref or arrayref of hashrefs containing tag Key/Value pairs
180  
181 This method does not return a value but will raise an error if unsuccessful.
182  
183 =cut
184  
185 sub add_tags_to_resource {
186 my $self = shift;
187 my %args = @_;
188 $args{-tags} && $args{-resource_name} or
189 croak "add_tags_to_resource(): -tags and -resource_name arguments required";
190 my @params = $VEP->format_parms(\%args,
191 {
192 single_parm => 'ResourceName',
193 member_list_parm => 'Tags',
194 });
195 return $self->rds_call('AddTagsToResource',@params);
196 }
197  
198 =head2 $sg = $ec2->authorize_db_security_group_ingress(%args)
199  
200 Enables ingress to a DBSecurityGroup using one of two forms of authorization. First, EC2 or VPC
201 security groups can be added to the DBSecurityGroup if the application using the database is running
202 on EC2 or VPC instances. Second, IP ranges are available if the application accessing your database
203 is running on the Internet.
204  
205 Required arguments:
206  
207 -db_security_group_name The name of the DB Security Group to add authorization to.
208  
209 Optional arguments:
210  
211 -cidrip The IP range to authorize.
212  
213 -ec2_security_group_id ID of the EC2 Security Group to authorize. For VPC DB
214 security groups, EC2SecurityGroupId must be provided.
215  
216 -ec2_security_group_name Name of the EC2 Security Group to authorize.
217  
218 -ec2_security_group_owner_id AWS Account Number of the owner of the EC2 Security Group
219 specified in the -ec2_security_group_name parameter.
220  
221 Returns a L<VM::EC2::DB::SecurityGroup> object.
222  
223 =cut
224  
225 sub authorize_db_security_group_ingress {
226 my $self = shift;
227 my %args = @_;
228 $args{-db_security_group_name} &&
229 ($args{-cidrip} || $args{-ec2_security_group_id} || $args{-ec2_security_group_name}) or
230 croak "authorize_db_security_group_ingress(): -db_security_group_name and one of -cidrip, -ec2_security_group_id, -ec2_security_group_name arguments required";
231 ($args{-ec2_security_group_id} || $args{-ec2_security_group_name}) && $args{-ec2_security_group_owner_id} or
232 croak "authorize_db_security_group_ingress(): -ec2_security_group_owner_id required when -ec2_security_group_id or -ec2_security_group_name arguments specified";
233 my @params = $VEP->format_parms(\%args,
234 {
235 single_parm => [qw(CIDRIP DBSecurityGroupName
236 EC2SecurityGroupId EC2SecurityGroupName
237 EC2SecurityGroupOwnerId)],
238 });
239 return $self->rds_call('AuthorizeDBSecurityGroupIngress',@params);
240 }
241  
242 =head2 $snapshot = $ec2->copy_db_snapshot(-source_db_snapshot_identifier => $db_id, -target_db_snapshot_identifier => $snap_id)
243  
244 Copies the specified DBSnapshot. The source DBSnapshot must be in the "available" state.
245  
246 Required arguments:
247  
248 -source_db_snapshot_identifier The identifier for the source DB snapshot.
249 Constraints:
250 * Must specify a valid system snapshot in
251 the "available" state
252 * If the source snapshot is in the same
253 region as the copy, specify a valid DB
254 snapshot identifier
255 * If the source snapshot is in a different
256 region than the copy, specify a valid DB
257 snapshot ARN
258 For more information, see:
259 http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_CopySnapshot.html
260  
261 -target_db_snapshot_identifier The identifier for the copied snapshot.
262 Constraints:
263 * Cannot be null, empty, or blank
264 * Must contain from 1 to 255 alphanumeric
265 characters or hyphens
266 * First character must be a letter
267 * Cannot end with a hyphen or contain two
268 consecutive hyphens
269  
270 -source Alias for -source_db_snapshot_identifier
271  
272 -target Alias for -target_db_snapshot_identifier
273  
274 Optional arguments:
275  
276 -tags hashref or arrayref of hashrefs containing Key/Value pairs
277  
278 Returns a L<VM::EC2::DB::Snapshot> object.
279  
280 =cut
281  
282 sub copy_db_snapshot {
283 my $self = shift;
284 my %args = @_;
285 $args{-source_db_snapshot_identifier} ||= $args{-source};
286 $args{-target_db_snapshot_identifier} ||= $args{-target};
287 $args{-source_db_snapshot_identifier} && $args{-target_db_snapshot_identifier} or
288 croak "authorize_db_security_group_ingress(): -db_security_group_name and one of -cidrip, -ec2_security_group_id, -ec2_security_group_name arguments required";
289 my @params = $VEP->format_parms(\%args,
290 {
291 single_parm => [qw(SourceDBSnapshotIdentifier
292 TargetDBSnapshotIdentifier)],
293 member_list_parm => 'Tags',
294 });
295 return $self->rds_call('CopyDBSnapshot',@params);
296 }
297  
298 =head2 $instance = $ec2->create_db_instance(%args)
299  
300 Creates a new DB instance.
301  
302 Required arguments:
303  
304 -allocated_storage MySQL:
305 * Must be an integer from 5 to 1024.
306 Oracle:
307 * Must be an integer from 10 to 1024.
308 SQL Server:
309 * Must be an integer from 200 to 1024
310 (Standard Edition and Enterprise Edition)
311 or from 30 to 1024 (Express Edition and
312 Web Edition)
313  
314 -db_instance_class The compute and memory capacity of the DB Instance.
315 db.t1.micro | db.m1.small | db.m1.medium | db.m1.large |
316 db.m1.xlarge | db.m2.xlarge |db.m2.2xlarge | db.m2.4xlarge
317  
318 -db_instance_identifier The DB Instance identifier. This parameter is stored as a
319 lowercase string.
320 Constraints:
321 * Must contain from 1 to 63 alphanumeric characters or
322 hyphens (1 to 15 for SQL Server).
323 * First character must be a letter.
324 * Cannot end with a hyphen or contain two consecutive
325 hyphens.
326  
327 -engine The name of the database engine to be used for this
328 instance.
329 Valid values: MySQL | oracle-se1 | oracle-se | oracle-ee |
330 sqlserver-ee | sqlserver-se | sqlserver-ex | sqlserver-web
331  
332 -master_user_password The password for the master database user. Can be any
333 printable ASCII character except "/", "\", or "@".
334 Constraints:
335 * MySQL: Must contain from 8 to 41 alphanumeric characters.
336 * Oracle: Must contain from 8 to 30 alphanumeric characters.
337 * SQL Server: Must contain from 8 to 128 alphanumeric
338 characters.
339  
340 -master_username The name of master user for the client DB Instance.
341  
342 Constraints:
343 * First character must be a letter.
344 * Cannot be a reserved word for the chosen database engine.
345 MySQL:
346 * Must be 1 to 16 alphanumeric characters.
347 Oracle:
348 * Must be 1 to 30 alphanumeric characters.
349 SQL Server:
350 * Must be 1 to 128 alphanumeric characters.
351  
352 Optional arguments:
353  
354 -auto_minor_version_upgrade Indicates that minor engine upgrades will be applied
355 automatically to the DB Instance during the maintenance
356 window. (Boolean). Default: true
357  
358 -availability_zone The EC2 Availability Zone that the database instance will
359 be created in.
360 Default: A random, system-chosen Availability Zone in the
361 endpoint's region.
362  
363 -backup_retention_period The number of days for which automated backups are retained.
364 Setting this parameter to a positive number enables backups.
365 Setting this parameter to 0 disables automated backups.
366 Default: 1
367 Constraints:
368 * Must be a value from 0 to 8
369 * Cannot be set to 0 if the DB Instance is a master instance
370 with read replicas
371  
372 -character_set_name For supported engines, indicates that the DB Instance should
373 be associated with the specified CharacterSet.
374  
375 -db_name The meaning of this parameter differs according to the
376 database engine you use.
377  
378 MySQL:
379 The name of the database to create when the DB Instance
380 is created. If this parameter is not specified, no database
381 is created in the DB Instance.
382  
383 Constraints:
384 * Must contain 1 to 64 alphanumeric characters
385 * Cannot be a reserved word
386  
387 Oracle:
388 The Oracle System ID (SID) of the created DB Instance.
389  
390 Constraints:
391 * Cannot be longer than 8 characters
392  
393 SQL Server:
394 Not applicable. Must be null.
395  
396 -db_parameter_group_name The name of the DB Parameter Group to associate with this
397 DB instance. If this argument is omitted, the default
398 DBParameterGroup for the specified engine will be used.
399  
400 Constraints:
401 * Must be 1 to 255 alphanumeric characters
402 * First character must be a letter.
403 * Cannot end with a hyphen or contain two consecutive
404 hyphens
405  
406 -db_security_groups An arrayref of DB Security Groups to associate with the
407 instance
408  
409 -db_subnet_group_name A DB Subnet Group to associate with this DB Instance.
410 If not specified, then it is a non-VPC DB instance.
411  
412 -engine_version The version number of the database engine to use.
413  
414 -iops The amount of Provisioned IOPS initially allocated.
415 Integer between 100-1000
416  
417 -license_model License model information for this DB Instance.
418 Valid values: license-included |
419 bring-your-own-license |
420 general-public-license
421  
422 -multi_az Specifies if the DB Instance is a Multi-AZ deployment.
423 You cannot set the -availability_zone argument if the
424 -multi_az argument is set to true.
425  
426 -option_group_name Indicates that the DB Instance should be associated
427 with the specified option group.
428  
429 -port The port number on which the database accepts
430 connections.
431  
432 MySQL:
433 * Default: 3306, Valid values: 1150-65535
434 Oracle:
435 * Default: 1521, Valid values: 1150-65535
436 Oracle:
437 * Default: 1433, Valid values: 1150-65535 except
438 1434 and 3389.
439  
440 -preferred_backup_window The daily time range during which automated backups are
441 created if automated backups are enabled using the
442 -backup_retention_period argument.
443  
444 Default: Default: A 30-minute window selected at random
445 from an 8-hour block of time per region. The following
446 list shows the time blocks for each region from which
447 the default backup windows are assigned.
448  
449 * US-East (Northern Virginia) Region: 03:00-11:00 UTC
450 * US-West (N. California, Oregon) Region: 06:00-14:00 UTC
451 * EU (Ireland) Region: 22:00-06:00 UTC
452 * Asia Pacific (Singapore) Region: 14:00-22:00 UTC
453 * Asia Pacific (Tokyo) Region: 17:00-03:00 UTC
454  
455 Constraints:
456 * Must be in the format hh24:mi-hh24:mi
457 * Times in Universal Time Coordinated (UTC).
458 * Must not conflict with the preferred maintenance window.
459 * Must be at least 30 minutes.
460  
461 -preferred_maintenance_window The weekly time range (in UTC) during which system
462 maintenance can occur.
463  
464 Format: ddd:hh24:mi-ddd:hh24:mi
465  
466 Default: A 30-minute window selected at random from an 8-hour
467 block of time per region, occurring on a random day of the
468 week. The following list shows the time blocks for each
469 region from which the default maintenance windows are
470 assigned.
471  
472 * US-East (Northern Virginia) Region: 03:00-11:00 UTC
473 * US-West (N. California, Oregon) Region: 06:00-14:00 UTC
474 * EU (Ireland) Region: 22:00-06:00 UTC
475 * Asia Pacific (Singapore) Region: 14:00-22:00 UTC
476 * Asia Pacific (Tokyo) Region: 17:00-03:00 UTC
477  
478 Valid Days: Mon, Tue, Wed, Thu, Fri, Sat, Sun
479 Constraints: Minimum 30-minute window.
480  
481 -publicly_accessible Specifies the accessibility options for the DB instance. A
482 value of true specifies an Internet-facing instance with a
483 publicly resolvable DNS name, which resolves to a public IP
484 address. A value of false specifies an internal instance with
485 a DNS name that resolves to a private IP address.
486  
487 Default: The default behavior varies depending on whether a
488 VPC has been requested or not. The following list shows the
489 default behavior in each case.
490 * DefaultVPC:true
491 * VPC:false
492  
493 If no DB subnet group has been specified as part of the
494 request and the -publicly_accessible value has not been set,
495 the DB instance will be publicly accessible. If a specific DB
496 subnet group has been specified as part of the request and
497 the PubliclyAccessible value has not been set, the DB
498 instance will be private.
499  
500 -tags hashref or arrayref of hashrefs containing Key/Value pairs
501  
502 -vpc_security_group_ids A list of EC2 VPC Security Groups to associate with this
503 DB Instance.
504  
505 This method returns a L<VM::EC2::DB:Instance> object.
506  
507 =cut
508  
509  
510 sub create_db_instance {
511 my $self = shift;
512 my %args = @_;
513 my @params;
514 $args{-allocated_storage} or
515 croak "create_db_instance(): -allocated_storage required argument missing";
516 $args{-db_instance_class} or
517 croak "create_db_instance(): -db_instance_class required argument missing";
518 $args{-db_instance_identifier} or
519 croak "create_db_instance(): -db_instance_identifier required argument missing";
520 $args{-engine} or
521 croak "create_db_instance(): -engine required argument missing";
522 $args{-master_user_password} or
523 croak "create_db_instance(): -master_user_password required argument missing";
524 $args{-master_username} or
525 croak "create_db_instance(): -master_username required argument missing";
526 my @params = $VEP->format_parms(\%args,
527 {
528 boolean_parm => [qw(AutoMinorVersionUpgrade MultiAZ
529 PubliclyAccessible)],
530 single_parm => [qw(AllocatedStorage AvailabilityZone
531 BackupRetentionPeriod
532 CharacterSetName DBInstanceClass
533 DBInstanceIdentifier DBName
534 DBParameterGroupName
535 DBSubnetGroupName Engine
536 EngineVersion Iops LicenseModel
537 MasterUserPassword MasterUsername
538 OptionGroupName Port
539 PreferredBackupWindow
540 PreferredMaintenanceWindow)],
541 member_list_parm => [qw(VpcSecurityGroupIds DBSecurityGroups
542 Tags)],
543 });
544 return $self->rds_call('CreateDBInstance',@params);
545 }
546  
547 =head2 $instance = $ec2->create_db_instance_read_replica(%args)
548  
549 Creates a DB Instance that acts as a Read Replica of a source DB Instance. All Read Replica DB
550 Instances are created as Single-AZ deployments with backups disabled. All other DB Instance
551 attributes (including DB Security Groups and DB Parameter Groups) are inherited from the source DB
552 Instance, except as specified below.
553 IMPORTANT: The source DB Instance must have backup retention enabled.
554  
555 Required arguments:
556  
557 -db_instance_identifier The DB Instance identifier of the Read Replica. This is the
558 unique key that identifies a DB Instance. This parameter is
559 stored as a lowercase string.
560  
561 -source_db_instance_identifier The identifier of the DB Instance that will act as the source
562 for the Read Replica. Each DB Instance can have up to five
563 Read Replicas. Constraints: Must be the identifier of an
564 existing DB Instance that is not already a Read Replica DB
565 Instance.
566  
567 Optional arguments:
568  
569 -auto_minor_version_upgrade Indicates that minor engine upgrades will be applied
570 automatically to the Read Replica during the maintenance
571 window. (Boolean)
572  
573 -availability_zone The Amazon EC2 Availability Zone that the Read Replica will
574 be created in. Default: A random, system-chosen
575 Availability Zone in the endpoint's region.
576  
577 -db_instance_class The compute and memory capacity of the Read
578 Replica.
579 Valid Values: db.m1.small | db.m1.medium |
580 db.m1.large | db.m1.xlarge | db.m2.xlarge |
581 db.m2.2xlarge | db.m2.4xlarge
582  
583 -iops The amount of Provisioned IOPS to be initially allocated for
584 the DB Instance.
585  
586 -option_group_name The option group the DB instance will be associated with. If
587 omitted, the default Option Group for the engine specified
588 will be used.
589  
590 -port The port number that the DB Instance uses for connections.
591 Default: Inherits from the source instance
592 Valid Values: 1150-65535
593  
594 -publicly_accessible Specifies the accessibility options for the DB instance. A
595 value of true specifies an Internet-facing instance with a
596 publicly resolvable DNS name, which resolves to a public IP
597 address. A value of false specifies an internal instance with
598 a DNS name that resolves to a private IP address.
599  
600 Default: The default behavior varies depending on whether a
601 VPC has been requested or not. The following list shows the
602 default behavior in each case.
603 * DefaultVPC:true
604 * VPC:false
605  
606 If no DB subnet group has been specified as part of the
607 request and the -publicly_accessible value has not been set,
608 the DB instance will be publicly accessible. If a specific DB
609 subnet group has been specified as part of the request and
610 the PubliclyAccessible value has not been set, the DB
611 instance will be private.
612  
613  
614 Returns a L<VM::EC2::DB::Instance> object on success.
615  
616 =cut
617  
618 sub create_db_instance_read_replica {
619 my $self = shift;
620 my %args = @_;
621 my @params;
622 $args{-db_instance_identifier} or
623 croak "create_db_instance_read_replica(): -db_instance_identifier required argument missing";
624 $args{-source_db_instance_identifier} or
625 croak "create_db_instance_read_replica(): -source_db_instance_identifier required argument missing";
626 my @params = $VEP->format_parms(\%args,
627 {
628 boolean_parm => [qw(AutoMinorVersionUpgrade MultiAZ
629 PubliclyAccessible)],
630 single_parm => [qw(AvailabilityZone DBInstanceClass
631 DBInstanceIdentifier Iops
632 OptionGroupName Port
633 SourceDBInstanceIdentifier)],
634 member_list_parm => [qw(VpcSecurityGroupIds DBSecurityGroups
635 Tags)],
636 });
637 return $self->rds_call('CreateDBInstanceReadReplica',@params);
638 }
639  
640 =head2 $group = $ec2->create_db_parameter_group(%args)
641  
642 Creates a new DB Parameter Group.
643  
644 A DB Parameter Group is initially created with the default parameters for the database engine used
645 by the DB Instance. To provide custom values for any of the parameters, you must modify the group
646 after creating it using modify_db_parameter_group(). Once you've created a DB Parameter Group, you
647 need to associate it with your DB Instance using modify_db_instance(). When you associate a new DB
648 Parameter Group with a running DB Instance, you need to reboot the DB Instance for the new DB
649 Parameter Group and associated settings to take effect.
650  
651 Required arguments:
652  
653 -db_parameter_group_family The DB Parameter Group Family name. A DB Parameter Group can
654 be associated with one and only one DB Parameter Group
655 Family, and can be applied only to a DB Instance running a
656 database engine and engine version compatible with that DB
657 Parameter Group Family.
658  
659 -db_parameter_group_name The name of the DB Parameter Group.
660 Constraints:
661 * Must be 1 to 255 alphanumeric characters
662 * First character must be a letter
663 * Cannot end with a hyphen or contain two consecutive hyphens
664 NOTE: This value is stored as a lower-case string.
665  
666 -description The description for the DB Parameter Group.
667  
668 Returns a L<VM::EC2::DB::Parameter::Group> object.
669  
670 =cut
671  
672 sub create_db_parameter_group {
673 my $self = shift;
674 my %args = @_;
675 my @params;
676 $args{-db_parameter_group_family} or
677 croak "create_db_parameter_group(): -db_parameter_group_family required argument missing";
678 $args{-db_parameter_group_name} or
679 croak "create_db_parameter_group(): -db_parameter_group_name required argument missing";
680 $args{-description} or
681 croak "create_db_parameter_group(): -description required argument missing";
682 my @params = $VEP->format_parms(\%args,
683 {
684 single_parm => [qw(DBParameterGroupFamily
685 DBParameterGroupName Description)],
686 });
687 return $self->rds_call('CreateDBParameterGroup',@params);
688 }
689  
690 =head2 $group = $ec2->create_db_security_group(%args)
691  
692 Creates a new DB Security Group. DB Security Groups control access to a DB Instance if not in a VPC.
693  
694 Required arguments:
695  
696 -db_security_group_description The description for the DB Security Group.
697  
698 -db_security_group_name The name for the DB Security Group. This value is stored as a
699 lowercase string.
700 Constraints: Must contain no more than 255
701 alphanumeric characters or hyphens.
702 Must not be "Default".
703  
704 -name Alias for -db_security_group_name
705  
706 -description Alias for -db_security_group_description
707  
708 Returns a L<VM::EC2::DB::SecurityGroup> object.
709  
710 =cut
711  
712 sub create_db_security_group {
713 my $self = shift;
714 my %args = @_;
715 $args{-db_security_group_name} ||= $args{-name} or
716 croak "create_db_security_group(): -db_security_group_name required argument missing";
717 $args{-db_security_group_description} ||= $args{-description} or
718 croak "create_db_security_group(): -db_security_group_description required argument missing";
719 my @params = $VEP->format_parms(\%args,
720 {
721 single_parm => [qw(DBSecurityGroupDescription
722 DBSecurityGroupName)],
723 });
724 return $self->rds_call('CreateDBSecurityGroup',@params);
725 }
726  
727 =head2 $dbsnap = $ec2->create_db_snapshot(-db_instance_identifier => $db_id, -db_snapshot_identifier => $snap_id)
728  
729 Creates a DB snapshot. The source DB instance must be in "available" state.
730  
731 Required arguments:
732  
733 -db_instance_identifier The DB instance identifier. This is the unique key that
734 identifies a DB instance. This parameter is not case
735 sensitive.
736  
737 Constraints:
738 * Must contain from 1 to 63 alphanumeric
739 characters or hyphens
740 * First character must be a letter
741 * Cannot end with a hyphen or contain two
742 consecutive hyphens
743  
744 -db_snapshot_identifier The identifier for the DB snapshot.
745  
746 Constraints:
747 * Cannot be null, empty, or blank
748 * Must contain from 1 to 255 alphanumeric
749 characters or hyphens
750 * First character must be a letter
751 * Cannot end with a hyphen or contain two
752 consecutive hyphens
753  
754 -db_id Alias for -db_instance_identifier
755  
756 -snapshot_id Alias for -db_snapshot_identifier
757  
758 Returns a L<VM::EC2::DB::Snapshot> object on success.
759  
760 =cut
761  
762 sub create_db_snapshot {
763 my $self = shift;
764 my %args = @_;
765 $args{-db_instance_identifier} ||= $args{-db_id} or
766 croak "create_db_snapshot(): -db_instance_identifier required argument missing";
767 $args{-db_snapshot_identifier} ||= $args{-snapshot_id} or
768 croak "create_db_snapshot(): -db_snapshot_identifier required argument missing";
769 my @params = $VEP->format_parms(\%args,
770 {
771 single_parm => [qw(DBInstanceIdentifier
772 DBSnapshotIdentifier)],
773 });
774 return $self->rds_call('CreateDBSnapshot',@params);
775 }
776  
777 =head2 $subnet_group = $ec2->create_db_subnet_group(%args)
778  
779 Creates a new DB subnet group. DB subnet groups must contain at least one subnet in at least two
780 availability zones in the region.
781  
782 Required arguments:
783  
784 -db_subnet_group_description The description for the DB subnet group.
785  
786 -db_subnet_group_name The name for the DB Subnet Group. This value is stored as a
787 lowercase string.
788  
789 Constraints:
790 * Must contain no more than 255 alphanumeric
791 characters or hyphens.
792 * Must not be "Default".
793  
794 -subnet_ids Arrayref of subnet IDs for the subnet group.
795  
796 -description Alias for -db_subnet_group_description
797  
798 -name Alias -db_subnet_group_name
799  
800 Returns a L<VM::EC2::DB::Subnet::Group> object on success.
801  
802 =cut
803  
804 sub create_db_subnet_group {
805 my $self = shift;
806 my %args = @_;
807 my @params;
808 $args{-db_subnet_group_name} ||= $args{-name} or
809 croak "create_db_subnet_group(): -db_subnet_group_name required argument missing";
810 $args{-db_subnet_group_description} ||= $args{-description} or
811 croak "create_db_subnet_group(): -db_subnet_group_description required argument missing";
812 $args{-subnet_ids} or croak "create_db_subnet_group(): -subnet_ids required argument missing";
813 my @params = $VEP->format_parms(\%args,
814 {
815 single_parm => [qw(DBInstanceIdentifier
816 DBSnapshotIdentifier)],
817 member_list_parm => 'SubnetIds',
818 });
819 return $self->rds_call('CreateDBSubnetGroup',@params);
820 }
821  
822 =head2 $event_sub = $ec2->create_event_subscription(%args)
823  
824 Creates an RDS event notification subscription. This action requires a topic ARN
825 (Amazon Resource Name) created by either the RDS console, the SNS console, or
826 the SNS API. To obtain an ARN with SNS, you must create a topic in Amazon SNS
827 and subscribe to the topic. The ARN is displayed in the SNS console.
828  
829 You can specify the type of source (SourceType) you want to be notified of,
830 provide a list of RDS sources (SourceIds) that triggers the events, and provide
831 a list of event categories (EventCategories) for events you want to be notified
832 of. For example, you can specify SourceType = db-instance, SourceIds =
833 mydbinstance1, mydbinstance2 and EventCategories = Availability, Backup.
834  
835 If you specify both the SourceType and SourceIds, such as SourceType =
836 db-instance and SourceIdentifier = myDBInstance1, you will be notified of all
837 the db-instance events for the specified source. If you specify a SourceType but
838 do not specify a SourceIdentifier, you will receive notice of the events for
839 that source type for all your RDS sources. If you do not specify either the
840 SourceType nor the SourceIdentifier, you will be notified of events generated
841 from all RDS sources belonging to your customer account.
842  
843 Required arguments:
844  
845 -sns_topic_arn The Amazon Resource Name (ARN) of the SNS topic created
846 for event notification. The ARN is created by Amazon SNS
847 when you create a topic and subscribe to it.
848  
849 -subscription_name The name of the subscription.
850  
851 Optional arguments:
852  
853 -enabled Boolean; set to true to activate the subscription, set to
854 false to create the subscription but not active it.
855  
856 -event_categories An arrayref of event categories for a -source_type that
857 you want to subscribe to. You can see a list of the
858 categories for a given -source_type in the Events topic
859 in the Amazon RDS User Guide or by using the
860 describe_event_categories() call.
861 -source_ids An arrayref of identifiers of the event sources for which
862 events will be returned. If not specified, then all
863 sources are included in the response. An identifier must
864 begin with a letter and must contain only ASCII letters,
865 digits, and hyphens; it cannot end with a hyphen or
866 contain two consecutive hyphens.
867  
868 -source_type The type of source that will be generating the events.
869 For example, if you want to be notified of events
870 generated by a DB instance, you would set this parameter
871 to db-instance. if this value is not specified, all
872 events are returned.
873  
874 Valid values: db-instance | db-parameter-group |
875 db-security-group | db-snapshot
876  
877 -name Alias for -subscription_name
878  
879 Returns a L<VM::EC2::DB::Event::Subscription> object on success.
880  
881 =cut
882  
883 sub create_event_subscription {
884 my $self = shift;
885 my %args = @_;
886 my @params;
887 $args{-subscription_name} ||= $args{-name} or
888 croak "create_event_subscription(): -subscription_name required argument missing";
889 $args{-sns_topic_arn} or croak "create_event_subscription(): -sns_topic_arn required argument missing";
890 my @params = $VEP->format_parms(\%args,
891 {
892 boolean_parm => 'Enabled',
893 single_parm => [qw(SnsTopicArn SourceType
894 SubscriptionName)],
895 member_list_parm => [qw(EventCategories SourceIds)],
896 });
897 return $self->rds_call('CreateEventSubscription',@params);
898 }
899  
900 =head2 $option_grp = $ec2->create_option_group(%args)
901  
902 Creates a new Option Group. You can create up to 20 option groups.
903  
904 Required arguments:
905  
906 -engine_name Specifies the name of the engine that this
907 option group should be associated with.
908  
909 -major_engine_version Specifies the major version of the engine
910 that this option group should be associated
911 with.
912  
913 -option_group_description The description of the option group.
914  
915 -option_group_name Specifies the name of the option group to be
916 created.
917  
918 Constraints:
919 * Must be 1 to 255 alphanumeric characters or
920 hyphens
921 * First character must be a letter
922 * Cannot end with a hyphen or contain two
923 consecutive hyphens
924  
925 -name Alias for -option_group_name
926  
927 -description Alias for -option_group_description
928  
929 Returns a L<VM::EC2::DB::Option::Group> object on success.
930  
931 =cut
932  
933 sub create_option_group {
934 my $self = shift;
935 my %args = @_;
936 $args{-option_group_name} ||= $args{-name} or
937 croak "create_option_group(): -option_group_name required argument missing";
938 $args{-option_group_description} ||= $args{-description} or
939 croak "create_option_group(): -option_group_description required argument missing";
940 my @params = $VEP->format_parms(\%args,
941 {
942 single_parm => [qw(EngineName MajorEngineVersion
943 OptionGroupDescription
944 OptionGroupName)],
945 });
946 return $self->rds_call('CreateOptionGroup',@params);
947 }
948  
949 =head2 @versions = $ec2->describe_db_engine_versions(%args)
950  
951 All arguments are optional.
952  
953 -db_parameter_group_family The specific DB Parameter Group family to
954 return details for.
955  
956 -family Alias for -db_parameter_group_family
957  
958 -default_only Return only the default version of the
959 specified engine or engine and major
960 version combination (boolean).
961  
962 -engine Database engine to return.
963  
964 -engine_version Database engine version to return.
965  
966 -list_supported_character_sets List supported charsets (boolean)
967  
968 -marker An optional pagination token provided by a previous
969 request. If specified, the response includes only
970 records after the marker, up to the value specified by
971 -max_records.
972  
973 -max_records The maximum number of records to include in the
974 response. If more records than the max exist,
975 a marker token is included in the response.
976  
977 Returns an array of L<VM::EC2::DB::Engine::Version> objects.
978  
979 =cut
980  
981 sub describe_db_engine_versions {
982 my $self = shift;
983 my %args = @_;
984 $args{-db_parameter_group_family} ||= $args{-family};
985 my @params = $VEP->format_parms(\%args,
986 {
987 boolean_parm => [qw(DefaultOnly
988 ListSupportedCharacterSets)],
989 single_parm => [qw(DBParameterGroupFamily Engine
990 EngineVersion Marker MaxRecords)],
991 });
992 return $self->rds_call('DescribeDBEngineVersions',@params);
993 }
994  
995 =head2 @db_instances = $ec2->describe_db_instances(-db_instance_identifier => $id, -marker => $marker, -max_records => $integer)
996  
997 All arguments are optional.
998  
999 -db_instance_identifier The user-supplied instance identifier. If this
1000 parameter is specified, only information for the
1001 specific DB Instance is returned.
1002  
1003 -marker An optional pagination token provided by a previous
1004 request. If specified, the response includes only
1005 records after the marker, up to the value specified by
1006 -max_records.
1007  
1008 -max_records The maximum number of records to include in the
1009 response. If more records than the max exist,
1010 a marker token is included in the response.
1011  
1012 -db_instance_id alias for -db_instance_identifier
1013  
1014 Returns an array of L<VM::EC2::DB::Instance> objects if any exist.
1015  
1016 =cut
1017  
1018 sub describe_db_instances {
1019 my $self = shift;
1020 my %args = @_;
1021 $args{-db_instance_identifier} ||= $args{-db_instance_id};
1022 my @params = $VEP->format_parms(\%args,
1023 {
1024 single_parm => [qw(DBInstanceIdentifier
1025 Marker MaxRecords)],
1026 });
1027 return $self->rds_call('DescribeDBInstances',@params);
1028 }
1029  
1030 =head2 @groups = $ec2->describe_db_parameter_groups(-db_parameter_group_name => $name, -marker => $marker, -max_records => $integer)
1031  
1032 All arguments are optional.
1033  
1034 -db_parameter_group_name The name of the DB parameter group to describe.
1035  
1036 -marker An optional pagination token provided by a previous
1037 request. If specified, the response includes only
1038 records after the marker, up to the value specified by
1039 -max_records.
1040  
1041 -max_records The maximum number of records to include in the
1042 response. If more records than the max exist,
1043 a marker token is included in the response.
1044  
1045 -group_name alias for -db_subnet_group_name
1046  
1047 Returns an array of L<VM::EC2::DB::Parameter::Group> objects if any exist.
1048  
1049 =cut
1050  
1051 sub describe_db_parameter_groups {
1052 my $self = shift;
1053 my %args = @_;
1054 $args{-db_parameter_group_name} ||= $args{-group_name};
1055 my @params = $VEP->format_parms(\%args,
1056 {
1057 single_parm => [qw(DBParameterGroupName
1058 Marker MaxRecords)],
1059 });
1060 return $self->rds_call('DescribeDBParameterGroups',@params);
1061 }
1062  
1063 =head2 @params = $ec2->describe_db_parameters(-db_parameter_group_name => $name, -source => $source, -marker => $marker, -max_records => $integer)
1064  
1065 Required arguments:
1066  
1067 -db_parameter_group_name The name of the DB parameter group.
1068  
1069 Optional arguments:
1070  
1071 -source The parameter types to return.
1072 Valid values: user | system | engine-default
1073 Default is all parameter types.
1074  
1075 -marker An optional pagination token provided by a previous
1076 request. If specified, the response includes only
1077 records after the marker, up to the value specified by
1078 -max_records.
1079  
1080 -max_records The maximum number of records to include in the
1081 response. If more records than the max exist,
1082 a marker token is included in the response.
1083  
1084 Returns an array of L<VM::EC2::DB::Parameter> objects.
1085  
1086 =cut
1087  
1088 sub describe_db_parameters {
1089 my $self = shift;
1090 my %args = @_;
1091 $args{-db_parameter_group_name} ||= $args{-group_name} or
1092 croak "describe_db_parameters(): -db_parameter_group_name argument missing";
1093 my @params = $VEP->format_parms(\%args,
1094 {
1095 single_parm => [qw(DBParameterGroupName Source
1096 Marker MaxRecords)],
1097 });
1098 return $self->rds_call('DescribeDBParameters',@params);
1099 }
1100  
1101 =head2 @groups = $ec2->describe_db_security_groups(-db_security_group_name => $name, -marker => $marker, -max_records => $integer)
1102  
1103 All arguments are optional.
1104  
1105 -db_security_group_name The name of the DB security group.
1106  
1107 -marker An optional pagination token provided by a previous
1108 request. If specified, the response includes only
1109 records after the marker, up to the value specified by
1110 -max_records.
1111  
1112 -max_records The maximum number of records to include in the
1113 response. If more records than the max exist,
1114 a marker token is included in the response.
1115  
1116 -group_name alias for -db_security_group_name
1117  
1118 Returns an array of L<VM::EC2::DB::SecurityGroup> objects if any exist.
1119  
1120 =cut
1121  
1122 sub describe_db_security_groups {
1123 my $self = shift;
1124 my %args = @_;
1125 $args{-db_security_group_name} ||= $args{-group_name};
1126 my @params = $VEP->format_parms(\%args,
1127 {
1128 single_parm => [qw(DBSecurityGroupName
1129 Marker MaxRecords)],
1130 });
1131 return $self->rds_call('DescribeDBSecurityGroups',@params);
1132 }
1133  
1134 =head2 @snapshots = $ec2->describe_db_snapshots(%args)
1135  
1136 All arguments are optional.
1137  
1138 -db_instance_identifier A DB Instance Identifier to retrieve the list of DB
1139 snapshots for. Cannot be used in conjunction with
1140 -db_snapshot_identifier.
1141 This parameter is not case sensitive.
1142  
1143 -db_snapshot_identifier A specific DB Snapshot Identifier to describe.
1144 Cannot be used in conjunction with .
1145 This value is stored as a lowercase string.
1146  
1147 -marker An optional pagination token provided by a previous
1148 request. If specified, the response includes only
1149 records after the marker, up to the value specified by
1150 -max_records.
1151  
1152 -max_records The maximum number of records to include in the
1153 response. If more records than the max exist,
1154 a marker token is included in the response.
1155  
1156 -snapshot_type An optional snapshot type for which snapshots will
1157 be returned. If not specified, the returned results
1158 will include snapshots of all types.
1159  
1160 -db_instance_id Alias for -db_instance_identifier
1161  
1162 -db_snapshot_id Alias for -db_snapshot_identifier
1163  
1164 Returns an array of L<VM::EC2:DB::Snapshot> objects if any exist.
1165  
1166 =cut
1167  
1168 sub describe_db_snapshots {
1169 my $self = shift;
1170 my %args = @_;
1171 $args{-db_instance_identifier} ||= $args{-db_instance_id};
1172 $args{-db_snapshot_identifier} ||= $args{-db_snapshot_id};
1173 $args{-db_instance_identifier} && $args{-db_snapshot_identifier} and
1174 croak "describe_db_snapshots(): Specify only one of -db_instance_identifier or -db_snapshot_identifier";
1175 my @params = $VEP->format_parms(\%args,
1176 {
1177 single_parm => [qw(DBInstanceIdentifier
1178 DBSnapshotIdentifier
1179 SnapshotType Marker MaxRecords)],
1180 });
1181 return $self->rds_call('DescribeDBSnapshots',@params);
1182 }
1183  
1184 =head2 @groups = $ec2->describe_db_subnet_groups(-db_subnet_group_name => $name, -marker => $marker, -max_records => $integer)
1185  
1186 All arguments are optional.
1187  
1188 -db_subnet_group_name The name of the DB Subnet Group to describe.
1189  
1190 -marker An optional pagination token provided by a previous
1191 request. If specified, the response includes only
1192 records after the marker, up to the value specified by
1193 -max_records.
1194  
1195 -max_records The maximum number of records to include in the
1196 response. If more records than the max exist,
1197 a marker token is included in the response.
1198  
1199 -group_name alias for -db_subnet_group_name
1200  
1201 Returns an array of L<VM::EC2::DB::Subnet::Group> objects if any exist.
1202  
1203 =cut
1204  
1205 sub describe_db_subnet_groups {
1206 my $self = shift;
1207 my %args = @_;
1208 $args{-db_subnet_group_name} ||= $args{-group_name};
1209 my @params = $VEP->format_parms(\%args,
1210 {
1211 single_parm => [qw(DBSubnetGroupName
1212 Marker MaxRecords)],
1213 });
1214 return $self->rds_call('DescribeDBSubnetGroups',@params);
1215 }
1216  
1217 =head2 @params = $ec2->describe_engine_default_parameters(%args)
1218  
1219 Required arguments:
1220  
1221 -db_parameter_group_family The name of the DB Parameter Group Family.
1222  
1223 -family Alias for -db_parameter_group_family
1224  
1225 Returns an array of L<VM::EC2::DB::Parameter> objects.
1226  
1227 =cut
1228  
1229 sub describe_engine_default_parameters {
1230 my $self = shift;
1231 my %args = @_;
1232 $args{-db_parameter_group_family} ||= $args{-family} or
1233 croak "describe_engine_default_parameters(): missing argument -db_parameter_group_family";
1234 my @params = $VEP->format_parms(\%args,
1235 {
1236 single_parm => [qw(DBParameterGroupFamily
1237 Marker MaxRecords)],
1238 });
1239 return $self->rds_call('DescribeEngineDefaultParameters',@params);
1240 }
1241  
1242 =head2 @categories = $ec2->describe_event_categories(-source_type => $type)
1243  
1244 Optional argument:
1245  
1246 -source_type The type of source that will be generating the events.
1247 Valid values: db-instance | db-parameter-group |
1248 db-security-group | db-snapshot
1249  
1250 Returns an array of L<VM::EC2::DB::Event::Category> objects
1251  
1252 =cut
1253  
1254 sub describe_event_categories {
1255 my $self = shift;
1256 my %args = @_;
1257 my @params = $VEP->format_parms(\%args,
1258 {
1259 single_parm => [qw(SourceType
1260 Marker MaxRecords)],
1261 });
1262 return $self->rds_call('DescribeEventCategories',@params);
1263 }
1264  
1265 =head2 @subs = $ec2->describe_event_subscriptions(-subscription_name => $name)
1266  
1267 Optional argument:
1268  
1269 -subscription_name The name of the RDS event notification subscription.
1270  
1271 Returns an array of L<VM::EC2::DB::Event::Subscription> object.
1272  
1273 =cut
1274  
1275 sub describe_event_subscriptions {
1276 my $self = shift;
1277 my %args = @_;
1278 my @params = $VEP->format_parms(\%args,
1279 {
1280 single_parm => [qw(SubscriptionName
1281 Marker MaxRecords)],
1282 });
1283 return $self->rds_call('DescribeEventSubscriptions',@params);
1284 }
1285  
1286 =head2 @events = $ec2->describe_events(%args)
1287  
1288 All arguments are optional but some conditions apply.
1289  
1290 -duration The number of minutes to retrieve events for.
1291  
1292 -end_time The end of the time interval for which to retrieve
1293 events, specified in ISO 8601 format.
1294 For more information on ISO 8601, visit:
1295 http://en.wikipedia.org/wiki/ISO_8601
1296  
1297 -event_categories A string or arrayref of event categories that trigger
1298 notifications for a event notification subscription.
1299  
1300 -source_identifier The identifier of the event source for which events
1301 will be returned. If not specified, then all sources
1302 are included in the response.
1303  
1304 -source_type The event source to retrieve events for. If no value
1305 is specified, all events are returned.
1306 REQUIRED if -source_identifier is provided.
1307  
1308 If 'DBInstance', then a DBInstanceIdentifier must be
1309 supplied in -source_identifier.
1310  
1311 If 'DBSecurityGroup', a DBSecurityGroupName must be
1312 supplied in -source_identifier.
1313  
1314 If 'DBParameterGroup', a DBParameterGroupName must be
1315 supplied in -source_identifier.
1316  
1317 If 'DBSnapshot', a DBSnapshotIdentifier must be
1318 supplied in -source_identifier.
1319  
1320 -start_time The beginning of the time interval to retrieve events
1321 for, specified in ISO 8601 format.
1322 For more information on ISO 8601, visit:
1323 http://en.wikipedia.org/wiki/ISO_8601
1324  
1325 Returns an array of L<VM::EC2::DB::Event> objects.
1326  
1327 =cut
1328  
1329 sub describe_events {
1330 my $self = shift;
1331 my %args = @_;
1332 my @params = $VEP->format_parms(\%args,
1333 {
1334 single_parm => [qw(Duration EndTime SourceIdentifier SourceType StartTime
1335 Marker MaxRecords)],
1336 member_list_parm => 'EventCategories',
1337 });
1338 return $self->rds_call('DescribeEvents',@params);
1339 }
1340  
1341 =head2 @options = $ec2->describe_option_group_options(-engine_name => $name, -major_engine_version => $version)
1342  
1343 Describes all available options for a particular database engine.
1344  
1345 Required arguments:
1346  
1347 -engine_name Database engine to describe options for.
1348  
1349 Optional arguments:
1350  
1351 -major_engine_version If specified, filters the results to include only
1352 options for the specified major engine version.
1353  
1354 Returns an array of L<VM::EC2::DB::Option::Group::Option> objects.
1355  
1356 =cut
1357  
1358 sub describe_option_group_options {
1359 my $self = shift;
1360 my %args = @_;
1361 $args{-engine_name} or
1362 croak "describe_option_group_options(): Required argument -engine_name missing";
1363 my @params = $VEP->format_parms(\%args,
1364 {
1365 single_parm => [qw(EngineName MajorEngineVersion
1366 Marker MaxRecords)],
1367 });
1368 return $self->rds_call('DescribeOptionGroupOptions',@params);
1369 }
1370  
1371 =head2 @groups = $ec2->describe_option_groups(-engine_name => $name, -major_engine_version => $version, -option_group_name => $og_name)
1372  
1373 Describes the available option groups.
1374  
1375 All arguments are optional.
1376  
1377 -engine_name Database engine to describe options for.
1378  
1379 -major_engine_version If specified, filters the results to include only
1380 options for the specified major engine version.
1381  
1382 -option_group_name The name of the option group to describe. Cannot
1383 be supplied together with -engine_name or
1384 -major_engine_version.
1385  
1386 Returns an array of L<VM::EC2::DB::Option::Group> objects.
1387  
1388 =cut
1389  
1390 sub describe_option_groups {
1391 my $self = shift;
1392 my %args = @_;
1393 $args{-engine_name} && $args{-option_group_name} and
1394 croak "describe_option_groups(): Cannot specify -engine_name and -option_group_name together";
1395 $args{-major_engine_version} && $args{-option_group_name} and
1396 croak "describe_option_groups(): Cannot specify -major_engine_version and -option_group_name together";
1397 my @params = $VEP->format_parms(\%args,
1398 {
1399 single_parm => [qw(EngineName MajorEngineVersion
1400 OptionGroupName
1401 Marker MaxRecords)],
1402 });
1403 return $self->rds_call('DescribeOptionGroups',@params);
1404 }
1405  
1406 =head2 @options = $ec2->describe_orderable_db_instance_options(%args)
1407  
1408 Describe the different RDS instances that can be launched.
1409  
1410 Required arguments:
1411  
1412 -engine The name of the engine to retrieve DB Instance options
1413 for.
1414  
1415 Optional arguments:
1416  
1417 -db_instance_class The DB Instance class (size) filter value.
1418  
1419 -engine_version The engine version filter value.
1420  
1421 -license_model The license model filter value.
1422  
1423 -vpc The VPC filter value. (boolean)
1424  
1425 Returns an array of L<VM::EC2::DB::Instance::OrderableOption> objects.
1426  
1427 =cut
1428  
1429 sub describe_orderable_db_instance_options {
1430 my $self = shift;
1431 my %args = @_;
1432 $args{-engine} or
1433 croak "describe_orderable_db_instance_options(): Required argument -engine missing";
1434 my @params = $VEP->format_parms(\%args,
1435 {
1436 boolean_parm => 'Vpc',
1437 single_parm => [qw(Engine DBInstanceClass
1438 EngineVersion LicenseModel
1439 Marker MaxRecords)],
1440 });
1441 return $self->rds_call('DescribeOrderableDBInstanceOptions',@params);
1442 }
1443  
1444 =head2 @instances = $ec2->describe_reserved_db_instances(%args)
1445  
1446 Returns information about reserved DB Instances for the account, or about a
1447 specific reserved DB Instance.
1448  
1449 All arguments are optional:
1450  
1451 -db_instance_class The DB Instance class (size) filter.
1452  
1453 -duration The duration filter value, specified in
1454 years or seconds.
1455 Valid values: 1 | 3 | 31536000 | 94608000
1456  
1457 -multi_az The Multi-AZ filter value. (boolean)
1458  
1459 -offering_type The offering type filter value.
1460 Valid Values: "Light Utilization" |
1461 "Medium Utilization" |
1462 "Heavy Utilization"
1463  
1464 -product_description The product description filter value.
1465  
1466 -reserved_db_instance_id The reserved DB Instance identifier filter value.
1467  
1468 -reserved_db_instances_offering_id The offering identifier filter value.
1469  
1470 Returns an array of L<VM::EC2::DB::Reserved::Instance> objects.
1471  
1472 =cut
1473  
1474 sub describe_reserved_db_instances {
1475 my $self = shift;
1476 my %args = @_;
1477 my @params = $VEP->format_parms(\%args,
1478 {
1479 boolean_parm => 'MultiAZ',
1480 single_parm => [qw(DBInstanceClass Duration
1481 OfferingType ProductDescription
1482 ReservedDBInstanceId
1483 ReservedDBInstancesOfferingId
1484 Marker MaxRecords)],
1485 });
1486 return $self->rds_call('DescribeReservedDBInstances',@params);
1487 }
1488  
1489 =head2 @offerings = $ec2->describe_reserved_db_instances_offerings(%args)
1490  
1491 Lists available reserved DB Instance offerings.
1492  
1493 All arguments are optional:
1494  
1495 -db_instance_class The DB Instance class (size) filter.
1496  
1497 -duration The duration filter value, specified in
1498 years or seconds.
1499 Valid values: 1 | 3 | 31536000 | 94608000
1500  
1501 -multi_az The Multi-AZ filter value. (boolean)
1502  
1503 -offering_type The offering type filter value.
1504 Valid Values: "Light Utilization" |
1505 "Medium Utilization" |
1506 "Heavy Utilization"
1507  
1508 -product_description The product description filter value.
1509  
1510 -reserved_db_instance_id The reserved DB Instance identifier filter value.
1511  
1512 -reserved_db_instances_offering_id The offering identifier filter value.
1513  
1514 Returns an array of L<VM::EC2::DB::Reserved::Instance> objects.
1515  
1516 =cut
1517  
1518 sub describe_reserved_db_instances_offerings {
1519 my $self = shift;
1520 my %args = @_;
1521 my @params = $VEP->format_parms(\%args,
1522 {
1523 boolean_parm => 'MultiAZ',
1524 single_parm => [qw(DBInstanceClass Duration
1525 OfferingType ProductDescription
1526 ReservedDBInstanceId
1527 ReservedDBInstancesOfferingId
1528 Marker MaxRecords)],
1529 });
1530 return $self->rds_call('DescribeReservedDBInstancesOfferings',@params);
1531 }
1532  
1533 =head2 $log = $ec2->download_db_log_file_portion(%args)
1534  
1535 Downloads the last line of the specified log file.
1536  
1537 All arguments are optional:
1538  
1539 -db_instance_identifier The DB Instance class (size) filter.
1540  
1541 -log_file_name The name of the log file to be downloaded.
1542  
1543 -marker The pagination token provided in the previous
1544 request. If this parameter is specified the
1545 response includes only records beyond the marker,
1546 up to MaxRecords.
1547  
1548 -number_of_lines The number of lines remaining to be downloaded.
1549  
1550 Returns a L<VM::EC2::DB::LogFilePortion> object.
1551  
1552 =cut
1553  
1554 sub download_db_log_file_portion {
1555 my $self = shift;
1556 my %args = @_;
1557 my @params = $VEP->format_parms(\%args,
1558 {
1559 single_parm => [qw(DBInstanceIdentifier LogFileName
1560 Marker NumberOfLines)],
1561 });
1562 return $self->rds_call('DownloadDBLogFilePortion',@params);
1563 }
1564  
1565 =head2 %tags = $ec2->list_tags_for_resource(-resource_name => $name)
1566  
1567 Lists all tags on a DB Instance or Snapshot.
1568  
1569 Arguments:
1570  
1571 -resource_name The name of the resource to list tags for.
1572  
1573 Returns a hash or hashref of tags.
1574  
1575 =cut
1576  
1577 sub list_tags_for_resource {
1578 my $self = shift;
1579 my %args = @_;
1580 my @params = $VEP->format_parms(\%args,
1581 {
1582 single_parm => 'ResourceName',
1583 });
1584 return $self->rds_call('ListTagsForResource',@params);
1585 }
1586  
1587 =head2 $db_instance = $ec2->modify_db_instance(%args)
1588  
1589 Modify settings for a DB Instance. You can change one or more database configuration
1590 parameters by specifying these parameters and the new values in the request.
1591  
1592 Required arguments:
1593  
1594 -db_instance_identifier The DB Instance identifier.
1595  
1596 Optional arguments:
1597  
1598 -allocated_storage The new storage capacity of the RDS instance. Changing this
1599 parameter does not result in an outage and the change is
1600 applied during the next maintenance window unless the
1601 -apply_immediately parameter is set to true for this request.
1602 MySQL:
1603 * Must be an integer from 5 to 1024.
1604 * Value supplied must be at least 10% greater than the
1605 current value. Values that are not at least 10% greater
1606 than the existing value are rounded up so that they are
1607 10% greater than the current value.
1608 Oracle:
1609 * Must be an integer from 10 to 1024.
1610 * Value supplied must be at least 10% greater than the
1611 current value. Values that are not at least 10% greater
1612 than the existing value are rounded up so that they are
1613 10% greater than the current value.
1614 SQL Server:
1615 * CANNOT BE MODIFIED
1616  
1617 -allow_major_version_upgrade Indicates that major version upgrades are allowed. Changing
1618 this parameter does not result in an outage and the change is
1619 asynchronously applied as soon as possible.
1620  
1621 Constraints: This parameter must be set to true when
1622 specifying a value for the -engine_version argument that is
1623 a different major version than the DB Instance's current
1624 version.
1625  
1626 -apply_immediately Specifies whether or not the modifications in this request
1627 and any pending modifications are asynchronously applied as
1628 soon as possible, regardless of the
1629 -preferred_maintenance_window setting for the DB Instance.
1630  
1631 If this parameter is passed as false, changes to the DB
1632 Instance are applied on the next reboot_db_instance() call,
1633 the next maintenance reboot, or the next failure reboot,
1634 whichever occurs first. See each parameter to determine when
1635 a change is applied. Default is false.
1636  
1637 -auto_minor_version_upgrade Indicates that minor engine upgrades will be applied
1638 automatically to the DB Instance during the maintenance
1639 window. Changing this parameter does not result in an outage
1640 except in the following case and the change is asynchronously
1641 applied as soon as possible. An outage will result if this
1642 parameter is set to true during the maintenance window, and a
1643 newer minor version is available, and RDS has enabled auto
1644 patching for that engine version. (Boolean)
1645  
1646 -backup_retention_period The number of days for which automated backups are retained.
1647 Setting this parameter to a positive number enables backups.
1648 Setting this parameter to 0 disables automated backups.
1649 Default: Existing setting
1650 Constraints:
1651 * Must be a value from 0 to 8
1652 * Cannot be set to 0 if the DB Instance is a master instance
1653 with read replicas
1654  
1655 -db_instance_class The new compute and memory capacity of the DB Instance.
1656 To determine the available classes, use the
1657 describe_orderable_db_instance_options() call.
1658  
1659 Passing a value for this parameter causes an outage during
1660 the change and is applied during the next maintenance window,
1661 unless the -apply_immediately argument is specified as true
1662 for this request.
1663  
1664 Valid values:
1665 db.t1.micro | db.m1.small | db.m1.medium | db.m1.large |
1666 db.m1.xlarge | db.m2.xlarge |db.m2.2xlarge | db.m2.4xlarge
1667  
1668 -db_parameter_group_name The name of the DB Parameter Group to apply to this DB Instance.
1669 Changing this parameter does not result in an outage and the
1670 change is applied during the next maintenance window unless the
1671 -apply_immediately argument is set to true for this request.
1672  
1673 Default: Existing setting.
1674  
1675 Constraints:
1676 * Must be 1 to 255 alphanumeric characters
1677 * First character must be a letter.
1678 * Cannot end with a hyphen or contain two consecutive
1679 hyphens
1680  
1681 -db_security_groups An arrayref of DB Security Groups to authorize on this DB
1682 Instance. Changing this parameter does not result in an outage
1683 and the change is asynchronously applied as soon as possible.
1684  
1685 -engine_version The version number of the database engine to upgrade to.
1686 Changing this parameter results in an outage and the change is
1687 applied during the next maintenance window unless the
1688 -apply_immediately parameter is set to true for this request.
1689  
1690 For major version upgrades, if a nondefault DB Parameter Group is
1691 currently in use, a new DB Parameter Group in the DB Parameter
1692 Group Family for the new engine version must be specified. The
1693 new DB Parameter Group can be the default for that DB Parameter
1694 Group Family.
1695  
1696 -iops The new Provisioned IOPS (I/O operations per second) value for
1697 the RDS instance. Changing this parameter does not result in an
1698 outage and the change is applied during the next maintenance
1699 window unless the -apply_immediately argument is set to true for
1700 this request.
1701  
1702 Default: Existing setting.
1703  
1704 Constraints:
1705 * Value supplied must be at least 10% greater than the current
1706 value. Values that are not at least 10% greater than the
1707 existing value are rounded up so that they are 10% greater than
1708 the current value.
1709  
1710 -master_user_password The new password for the master database user. Can be any
1711 printable ASCII character except "/", "\", or "@".
1712  
1713 Changing this parameter does not result in an outage and the
1714 change is asynchronously applied as soon as possible. Between the
1715 time of the request and the completion of the request, the
1716 MasterUserPassword element exists in the PendingModifiedValues
1717 element of the operation response.
1718  
1719 Constraints:
1720 * MySQL: Must contain from 8 to 41 alphanumeric characters.
1721 * Oracle: Must contain from 8 to 30 alphanumeric characters.
1722 * SQL Server: Must contain from 8 to 128 alphanumeric
1723 characters.
1724  
1725 -multi_az Specifies if the DB Instance is a Multi-AZ deployment.
1726 Changing this parameter does not result in an outage and the
1727 change is applied during the next maintenance window unless
1728 the -apply_immediately argument is set to true for this request.
1729 (Boolean)
1730  
1731 Constraints:
1732 * Cannot be specified if the DB Instance is a read replica.
1733  
1734 -new_db_instance_identifier The new DB Instance identifier for the DB Instance when renaming
1735 a DB Instance. This value is stored as a lowercase string.
1736  
1737 Constraints:
1738 * Must contain from 1 to 63 alphanumeric characters or
1739 hyphens (1 to 15 for SQL Server).
1740 * First character must be a letter.
1741 * Cannot end with a hyphen or contain two consecutive
1742 hyphens.
1743  
1744 -option_group_name Indicates that the DB Instance should be associated
1745 with the specified option group. Changing this parameter does
1746 not result in an outage except in the following case and the
1747 change is applied during the next maintenance window unless the
1748 -apply_immediately argument is set to true for this request. If
1749 the parameter change results in an option group that enables OEM,
1750 this change can cause a brief (sub-second) period during which
1751 new connections are rejected but existing connections are not
1752 interrupted.
1753  
1754 Note that persistent options, such as the TDE_SQLServer option for
1755 Microsoft SQL Server, cannot be removed from an option group while
1756 DB instances are associated with the option group. Permanent options,
1757 such as the TDE option for Oracle Advanced Security TDE, cannot be
1758 removed from an option group, and that option group cannot be removed
1759 from a DB instance once it is associated with a DB instance.
1760  
1761 -preferred_backup_window The daily time range during which automated backups are
1762 created if automated backups are enabled using the
1763 -backup_retention_period argument.
1764  
1765 Default: Default: A 30-minute window selected at random
1766 from an 8-hour block of time per region. The following
1767 list shows the time blocks for each region from which
1768 the default backup windows are assigned.
1769  
1770 * US-East (Northern Virginia) Region: 03:00-11:00 UTC
1771 * US-West (N. California, Oregon) Region: 06:00-14:00 UTC
1772 * EU (Ireland) Region: 22:00-06:00 UTC
1773 * Asia Pacific (Singapore) Region: 14:00-22:00 UTC
1774 * Asia Pacific (Tokyo) Region: 17:00-03:00 UTC
1775  
1776 Constraints:
1777 * Must be in the format hh24:mi-hh24:mi
1778 * Times in Universal Time Coordinated (UTC).
1779 * Must not conflict with the preferred maintenance window.
1780 * Must be at least 30 minutes.
1781  
1782 -preferred_maintenance_window The weekly time range (in UTC) during which system
1783 maintenance can occur.
1784  
1785 Format: ddd:hh24:mi-ddd:hh24:mi
1786  
1787 Default: A 30-minute window selected at random from an 8-hour
1788 block of time per region, occurring on a random day of the
1789 week. The following list shows the time blocks for each
1790 region from which the default maintenance windows are
1791 assigned.
1792  
1793 * US-East (Northern Virginia) Region: 03:00-11:00 UTC
1794 * US-West (N. California, Oregon) Region: 06:00-14:00 UTC
1795 * EU (Ireland) Region: 22:00-06:00 UTC
1796 * Asia Pacific (Singapore) Region: 14:00-22:00 UTC
1797 * Asia Pacific (Tokyo) Region: 17:00-03:00 UTC
1798  
1799 Valid Days: Mon, Tue, Wed, Thu, Fri, Sat, Sun
1800 Constraints: Minimum 30-minute window.
1801  
1802 -vpc_security_group_ids A list of EC2 VPC Security Groups to associate with this
1803 DB Instance. This change is asynchronously applied as soon
1804 as possible.
1805  
1806 This method returns a L<VM::EC2::DB:Instance> object.
1807  
1808 =cut
1809  
1810 sub modify_db_instance {
1811 my $self = shift;
1812 my %args = @_;
1813 $args{-db_instance_identifier} or
1814 croak "modify_db_instance(): -db_instance_identifier required argument missing";
1815 my @params = $VEP->format_parms(\%args,
1816 {
1817 boolean_parm => [qw(AutoMinorVersionUpgrade MultiAZ
1818 PubliclyAccessible)],
1819 single_parm => [qw(AllocatedStorage AvailabilityZone
1820 BackupRetentionPeriod
1821 CharacterSetName DBInstanceClass
1822 DBInstanceIdentifier DBName
1823 DBParameterGroupName
1824 DBSubnetGroupName Engine
1825 EngineVersion Iops LicenseModel
1826 MasterUserPassword MasterUsername
1827 OptionGroupName Port
1828 PreferredBackupWindow
1829 PreferredMaintenanceWindow)],
1830 member_list_parm => [qw(VpcSecurityGroupIds
1831 DBSecurityGroups)],
1832 });
1833 return $self->rds_call('CreateDBInstance',@params);
1834 }
1835  
1836 =head2 $group_name = $ec2->modify_db_parameter_group(-db_parameter_group_name => $group, -parameters => \@parms)
1837  
1838 Modifies the parameters of a DB Parameter Group.
1839  
1840 Note: The immediate method can be used only for dynamic parameters; the pending-reboot method
1841 can be used with MySQL and Oracle DB Instances for either dynamic or static parameters. For
1842 Microsoft SQL Server DB Instances, the pending-reboot method can be used only for static
1843 parameters.
1844  
1845 Required arguments:
1846  
1847 -db_parameter_group_name The name of the DB Parameter Group.
1848 Constraints:
1849 * Must be the name of an existing DB Parameter Group
1850 * Must be 1 to 255 alphanumeric characters
1851 * First character must be a letter
1852 * Cannot end with a hyphen or contain two consecutive hyphens
1853  
1854 -parameters An arrayref of hashes containing parameter names, values,
1855 and the apply method for the parameter update. At least one
1856 parameter name, value, and apply method must be supplied;
1857 subsequent arguments are optional. A maximum of 20 parameters
1858 may be modified in a single request.
1859  
1860 The hash keys must be: ParameterName, ParameterValue, ApplyMethod
1861  
1862 ie:
1863 [ { ParameterName => 'db_block_checking',
1864 ParameterValue => 'FULL',
1865 ApplyMethod => 'immediate' } ]
1866  
1867 -name Alias for -db_parameter_group_name
1868  
1869 Returns the DB Parameter Group name on success.
1870  
1871 =cut
1872  
1873 sub modify_db_parameter_group {
1874 my $self = shift;
1875 my %args = @_;
1876 my @params;
1877 $args{-db_parameter_group_name} ||= $args{-name} or
1878 croak "modify_db_parameter_group(): -db_parameter_group_name required argument missing";
1879 $args{-parameters} or
1880 croak "modify_db_parameter_group(): -parameters required argument missing";
1881 my @params = $VEP->format_parms(\%args,
1882 {
1883 single_parm => 'DBParameterGroupName',
1884 member_hash_parm => 'Parameters',
1885 });
1886 return $self->rds_call('ModifyDBParameterGroup',@params);
1887 }
1888  
1889 =head2 $subnet_group = $ec2->modify_db_subnet_group(%args)
1890  
1891 Modifies an existing DB subnet group. DB subnet groups must contain at least one subnet in at
1892 least two AZs in the region.
1893  
1894 Required arguments:
1895  
1896 -db_subnet_group_name The name for the DB Subnet Group.
1897  
1898 -subnet_ids An arrayref of EC2 Subnet IDs for the DB Subnet Group.
1899  
1900 Optional arguments:
1901  
1902 -db_subnet_group_description The description for the DB Subnet Group.
1903  
1904 Returns L<VM::EC2::DB::Subnet::Group> object on success.
1905  
1906 =cut
1907  
1908 sub modify_db_subnet_group {
1909 my $self = shift;
1910 my %args = @_;
1911 $args{-db_subnet_group_name} or
1912 croak "modify_db_subnet_group(): -db_subnet_group_name required argument missing";
1913 $args{-subnet_ids} or
1914 croak "modify_db_subnet_group(): -subnet_ids required argument missing";
1915 ref $args{-subnet_ids} eq 'ARRAY' or
1916 croak "modify_db_subnet_group(): -subnet_ids must be an arrayref";
1917 my @params = $VEP->format_parms(\%args,
1918 {
1919 single_parm => [qw(DBSubnetGroupName
1920 DBSubnetGroupDescription)],
1921 member_list_parm => 'SubnetIds',
1922 });
1923 return $self->rds_call('ModifyDBSubnetGroup',@params);
1924 }
1925  
1926 =head2 $event_sub = $ec2->modify_event_subscription(%args)
1927  
1928 Modifies an existing RDS event notification subscription. Note that you cannot modify the source
1929 identifiers using this call; to change source identifiers for a subscription, use the
1930 add_source_identifier_to_subscription() and remove_source_identifier_from_subscription() calls.
1931  
1932 Required arguments:
1933  
1934 -subscription_name The name of the RDS event notification subscription.
1935  
1936 Optional arguments:
1937  
1938 -enabled Boolean value; set to true to activate the subscription.
1939  
1940 -event_categories An arrayref of event categories for a -source_type to
1941 subscribe to. A list of the categories for a given
1942 -source_type can be seen in the Events topic in the Amazon
1943 RDS User Guide or by using the describe_event_categories()
1944 call.
1945  
1946 -sns_topic_arn The Amazon Resource Name (ARN) of the SNS topic created for
1947 event notification. The ARN is created by Amazon SNS when
1948 a topic is created and subscribed to.
1949  
1950 -source_type The type of source that will be generating the events.
1951 For example, to be notified of events generated by a DB
1952 instance, set this parameter to db-instance. if this value is
1953 not specified, all events are returned.
1954  
1955 Valid values: db-instance | db-parameter-group |
1956 db-security-group | db-snapshot
1957  
1958 Returns a L<VM::EC2::DB::Event::Subscription> object on success.
1959  
1960 =cut
1961  
1962 sub modify_event_subscription {
1963 my $self = shift;
1964 my %args = @_;
1965 $args{-subscription_name} or
1966 croak "modify_event_subscription(): -subscription_name required argument missing";
1967 my @params = $VEP->format_parms(\%args,
1968 {
1969 boolean_parm => 'Enabled',
1970 single_parm => [qw(SnsTopicArn SourceType
1971 SubscriptionName)],
1972 member_list_parm => 'EventCategories',
1973 });
1974 return $self->rds_call('ModifyEventSubscription',@params);
1975 }
1976  
1977 =head2 $option_group = $ec2->modify_option_group(%args)
1978  
1979 Modifies an existing Option Group.
1980  
1981 Required arguments:
1982  
1983 -option_group_name The name of the option group to be modified.
1984  
1985 Optional arguments:
1986  
1987 -apply_immediately Indicates whether the changes should be applied immediately,
1988 or during the next maintenance window for each instance
1989 associated with the Option Group. (Boolean)
1990  
1991 -options_to_include An arrayref of hashes containing OptionName and other available
1992 options.
1993  
1994 Available options are: DBSecurityGroupMemberships, OptionName,
1995 OptionSettings, Port, VpcSecurityGroupMemberships
1996  
1997 OptionName and Port must be provided as scalars.
1998 DBSecurityGroupMemberships, VpcSecurityGroupMemberships must
1999 be provided as arrayrefs.
2000 OptionSettings must be a hashref of Name => Value pairs.
2001  
2002 ie:
2003 [ { OptionName => 'OEM',
2004 DBSecurityGroupMemberships => [ 'mygroup' ],
2005 Port => 1158 },
2006 { OptionName => 'NATIVE_NETWORK_ENCRYPTION',
2007 OptionSettings => {
2008 'SQLNET.ENCRYPTION_SERVER' => 'REQUIRED',
2009 'SQLNET.CRYPTO_CHECKSUM_SERVER' => 'REQUIRED' } } ]
2010  
2011  
2012 -options_to_remove A string or arrayref containing the containing the option(s) to
2013 remove.
2014  
2015 ie:
2016 [ 'OEM', 'NATIVE_NETWORK_ENCRYPTION' ]
2017 or
2018 'OEM'
2019  
2020 Returns a L<VM::EC2::DB::Option::Group> object on success.
2021  
2022 =cut
2023  
2024 sub modify_option_group {
2025 my $self = shift;
2026 my %args = @_;
2027 my @params;
2028 $args{-option_group_name} or
2029 croak "modify_option_group(): -option_group_name required argument missing";
2030 ($args{-options_to_include} || $args{-options_to_remove}) or
2031 croak "modify_option_group(): -options_to_include or -options_to_remove argument required";
2032  
2033 # -options_to_include is a convoluted combination of parameter types
2034 # The DBSecurityGroupMemberships, VpcSecurityGroupMemberships options use
2035 # parameters in the style:
2036 # OptionsToInclude.member.1.DBSecurityGroupMemberships.member.1=value1
2037 # OptionsToInclude.member.1.DBSecurityGroupMemberships.member.2=value2
2038 #
2039 # The OptionSettings option use parameters in the style:
2040 # OptionsToInclude.member.1.OptionSettings.member.1.Name=SQLNET.ENCRYPTION_SERVER
2041 # OptionsToInclude.member.1.OptionSettings.member.1.Value=REQUIRED
2042 #
2043 # The following code is to generate the parameters from perl objects
2044 #
2045 if (my $options = $args{-options_to_include}) {
2046 croak "modify_option_group(): -options_to_include must be hashref or arrayref"
2047 unless ref $options;
2048 my @options = ref $options eq 'HASH' ? ($options) : @$options;
2049 foreach my $option (@options) {
2050 next unless ref $option eq 'HASH';
2051 foreach my $option_cfg (keys %$option) {
2052 if (ref $option->{$option_cfg}) {
2053 my %p;
2054 # this is for DBSecurityGroupMemberships, VpcSecurityGroupMemberships
2055 if (ref $option->{$option_cfg} eq 'ARRAY') {
2056 # create hashref compatible with member_list_parm()
2057 my $hash_ref = { "-$option_cfg" => $option->{$option_cfg} };
2058 %p = $self->member_list_parm($option_cfg,$hash_ref);
2059 }
2060 # this is for OptionSettings
2061 else {
2062 my $array_ref;
2063 foreach my $name (keys %{$option->{$option_cfg}}) {
2064 push @$array_ref, {
2065 Name => $name,
2066 Value => $option->{$option_cfg}->{$name}
2067 };
2068 }
2069 %p = $self->member_hash_parms($option_cfg,{ "-$option_cfg" => $array_ref });
2070 }
2071 $option->{$_} = $p{$_} foreach keys %p;
2072 delete $option->{$option_cfg};
2073 }
2074 }
2075 }
2076 }
2077 my @params = $VEP->format_parms(\%args,
2078 {
2079 boolean_parm => 'ApplyImmediately',
2080 single_parm => 'OptionGroupName',
2081 member_list_parm => 'OptionsToRemove',
2082 member_hash_parm => 'OptionsToInclude',
2083 });
2084 return $self->rds_call('ModifyOptionGroup',@params);
2085 }
2086  
2087 =head2 $db_instance = $ec2->promote_read_replica(%args)
2088  
2089 Promotes a Read Replica DB Instance to a standalone DB Instance.
2090  
2091 Required arguments:
2092  
2093 -db_instance_identifier The DB Instance identifier. This value is stored as a
2094 lowercase string.
2095  
2096 Constraints:
2097 * Must be the identifier for an existing Read Replica DB
2098 Instance
2099 * Must contain from 1 to 63 alphanumeric characters or
2100 hyphens
2101 * First character must be a letter
2102 * Cannot end with a hyphen or contain two consecutive hyphens
2103  
2104 Optional arguments:
2105  
2106 -backup_retention_period The daily time range during which automated backups are
2107 created if automated backups are enabled.
2108  
2109 -preferred_backup_window The daily time range during which automated backups are
2110 created if automated backups are enabled using the
2111 -backup_retention_period argument.
2112  
2113 Default: Default: A 30-minute window selected at random
2114 from an 8-hour block of time per region. The following
2115 list shows the time blocks for each region from which
2116 the default backup windows are assigned.
2117  
2118 * US-East (Northern Virginia) Region: 03:00-11:00 UTC
2119 * US-West (N. California, Oregon) Region: 06:00-14:00 UTC
2120 * EU (Ireland) Region: 22:00-06:00 UTC
2121 * Asia Pacific (Singapore) Region: 14:00-22:00 UTC
2122 * Asia Pacific (Tokyo) Region: 17:00-03:00 UTC
2123  
2124 Constraints:
2125 * Must be in the format hh24:mi-hh24:mi
2126 * Times in Universal Time Coordinated (UTC).
2127 * Must not conflict with the preferred maintenance window.
2128 * Must be at least 30 minutes.
2129  
2130  
2131 Returns a L<VM::EC2::DB::Instance> object on success.
2132  
2133 =cut
2134  
2135 sub promote_read_replica {
2136 my $self = shift;
2137 my %args = @_;
2138 $args{-db_instance_identifier} or
2139 croak "promote_read_replica(): -db_instance_identifier required argument missing";
2140 my @params = $VEP->format_parms(\%args,
2141 {
2142 single_parm => [qw(BackupRetentionPeriod
2143 DBInstanceIdentifier
2144 PreferredBackupWindow)],
2145 });
2146 return $self->rds_call('PromoteReadReplica',@params);
2147 }
2148  
2149 =head2 $reserved_db = $ec2->purchase_reserved_db_instances_offering(%args)
2150  
2151 Purchases a reserved DB Instance offering.
2152  
2153 Required arguments:
2154  
2155 -reserved_db_instances_offering_id The ID of the Reserved DB Instance offering to purchase.
2156 ie: 438012d3-4052-4cc7-b2e3-8d3372e0e706
2157  
2158 Optional arguments:
2159  
2160 -db_instance_count The number of instances to reserve. Default: 1
2161  
2162 -reserved_db_instance_id Customer-specified identifier to track this reservation.
2163 ie: myreservationID
2164  
2165 Returns a L<VM::EC2::DB::Reserved::Instance> object on success.
2166  
2167 =cut
2168  
2169 sub purchase_reserved_db_instances_offering {
2170 my $self = shift;
2171 my %args = @_;
2172 $args{-reserved_db_instances_offering_id} or
2173 croak "purchase_reserved_db_instances_offering(): -reserved_db_instances_offering_id required argument missing";
2174 my @params = $VEP->format_parms(\%args,
2175 {
2176 single_parm => [qw(DBInstanceCount
2177 ReservedDBInstanceId
2178 ReservedDBInstancesOfferingId)],
2179 });
2180 return $self->rds_call('PurchaseReservedDBInstancesOffering',@params);
2181 }
2182  
2183 =head2 $db_instance = $ec2->reboot_db_instance(-db_instance_identifier => $id, -force_failover => $boolean)
2184  
2185 Reboots a previously provisioned RDS instance. This API results in the application of modified
2186 DBParameterGroup parameters with ApplyStatus of pending-reboot to the RDS instance. This action
2187 is taken as soon as possible, and results in a momentary outage to the RDS instance during which
2188 the RDS instance status is set to rebooting. If the RDS instance is configured for MultiAZ, it is
2189 possible that the reboot will be conducted through a failover. A DBInstance event is created when
2190 the reboot is completed.
2191  
2192 Required arguments:
2193  
2194 -db_instance_identifier The DB Instance identifier.
2195  
2196 Optional arguments:
2197  
2198 -force_failover When true, the reboot will be conducted through a MultiAZ
2199 failover.
2200  
2201 Constraints:
2202 * You cannot specify true if the instance is not configured
2203 for MultiAZ.
2204  
2205 Returns a L<VM::EC2::DB::Instance> object on success.
2206  
2207 =cut
2208  
2209 sub reboot_db_instance {
2210 my $self = shift;
2211 my %args = @_;
2212 $args{-db_instance_identifier} or
2213 croak "reboot_db_instance(): -db_instance_identifier required argument missing";
2214 $args{-DBInstanceIdentifier} = $args{-db_instance_identifier};
2215 my @params = $VEP->format_parms(\%args,
2216 {
2217 boolean_parm => 'ForceFailover',
2218 single_parm => 'DBInstanceIdentifier',
2219 });
2220 return $self->rds_call('RebootDBInstance',@params);
2221 }
2222  
2223 =head2 $event_sub = $ec2->remove_source_identifier_from_subscription(-source_identifier => $id, -subscription_name => $name)
2224  
2225 Removes a source identifier from an existing RDS event notification subscription.
2226  
2227 Required arguments:
2228  
2229 -source_identifier The source identifier to be removed from the subscription,
2230 such as the DB instance identifier for a DB instance or the
2231 name of a security group.
2232  
2233 -subscription_name The name of the RDS event notification subscription to remove
2234 a source identifier from.
2235  
2236 Returns a L<VM::EC2::DB::Event::Subscription> object on success.
2237  
2238 =cut
2239  
2240 sub remove_source_identifier_from_subscription {
2241 my $self = shift;
2242 my %args = @_;
2243 $args{-instance_identifier} or
2244 croak "remove_source_identifier_from_subscription(): -instance_identifier required argument missing";
2245 $args{-subscription_name} or
2246 croak "remove_source_identifier_from_subscription(): -subscription_name required argument missing";
2247 my @params = $VEP->format_parms(\%args,
2248 {
2249 single_parm => [qw(SourceIdentifier SubscriptionName)],
2250 });
2251 return $self->rds_call('RemoveSourceIdentifierFromSubscription',@params);
2252 }
2253  
2254 =head2 $ec2->remove_tags_from_resource(-resource_name => $name, -tags => \@tags)
2255  
2256 Remove metadata tags from a resource.
2257  
2258 Required arguments:
2259  
2260 -resource_name The Amazon RDS resource the tags will be removed from. This value is an Amazon
2261 Resource Name (ARN). For information about creating an ARN, see Constructing
2262 an RDS Amazon Resource Name (ARN) at:
2263 http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html#USER_Tagging.ARN
2264  
2265 -tags hashref or arrayref of hashrefs containing tag Key/Value pairs
2266  
2267 This method does not return a value but will raise an error if unsuccessful.
2268  
2269 =cut
2270  
2271 sub remove_tags_from_resource {
2272 my $self = shift;
2273 my %args = @_;
2274 $args{-tags} && $args{-resource_name} or
2275 croak "remove_tags_from_resource(): -tags and -resource_name arguments required";
2276 my @params = $VEP->format_parms(\%args,
2277 {
2278 single_parm => 'ResourceName',
2279 member_list_parm => 'Tags',
2280 });
2281 return $self->rds_call('RemoveTagsFromResource',@params);
2282 }
2283  
2284 =head2 $name = $ec2->reset_db_parameter_group(%args)
2285  
2286 Modifies the parameters of a DB parameter group to the engine/system default value. To reset
2287 specific parameters, submit a hashref of the following: ParameterName and ApplyMethod.
2288 To reset the entire DB parameter group, set the -reset_all_parameters argument to true.
2289 When resetting the entire group, dynamic parameters are updated immediately and static
2290 parameters are set to pending-reboot to take effect on the next DB instance restart or
2291 after issuing a reboot_db_instance().
2292  
2293 Required arguments:
2294  
2295 -db_parameter_group_name The name of the DB Parameter Group.
2296 Constraints:
2297 * Must be the name of an existing DB Parameter Group
2298 * Must be 1 to 255 alphanumeric characters
2299 * First character must be a letter
2300 * Cannot end with a hyphen or contain two consecutive hyphens
2301  
2302 Conditional arguments:
2303  
2304 -parameters An arrayref of hashes containing parameter names and the apply
2305 method for the parameter update.
2306  
2307 The hash keys must be: ParameterName and ApplyMethod
2308 ie:
2309 [ { ParameterName => 'max_user_connections',
2310 ApplyMethod => 'pending-reboot' },
2311 { ParameterName => 'max_allowed_packet',
2312 ApplyMethod => 'immediate' } ]
2313  
2314 -reset_all_parameters Reset all parameters in the DB parameter group to default
2315 values. Boolean, default is true.
2316  
2317 Returns the name of the DB parameter group.
2318  
2319 =cut
2320  
2321 sub reset_db_parameter_group {
2322 my $self = shift;
2323 my %args = @_;
2324 $args{-db_parameter_group_name} or
2325 croak "reset_db_parameter_group(): -db_parameter_group_name argument required";
2326 $args{-DBParameterGroupName} = $args{-db_parameter_group_name};
2327 my @params = $VEP->format_parms(\%args,
2328 {
2329 boolean_parm => 'ResetAllParameters',
2330 single_parm => 'DBParameterGroupName',
2331 member_hash_parm => 'Parameters',
2332 });
2333 return $self->rds_call('ResetDBParameterGroup',@params);
2334 }
2335  
2336 =head2 $db_instance = $ec2->restore_db_instance_from_db_snapshot(%args)
2337  
2338 Creates a new DB instance from a DB snapshot. The target database is created from the source
2339 database restore point with the same configuration as the original source database, except that
2340 the new RDS instance is created in the default security group.
2341  
2342 Required arguments:
2343  
2344 -db_instance_identifier The DB Instance identifier.
2345 Constraints:
2346 * Must contain from 1 to 63 alphanumeric characters or
2347 hyphens (1 to 15 for SQL Server).
2348 * First character must be a letter.
2349 * Cannot end with a hyphen or contain two consecutive
2350 hyphens.
2351  
2352 -db_snapshot_identifier The identifier for the DB snapshot.
2353  
2354 Constraints:
2355 * Must contain 1 to 255 alphanumeric characters or hyphens
2356 * First character must be a letter
2357 * Cannot end with a hyphen or contain two consecutive hyphens
2358  
2359 Optional arguments:
2360  
2361 -auto_minor_version_upgrade Indicates that minor engine upgrades will be applied
2362 automatically to the DB Instance during the maintenance
2363 window. (Boolean). Default: true
2364  
2365 -availability_zone The EC2 Availability Zone that the database instance will
2366 be created in.
2367 Default: A random, system-chosen Availability Zone in the
2368 endpoint's region.
2369 Constraint: Cannot specify if -multi_az is true
2370  
2371 -db_instance_class The compute and memory capacity of the DB Instance.
2372 db.t1.micro | db.m1.small | db.m1.medium | db.m1.large |
2373 db.m1.xlarge | db.m2.xlarge |db.m2.2xlarge | db.m2.4xlarge
2374  
2375 -db_name The database name for the restored DB instance.
2376 NOTE: Does not apply to MySQL engine.
2377  
2378 -db_subnet_group_name A DB Subnet Group to associate with this DB Instance.
2379 If not specified, then it is a non-VPC DB instance.
2380  
2381 -engine The name of the database engine to be used for this
2382 instance.
2383 Default is that of source.
2384 Valid values: MySQL | oracle-se1 | oracle-se | oracle-ee |
2385 sqlserver-ee | sqlserver-se | sqlserver-ex | sqlserver-web
2386  
2387 -iops The amount of Provisioned IOPS initially allocated.
2388 Must be an integer greater than 1000
2389  
2390 -license_model License model information for this DB Instance.
2391 Valid values: license-included |
2392 bring-your-own-license |
2393 general-public-license
2394  
2395 -multi_az Specifies if the DB Instance is a Multi-AZ deployment.
2396 You cannot set the -availability_zone argument if the
2397 -multi_az argument is set to true.
2398  
2399 -option_group_name Indicates that the DB Instance should be associated
2400 with the specified option group.
2401  
2402 -port The port number on which the database accepts
2403 connections.
2404  
2405 MySQL:
2406 * Default: 3306, Valid values: 1150-65535
2407 Oracle:
2408 * Default: 1521, Valid values: 1150-65535
2409 Oracle:
2410 * Default: 1433, Valid values: 1150-65535 except
2411 1434 and 3389.
2412  
2413 -publicly_accessible Specifies the accessibility options for the DB instance. A
2414 value of true specifies an Internet-facing instance with a
2415 publicly resolvable DNS name, which resolves to a public IP
2416 address. A value of false specifies an internal instance with
2417 a DNS name that resolves to a private IP address.
2418  
2419 Default: The default behavior varies depending on whether a
2420 VPC has been requested or not. The following list shows the
2421 default behavior in each case.
2422 * DefaultVPC:true
2423 * VPC:false
2424  
2425 If no DB subnet group has been specified as part of the
2426 request and the -publicly_accessible value has not been set,
2427 the DB instance will be publicly accessible. If a specific DB
2428 subnet group has been specified as part of the request and
2429 the PubliclyAccessible value has not been set, the DB
2430 instance will be private.
2431  
2432 -tags hashref or arrayref of hashrefs containing Key/Value pairs
2433  
2434 =cut
2435  
2436 sub restore_db_instance_from_db_snapshot {
2437 my $self = shift;
2438 my %args = @_;
2439 $args{-db_instance_identifier} or
2440 croak "restore_db_instance_from_db_snapshot(): -db_instance_identifier required argument missing";
2441 $args{-db_snapshot_identifier} or
2442 croak "restore_db_instance_from_db_snapshot(): -db_snapshot_identifier required argument missing";
2443 my @params = $VEP->format_parms(\%args,
2444 {
2445 boolean_parm => [qw(AutoMinorVersionUpgrade MultiAZ
2446 PubliclyAccessible)],
2447 single_parm => [qw(AvailabilityZone DBInstanceClass
2448 DBInstanceIdentifier
2449 DBName DBSnapshotIdentifier
2450 DBSubnetGroupName Engine
2451 Iops LicenseModel OptionGroupName
2452 Port)],
2453 member_list_parm => 'Tags',
2454 });
2455 return $self->rds_call('RestoreDBInstanceFromDBSnapshot',@params);
2456 }
2457  
2458 =head2 $db_instance = $ec2->restore_db_instance_to_point_in_time(%args)
2459  
2460 Restores a DB instance to an arbitrary point-in-time. Users can restore to any point in time before
2461 the latestRestorableTime for up to backupRetentionPeriod days. The target database is created from
2462 the source database with the same configuration as the original database except that the DB instance
2463 is created with the default DB security group.
2464  
2465 Required arguments:
2466  
2467 -source_db_instance_identifier The identifier of the source DB instance from which to restore.
2468 Constraints: Must be the identifier of an existing DB Instance
2469  
2470 -target_db_instance_identifier The name of the new database instance to be created.
2471 Constraints:
2472 * Must contain from 1 to 63 alphanumeric characters or hyphens
2473 * First character must be a letter
2474 * Cannot end with a hyphen or contain two consecutive hyphens
2475  
2476 Optional arguments:
2477  
2478 -auto_minor_version_upgrade Indicates that minor engine upgrades will be applied
2479 automatically to the DB Instance during the maintenance
2480 window. (Boolean). Default: true
2481  
2482 -availability_zone The EC2 Availability Zone that the database instance will
2483 be created in.
2484 Default: A random, system-chosen Availability Zone in the
2485 endpoint's region.
2486 Constraint: Cannot specify if -multi_az is true
2487  
2488 -db_instance_class The compute and memory capacity of the DB Instance.
2489 db.t1.micro | db.m1.small | db.m1.medium | db.m1.large |
2490 db.m1.xlarge | db.m2.xlarge |db.m2.2xlarge | db.m2.4xlarge
2491  
2492 -db_name The database name for the restored DB instance.
2493 NOTE: Does not apply to MySQL engine.
2494  
2495 -db_subnet_group_name A DB Subnet Group to associate with this DB Instance.
2496 If not specified, then it is a non-VPC DB instance.
2497  
2498 -engine The name of the database engine to be used for this
2499 instance.
2500 Default is that of source.
2501 Valid values: MySQL | oracle-se1 | oracle-se | oracle-ee |
2502 sqlserver-ee | sqlserver-se | sqlserver-ex | sqlserver-web
2503  
2504 -iops The amount of Provisioned IOPS initially allocated.
2505 Must be an integer greater than 1000
2506  
2507 -license_model License model information for this DB Instance.
2508 Valid values: license-included |
2509 bring-your-own-license |
2510 general-public-license
2511  
2512 -multi_az Specifies if the DB Instance is a Multi-AZ deployment.
2513 You cannot set the -availability_zone argument if the
2514 -multi_az argument is set to true.
2515  
2516 -option_group_name Indicates that the DB Instance should be associated
2517 with the specified option group.
2518  
2519 -port The port number on which the database accepts
2520 connections.
2521  
2522 MySQL:
2523 * Default: 3306, Valid values: 1150-65535
2524 Oracle:
2525 * Default: 1521, Valid values: 1150-65535
2526 Oracle:
2527 * Default: 1433, Valid values: 1150-65535 except
2528 1434 and 3389.
2529  
2530 -publicly_accessible Specifies the accessibility options for the DB instance. A
2531 value of true specifies an Internet-facing instance with a
2532 publicly resolvable DNS name, which resolves to a public IP
2533 address. A value of false specifies an internal instance with
2534 a DNS name that resolves to a private IP address.
2535  
2536 Default: The default behavior varies depending on whether a
2537 VPC has been requested or not. The following list shows the
2538 default behavior in each case.
2539 * DefaultVPC:true
2540 * VPC:false
2541  
2542 If no DB subnet group has been specified as part of the
2543 request and the -publicly_accessible value has not been set,
2544 the DB instance will be publicly accessible. If a specific DB
2545 subnet group has been specified as part of the request and
2546 the PubliclyAccessible value has not been set, the DB
2547 instance will be private.
2548  
2549 -restore_time The date and time to restore from.
2550 Valid Values: Value must be a UTC time
2551 Constraints:
2552 * Must be prior the latest restorable time for the DB
2553 instance
2554 * Cannot be specified if -use_latest_restorable_time
2555 parameter is true
2556 Example: 2009-09-07T23:45:00Z
2557  
2558 -tags hashref or arrayref of hashrefs containing Key/Value pairs
2559  
2560 -use_latest_restorable_time Specifies if the DB instance is restored from the latest
2561 backup time.
2562 Boolean, default is false.
2563 Constraints: Cannot be specified if -restore_time parameter
2564 is provided.
2565  
2566 =cut
2567  
2568 sub restore_db_instance_to_point_in_time {
2569 my $self = shift;
2570 my %args = @_;
2571 $args{-source_db_instance_identifier} or
2572 croak "restore_db_instance_to_point_in_time(): -source_db_instance_identifier required argument missing";
2573 $args{-target_db_instance_identifier} or
2574 croak "restore_db_instance_to_point_in_time(): -target_db_instance_identifier required argument missing";
2575 my @params = $VEP->format_parms(\%args,
2576 {
2577 boolean_parm => [qw(AutoMinorVersionUpgrade MultiAZ
2578 PubliclyAccessible
2579 UseLatestRestorableTime)],
2580 single_parm => [qw(AvailabilityZone DBInstanceClass
2581 DBName DBSubnetGroupName Engine
2582 Iops OptionGroupName Port
2583 RestoreTime
2584 SourceDBInstanceIdentifier
2585 TargetDBInstanceIdentifier)],
2586 member_list_parm => 'Tags',
2587 });
2588 return $self->rds_call('RestoreDBInstanceToPointInTime',@params);
2589 }
2590  
2591 =head2 $sg = $ec2->revoke_db_security_group_ingress(%args)
2592  
2593 Revokes ingress from a DBSecurityGroup for previously authorized IP ranges or EC2 or VPC Security
2594 Groups.
2595  
2596 Required arguments:
2597  
2598 -db_security_group_name The name of the DB Security Group to revoke authorization from.
2599  
2600 Optional arguments:
2601  
2602 -cidrip The IP range to revoke. Must be a valid CIDR range.
2603 Security group parameters cannot be specified if -cidrip is
2604 specified.
2605  
2606 -ec2_security_group_id ID of the EC2 Security Group to revoke access from.
2607 For VPC DB security groups, this must be provided.
2608  
2609 -ec2_security_group_name Name of the EC2 Security Group to revoke access from.
2610  
2611 -ec2_security_group_owner_id AWS Account Number of the owner of the EC2 Security Group
2612 specified in the -ec2_security_group_name parameter.
2613  
2614 Returns a L<VM::EC2::DB::SecurityGroup> object.
2615  
2616 =cut
2617  
2618 sub revoke_db_security_group_ingress {
2619 my $self = shift;
2620 my %args = @_;
2621 $args{-db_security_group_name} &&
2622 ($args{-cidrip} || $args{-ec2_security_group_id} || $args{-ec2_security_group_name}) or
2623 croak "revoke_db_security_group_ingress(): -db_security_group_name and one of -cidrip, -ec2_security_group_id, -ec2_security_group_name arguments required";
2624 ($args{-ec2_security_group_id} || $args{-ec2_security_group_name}) &&
2625 $args{-ec2_security_group_owner_id} or
2626 croak "revoke_db_security_group_ingress(): -ec2_security_group_owner_id required when -ec2_security_group_id or -ec2_security_group_name arguments specified";
2627 my @params = $VEP->format_parms(\%args,
2628 {
2629 single_parm => [qw(CIDRIP DBSecurityGroupName
2630 EC2SecurityGroupId
2631 EC2SecurityGroupName
2632 EC2SecurityGroupOwnerId)],
2633 });
2634 return $self->rds_call('RevokeDBSecurityGroupIngress',@params);
2635 }
2636  
2637 =head1 AUTHOR
2638  
2639 Lance Kinley E<lt>lkinley@loyaltymethods.com<gt>.
2640  
2641 Copyright (c) 2013 Loyalty Methods, Inc.
2642  
2643 This package and its accompanying libraries is free software; you can
2644 redistribute it and/or modify it under the terms of the GPL (either
2645 version 1, or at your option, any later version) or the Artistic
2646 License 2.0. Refer to LICENSE for the full license text. In addition,
2647 please see DISCLAIMER.txt for disclaimers of warranty.
2648  
2649 =cut
2650  
2651 1;