github.com/aavshr/aws-sdk-go@v1.41.3/service/rds/examples_test.go (about)

     1  // Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
     2  
     3  package rds_test
     4  
     5  import (
     6  	"fmt"
     7  	"strings"
     8  	"time"
     9  
    10  	"github.com/aavshr/aws-sdk-go/aws"
    11  	"github.com/aavshr/aws-sdk-go/aws/awserr"
    12  	"github.com/aavshr/aws-sdk-go/aws/session"
    13  	"github.com/aavshr/aws-sdk-go/service/rds"
    14  )
    15  
    16  var _ time.Duration
    17  var _ strings.Reader
    18  var _ aws.Config
    19  
    20  func parseTime(layout, value string) *time.Time {
    21  	t, err := time.Parse(layout, value)
    22  	if err != nil {
    23  		panic(err)
    24  	}
    25  	return &t
    26  }
    27  
    28  // To add a source identifier to an event notification subscription
    29  //
    30  // This example add a source identifier to an event notification subscription.
    31  func ExampleRDS_AddSourceIdentifierToSubscription_shared00() {
    32  	svc := rds.New(session.New())
    33  	input := &rds.AddSourceIdentifierToSubscriptionInput{
    34  		SourceIdentifier: aws.String("mymysqlinstance"),
    35  		SubscriptionName: aws.String("mymysqleventsubscription"),
    36  	}
    37  
    38  	result, err := svc.AddSourceIdentifierToSubscription(input)
    39  	if err != nil {
    40  		if aerr, ok := err.(awserr.Error); ok {
    41  			switch aerr.Code() {
    42  			case rds.ErrCodeSubscriptionNotFoundFault:
    43  				fmt.Println(rds.ErrCodeSubscriptionNotFoundFault, aerr.Error())
    44  			case rds.ErrCodeSourceNotFoundFault:
    45  				fmt.Println(rds.ErrCodeSourceNotFoundFault, aerr.Error())
    46  			default:
    47  				fmt.Println(aerr.Error())
    48  			}
    49  		} else {
    50  			// Print the error, cast err to awserr.Error to get the Code and
    51  			// Message from an error.
    52  			fmt.Println(err.Error())
    53  		}
    54  		return
    55  	}
    56  
    57  	fmt.Println(result)
    58  }
    59  
    60  // To add tags to a resource
    61  //
    62  // This example adds a tag to an option group.
    63  func ExampleRDS_AddTagsToResource_shared00() {
    64  	svc := rds.New(session.New())
    65  	input := &rds.AddTagsToResourceInput{
    66  		ResourceName: aws.String("arn:aws:rds:us-east-1:992648334831:og:mymysqloptiongroup"),
    67  		Tags: []*rds.Tag{
    68  			{
    69  				Key:   aws.String("Staging"),
    70  				Value: aws.String("LocationDB"),
    71  			},
    72  		},
    73  	}
    74  
    75  	result, err := svc.AddTagsToResource(input)
    76  	if err != nil {
    77  		if aerr, ok := err.(awserr.Error); ok {
    78  			switch aerr.Code() {
    79  			case rds.ErrCodeDBInstanceNotFoundFault:
    80  				fmt.Println(rds.ErrCodeDBInstanceNotFoundFault, aerr.Error())
    81  			case rds.ErrCodeDBClusterNotFoundFault:
    82  				fmt.Println(rds.ErrCodeDBClusterNotFoundFault, aerr.Error())
    83  			case rds.ErrCodeDBSnapshotNotFoundFault:
    84  				fmt.Println(rds.ErrCodeDBSnapshotNotFoundFault, aerr.Error())
    85  			case rds.ErrCodeDBProxyNotFoundFault:
    86  				fmt.Println(rds.ErrCodeDBProxyNotFoundFault, aerr.Error())
    87  			case rds.ErrCodeDBProxyTargetGroupNotFoundFault:
    88  				fmt.Println(rds.ErrCodeDBProxyTargetGroupNotFoundFault, aerr.Error())
    89  			default:
    90  				fmt.Println(aerr.Error())
    91  			}
    92  		} else {
    93  			// Print the error, cast err to awserr.Error to get the Code and
    94  			// Message from an error.
    95  			fmt.Println(err.Error())
    96  		}
    97  		return
    98  	}
    99  
   100  	fmt.Println(result)
   101  }
   102  
   103  // To apply a pending maintenance action
   104  //
   105  // This example immediately applies a pending system update to a DB instance.
   106  func ExampleRDS_ApplyPendingMaintenanceAction_shared00() {
   107  	svc := rds.New(session.New())
   108  	input := &rds.ApplyPendingMaintenanceActionInput{
   109  		ApplyAction:        aws.String("system-update"),
   110  		OptInType:          aws.String("immediate"),
   111  		ResourceIdentifier: aws.String("arn:aws:rds:us-east-1:992648334831:db:mymysqlinstance"),
   112  	}
   113  
   114  	result, err := svc.ApplyPendingMaintenanceAction(input)
   115  	if err != nil {
   116  		if aerr, ok := err.(awserr.Error); ok {
   117  			switch aerr.Code() {
   118  			case rds.ErrCodeResourceNotFoundFault:
   119  				fmt.Println(rds.ErrCodeResourceNotFoundFault, aerr.Error())
   120  			case rds.ErrCodeInvalidDBClusterStateFault:
   121  				fmt.Println(rds.ErrCodeInvalidDBClusterStateFault, aerr.Error())
   122  			case rds.ErrCodeInvalidDBInstanceStateFault:
   123  				fmt.Println(rds.ErrCodeInvalidDBInstanceStateFault, aerr.Error())
   124  			default:
   125  				fmt.Println(aerr.Error())
   126  			}
   127  		} else {
   128  			// Print the error, cast err to awserr.Error to get the Code and
   129  			// Message from an error.
   130  			fmt.Println(err.Error())
   131  		}
   132  		return
   133  	}
   134  
   135  	fmt.Println(result)
   136  }
   137  
   138  // To authorize DB security group integress
   139  //
   140  // This example authorizes access to the specified security group by the specified CIDR
   141  // block.
   142  func ExampleRDS_AuthorizeDBSecurityGroupIngress_shared00() {
   143  	svc := rds.New(session.New())
   144  	input := &rds.AuthorizeDBSecurityGroupIngressInput{
   145  		CIDRIP:              aws.String("203.0.113.5/32"),
   146  		DBSecurityGroupName: aws.String("mydbsecuritygroup"),
   147  	}
   148  
   149  	result, err := svc.AuthorizeDBSecurityGroupIngress(input)
   150  	if err != nil {
   151  		if aerr, ok := err.(awserr.Error); ok {
   152  			switch aerr.Code() {
   153  			case rds.ErrCodeDBSecurityGroupNotFoundFault:
   154  				fmt.Println(rds.ErrCodeDBSecurityGroupNotFoundFault, aerr.Error())
   155  			case rds.ErrCodeInvalidDBSecurityGroupStateFault:
   156  				fmt.Println(rds.ErrCodeInvalidDBSecurityGroupStateFault, aerr.Error())
   157  			case rds.ErrCodeAuthorizationAlreadyExistsFault:
   158  				fmt.Println(rds.ErrCodeAuthorizationAlreadyExistsFault, aerr.Error())
   159  			case rds.ErrCodeAuthorizationQuotaExceededFault:
   160  				fmt.Println(rds.ErrCodeAuthorizationQuotaExceededFault, aerr.Error())
   161  			default:
   162  				fmt.Println(aerr.Error())
   163  			}
   164  		} else {
   165  			// Print the error, cast err to awserr.Error to get the Code and
   166  			// Message from an error.
   167  			fmt.Println(err.Error())
   168  		}
   169  		return
   170  	}
   171  
   172  	fmt.Println(result)
   173  }
   174  
   175  // To copy a DB cluster parameter group
   176  //
   177  // This example copies a DB cluster parameter group.
   178  func ExampleRDS_CopyDBClusterParameterGroup_shared00() {
   179  	svc := rds.New(session.New())
   180  	input := &rds.CopyDBClusterParameterGroupInput{
   181  		SourceDBClusterParameterGroupIdentifier:  aws.String("mydbclusterparametergroup"),
   182  		TargetDBClusterParameterGroupDescription: aws.String("My DB cluster parameter group copy"),
   183  		TargetDBClusterParameterGroupIdentifier:  aws.String("mydbclusterparametergroup-copy"),
   184  	}
   185  
   186  	result, err := svc.CopyDBClusterParameterGroup(input)
   187  	if err != nil {
   188  		if aerr, ok := err.(awserr.Error); ok {
   189  			switch aerr.Code() {
   190  			case rds.ErrCodeDBParameterGroupNotFoundFault:
   191  				fmt.Println(rds.ErrCodeDBParameterGroupNotFoundFault, aerr.Error())
   192  			case rds.ErrCodeDBParameterGroupQuotaExceededFault:
   193  				fmt.Println(rds.ErrCodeDBParameterGroupQuotaExceededFault, aerr.Error())
   194  			case rds.ErrCodeDBParameterGroupAlreadyExistsFault:
   195  				fmt.Println(rds.ErrCodeDBParameterGroupAlreadyExistsFault, aerr.Error())
   196  			default:
   197  				fmt.Println(aerr.Error())
   198  			}
   199  		} else {
   200  			// Print the error, cast err to awserr.Error to get the Code and
   201  			// Message from an error.
   202  			fmt.Println(err.Error())
   203  		}
   204  		return
   205  	}
   206  
   207  	fmt.Println(result)
   208  }
   209  
   210  // To copy a DB cluster snapshot
   211  //
   212  // The following example copies an automated snapshot of a DB cluster to a new DB cluster
   213  // snapshot.
   214  func ExampleRDS_CopyDBClusterSnapshot_shared00() {
   215  	svc := rds.New(session.New())
   216  	input := &rds.CopyDBClusterSnapshotInput{
   217  		SourceDBClusterSnapshotIdentifier: aws.String("rds:sample-cluster-2016-09-14-10-38"),
   218  		TargetDBClusterSnapshotIdentifier: aws.String("cluster-snapshot-copy-1"),
   219  	}
   220  
   221  	result, err := svc.CopyDBClusterSnapshot(input)
   222  	if err != nil {
   223  		if aerr, ok := err.(awserr.Error); ok {
   224  			switch aerr.Code() {
   225  			case rds.ErrCodeDBClusterSnapshotAlreadyExistsFault:
   226  				fmt.Println(rds.ErrCodeDBClusterSnapshotAlreadyExistsFault, aerr.Error())
   227  			case rds.ErrCodeDBClusterSnapshotNotFoundFault:
   228  				fmt.Println(rds.ErrCodeDBClusterSnapshotNotFoundFault, aerr.Error())
   229  			case rds.ErrCodeInvalidDBClusterStateFault:
   230  				fmt.Println(rds.ErrCodeInvalidDBClusterStateFault, aerr.Error())
   231  			case rds.ErrCodeInvalidDBClusterSnapshotStateFault:
   232  				fmt.Println(rds.ErrCodeInvalidDBClusterSnapshotStateFault, aerr.Error())
   233  			case rds.ErrCodeSnapshotQuotaExceededFault:
   234  				fmt.Println(rds.ErrCodeSnapshotQuotaExceededFault, aerr.Error())
   235  			case rds.ErrCodeKMSKeyNotAccessibleFault:
   236  				fmt.Println(rds.ErrCodeKMSKeyNotAccessibleFault, aerr.Error())
   237  			default:
   238  				fmt.Println(aerr.Error())
   239  			}
   240  		} else {
   241  			// Print the error, cast err to awserr.Error to get the Code and
   242  			// Message from an error.
   243  			fmt.Println(err.Error())
   244  		}
   245  		return
   246  	}
   247  
   248  	fmt.Println(result)
   249  }
   250  
   251  // To copy a DB parameter group
   252  //
   253  // This example copies a DB parameter group.
   254  func ExampleRDS_CopyDBParameterGroup_shared00() {
   255  	svc := rds.New(session.New())
   256  	input := &rds.CopyDBParameterGroupInput{
   257  		SourceDBParameterGroupIdentifier:  aws.String("mymysqlparametergroup"),
   258  		TargetDBParameterGroupDescription: aws.String("My MySQL parameter group copy"),
   259  		TargetDBParameterGroupIdentifier:  aws.String("mymysqlparametergroup-copy"),
   260  	}
   261  
   262  	result, err := svc.CopyDBParameterGroup(input)
   263  	if err != nil {
   264  		if aerr, ok := err.(awserr.Error); ok {
   265  			switch aerr.Code() {
   266  			case rds.ErrCodeDBParameterGroupNotFoundFault:
   267  				fmt.Println(rds.ErrCodeDBParameterGroupNotFoundFault, aerr.Error())
   268  			case rds.ErrCodeDBParameterGroupAlreadyExistsFault:
   269  				fmt.Println(rds.ErrCodeDBParameterGroupAlreadyExistsFault, aerr.Error())
   270  			case rds.ErrCodeDBParameterGroupQuotaExceededFault:
   271  				fmt.Println(rds.ErrCodeDBParameterGroupQuotaExceededFault, aerr.Error())
   272  			default:
   273  				fmt.Println(aerr.Error())
   274  			}
   275  		} else {
   276  			// Print the error, cast err to awserr.Error to get the Code and
   277  			// Message from an error.
   278  			fmt.Println(err.Error())
   279  		}
   280  		return
   281  	}
   282  
   283  	fmt.Println(result)
   284  }
   285  
   286  // To copy a DB snapshot
   287  //
   288  // This example copies a DB snapshot.
   289  func ExampleRDS_CopyDBSnapshot_shared00() {
   290  	svc := rds.New(session.New())
   291  	input := &rds.CopyDBSnapshotInput{
   292  		SourceDBSnapshotIdentifier: aws.String("mydbsnapshot"),
   293  		TargetDBSnapshotIdentifier: aws.String("mydbsnapshot-copy"),
   294  	}
   295  
   296  	result, err := svc.CopyDBSnapshot(input)
   297  	if err != nil {
   298  		if aerr, ok := err.(awserr.Error); ok {
   299  			switch aerr.Code() {
   300  			case rds.ErrCodeDBSnapshotAlreadyExistsFault:
   301  				fmt.Println(rds.ErrCodeDBSnapshotAlreadyExistsFault, aerr.Error())
   302  			case rds.ErrCodeDBSnapshotNotFoundFault:
   303  				fmt.Println(rds.ErrCodeDBSnapshotNotFoundFault, aerr.Error())
   304  			case rds.ErrCodeInvalidDBSnapshotStateFault:
   305  				fmt.Println(rds.ErrCodeInvalidDBSnapshotStateFault, aerr.Error())
   306  			case rds.ErrCodeSnapshotQuotaExceededFault:
   307  				fmt.Println(rds.ErrCodeSnapshotQuotaExceededFault, aerr.Error())
   308  			case rds.ErrCodeKMSKeyNotAccessibleFault:
   309  				fmt.Println(rds.ErrCodeKMSKeyNotAccessibleFault, aerr.Error())
   310  			case rds.ErrCodeCustomAvailabilityZoneNotFoundFault:
   311  				fmt.Println(rds.ErrCodeCustomAvailabilityZoneNotFoundFault, aerr.Error())
   312  			default:
   313  				fmt.Println(aerr.Error())
   314  			}
   315  		} else {
   316  			// Print the error, cast err to awserr.Error to get the Code and
   317  			// Message from an error.
   318  			fmt.Println(err.Error())
   319  		}
   320  		return
   321  	}
   322  
   323  	fmt.Println(result)
   324  }
   325  
   326  // To copy an option group
   327  //
   328  // This example copies an option group.
   329  func ExampleRDS_CopyOptionGroup_shared00() {
   330  	svc := rds.New(session.New())
   331  	input := &rds.CopyOptionGroupInput{
   332  		SourceOptionGroupIdentifier:  aws.String("mymysqloptiongroup"),
   333  		TargetOptionGroupDescription: aws.String("My MySQL option group copy"),
   334  		TargetOptionGroupIdentifier:  aws.String("mymysqloptiongroup-copy"),
   335  	}
   336  
   337  	result, err := svc.CopyOptionGroup(input)
   338  	if err != nil {
   339  		if aerr, ok := err.(awserr.Error); ok {
   340  			switch aerr.Code() {
   341  			case rds.ErrCodeOptionGroupAlreadyExistsFault:
   342  				fmt.Println(rds.ErrCodeOptionGroupAlreadyExistsFault, aerr.Error())
   343  			case rds.ErrCodeOptionGroupNotFoundFault:
   344  				fmt.Println(rds.ErrCodeOptionGroupNotFoundFault, aerr.Error())
   345  			case rds.ErrCodeOptionGroupQuotaExceededFault:
   346  				fmt.Println(rds.ErrCodeOptionGroupQuotaExceededFault, aerr.Error())
   347  			default:
   348  				fmt.Println(aerr.Error())
   349  			}
   350  		} else {
   351  			// Print the error, cast err to awserr.Error to get the Code and
   352  			// Message from an error.
   353  			fmt.Println(err.Error())
   354  		}
   355  		return
   356  	}
   357  
   358  	fmt.Println(result)
   359  }
   360  
   361  // To create a DB cluster
   362  //
   363  // This example creates a DB cluster.
   364  func ExampleRDS_CreateDBCluster_shared00() {
   365  	svc := rds.New(session.New())
   366  	input := &rds.CreateDBClusterInput{
   367  		AvailabilityZones: []*string{
   368  			aws.String("us-east-1a"),
   369  		},
   370  		BackupRetentionPeriod:       aws.Int64(1),
   371  		DBClusterIdentifier:         aws.String("mydbcluster"),
   372  		DBClusterParameterGroupName: aws.String("mydbclusterparametergroup"),
   373  		DatabaseName:                aws.String("myauroradb"),
   374  		Engine:                      aws.String("aurora"),
   375  		EngineVersion:               aws.String("5.6.10a"),
   376  		MasterUserPassword:          aws.String("mypassword"),
   377  		MasterUsername:              aws.String("myuser"),
   378  		Port:                        aws.Int64(3306),
   379  		StorageEncrypted:            aws.Bool(true),
   380  	}
   381  
   382  	result, err := svc.CreateDBCluster(input)
   383  	if err != nil {
   384  		if aerr, ok := err.(awserr.Error); ok {
   385  			switch aerr.Code() {
   386  			case rds.ErrCodeDBClusterAlreadyExistsFault:
   387  				fmt.Println(rds.ErrCodeDBClusterAlreadyExistsFault, aerr.Error())
   388  			case rds.ErrCodeInsufficientStorageClusterCapacityFault:
   389  				fmt.Println(rds.ErrCodeInsufficientStorageClusterCapacityFault, aerr.Error())
   390  			case rds.ErrCodeDBClusterQuotaExceededFault:
   391  				fmt.Println(rds.ErrCodeDBClusterQuotaExceededFault, aerr.Error())
   392  			case rds.ErrCodeStorageQuotaExceededFault:
   393  				fmt.Println(rds.ErrCodeStorageQuotaExceededFault, aerr.Error())
   394  			case rds.ErrCodeDBSubnetGroupNotFoundFault:
   395  				fmt.Println(rds.ErrCodeDBSubnetGroupNotFoundFault, aerr.Error())
   396  			case rds.ErrCodeInvalidVPCNetworkStateFault:
   397  				fmt.Println(rds.ErrCodeInvalidVPCNetworkStateFault, aerr.Error())
   398  			case rds.ErrCodeInvalidDBClusterStateFault:
   399  				fmt.Println(rds.ErrCodeInvalidDBClusterStateFault, aerr.Error())
   400  			case rds.ErrCodeInvalidDBSubnetGroupStateFault:
   401  				fmt.Println(rds.ErrCodeInvalidDBSubnetGroupStateFault, aerr.Error())
   402  			case rds.ErrCodeInvalidSubnet:
   403  				fmt.Println(rds.ErrCodeInvalidSubnet, aerr.Error())
   404  			case rds.ErrCodeInvalidDBInstanceStateFault:
   405  				fmt.Println(rds.ErrCodeInvalidDBInstanceStateFault, aerr.Error())
   406  			case rds.ErrCodeDBClusterParameterGroupNotFoundFault:
   407  				fmt.Println(rds.ErrCodeDBClusterParameterGroupNotFoundFault, aerr.Error())
   408  			case rds.ErrCodeKMSKeyNotAccessibleFault:
   409  				fmt.Println(rds.ErrCodeKMSKeyNotAccessibleFault, aerr.Error())
   410  			case rds.ErrCodeDBClusterNotFoundFault:
   411  				fmt.Println(rds.ErrCodeDBClusterNotFoundFault, aerr.Error())
   412  			case rds.ErrCodeDBInstanceNotFoundFault:
   413  				fmt.Println(rds.ErrCodeDBInstanceNotFoundFault, aerr.Error())
   414  			case rds.ErrCodeDBSubnetGroupDoesNotCoverEnoughAZs:
   415  				fmt.Println(rds.ErrCodeDBSubnetGroupDoesNotCoverEnoughAZs, aerr.Error())
   416  			case rds.ErrCodeGlobalClusterNotFoundFault:
   417  				fmt.Println(rds.ErrCodeGlobalClusterNotFoundFault, aerr.Error())
   418  			case rds.ErrCodeInvalidGlobalClusterStateFault:
   419  				fmt.Println(rds.ErrCodeInvalidGlobalClusterStateFault, aerr.Error())
   420  			case rds.ErrCodeDomainNotFoundFault:
   421  				fmt.Println(rds.ErrCodeDomainNotFoundFault, aerr.Error())
   422  			default:
   423  				fmt.Println(aerr.Error())
   424  			}
   425  		} else {
   426  			// Print the error, cast err to awserr.Error to get the Code and
   427  			// Message from an error.
   428  			fmt.Println(err.Error())
   429  		}
   430  		return
   431  	}
   432  
   433  	fmt.Println(result)
   434  }
   435  
   436  // To create a DB cluster parameter group
   437  //
   438  // This example creates a DB cluster parameter group.
   439  func ExampleRDS_CreateDBClusterParameterGroup_shared00() {
   440  	svc := rds.New(session.New())
   441  	input := &rds.CreateDBClusterParameterGroupInput{
   442  		DBClusterParameterGroupName: aws.String("mydbclusterparametergroup"),
   443  		DBParameterGroupFamily:      aws.String("aurora5.6"),
   444  		Description:                 aws.String("My DB cluster parameter group"),
   445  	}
   446  
   447  	result, err := svc.CreateDBClusterParameterGroup(input)
   448  	if err != nil {
   449  		if aerr, ok := err.(awserr.Error); ok {
   450  			switch aerr.Code() {
   451  			case rds.ErrCodeDBParameterGroupQuotaExceededFault:
   452  				fmt.Println(rds.ErrCodeDBParameterGroupQuotaExceededFault, aerr.Error())
   453  			case rds.ErrCodeDBParameterGroupAlreadyExistsFault:
   454  				fmt.Println(rds.ErrCodeDBParameterGroupAlreadyExistsFault, aerr.Error())
   455  			default:
   456  				fmt.Println(aerr.Error())
   457  			}
   458  		} else {
   459  			// Print the error, cast err to awserr.Error to get the Code and
   460  			// Message from an error.
   461  			fmt.Println(err.Error())
   462  		}
   463  		return
   464  	}
   465  
   466  	fmt.Println(result)
   467  }
   468  
   469  // To create a DB cluster snapshot
   470  //
   471  // This example creates a DB cluster snapshot.
   472  func ExampleRDS_CreateDBClusterSnapshot_shared00() {
   473  	svc := rds.New(session.New())
   474  	input := &rds.CreateDBClusterSnapshotInput{
   475  		DBClusterIdentifier:         aws.String("mydbcluster"),
   476  		DBClusterSnapshotIdentifier: aws.String("mydbclustersnapshot"),
   477  	}
   478  
   479  	result, err := svc.CreateDBClusterSnapshot(input)
   480  	if err != nil {
   481  		if aerr, ok := err.(awserr.Error); ok {
   482  			switch aerr.Code() {
   483  			case rds.ErrCodeDBClusterSnapshotAlreadyExistsFault:
   484  				fmt.Println(rds.ErrCodeDBClusterSnapshotAlreadyExistsFault, aerr.Error())
   485  			case rds.ErrCodeInvalidDBClusterStateFault:
   486  				fmt.Println(rds.ErrCodeInvalidDBClusterStateFault, aerr.Error())
   487  			case rds.ErrCodeDBClusterNotFoundFault:
   488  				fmt.Println(rds.ErrCodeDBClusterNotFoundFault, aerr.Error())
   489  			case rds.ErrCodeSnapshotQuotaExceededFault:
   490  				fmt.Println(rds.ErrCodeSnapshotQuotaExceededFault, aerr.Error())
   491  			case rds.ErrCodeInvalidDBClusterSnapshotStateFault:
   492  				fmt.Println(rds.ErrCodeInvalidDBClusterSnapshotStateFault, aerr.Error())
   493  			default:
   494  				fmt.Println(aerr.Error())
   495  			}
   496  		} else {
   497  			// Print the error, cast err to awserr.Error to get the Code and
   498  			// Message from an error.
   499  			fmt.Println(err.Error())
   500  		}
   501  		return
   502  	}
   503  
   504  	fmt.Println(result)
   505  }
   506  
   507  // To create a DB instance.
   508  //
   509  // This example creates a DB instance.
   510  func ExampleRDS_CreateDBInstance_shared00() {
   511  	svc := rds.New(session.New())
   512  	input := &rds.CreateDBInstanceInput{
   513  		AllocatedStorage:     aws.Int64(5),
   514  		DBInstanceClass:      aws.String("db.t2.micro"),
   515  		DBInstanceIdentifier: aws.String("mymysqlinstance"),
   516  		Engine:               aws.String("MySQL"),
   517  		MasterUserPassword:   aws.String("MyPassword"),
   518  		MasterUsername:       aws.String("MyUser"),
   519  	}
   520  
   521  	result, err := svc.CreateDBInstance(input)
   522  	if err != nil {
   523  		if aerr, ok := err.(awserr.Error); ok {
   524  			switch aerr.Code() {
   525  			case rds.ErrCodeDBInstanceAlreadyExistsFault:
   526  				fmt.Println(rds.ErrCodeDBInstanceAlreadyExistsFault, aerr.Error())
   527  			case rds.ErrCodeInsufficientDBInstanceCapacityFault:
   528  				fmt.Println(rds.ErrCodeInsufficientDBInstanceCapacityFault, aerr.Error())
   529  			case rds.ErrCodeDBParameterGroupNotFoundFault:
   530  				fmt.Println(rds.ErrCodeDBParameterGroupNotFoundFault, aerr.Error())
   531  			case rds.ErrCodeDBSecurityGroupNotFoundFault:
   532  				fmt.Println(rds.ErrCodeDBSecurityGroupNotFoundFault, aerr.Error())
   533  			case rds.ErrCodeInstanceQuotaExceededFault:
   534  				fmt.Println(rds.ErrCodeInstanceQuotaExceededFault, aerr.Error())
   535  			case rds.ErrCodeStorageQuotaExceededFault:
   536  				fmt.Println(rds.ErrCodeStorageQuotaExceededFault, aerr.Error())
   537  			case rds.ErrCodeDBSubnetGroupNotFoundFault:
   538  				fmt.Println(rds.ErrCodeDBSubnetGroupNotFoundFault, aerr.Error())
   539  			case rds.ErrCodeDBSubnetGroupDoesNotCoverEnoughAZs:
   540  				fmt.Println(rds.ErrCodeDBSubnetGroupDoesNotCoverEnoughAZs, aerr.Error())
   541  			case rds.ErrCodeInvalidDBClusterStateFault:
   542  				fmt.Println(rds.ErrCodeInvalidDBClusterStateFault, aerr.Error())
   543  			case rds.ErrCodeInvalidSubnet:
   544  				fmt.Println(rds.ErrCodeInvalidSubnet, aerr.Error())
   545  			case rds.ErrCodeInvalidVPCNetworkStateFault:
   546  				fmt.Println(rds.ErrCodeInvalidVPCNetworkStateFault, aerr.Error())
   547  			case rds.ErrCodeProvisionedIopsNotAvailableInAZFault:
   548  				fmt.Println(rds.ErrCodeProvisionedIopsNotAvailableInAZFault, aerr.Error())
   549  			case rds.ErrCodeOptionGroupNotFoundFault:
   550  				fmt.Println(rds.ErrCodeOptionGroupNotFoundFault, aerr.Error())
   551  			case rds.ErrCodeDBClusterNotFoundFault:
   552  				fmt.Println(rds.ErrCodeDBClusterNotFoundFault, aerr.Error())
   553  			case rds.ErrCodeStorageTypeNotSupportedFault:
   554  				fmt.Println(rds.ErrCodeStorageTypeNotSupportedFault, aerr.Error())
   555  			case rds.ErrCodeAuthorizationNotFoundFault:
   556  				fmt.Println(rds.ErrCodeAuthorizationNotFoundFault, aerr.Error())
   557  			case rds.ErrCodeKMSKeyNotAccessibleFault:
   558  				fmt.Println(rds.ErrCodeKMSKeyNotAccessibleFault, aerr.Error())
   559  			case rds.ErrCodeDomainNotFoundFault:
   560  				fmt.Println(rds.ErrCodeDomainNotFoundFault, aerr.Error())
   561  			case rds.ErrCodeBackupPolicyNotFoundFault:
   562  				fmt.Println(rds.ErrCodeBackupPolicyNotFoundFault, aerr.Error())
   563  			default:
   564  				fmt.Println(aerr.Error())
   565  			}
   566  		} else {
   567  			// Print the error, cast err to awserr.Error to get the Code and
   568  			// Message from an error.
   569  			fmt.Println(err.Error())
   570  		}
   571  		return
   572  	}
   573  
   574  	fmt.Println(result)
   575  }
   576  
   577  // To create a DB instance read replica.
   578  //
   579  // This example creates a DB instance read replica.
   580  func ExampleRDS_CreateDBInstanceReadReplica_shared00() {
   581  	svc := rds.New(session.New())
   582  	input := &rds.CreateDBInstanceReadReplicaInput{
   583  		AvailabilityZone:           aws.String("us-east-1a"),
   584  		CopyTagsToSnapshot:         aws.Bool(true),
   585  		DBInstanceClass:            aws.String("db.t2.micro"),
   586  		DBInstanceIdentifier:       aws.String("mydbreadreplica"),
   587  		PubliclyAccessible:         aws.Bool(true),
   588  		SourceDBInstanceIdentifier: aws.String("mymysqlinstance"),
   589  		StorageType:                aws.String("gp2"),
   590  		Tags: []*rds.Tag{
   591  			{
   592  				Key:   aws.String("mydbreadreplicakey"),
   593  				Value: aws.String("mydbreadreplicavalue"),
   594  			},
   595  		},
   596  	}
   597  
   598  	result, err := svc.CreateDBInstanceReadReplica(input)
   599  	if err != nil {
   600  		if aerr, ok := err.(awserr.Error); ok {
   601  			switch aerr.Code() {
   602  			case rds.ErrCodeDBInstanceAlreadyExistsFault:
   603  				fmt.Println(rds.ErrCodeDBInstanceAlreadyExistsFault, aerr.Error())
   604  			case rds.ErrCodeInsufficientDBInstanceCapacityFault:
   605  				fmt.Println(rds.ErrCodeInsufficientDBInstanceCapacityFault, aerr.Error())
   606  			case rds.ErrCodeDBParameterGroupNotFoundFault:
   607  				fmt.Println(rds.ErrCodeDBParameterGroupNotFoundFault, aerr.Error())
   608  			case rds.ErrCodeDBSecurityGroupNotFoundFault:
   609  				fmt.Println(rds.ErrCodeDBSecurityGroupNotFoundFault, aerr.Error())
   610  			case rds.ErrCodeInstanceQuotaExceededFault:
   611  				fmt.Println(rds.ErrCodeInstanceQuotaExceededFault, aerr.Error())
   612  			case rds.ErrCodeStorageQuotaExceededFault:
   613  				fmt.Println(rds.ErrCodeStorageQuotaExceededFault, aerr.Error())
   614  			case rds.ErrCodeDBInstanceNotFoundFault:
   615  				fmt.Println(rds.ErrCodeDBInstanceNotFoundFault, aerr.Error())
   616  			case rds.ErrCodeInvalidDBInstanceStateFault:
   617  				fmt.Println(rds.ErrCodeInvalidDBInstanceStateFault, aerr.Error())
   618  			case rds.ErrCodeDBSubnetGroupNotFoundFault:
   619  				fmt.Println(rds.ErrCodeDBSubnetGroupNotFoundFault, aerr.Error())
   620  			case rds.ErrCodeDBSubnetGroupDoesNotCoverEnoughAZs:
   621  				fmt.Println(rds.ErrCodeDBSubnetGroupDoesNotCoverEnoughAZs, aerr.Error())
   622  			case rds.ErrCodeInvalidSubnet:
   623  				fmt.Println(rds.ErrCodeInvalidSubnet, aerr.Error())
   624  			case rds.ErrCodeInvalidVPCNetworkStateFault:
   625  				fmt.Println(rds.ErrCodeInvalidVPCNetworkStateFault, aerr.Error())
   626  			case rds.ErrCodeProvisionedIopsNotAvailableInAZFault:
   627  				fmt.Println(rds.ErrCodeProvisionedIopsNotAvailableInAZFault, aerr.Error())
   628  			case rds.ErrCodeOptionGroupNotFoundFault:
   629  				fmt.Println(rds.ErrCodeOptionGroupNotFoundFault, aerr.Error())
   630  			case rds.ErrCodeDBSubnetGroupNotAllowedFault:
   631  				fmt.Println(rds.ErrCodeDBSubnetGroupNotAllowedFault, aerr.Error())
   632  			case rds.ErrCodeInvalidDBSubnetGroupFault:
   633  				fmt.Println(rds.ErrCodeInvalidDBSubnetGroupFault, aerr.Error())
   634  			case rds.ErrCodeStorageTypeNotSupportedFault:
   635  				fmt.Println(rds.ErrCodeStorageTypeNotSupportedFault, aerr.Error())
   636  			case rds.ErrCodeKMSKeyNotAccessibleFault:
   637  				fmt.Println(rds.ErrCodeKMSKeyNotAccessibleFault, aerr.Error())
   638  			case rds.ErrCodeDomainNotFoundFault:
   639  				fmt.Println(rds.ErrCodeDomainNotFoundFault, aerr.Error())
   640  			default:
   641  				fmt.Println(aerr.Error())
   642  			}
   643  		} else {
   644  			// Print the error, cast err to awserr.Error to get the Code and
   645  			// Message from an error.
   646  			fmt.Println(err.Error())
   647  		}
   648  		return
   649  	}
   650  
   651  	fmt.Println(result)
   652  }
   653  
   654  // To create a DB parameter group.
   655  //
   656  // This example creates a DB parameter group.
   657  func ExampleRDS_CreateDBParameterGroup_shared00() {
   658  	svc := rds.New(session.New())
   659  	input := &rds.CreateDBParameterGroupInput{
   660  		DBParameterGroupFamily: aws.String("mysql5.6"),
   661  		DBParameterGroupName:   aws.String("mymysqlparametergroup"),
   662  		Description:            aws.String("My MySQL parameter group"),
   663  	}
   664  
   665  	result, err := svc.CreateDBParameterGroup(input)
   666  	if err != nil {
   667  		if aerr, ok := err.(awserr.Error); ok {
   668  			switch aerr.Code() {
   669  			case rds.ErrCodeDBParameterGroupQuotaExceededFault:
   670  				fmt.Println(rds.ErrCodeDBParameterGroupQuotaExceededFault, aerr.Error())
   671  			case rds.ErrCodeDBParameterGroupAlreadyExistsFault:
   672  				fmt.Println(rds.ErrCodeDBParameterGroupAlreadyExistsFault, aerr.Error())
   673  			default:
   674  				fmt.Println(aerr.Error())
   675  			}
   676  		} else {
   677  			// Print the error, cast err to awserr.Error to get the Code and
   678  			// Message from an error.
   679  			fmt.Println(err.Error())
   680  		}
   681  		return
   682  	}
   683  
   684  	fmt.Println(result)
   685  }
   686  
   687  // To create a DB security group.
   688  //
   689  // This example creates a DB security group.
   690  func ExampleRDS_CreateDBSecurityGroup_shared00() {
   691  	svc := rds.New(session.New())
   692  	input := &rds.CreateDBSecurityGroupInput{
   693  		DBSecurityGroupDescription: aws.String("My DB security group"),
   694  		DBSecurityGroupName:        aws.String("mydbsecuritygroup"),
   695  	}
   696  
   697  	result, err := svc.CreateDBSecurityGroup(input)
   698  	if err != nil {
   699  		if aerr, ok := err.(awserr.Error); ok {
   700  			switch aerr.Code() {
   701  			case rds.ErrCodeDBSecurityGroupAlreadyExistsFault:
   702  				fmt.Println(rds.ErrCodeDBSecurityGroupAlreadyExistsFault, aerr.Error())
   703  			case rds.ErrCodeDBSecurityGroupQuotaExceededFault:
   704  				fmt.Println(rds.ErrCodeDBSecurityGroupQuotaExceededFault, aerr.Error())
   705  			case rds.ErrCodeDBSecurityGroupNotSupportedFault:
   706  				fmt.Println(rds.ErrCodeDBSecurityGroupNotSupportedFault, aerr.Error())
   707  			default:
   708  				fmt.Println(aerr.Error())
   709  			}
   710  		} else {
   711  			// Print the error, cast err to awserr.Error to get the Code and
   712  			// Message from an error.
   713  			fmt.Println(err.Error())
   714  		}
   715  		return
   716  	}
   717  
   718  	fmt.Println(result)
   719  }
   720  
   721  // To create a DB snapshot.
   722  //
   723  // This example creates a DB snapshot.
   724  func ExampleRDS_CreateDBSnapshot_shared00() {
   725  	svc := rds.New(session.New())
   726  	input := &rds.CreateDBSnapshotInput{
   727  		DBInstanceIdentifier: aws.String("mymysqlinstance"),
   728  		DBSnapshotIdentifier: aws.String("mydbsnapshot"),
   729  	}
   730  
   731  	result, err := svc.CreateDBSnapshot(input)
   732  	if err != nil {
   733  		if aerr, ok := err.(awserr.Error); ok {
   734  			switch aerr.Code() {
   735  			case rds.ErrCodeDBSnapshotAlreadyExistsFault:
   736  				fmt.Println(rds.ErrCodeDBSnapshotAlreadyExistsFault, aerr.Error())
   737  			case rds.ErrCodeInvalidDBInstanceStateFault:
   738  				fmt.Println(rds.ErrCodeInvalidDBInstanceStateFault, aerr.Error())
   739  			case rds.ErrCodeDBInstanceNotFoundFault:
   740  				fmt.Println(rds.ErrCodeDBInstanceNotFoundFault, aerr.Error())
   741  			case rds.ErrCodeSnapshotQuotaExceededFault:
   742  				fmt.Println(rds.ErrCodeSnapshotQuotaExceededFault, aerr.Error())
   743  			default:
   744  				fmt.Println(aerr.Error())
   745  			}
   746  		} else {
   747  			// Print the error, cast err to awserr.Error to get the Code and
   748  			// Message from an error.
   749  			fmt.Println(err.Error())
   750  		}
   751  		return
   752  	}
   753  
   754  	fmt.Println(result)
   755  }
   756  
   757  // To create a DB subnet group.
   758  //
   759  // This example creates a DB subnet group.
   760  func ExampleRDS_CreateDBSubnetGroup_shared00() {
   761  	svc := rds.New(session.New())
   762  	input := &rds.CreateDBSubnetGroupInput{
   763  		DBSubnetGroupDescription: aws.String("My DB subnet group"),
   764  		DBSubnetGroupName:        aws.String("mydbsubnetgroup"),
   765  		SubnetIds: []*string{
   766  			aws.String("subnet-1fab8a69"),
   767  			aws.String("subnet-d43a468c"),
   768  		},
   769  	}
   770  
   771  	result, err := svc.CreateDBSubnetGroup(input)
   772  	if err != nil {
   773  		if aerr, ok := err.(awserr.Error); ok {
   774  			switch aerr.Code() {
   775  			case rds.ErrCodeDBSubnetGroupAlreadyExistsFault:
   776  				fmt.Println(rds.ErrCodeDBSubnetGroupAlreadyExistsFault, aerr.Error())
   777  			case rds.ErrCodeDBSubnetGroupQuotaExceededFault:
   778  				fmt.Println(rds.ErrCodeDBSubnetGroupQuotaExceededFault, aerr.Error())
   779  			case rds.ErrCodeDBSubnetQuotaExceededFault:
   780  				fmt.Println(rds.ErrCodeDBSubnetQuotaExceededFault, aerr.Error())
   781  			case rds.ErrCodeDBSubnetGroupDoesNotCoverEnoughAZs:
   782  				fmt.Println(rds.ErrCodeDBSubnetGroupDoesNotCoverEnoughAZs, aerr.Error())
   783  			case rds.ErrCodeInvalidSubnet:
   784  				fmt.Println(rds.ErrCodeInvalidSubnet, aerr.Error())
   785  			default:
   786  				fmt.Println(aerr.Error())
   787  			}
   788  		} else {
   789  			// Print the error, cast err to awserr.Error to get the Code and
   790  			// Message from an error.
   791  			fmt.Println(err.Error())
   792  		}
   793  		return
   794  	}
   795  
   796  	fmt.Println(result)
   797  }
   798  
   799  // To create an event notification subscription
   800  //
   801  // This example creates an event notification subscription.
   802  func ExampleRDS_CreateEventSubscription_shared00() {
   803  	svc := rds.New(session.New())
   804  	input := &rds.CreateEventSubscriptionInput{
   805  		Enabled: aws.Bool(true),
   806  		EventCategories: []*string{
   807  			aws.String("availability"),
   808  		},
   809  		SnsTopicArn: aws.String("arn:aws:sns:us-east-1:992648334831:MyDemoSNSTopic"),
   810  		SourceIds: []*string{
   811  			aws.String("mymysqlinstance"),
   812  		},
   813  		SourceType:       aws.String("db-instance"),
   814  		SubscriptionName: aws.String("mymysqleventsubscription"),
   815  	}
   816  
   817  	result, err := svc.CreateEventSubscription(input)
   818  	if err != nil {
   819  		if aerr, ok := err.(awserr.Error); ok {
   820  			switch aerr.Code() {
   821  			case rds.ErrCodeEventSubscriptionQuotaExceededFault:
   822  				fmt.Println(rds.ErrCodeEventSubscriptionQuotaExceededFault, aerr.Error())
   823  			case rds.ErrCodeSubscriptionAlreadyExistFault:
   824  				fmt.Println(rds.ErrCodeSubscriptionAlreadyExistFault, aerr.Error())
   825  			case rds.ErrCodeSNSInvalidTopicFault:
   826  				fmt.Println(rds.ErrCodeSNSInvalidTopicFault, aerr.Error())
   827  			case rds.ErrCodeSNSNoAuthorizationFault:
   828  				fmt.Println(rds.ErrCodeSNSNoAuthorizationFault, aerr.Error())
   829  			case rds.ErrCodeSNSTopicArnNotFoundFault:
   830  				fmt.Println(rds.ErrCodeSNSTopicArnNotFoundFault, aerr.Error())
   831  			case rds.ErrCodeSubscriptionCategoryNotFoundFault:
   832  				fmt.Println(rds.ErrCodeSubscriptionCategoryNotFoundFault, aerr.Error())
   833  			case rds.ErrCodeSourceNotFoundFault:
   834  				fmt.Println(rds.ErrCodeSourceNotFoundFault, aerr.Error())
   835  			default:
   836  				fmt.Println(aerr.Error())
   837  			}
   838  		} else {
   839  			// Print the error, cast err to awserr.Error to get the Code and
   840  			// Message from an error.
   841  			fmt.Println(err.Error())
   842  		}
   843  		return
   844  	}
   845  
   846  	fmt.Println(result)
   847  }
   848  
   849  // To create an option group
   850  //
   851  // This example creates an option group.
   852  func ExampleRDS_CreateOptionGroup_shared00() {
   853  	svc := rds.New(session.New())
   854  	input := &rds.CreateOptionGroupInput{
   855  		EngineName:             aws.String("MySQL"),
   856  		MajorEngineVersion:     aws.String("5.6"),
   857  		OptionGroupDescription: aws.String("My MySQL 5.6 option group"),
   858  		OptionGroupName:        aws.String("mymysqloptiongroup"),
   859  	}
   860  
   861  	result, err := svc.CreateOptionGroup(input)
   862  	if err != nil {
   863  		if aerr, ok := err.(awserr.Error); ok {
   864  			switch aerr.Code() {
   865  			case rds.ErrCodeOptionGroupAlreadyExistsFault:
   866  				fmt.Println(rds.ErrCodeOptionGroupAlreadyExistsFault, aerr.Error())
   867  			case rds.ErrCodeOptionGroupQuotaExceededFault:
   868  				fmt.Println(rds.ErrCodeOptionGroupQuotaExceededFault, aerr.Error())
   869  			default:
   870  				fmt.Println(aerr.Error())
   871  			}
   872  		} else {
   873  			// Print the error, cast err to awserr.Error to get the Code and
   874  			// Message from an error.
   875  			fmt.Println(err.Error())
   876  		}
   877  		return
   878  	}
   879  
   880  	fmt.Println(result)
   881  }
   882  
   883  // To delete a DB cluster.
   884  //
   885  // This example deletes the specified DB cluster.
   886  func ExampleRDS_DeleteDBCluster_shared00() {
   887  	svc := rds.New(session.New())
   888  	input := &rds.DeleteDBClusterInput{
   889  		DBClusterIdentifier: aws.String("mydbcluster"),
   890  		SkipFinalSnapshot:   aws.Bool(true),
   891  	}
   892  
   893  	result, err := svc.DeleteDBCluster(input)
   894  	if err != nil {
   895  		if aerr, ok := err.(awserr.Error); ok {
   896  			switch aerr.Code() {
   897  			case rds.ErrCodeDBClusterNotFoundFault:
   898  				fmt.Println(rds.ErrCodeDBClusterNotFoundFault, aerr.Error())
   899  			case rds.ErrCodeInvalidDBClusterStateFault:
   900  				fmt.Println(rds.ErrCodeInvalidDBClusterStateFault, aerr.Error())
   901  			case rds.ErrCodeDBClusterSnapshotAlreadyExistsFault:
   902  				fmt.Println(rds.ErrCodeDBClusterSnapshotAlreadyExistsFault, aerr.Error())
   903  			case rds.ErrCodeSnapshotQuotaExceededFault:
   904  				fmt.Println(rds.ErrCodeSnapshotQuotaExceededFault, aerr.Error())
   905  			case rds.ErrCodeInvalidDBClusterSnapshotStateFault:
   906  				fmt.Println(rds.ErrCodeInvalidDBClusterSnapshotStateFault, aerr.Error())
   907  			default:
   908  				fmt.Println(aerr.Error())
   909  			}
   910  		} else {
   911  			// Print the error, cast err to awserr.Error to get the Code and
   912  			// Message from an error.
   913  			fmt.Println(err.Error())
   914  		}
   915  		return
   916  	}
   917  
   918  	fmt.Println(result)
   919  }
   920  
   921  // To delete a DB cluster parameter group.
   922  //
   923  // This example deletes the specified DB cluster parameter group.
   924  func ExampleRDS_DeleteDBClusterParameterGroup_shared00() {
   925  	svc := rds.New(session.New())
   926  	input := &rds.DeleteDBClusterParameterGroupInput{
   927  		DBClusterParameterGroupName: aws.String("mydbclusterparametergroup"),
   928  	}
   929  
   930  	result, err := svc.DeleteDBClusterParameterGroup(input)
   931  	if err != nil {
   932  		if aerr, ok := err.(awserr.Error); ok {
   933  			switch aerr.Code() {
   934  			case rds.ErrCodeInvalidDBParameterGroupStateFault:
   935  				fmt.Println(rds.ErrCodeInvalidDBParameterGroupStateFault, aerr.Error())
   936  			case rds.ErrCodeDBParameterGroupNotFoundFault:
   937  				fmt.Println(rds.ErrCodeDBParameterGroupNotFoundFault, aerr.Error())
   938  			default:
   939  				fmt.Println(aerr.Error())
   940  			}
   941  		} else {
   942  			// Print the error, cast err to awserr.Error to get the Code and
   943  			// Message from an error.
   944  			fmt.Println(err.Error())
   945  		}
   946  		return
   947  	}
   948  
   949  	fmt.Println(result)
   950  }
   951  
   952  // To delete a DB cluster snapshot.
   953  //
   954  // This example deletes the specified DB cluster snapshot.
   955  func ExampleRDS_DeleteDBClusterSnapshot_shared00() {
   956  	svc := rds.New(session.New())
   957  	input := &rds.DeleteDBClusterSnapshotInput{
   958  		DBClusterSnapshotIdentifier: aws.String("mydbclustersnapshot"),
   959  	}
   960  
   961  	result, err := svc.DeleteDBClusterSnapshot(input)
   962  	if err != nil {
   963  		if aerr, ok := err.(awserr.Error); ok {
   964  			switch aerr.Code() {
   965  			case rds.ErrCodeInvalidDBClusterSnapshotStateFault:
   966  				fmt.Println(rds.ErrCodeInvalidDBClusterSnapshotStateFault, aerr.Error())
   967  			case rds.ErrCodeDBClusterSnapshotNotFoundFault:
   968  				fmt.Println(rds.ErrCodeDBClusterSnapshotNotFoundFault, aerr.Error())
   969  			default:
   970  				fmt.Println(aerr.Error())
   971  			}
   972  		} else {
   973  			// Print the error, cast err to awserr.Error to get the Code and
   974  			// Message from an error.
   975  			fmt.Println(err.Error())
   976  		}
   977  		return
   978  	}
   979  
   980  	fmt.Println(result)
   981  }
   982  
   983  // To delete a DB instance.
   984  //
   985  // This example deletes the specified DB instance.
   986  func ExampleRDS_DeleteDBInstance_shared00() {
   987  	svc := rds.New(session.New())
   988  	input := &rds.DeleteDBInstanceInput{
   989  		DBInstanceIdentifier: aws.String("mymysqlinstance"),
   990  		SkipFinalSnapshot:    aws.Bool(true),
   991  	}
   992  
   993  	result, err := svc.DeleteDBInstance(input)
   994  	if err != nil {
   995  		if aerr, ok := err.(awserr.Error); ok {
   996  			switch aerr.Code() {
   997  			case rds.ErrCodeDBInstanceNotFoundFault:
   998  				fmt.Println(rds.ErrCodeDBInstanceNotFoundFault, aerr.Error())
   999  			case rds.ErrCodeInvalidDBInstanceStateFault:
  1000  				fmt.Println(rds.ErrCodeInvalidDBInstanceStateFault, aerr.Error())
  1001  			case rds.ErrCodeDBSnapshotAlreadyExistsFault:
  1002  				fmt.Println(rds.ErrCodeDBSnapshotAlreadyExistsFault, aerr.Error())
  1003  			case rds.ErrCodeSnapshotQuotaExceededFault:
  1004  				fmt.Println(rds.ErrCodeSnapshotQuotaExceededFault, aerr.Error())
  1005  			case rds.ErrCodeInvalidDBClusterStateFault:
  1006  				fmt.Println(rds.ErrCodeInvalidDBClusterStateFault, aerr.Error())
  1007  			case rds.ErrCodeDBInstanceAutomatedBackupQuotaExceededFault:
  1008  				fmt.Println(rds.ErrCodeDBInstanceAutomatedBackupQuotaExceededFault, aerr.Error())
  1009  			default:
  1010  				fmt.Println(aerr.Error())
  1011  			}
  1012  		} else {
  1013  			// Print the error, cast err to awserr.Error to get the Code and
  1014  			// Message from an error.
  1015  			fmt.Println(err.Error())
  1016  		}
  1017  		return
  1018  	}
  1019  
  1020  	fmt.Println(result)
  1021  }
  1022  
  1023  // To delete a DB parameter group
  1024  //
  1025  // The following example deletes a DB parameter group.
  1026  func ExampleRDS_DeleteDBParameterGroup_shared00() {
  1027  	svc := rds.New(session.New())
  1028  	input := &rds.DeleteDBParameterGroupInput{
  1029  		DBParameterGroupName: aws.String("mydbparamgroup3"),
  1030  	}
  1031  
  1032  	result, err := svc.DeleteDBParameterGroup(input)
  1033  	if err != nil {
  1034  		if aerr, ok := err.(awserr.Error); ok {
  1035  			switch aerr.Code() {
  1036  			case rds.ErrCodeInvalidDBParameterGroupStateFault:
  1037  				fmt.Println(rds.ErrCodeInvalidDBParameterGroupStateFault, aerr.Error())
  1038  			case rds.ErrCodeDBParameterGroupNotFoundFault:
  1039  				fmt.Println(rds.ErrCodeDBParameterGroupNotFoundFault, aerr.Error())
  1040  			default:
  1041  				fmt.Println(aerr.Error())
  1042  			}
  1043  		} else {
  1044  			// Print the error, cast err to awserr.Error to get the Code and
  1045  			// Message from an error.
  1046  			fmt.Println(err.Error())
  1047  		}
  1048  		return
  1049  	}
  1050  
  1051  	fmt.Println(result)
  1052  }
  1053  
  1054  // To delete a DB security group
  1055  //
  1056  // The following example deletes a DB security group.
  1057  func ExampleRDS_DeleteDBSecurityGroup_shared00() {
  1058  	svc := rds.New(session.New())
  1059  	input := &rds.DeleteDBSecurityGroupInput{
  1060  		DBSecurityGroupName: aws.String("mysecgroup"),
  1061  	}
  1062  
  1063  	result, err := svc.DeleteDBSecurityGroup(input)
  1064  	if err != nil {
  1065  		if aerr, ok := err.(awserr.Error); ok {
  1066  			switch aerr.Code() {
  1067  			case rds.ErrCodeInvalidDBSecurityGroupStateFault:
  1068  				fmt.Println(rds.ErrCodeInvalidDBSecurityGroupStateFault, aerr.Error())
  1069  			case rds.ErrCodeDBSecurityGroupNotFoundFault:
  1070  				fmt.Println(rds.ErrCodeDBSecurityGroupNotFoundFault, aerr.Error())
  1071  			default:
  1072  				fmt.Println(aerr.Error())
  1073  			}
  1074  		} else {
  1075  			// Print the error, cast err to awserr.Error to get the Code and
  1076  			// Message from an error.
  1077  			fmt.Println(err.Error())
  1078  		}
  1079  		return
  1080  	}
  1081  
  1082  	fmt.Println(result)
  1083  }
  1084  
  1085  // To delete a DB cluster snapshot.
  1086  //
  1087  // This example deletes the specified DB snapshot.
  1088  func ExampleRDS_DeleteDBSnapshot_shared00() {
  1089  	svc := rds.New(session.New())
  1090  	input := &rds.DeleteDBSnapshotInput{
  1091  		DBSnapshotIdentifier: aws.String("mydbsnapshot"),
  1092  	}
  1093  
  1094  	result, err := svc.DeleteDBSnapshot(input)
  1095  	if err != nil {
  1096  		if aerr, ok := err.(awserr.Error); ok {
  1097  			switch aerr.Code() {
  1098  			case rds.ErrCodeInvalidDBSnapshotStateFault:
  1099  				fmt.Println(rds.ErrCodeInvalidDBSnapshotStateFault, aerr.Error())
  1100  			case rds.ErrCodeDBSnapshotNotFoundFault:
  1101  				fmt.Println(rds.ErrCodeDBSnapshotNotFoundFault, aerr.Error())
  1102  			default:
  1103  				fmt.Println(aerr.Error())
  1104  			}
  1105  		} else {
  1106  			// Print the error, cast err to awserr.Error to get the Code and
  1107  			// Message from an error.
  1108  			fmt.Println(err.Error())
  1109  		}
  1110  		return
  1111  	}
  1112  
  1113  	fmt.Println(result)
  1114  }
  1115  
  1116  // To delete a DB subnet group.
  1117  //
  1118  // This example deletes the specified DB subnetgroup.
  1119  func ExampleRDS_DeleteDBSubnetGroup_shared00() {
  1120  	svc := rds.New(session.New())
  1121  	input := &rds.DeleteDBSubnetGroupInput{
  1122  		DBSubnetGroupName: aws.String("mydbsubnetgroup"),
  1123  	}
  1124  
  1125  	result, err := svc.DeleteDBSubnetGroup(input)
  1126  	if err != nil {
  1127  		if aerr, ok := err.(awserr.Error); ok {
  1128  			switch aerr.Code() {
  1129  			case rds.ErrCodeInvalidDBSubnetGroupStateFault:
  1130  				fmt.Println(rds.ErrCodeInvalidDBSubnetGroupStateFault, aerr.Error())
  1131  			case rds.ErrCodeInvalidDBSubnetStateFault:
  1132  				fmt.Println(rds.ErrCodeInvalidDBSubnetStateFault, aerr.Error())
  1133  			case rds.ErrCodeDBSubnetGroupNotFoundFault:
  1134  				fmt.Println(rds.ErrCodeDBSubnetGroupNotFoundFault, aerr.Error())
  1135  			default:
  1136  				fmt.Println(aerr.Error())
  1137  			}
  1138  		} else {
  1139  			// Print the error, cast err to awserr.Error to get the Code and
  1140  			// Message from an error.
  1141  			fmt.Println(err.Error())
  1142  		}
  1143  		return
  1144  	}
  1145  
  1146  	fmt.Println(result)
  1147  }
  1148  
  1149  // To delete a DB event subscription.
  1150  //
  1151  // This example deletes the specified DB event subscription.
  1152  func ExampleRDS_DeleteEventSubscription_shared00() {
  1153  	svc := rds.New(session.New())
  1154  	input := &rds.DeleteEventSubscriptionInput{
  1155  		SubscriptionName: aws.String("myeventsubscription"),
  1156  	}
  1157  
  1158  	result, err := svc.DeleteEventSubscription(input)
  1159  	if err != nil {
  1160  		if aerr, ok := err.(awserr.Error); ok {
  1161  			switch aerr.Code() {
  1162  			case rds.ErrCodeSubscriptionNotFoundFault:
  1163  				fmt.Println(rds.ErrCodeSubscriptionNotFoundFault, aerr.Error())
  1164  			case rds.ErrCodeInvalidEventSubscriptionStateFault:
  1165  				fmt.Println(rds.ErrCodeInvalidEventSubscriptionStateFault, aerr.Error())
  1166  			default:
  1167  				fmt.Println(aerr.Error())
  1168  			}
  1169  		} else {
  1170  			// Print the error, cast err to awserr.Error to get the Code and
  1171  			// Message from an error.
  1172  			fmt.Println(err.Error())
  1173  		}
  1174  		return
  1175  	}
  1176  
  1177  	fmt.Println(result)
  1178  }
  1179  
  1180  // To delete an option group.
  1181  //
  1182  // This example deletes the specified option group.
  1183  func ExampleRDS_DeleteOptionGroup_shared00() {
  1184  	svc := rds.New(session.New())
  1185  	input := &rds.DeleteOptionGroupInput{
  1186  		OptionGroupName: aws.String("mydboptiongroup"),
  1187  	}
  1188  
  1189  	result, err := svc.DeleteOptionGroup(input)
  1190  	if err != nil {
  1191  		if aerr, ok := err.(awserr.Error); ok {
  1192  			switch aerr.Code() {
  1193  			case rds.ErrCodeOptionGroupNotFoundFault:
  1194  				fmt.Println(rds.ErrCodeOptionGroupNotFoundFault, aerr.Error())
  1195  			case rds.ErrCodeInvalidOptionGroupStateFault:
  1196  				fmt.Println(rds.ErrCodeInvalidOptionGroupStateFault, aerr.Error())
  1197  			default:
  1198  				fmt.Println(aerr.Error())
  1199  			}
  1200  		} else {
  1201  			// Print the error, cast err to awserr.Error to get the Code and
  1202  			// Message from an error.
  1203  			fmt.Println(err.Error())
  1204  		}
  1205  		return
  1206  	}
  1207  
  1208  	fmt.Println(result)
  1209  }
  1210  
  1211  // To list account attributes
  1212  //
  1213  // This example lists account attributes.
  1214  func ExampleRDS_DescribeAccountAttributes_shared00() {
  1215  	svc := rds.New(session.New())
  1216  	input := &rds.DescribeAccountAttributesInput{}
  1217  
  1218  	result, err := svc.DescribeAccountAttributes(input)
  1219  	if err != nil {
  1220  		if aerr, ok := err.(awserr.Error); ok {
  1221  			switch aerr.Code() {
  1222  			default:
  1223  				fmt.Println(aerr.Error())
  1224  			}
  1225  		} else {
  1226  			// Print the error, cast err to awserr.Error to get the Code and
  1227  			// Message from an error.
  1228  			fmt.Println(err.Error())
  1229  		}
  1230  		return
  1231  	}
  1232  
  1233  	fmt.Println(result)
  1234  }
  1235  
  1236  // To list certificates
  1237  //
  1238  // This example lists up to 20 certificates for the specified certificate identifier.
  1239  func ExampleRDS_DescribeCertificates_shared00() {
  1240  	svc := rds.New(session.New())
  1241  	input := &rds.DescribeCertificatesInput{
  1242  		CertificateIdentifier: aws.String("rds-ca-2015"),
  1243  		MaxRecords:            aws.Int64(20),
  1244  	}
  1245  
  1246  	result, err := svc.DescribeCertificates(input)
  1247  	if err != nil {
  1248  		if aerr, ok := err.(awserr.Error); ok {
  1249  			switch aerr.Code() {
  1250  			case rds.ErrCodeCertificateNotFoundFault:
  1251  				fmt.Println(rds.ErrCodeCertificateNotFoundFault, aerr.Error())
  1252  			default:
  1253  				fmt.Println(aerr.Error())
  1254  			}
  1255  		} else {
  1256  			// Print the error, cast err to awserr.Error to get the Code and
  1257  			// Message from an error.
  1258  			fmt.Println(err.Error())
  1259  		}
  1260  		return
  1261  	}
  1262  
  1263  	fmt.Println(result)
  1264  }
  1265  
  1266  // To list DB cluster parameter group settings
  1267  //
  1268  // This example lists settings for the specified DB cluster parameter group.
  1269  func ExampleRDS_DescribeDBClusterParameterGroups_shared00() {
  1270  	svc := rds.New(session.New())
  1271  	input := &rds.DescribeDBClusterParameterGroupsInput{
  1272  		DBClusterParameterGroupName: aws.String("mydbclusterparametergroup"),
  1273  	}
  1274  
  1275  	result, err := svc.DescribeDBClusterParameterGroups(input)
  1276  	if err != nil {
  1277  		if aerr, ok := err.(awserr.Error); ok {
  1278  			switch aerr.Code() {
  1279  			case rds.ErrCodeDBParameterGroupNotFoundFault:
  1280  				fmt.Println(rds.ErrCodeDBParameterGroupNotFoundFault, aerr.Error())
  1281  			default:
  1282  				fmt.Println(aerr.Error())
  1283  			}
  1284  		} else {
  1285  			// Print the error, cast err to awserr.Error to get the Code and
  1286  			// Message from an error.
  1287  			fmt.Println(err.Error())
  1288  		}
  1289  		return
  1290  	}
  1291  
  1292  	fmt.Println(result)
  1293  }
  1294  
  1295  // To list DB cluster parameters
  1296  //
  1297  // This example lists system parameters for the specified DB cluster parameter group.
  1298  func ExampleRDS_DescribeDBClusterParameters_shared00() {
  1299  	svc := rds.New(session.New())
  1300  	input := &rds.DescribeDBClusterParametersInput{
  1301  		DBClusterParameterGroupName: aws.String("mydbclusterparametergroup"),
  1302  		Source:                      aws.String("system"),
  1303  	}
  1304  
  1305  	result, err := svc.DescribeDBClusterParameters(input)
  1306  	if err != nil {
  1307  		if aerr, ok := err.(awserr.Error); ok {
  1308  			switch aerr.Code() {
  1309  			case rds.ErrCodeDBParameterGroupNotFoundFault:
  1310  				fmt.Println(rds.ErrCodeDBParameterGroupNotFoundFault, aerr.Error())
  1311  			default:
  1312  				fmt.Println(aerr.Error())
  1313  			}
  1314  		} else {
  1315  			// Print the error, cast err to awserr.Error to get the Code and
  1316  			// Message from an error.
  1317  			fmt.Println(err.Error())
  1318  		}
  1319  		return
  1320  	}
  1321  
  1322  	fmt.Println(result)
  1323  }
  1324  
  1325  // To list DB cluster snapshot attributes
  1326  //
  1327  // This example lists attributes for the specified DB cluster snapshot.
  1328  func ExampleRDS_DescribeDBClusterSnapshotAttributes_shared00() {
  1329  	svc := rds.New(session.New())
  1330  	input := &rds.DescribeDBClusterSnapshotAttributesInput{
  1331  		DBClusterSnapshotIdentifier: aws.String("mydbclustersnapshot"),
  1332  	}
  1333  
  1334  	result, err := svc.DescribeDBClusterSnapshotAttributes(input)
  1335  	if err != nil {
  1336  		if aerr, ok := err.(awserr.Error); ok {
  1337  			switch aerr.Code() {
  1338  			case rds.ErrCodeDBClusterSnapshotNotFoundFault:
  1339  				fmt.Println(rds.ErrCodeDBClusterSnapshotNotFoundFault, aerr.Error())
  1340  			default:
  1341  				fmt.Println(aerr.Error())
  1342  			}
  1343  		} else {
  1344  			// Print the error, cast err to awserr.Error to get the Code and
  1345  			// Message from an error.
  1346  			fmt.Println(err.Error())
  1347  		}
  1348  		return
  1349  	}
  1350  
  1351  	fmt.Println(result)
  1352  }
  1353  
  1354  // To list DB cluster snapshots
  1355  //
  1356  // This example lists settings for the specified, manually-created cluster snapshot.
  1357  func ExampleRDS_DescribeDBClusterSnapshots_shared00() {
  1358  	svc := rds.New(session.New())
  1359  	input := &rds.DescribeDBClusterSnapshotsInput{
  1360  		DBClusterSnapshotIdentifier: aws.String("mydbclustersnapshot"),
  1361  		SnapshotType:                aws.String("manual"),
  1362  	}
  1363  
  1364  	result, err := svc.DescribeDBClusterSnapshots(input)
  1365  	if err != nil {
  1366  		if aerr, ok := err.(awserr.Error); ok {
  1367  			switch aerr.Code() {
  1368  			case rds.ErrCodeDBClusterSnapshotNotFoundFault:
  1369  				fmt.Println(rds.ErrCodeDBClusterSnapshotNotFoundFault, aerr.Error())
  1370  			default:
  1371  				fmt.Println(aerr.Error())
  1372  			}
  1373  		} else {
  1374  			// Print the error, cast err to awserr.Error to get the Code and
  1375  			// Message from an error.
  1376  			fmt.Println(err.Error())
  1377  		}
  1378  		return
  1379  	}
  1380  
  1381  	fmt.Println(result)
  1382  }
  1383  
  1384  // To list DB clusters
  1385  //
  1386  // This example lists settings for the specified DB cluster.
  1387  func ExampleRDS_DescribeDBClusters_shared00() {
  1388  	svc := rds.New(session.New())
  1389  	input := &rds.DescribeDBClustersInput{
  1390  		DBClusterIdentifier: aws.String("mynewdbcluster"),
  1391  	}
  1392  
  1393  	result, err := svc.DescribeDBClusters(input)
  1394  	if err != nil {
  1395  		if aerr, ok := err.(awserr.Error); ok {
  1396  			switch aerr.Code() {
  1397  			case rds.ErrCodeDBClusterNotFoundFault:
  1398  				fmt.Println(rds.ErrCodeDBClusterNotFoundFault, aerr.Error())
  1399  			default:
  1400  				fmt.Println(aerr.Error())
  1401  			}
  1402  		} else {
  1403  			// Print the error, cast err to awserr.Error to get the Code and
  1404  			// Message from an error.
  1405  			fmt.Println(err.Error())
  1406  		}
  1407  		return
  1408  	}
  1409  
  1410  	fmt.Println(result)
  1411  }
  1412  
  1413  // To list DB engine version settings
  1414  //
  1415  // This example lists settings for the specified DB engine version.
  1416  func ExampleRDS_DescribeDBEngineVersions_shared00() {
  1417  	svc := rds.New(session.New())
  1418  	input := &rds.DescribeDBEngineVersionsInput{
  1419  		DBParameterGroupFamily:     aws.String("mysql5.6"),
  1420  		DefaultOnly:                aws.Bool(true),
  1421  		Engine:                     aws.String("mysql"),
  1422  		EngineVersion:              aws.String("5.6"),
  1423  		ListSupportedCharacterSets: aws.Bool(true),
  1424  	}
  1425  
  1426  	result, err := svc.DescribeDBEngineVersions(input)
  1427  	if err != nil {
  1428  		if aerr, ok := err.(awserr.Error); ok {
  1429  			switch aerr.Code() {
  1430  			default:
  1431  				fmt.Println(aerr.Error())
  1432  			}
  1433  		} else {
  1434  			// Print the error, cast err to awserr.Error to get the Code and
  1435  			// Message from an error.
  1436  			fmt.Println(err.Error())
  1437  		}
  1438  		return
  1439  	}
  1440  
  1441  	fmt.Println(result)
  1442  }
  1443  
  1444  // To list DB instance settings
  1445  //
  1446  // This example lists settings for the specified DB instance.
  1447  func ExampleRDS_DescribeDBInstances_shared00() {
  1448  	svc := rds.New(session.New())
  1449  	input := &rds.DescribeDBInstancesInput{
  1450  		DBInstanceIdentifier: aws.String("mymysqlinstance"),
  1451  	}
  1452  
  1453  	result, err := svc.DescribeDBInstances(input)
  1454  	if err != nil {
  1455  		if aerr, ok := err.(awserr.Error); ok {
  1456  			switch aerr.Code() {
  1457  			case rds.ErrCodeDBInstanceNotFoundFault:
  1458  				fmt.Println(rds.ErrCodeDBInstanceNotFoundFault, aerr.Error())
  1459  			default:
  1460  				fmt.Println(aerr.Error())
  1461  			}
  1462  		} else {
  1463  			// Print the error, cast err to awserr.Error to get the Code and
  1464  			// Message from an error.
  1465  			fmt.Println(err.Error())
  1466  		}
  1467  		return
  1468  	}
  1469  
  1470  	fmt.Println(result)
  1471  }
  1472  
  1473  // To list DB log file names
  1474  //
  1475  // This example lists matching log file names for the specified DB instance, file name
  1476  // pattern, last write date in POSIX time with milleseconds, and minimum file size.
  1477  func ExampleRDS_DescribeDBLogFiles_shared00() {
  1478  	svc := rds.New(session.New())
  1479  	input := &rds.DescribeDBLogFilesInput{
  1480  		DBInstanceIdentifier: aws.String("mymysqlinstance"),
  1481  		FileLastWritten:      aws.Int64(1470873600000),
  1482  		FileSize:             aws.Int64(0),
  1483  		FilenameContains:     aws.String("error"),
  1484  	}
  1485  
  1486  	result, err := svc.DescribeDBLogFiles(input)
  1487  	if err != nil {
  1488  		if aerr, ok := err.(awserr.Error); ok {
  1489  			switch aerr.Code() {
  1490  			case rds.ErrCodeDBInstanceNotFoundFault:
  1491  				fmt.Println(rds.ErrCodeDBInstanceNotFoundFault, aerr.Error())
  1492  			default:
  1493  				fmt.Println(aerr.Error())
  1494  			}
  1495  		} else {
  1496  			// Print the error, cast err to awserr.Error to get the Code and
  1497  			// Message from an error.
  1498  			fmt.Println(err.Error())
  1499  		}
  1500  		return
  1501  	}
  1502  
  1503  	fmt.Println(result)
  1504  }
  1505  
  1506  // To list information about DB parameter groups
  1507  //
  1508  // This example lists information about the specified DB parameter group.
  1509  func ExampleRDS_DescribeDBParameterGroups_shared00() {
  1510  	svc := rds.New(session.New())
  1511  	input := &rds.DescribeDBParameterGroupsInput{
  1512  		DBParameterGroupName: aws.String("mymysqlparametergroup"),
  1513  	}
  1514  
  1515  	result, err := svc.DescribeDBParameterGroups(input)
  1516  	if err != nil {
  1517  		if aerr, ok := err.(awserr.Error); ok {
  1518  			switch aerr.Code() {
  1519  			case rds.ErrCodeDBParameterGroupNotFoundFault:
  1520  				fmt.Println(rds.ErrCodeDBParameterGroupNotFoundFault, aerr.Error())
  1521  			default:
  1522  				fmt.Println(aerr.Error())
  1523  			}
  1524  		} else {
  1525  			// Print the error, cast err to awserr.Error to get the Code and
  1526  			// Message from an error.
  1527  			fmt.Println(err.Error())
  1528  		}
  1529  		return
  1530  	}
  1531  
  1532  	fmt.Println(result)
  1533  }
  1534  
  1535  // To list information about DB parameters
  1536  //
  1537  // This example lists information for up to the first 20 system parameters for the specified
  1538  // DB parameter group.
  1539  func ExampleRDS_DescribeDBParameters_shared00() {
  1540  	svc := rds.New(session.New())
  1541  	input := &rds.DescribeDBParametersInput{
  1542  		DBParameterGroupName: aws.String("mymysqlparametergroup"),
  1543  		MaxRecords:           aws.Int64(20),
  1544  		Source:               aws.String("system"),
  1545  	}
  1546  
  1547  	result, err := svc.DescribeDBParameters(input)
  1548  	if err != nil {
  1549  		if aerr, ok := err.(awserr.Error); ok {
  1550  			switch aerr.Code() {
  1551  			case rds.ErrCodeDBParameterGroupNotFoundFault:
  1552  				fmt.Println(rds.ErrCodeDBParameterGroupNotFoundFault, aerr.Error())
  1553  			default:
  1554  				fmt.Println(aerr.Error())
  1555  			}
  1556  		} else {
  1557  			// Print the error, cast err to awserr.Error to get the Code and
  1558  			// Message from an error.
  1559  			fmt.Println(err.Error())
  1560  		}
  1561  		return
  1562  	}
  1563  
  1564  	fmt.Println(result)
  1565  }
  1566  
  1567  // To list DB security group settings
  1568  //
  1569  // This example lists settings for the specified security group.
  1570  func ExampleRDS_DescribeDBSecurityGroups_shared00() {
  1571  	svc := rds.New(session.New())
  1572  	input := &rds.DescribeDBSecurityGroupsInput{
  1573  		DBSecurityGroupName: aws.String("mydbsecuritygroup"),
  1574  	}
  1575  
  1576  	result, err := svc.DescribeDBSecurityGroups(input)
  1577  	if err != nil {
  1578  		if aerr, ok := err.(awserr.Error); ok {
  1579  			switch aerr.Code() {
  1580  			case rds.ErrCodeDBSecurityGroupNotFoundFault:
  1581  				fmt.Println(rds.ErrCodeDBSecurityGroupNotFoundFault, aerr.Error())
  1582  			default:
  1583  				fmt.Println(aerr.Error())
  1584  			}
  1585  		} else {
  1586  			// Print the error, cast err to awserr.Error to get the Code and
  1587  			// Message from an error.
  1588  			fmt.Println(err.Error())
  1589  		}
  1590  		return
  1591  	}
  1592  
  1593  	fmt.Println(result)
  1594  }
  1595  
  1596  // To list DB snapshot attributes
  1597  //
  1598  // This example lists attributes for the specified DB snapshot.
  1599  func ExampleRDS_DescribeDBSnapshotAttributes_shared00() {
  1600  	svc := rds.New(session.New())
  1601  	input := &rds.DescribeDBSnapshotAttributesInput{
  1602  		DBSnapshotIdentifier: aws.String("mydbsnapshot"),
  1603  	}
  1604  
  1605  	result, err := svc.DescribeDBSnapshotAttributes(input)
  1606  	if err != nil {
  1607  		if aerr, ok := err.(awserr.Error); ok {
  1608  			switch aerr.Code() {
  1609  			case rds.ErrCodeDBSnapshotNotFoundFault:
  1610  				fmt.Println(rds.ErrCodeDBSnapshotNotFoundFault, aerr.Error())
  1611  			default:
  1612  				fmt.Println(aerr.Error())
  1613  			}
  1614  		} else {
  1615  			// Print the error, cast err to awserr.Error to get the Code and
  1616  			// Message from an error.
  1617  			fmt.Println(err.Error())
  1618  		}
  1619  		return
  1620  	}
  1621  
  1622  	fmt.Println(result)
  1623  }
  1624  
  1625  // To list DB snapshot attributes
  1626  //
  1627  // This example lists all manually-created, shared snapshots for the specified DB instance.
  1628  func ExampleRDS_DescribeDBSnapshots_shared00() {
  1629  	svc := rds.New(session.New())
  1630  	input := &rds.DescribeDBSnapshotsInput{
  1631  		DBInstanceIdentifier: aws.String("mymysqlinstance"),
  1632  		IncludePublic:        aws.Bool(false),
  1633  		IncludeShared:        aws.Bool(true),
  1634  		SnapshotType:         aws.String("manual"),
  1635  	}
  1636  
  1637  	result, err := svc.DescribeDBSnapshots(input)
  1638  	if err != nil {
  1639  		if aerr, ok := err.(awserr.Error); ok {
  1640  			switch aerr.Code() {
  1641  			case rds.ErrCodeDBSnapshotNotFoundFault:
  1642  				fmt.Println(rds.ErrCodeDBSnapshotNotFoundFault, aerr.Error())
  1643  			default:
  1644  				fmt.Println(aerr.Error())
  1645  			}
  1646  		} else {
  1647  			// Print the error, cast err to awserr.Error to get the Code and
  1648  			// Message from an error.
  1649  			fmt.Println(err.Error())
  1650  		}
  1651  		return
  1652  	}
  1653  
  1654  	fmt.Println(result)
  1655  }
  1656  
  1657  // To list information about DB subnet groups
  1658  //
  1659  // This example lists information about the specified DB subnet group.
  1660  func ExampleRDS_DescribeDBSubnetGroups_shared00() {
  1661  	svc := rds.New(session.New())
  1662  	input := &rds.DescribeDBSubnetGroupsInput{
  1663  		DBSubnetGroupName: aws.String("mydbsubnetgroup"),
  1664  	}
  1665  
  1666  	result, err := svc.DescribeDBSubnetGroups(input)
  1667  	if err != nil {
  1668  		if aerr, ok := err.(awserr.Error); ok {
  1669  			switch aerr.Code() {
  1670  			case rds.ErrCodeDBSubnetGroupNotFoundFault:
  1671  				fmt.Println(rds.ErrCodeDBSubnetGroupNotFoundFault, aerr.Error())
  1672  			default:
  1673  				fmt.Println(aerr.Error())
  1674  			}
  1675  		} else {
  1676  			// Print the error, cast err to awserr.Error to get the Code and
  1677  			// Message from an error.
  1678  			fmt.Println(err.Error())
  1679  		}
  1680  		return
  1681  	}
  1682  
  1683  	fmt.Println(result)
  1684  }
  1685  
  1686  // To list default parameters for a DB cluster engine
  1687  //
  1688  // This example lists default parameters for the specified DB cluster engine.
  1689  func ExampleRDS_DescribeEngineDefaultClusterParameters_shared00() {
  1690  	svc := rds.New(session.New())
  1691  	input := &rds.DescribeEngineDefaultClusterParametersInput{
  1692  		DBParameterGroupFamily: aws.String("aurora5.6"),
  1693  	}
  1694  
  1695  	result, err := svc.DescribeEngineDefaultClusterParameters(input)
  1696  	if err != nil {
  1697  		if aerr, ok := err.(awserr.Error); ok {
  1698  			switch aerr.Code() {
  1699  			default:
  1700  				fmt.Println(aerr.Error())
  1701  			}
  1702  		} else {
  1703  			// Print the error, cast err to awserr.Error to get the Code and
  1704  			// Message from an error.
  1705  			fmt.Println(err.Error())
  1706  		}
  1707  		return
  1708  	}
  1709  
  1710  	fmt.Println(result)
  1711  }
  1712  
  1713  // To list default parameters for a DB engine
  1714  //
  1715  // This example lists default parameters for the specified DB engine.
  1716  func ExampleRDS_DescribeEngineDefaultParameters_shared00() {
  1717  	svc := rds.New(session.New())
  1718  	input := &rds.DescribeEngineDefaultParametersInput{
  1719  		DBParameterGroupFamily: aws.String("mysql5.6"),
  1720  	}
  1721  
  1722  	result, err := svc.DescribeEngineDefaultParameters(input)
  1723  	if err != nil {
  1724  		if aerr, ok := err.(awserr.Error); ok {
  1725  			switch aerr.Code() {
  1726  			default:
  1727  				fmt.Println(aerr.Error())
  1728  			}
  1729  		} else {
  1730  			// Print the error, cast err to awserr.Error to get the Code and
  1731  			// Message from an error.
  1732  			fmt.Println(err.Error())
  1733  		}
  1734  		return
  1735  	}
  1736  
  1737  	fmt.Println(result)
  1738  }
  1739  
  1740  // To list event categories.
  1741  //
  1742  // This example lists all DB instance event categories.
  1743  func ExampleRDS_DescribeEventCategories_shared00() {
  1744  	svc := rds.New(session.New())
  1745  	input := &rds.DescribeEventCategoriesInput{
  1746  		SourceType: aws.String("db-instance"),
  1747  	}
  1748  
  1749  	result, err := svc.DescribeEventCategories(input)
  1750  	if err != nil {
  1751  		if aerr, ok := err.(awserr.Error); ok {
  1752  			switch aerr.Code() {
  1753  			default:
  1754  				fmt.Println(aerr.Error())
  1755  			}
  1756  		} else {
  1757  			// Print the error, cast err to awserr.Error to get the Code and
  1758  			// Message from an error.
  1759  			fmt.Println(err.Error())
  1760  		}
  1761  		return
  1762  	}
  1763  
  1764  	fmt.Println(result)
  1765  }
  1766  
  1767  // To list information about DB event notification subscriptions
  1768  //
  1769  // This example lists information for the specified DB event notification subscription.
  1770  func ExampleRDS_DescribeEventSubscriptions_shared00() {
  1771  	svc := rds.New(session.New())
  1772  	input := &rds.DescribeEventSubscriptionsInput{
  1773  		SubscriptionName: aws.String("mymysqleventsubscription"),
  1774  	}
  1775  
  1776  	result, err := svc.DescribeEventSubscriptions(input)
  1777  	if err != nil {
  1778  		if aerr, ok := err.(awserr.Error); ok {
  1779  			switch aerr.Code() {
  1780  			case rds.ErrCodeSubscriptionNotFoundFault:
  1781  				fmt.Println(rds.ErrCodeSubscriptionNotFoundFault, aerr.Error())
  1782  			default:
  1783  				fmt.Println(aerr.Error())
  1784  			}
  1785  		} else {
  1786  			// Print the error, cast err to awserr.Error to get the Code and
  1787  			// Message from an error.
  1788  			fmt.Println(err.Error())
  1789  		}
  1790  		return
  1791  	}
  1792  
  1793  	fmt.Println(result)
  1794  }
  1795  
  1796  // To list information about events
  1797  //
  1798  // This example lists information for all backup-related events for the specified DB
  1799  // instance for the past 7 days (7 days * 24 hours * 60 minutes = 10,080 minutes).
  1800  func ExampleRDS_DescribeEvents_shared00() {
  1801  	svc := rds.New(session.New())
  1802  	input := &rds.DescribeEventsInput{
  1803  		Duration: aws.Int64(10080),
  1804  		EventCategories: []*string{
  1805  			aws.String("backup"),
  1806  		},
  1807  		SourceIdentifier: aws.String("mymysqlinstance"),
  1808  		SourceType:       aws.String("db-instance"),
  1809  	}
  1810  
  1811  	result, err := svc.DescribeEvents(input)
  1812  	if err != nil {
  1813  		if aerr, ok := err.(awserr.Error); ok {
  1814  			switch aerr.Code() {
  1815  			default:
  1816  				fmt.Println(aerr.Error())
  1817  			}
  1818  		} else {
  1819  			// Print the error, cast err to awserr.Error to get the Code and
  1820  			// Message from an error.
  1821  			fmt.Println(err.Error())
  1822  		}
  1823  		return
  1824  	}
  1825  
  1826  	fmt.Println(result)
  1827  }
  1828  
  1829  // To list information about DB option group options
  1830  //
  1831  // This example lists information for all option group options for the specified DB
  1832  // engine.
  1833  func ExampleRDS_DescribeOptionGroupOptions_shared00() {
  1834  	svc := rds.New(session.New())
  1835  	input := &rds.DescribeOptionGroupOptionsInput{
  1836  		EngineName:         aws.String("mysql"),
  1837  		MajorEngineVersion: aws.String("5.6"),
  1838  	}
  1839  
  1840  	result, err := svc.DescribeOptionGroupOptions(input)
  1841  	if err != nil {
  1842  		if aerr, ok := err.(awserr.Error); ok {
  1843  			switch aerr.Code() {
  1844  			default:
  1845  				fmt.Println(aerr.Error())
  1846  			}
  1847  		} else {
  1848  			// Print the error, cast err to awserr.Error to get the Code and
  1849  			// Message from an error.
  1850  			fmt.Println(err.Error())
  1851  		}
  1852  		return
  1853  	}
  1854  
  1855  	fmt.Println(result)
  1856  }
  1857  
  1858  // To list information about DB option groups
  1859  //
  1860  // This example lists information for all option groups for the specified DB engine.
  1861  func ExampleRDS_DescribeOptionGroups_shared00() {
  1862  	svc := rds.New(session.New())
  1863  	input := &rds.DescribeOptionGroupsInput{
  1864  		EngineName:         aws.String("mysql"),
  1865  		MajorEngineVersion: aws.String("5.6"),
  1866  	}
  1867  
  1868  	result, err := svc.DescribeOptionGroups(input)
  1869  	if err != nil {
  1870  		if aerr, ok := err.(awserr.Error); ok {
  1871  			switch aerr.Code() {
  1872  			case rds.ErrCodeOptionGroupNotFoundFault:
  1873  				fmt.Println(rds.ErrCodeOptionGroupNotFoundFault, aerr.Error())
  1874  			default:
  1875  				fmt.Println(aerr.Error())
  1876  			}
  1877  		} else {
  1878  			// Print the error, cast err to awserr.Error to get the Code and
  1879  			// Message from an error.
  1880  			fmt.Println(err.Error())
  1881  		}
  1882  		return
  1883  	}
  1884  
  1885  	fmt.Println(result)
  1886  }
  1887  
  1888  // To list information about orderable DB instance options
  1889  //
  1890  // This example lists information for all orderable DB instance options for the specified
  1891  // DB engine, engine version, DB instance class, license model, and VPC settings.
  1892  func ExampleRDS_DescribeOrderableDBInstanceOptions_shared00() {
  1893  	svc := rds.New(session.New())
  1894  	input := &rds.DescribeOrderableDBInstanceOptionsInput{
  1895  		DBInstanceClass: aws.String("db.t2.micro"),
  1896  		Engine:          aws.String("mysql"),
  1897  		EngineVersion:   aws.String("5.6.27"),
  1898  		LicenseModel:    aws.String("general-public-license"),
  1899  		Vpc:             aws.Bool(true),
  1900  	}
  1901  
  1902  	result, err := svc.DescribeOrderableDBInstanceOptions(input)
  1903  	if err != nil {
  1904  		if aerr, ok := err.(awserr.Error); ok {
  1905  			switch aerr.Code() {
  1906  			default:
  1907  				fmt.Println(aerr.Error())
  1908  			}
  1909  		} else {
  1910  			// Print the error, cast err to awserr.Error to get the Code and
  1911  			// Message from an error.
  1912  			fmt.Println(err.Error())
  1913  		}
  1914  		return
  1915  	}
  1916  
  1917  	fmt.Println(result)
  1918  }
  1919  
  1920  // To list information about pending maintenance actions
  1921  //
  1922  // This example lists information for all pending maintenance actions for the specified
  1923  // DB instance.
  1924  func ExampleRDS_DescribePendingMaintenanceActions_shared00() {
  1925  	svc := rds.New(session.New())
  1926  	input := &rds.DescribePendingMaintenanceActionsInput{
  1927  		ResourceIdentifier: aws.String("arn:aws:rds:us-east-1:992648334831:db:mymysqlinstance"),
  1928  	}
  1929  
  1930  	result, err := svc.DescribePendingMaintenanceActions(input)
  1931  	if err != nil {
  1932  		if aerr, ok := err.(awserr.Error); ok {
  1933  			switch aerr.Code() {
  1934  			case rds.ErrCodeResourceNotFoundFault:
  1935  				fmt.Println(rds.ErrCodeResourceNotFoundFault, aerr.Error())
  1936  			default:
  1937  				fmt.Println(aerr.Error())
  1938  			}
  1939  		} else {
  1940  			// Print the error, cast err to awserr.Error to get the Code and
  1941  			// Message from an error.
  1942  			fmt.Println(err.Error())
  1943  		}
  1944  		return
  1945  	}
  1946  
  1947  	fmt.Println(result)
  1948  }
  1949  
  1950  // To list information about reserved DB instances
  1951  //
  1952  // This example lists information for all reserved DB instances for the specified DB
  1953  // instance class, duration, product, offering type, and availability zone settings.
  1954  func ExampleRDS_DescribeReservedDBInstances_shared00() {
  1955  	svc := rds.New(session.New())
  1956  	input := &rds.DescribeReservedDBInstancesInput{
  1957  		DBInstanceClass:    aws.String("db.t2.micro"),
  1958  		Duration:           aws.String("1y"),
  1959  		MultiAZ:            aws.Bool(false),
  1960  		OfferingType:       aws.String("No Upfront"),
  1961  		ProductDescription: aws.String("mysql"),
  1962  	}
  1963  
  1964  	result, err := svc.DescribeReservedDBInstances(input)
  1965  	if err != nil {
  1966  		if aerr, ok := err.(awserr.Error); ok {
  1967  			switch aerr.Code() {
  1968  			case rds.ErrCodeReservedDBInstanceNotFoundFault:
  1969  				fmt.Println(rds.ErrCodeReservedDBInstanceNotFoundFault, aerr.Error())
  1970  			default:
  1971  				fmt.Println(aerr.Error())
  1972  			}
  1973  		} else {
  1974  			// Print the error, cast err to awserr.Error to get the Code and
  1975  			// Message from an error.
  1976  			fmt.Println(err.Error())
  1977  		}
  1978  		return
  1979  	}
  1980  
  1981  	fmt.Println(result)
  1982  }
  1983  
  1984  // To list information about reserved DB instance offerings
  1985  //
  1986  // This example lists information for all reserved DB instance offerings for the specified
  1987  // DB instance class, duration, product, offering type, and availability zone settings.
  1988  func ExampleRDS_DescribeReservedDBInstancesOfferings_shared00() {
  1989  	svc := rds.New(session.New())
  1990  	input := &rds.DescribeReservedDBInstancesOfferingsInput{
  1991  		DBInstanceClass:    aws.String("db.t2.micro"),
  1992  		Duration:           aws.String("1y"),
  1993  		MultiAZ:            aws.Bool(false),
  1994  		OfferingType:       aws.String("No Upfront"),
  1995  		ProductDescription: aws.String("mysql"),
  1996  	}
  1997  
  1998  	result, err := svc.DescribeReservedDBInstancesOfferings(input)
  1999  	if err != nil {
  2000  		if aerr, ok := err.(awserr.Error); ok {
  2001  			switch aerr.Code() {
  2002  			case rds.ErrCodeReservedDBInstancesOfferingNotFoundFault:
  2003  				fmt.Println(rds.ErrCodeReservedDBInstancesOfferingNotFoundFault, aerr.Error())
  2004  			default:
  2005  				fmt.Println(aerr.Error())
  2006  			}
  2007  		} else {
  2008  			// Print the error, cast err to awserr.Error to get the Code and
  2009  			// Message from an error.
  2010  			fmt.Println(err.Error())
  2011  		}
  2012  		return
  2013  	}
  2014  
  2015  	fmt.Println(result)
  2016  }
  2017  
  2018  // To describe source regions
  2019  //
  2020  // To list the AWS regions where a Read Replica can be created.
  2021  func ExampleRDS_DescribeSourceRegions_shared00() {
  2022  	svc := rds.New(session.New())
  2023  	input := &rds.DescribeSourceRegionsInput{}
  2024  
  2025  	result, err := svc.DescribeSourceRegions(input)
  2026  	if err != nil {
  2027  		if aerr, ok := err.(awserr.Error); ok {
  2028  			switch aerr.Code() {
  2029  			default:
  2030  				fmt.Println(aerr.Error())
  2031  			}
  2032  		} else {
  2033  			// Print the error, cast err to awserr.Error to get the Code and
  2034  			// Message from an error.
  2035  			fmt.Println(err.Error())
  2036  		}
  2037  		return
  2038  	}
  2039  
  2040  	fmt.Println(result)
  2041  }
  2042  
  2043  // To list information about DB log files
  2044  //
  2045  // This example lists information for the specified log file for the specified DB instance.
  2046  func ExampleRDS_DownloadDBLogFilePortion_shared00() {
  2047  	svc := rds.New(session.New())
  2048  	input := &rds.DownloadDBLogFilePortionInput{
  2049  		DBInstanceIdentifier: aws.String("mymysqlinstance"),
  2050  		LogFileName:          aws.String("mysqlUpgrade"),
  2051  	}
  2052  
  2053  	result, err := svc.DownloadDBLogFilePortion(input)
  2054  	if err != nil {
  2055  		if aerr, ok := err.(awserr.Error); ok {
  2056  			switch aerr.Code() {
  2057  			case rds.ErrCodeDBInstanceNotFoundFault:
  2058  				fmt.Println(rds.ErrCodeDBInstanceNotFoundFault, aerr.Error())
  2059  			case rds.ErrCodeDBLogFileNotFoundFault:
  2060  				fmt.Println(rds.ErrCodeDBLogFileNotFoundFault, aerr.Error())
  2061  			default:
  2062  				fmt.Println(aerr.Error())
  2063  			}
  2064  		} else {
  2065  			// Print the error, cast err to awserr.Error to get the Code and
  2066  			// Message from an error.
  2067  			fmt.Println(err.Error())
  2068  		}
  2069  		return
  2070  	}
  2071  
  2072  	fmt.Println(result)
  2073  }
  2074  
  2075  // To perform a failover for a DB cluster
  2076  //
  2077  // This example performs a failover for the specified DB cluster to the specified DB
  2078  // instance.
  2079  func ExampleRDS_FailoverDBCluster_shared00() {
  2080  	svc := rds.New(session.New())
  2081  	input := &rds.FailoverDBClusterInput{
  2082  		DBClusterIdentifier:        aws.String("myaurorainstance-cluster"),
  2083  		TargetDBInstanceIdentifier: aws.String("myaurorareplica"),
  2084  	}
  2085  
  2086  	result, err := svc.FailoverDBCluster(input)
  2087  	if err != nil {
  2088  		if aerr, ok := err.(awserr.Error); ok {
  2089  			switch aerr.Code() {
  2090  			case rds.ErrCodeDBClusterNotFoundFault:
  2091  				fmt.Println(rds.ErrCodeDBClusterNotFoundFault, aerr.Error())
  2092  			case rds.ErrCodeInvalidDBClusterStateFault:
  2093  				fmt.Println(rds.ErrCodeInvalidDBClusterStateFault, aerr.Error())
  2094  			case rds.ErrCodeInvalidDBInstanceStateFault:
  2095  				fmt.Println(rds.ErrCodeInvalidDBInstanceStateFault, aerr.Error())
  2096  			default:
  2097  				fmt.Println(aerr.Error())
  2098  			}
  2099  		} else {
  2100  			// Print the error, cast err to awserr.Error to get the Code and
  2101  			// Message from an error.
  2102  			fmt.Println(err.Error())
  2103  		}
  2104  		return
  2105  	}
  2106  
  2107  	fmt.Println(result)
  2108  }
  2109  
  2110  // To list information about tags associated with a resource
  2111  //
  2112  // This example lists information about all tags associated with the specified DB option
  2113  // group.
  2114  func ExampleRDS_ListTagsForResource_shared00() {
  2115  	svc := rds.New(session.New())
  2116  	input := &rds.ListTagsForResourceInput{
  2117  		ResourceName: aws.String("arn:aws:rds:us-east-1:992648334831:og:mymysqloptiongroup"),
  2118  	}
  2119  
  2120  	result, err := svc.ListTagsForResource(input)
  2121  	if err != nil {
  2122  		if aerr, ok := err.(awserr.Error); ok {
  2123  			switch aerr.Code() {
  2124  			case rds.ErrCodeDBInstanceNotFoundFault:
  2125  				fmt.Println(rds.ErrCodeDBInstanceNotFoundFault, aerr.Error())
  2126  			case rds.ErrCodeDBSnapshotNotFoundFault:
  2127  				fmt.Println(rds.ErrCodeDBSnapshotNotFoundFault, aerr.Error())
  2128  			case rds.ErrCodeDBClusterNotFoundFault:
  2129  				fmt.Println(rds.ErrCodeDBClusterNotFoundFault, aerr.Error())
  2130  			case rds.ErrCodeDBProxyNotFoundFault:
  2131  				fmt.Println(rds.ErrCodeDBProxyNotFoundFault, aerr.Error())
  2132  			case rds.ErrCodeDBProxyTargetGroupNotFoundFault:
  2133  				fmt.Println(rds.ErrCodeDBProxyTargetGroupNotFoundFault, aerr.Error())
  2134  			default:
  2135  				fmt.Println(aerr.Error())
  2136  			}
  2137  		} else {
  2138  			// Print the error, cast err to awserr.Error to get the Code and
  2139  			// Message from an error.
  2140  			fmt.Println(err.Error())
  2141  		}
  2142  		return
  2143  	}
  2144  
  2145  	fmt.Println(result)
  2146  }
  2147  
  2148  // To change DB cluster settings
  2149  //
  2150  // This example changes the specified settings for the specified DB cluster.
  2151  func ExampleRDS_ModifyDBCluster_shared00() {
  2152  	svc := rds.New(session.New())
  2153  	input := &rds.ModifyDBClusterInput{
  2154  		ApplyImmediately:           aws.Bool(true),
  2155  		DBClusterIdentifier:        aws.String("mydbcluster"),
  2156  		MasterUserPassword:         aws.String("mynewpassword"),
  2157  		NewDBClusterIdentifier:     aws.String("mynewdbcluster"),
  2158  		PreferredBackupWindow:      aws.String("04:00-04:30"),
  2159  		PreferredMaintenanceWindow: aws.String("Tue:05:00-Tue:05:30"),
  2160  	}
  2161  
  2162  	result, err := svc.ModifyDBCluster(input)
  2163  	if err != nil {
  2164  		if aerr, ok := err.(awserr.Error); ok {
  2165  			switch aerr.Code() {
  2166  			case rds.ErrCodeDBClusterNotFoundFault:
  2167  				fmt.Println(rds.ErrCodeDBClusterNotFoundFault, aerr.Error())
  2168  			case rds.ErrCodeInvalidDBClusterStateFault:
  2169  				fmt.Println(rds.ErrCodeInvalidDBClusterStateFault, aerr.Error())
  2170  			case rds.ErrCodeStorageQuotaExceededFault:
  2171  				fmt.Println(rds.ErrCodeStorageQuotaExceededFault, aerr.Error())
  2172  			case rds.ErrCodeDBSubnetGroupNotFoundFault:
  2173  				fmt.Println(rds.ErrCodeDBSubnetGroupNotFoundFault, aerr.Error())
  2174  			case rds.ErrCodeInvalidVPCNetworkStateFault:
  2175  				fmt.Println(rds.ErrCodeInvalidVPCNetworkStateFault, aerr.Error())
  2176  			case rds.ErrCodeInvalidDBSubnetGroupStateFault:
  2177  				fmt.Println(rds.ErrCodeInvalidDBSubnetGroupStateFault, aerr.Error())
  2178  			case rds.ErrCodeInvalidSubnet:
  2179  				fmt.Println(rds.ErrCodeInvalidSubnet, aerr.Error())
  2180  			case rds.ErrCodeDBClusterParameterGroupNotFoundFault:
  2181  				fmt.Println(rds.ErrCodeDBClusterParameterGroupNotFoundFault, aerr.Error())
  2182  			case rds.ErrCodeInvalidDBSecurityGroupStateFault:
  2183  				fmt.Println(rds.ErrCodeInvalidDBSecurityGroupStateFault, aerr.Error())
  2184  			case rds.ErrCodeInvalidDBInstanceStateFault:
  2185  				fmt.Println(rds.ErrCodeInvalidDBInstanceStateFault, aerr.Error())
  2186  			case rds.ErrCodeDBClusterAlreadyExistsFault:
  2187  				fmt.Println(rds.ErrCodeDBClusterAlreadyExistsFault, aerr.Error())
  2188  			case rds.ErrCodeDomainNotFoundFault:
  2189  				fmt.Println(rds.ErrCodeDomainNotFoundFault, aerr.Error())
  2190  			default:
  2191  				fmt.Println(aerr.Error())
  2192  			}
  2193  		} else {
  2194  			// Print the error, cast err to awserr.Error to get the Code and
  2195  			// Message from an error.
  2196  			fmt.Println(err.Error())
  2197  		}
  2198  		return
  2199  	}
  2200  
  2201  	fmt.Println(result)
  2202  }
  2203  
  2204  // To change DB cluster parameter group settings
  2205  //
  2206  // This example immediately changes the specified setting for the specified DB cluster
  2207  // parameter group.
  2208  func ExampleRDS_ModifyDBClusterParameterGroup_shared00() {
  2209  	svc := rds.New(session.New())
  2210  	input := &rds.ModifyDBClusterParameterGroupInput{
  2211  		DBClusterParameterGroupName: aws.String("mydbclusterparametergroup"),
  2212  		Parameters: []*rds.Parameter{
  2213  			{
  2214  				ApplyMethod:    aws.String("immediate"),
  2215  				ParameterName:  aws.String("time_zone"),
  2216  				ParameterValue: aws.String("America/Phoenix"),
  2217  			},
  2218  		},
  2219  	}
  2220  
  2221  	result, err := svc.ModifyDBClusterParameterGroup(input)
  2222  	if err != nil {
  2223  		if aerr, ok := err.(awserr.Error); ok {
  2224  			switch aerr.Code() {
  2225  			case rds.ErrCodeDBParameterGroupNotFoundFault:
  2226  				fmt.Println(rds.ErrCodeDBParameterGroupNotFoundFault, aerr.Error())
  2227  			case rds.ErrCodeInvalidDBParameterGroupStateFault:
  2228  				fmt.Println(rds.ErrCodeInvalidDBParameterGroupStateFault, aerr.Error())
  2229  			default:
  2230  				fmt.Println(aerr.Error())
  2231  			}
  2232  		} else {
  2233  			// Print the error, cast err to awserr.Error to get the Code and
  2234  			// Message from an error.
  2235  			fmt.Println(err.Error())
  2236  		}
  2237  		return
  2238  	}
  2239  
  2240  	fmt.Println(result)
  2241  }
  2242  
  2243  // To add or remove access to a manual DB cluster snapshot
  2244  //
  2245  // The following example gives two AWS accounts access to a manual DB cluster snapshot
  2246  // and ensures that the DB cluster snapshot is private by removing the value "all".
  2247  func ExampleRDS_ModifyDBClusterSnapshotAttribute_shared00() {
  2248  	svc := rds.New(session.New())
  2249  	input := &rds.ModifyDBClusterSnapshotAttributeInput{
  2250  		AttributeName:               aws.String("restore"),
  2251  		DBClusterSnapshotIdentifier: aws.String("manual-cluster-snapshot1"),
  2252  		ValuesToAdd: []*string{
  2253  			aws.String("123451234512"),
  2254  			aws.String("123456789012"),
  2255  		},
  2256  		ValuesToRemove: []*string{
  2257  			aws.String("all"),
  2258  		},
  2259  	}
  2260  
  2261  	result, err := svc.ModifyDBClusterSnapshotAttribute(input)
  2262  	if err != nil {
  2263  		if aerr, ok := err.(awserr.Error); ok {
  2264  			switch aerr.Code() {
  2265  			case rds.ErrCodeDBClusterSnapshotNotFoundFault:
  2266  				fmt.Println(rds.ErrCodeDBClusterSnapshotNotFoundFault, aerr.Error())
  2267  			case rds.ErrCodeInvalidDBClusterSnapshotStateFault:
  2268  				fmt.Println(rds.ErrCodeInvalidDBClusterSnapshotStateFault, aerr.Error())
  2269  			case rds.ErrCodeSharedSnapshotQuotaExceededFault:
  2270  				fmt.Println(rds.ErrCodeSharedSnapshotQuotaExceededFault, aerr.Error())
  2271  			default:
  2272  				fmt.Println(aerr.Error())
  2273  			}
  2274  		} else {
  2275  			// Print the error, cast err to awserr.Error to get the Code and
  2276  			// Message from an error.
  2277  			fmt.Println(err.Error())
  2278  		}
  2279  		return
  2280  	}
  2281  
  2282  	fmt.Println(result)
  2283  }
  2284  
  2285  // To change DB instance settings
  2286  //
  2287  // This example immediately changes the specified settings for the specified DB instance.
  2288  func ExampleRDS_ModifyDBInstance_shared00() {
  2289  	svc := rds.New(session.New())
  2290  	input := &rds.ModifyDBInstanceInput{
  2291  		AllocatedStorage:           aws.Int64(10),
  2292  		ApplyImmediately:           aws.Bool(true),
  2293  		BackupRetentionPeriod:      aws.Int64(1),
  2294  		DBInstanceClass:            aws.String("db.t2.small"),
  2295  		DBInstanceIdentifier:       aws.String("mymysqlinstance"),
  2296  		MasterUserPassword:         aws.String("mynewpassword"),
  2297  		PreferredBackupWindow:      aws.String("04:00-04:30"),
  2298  		PreferredMaintenanceWindow: aws.String("Tue:05:00-Tue:05:30"),
  2299  	}
  2300  
  2301  	result, err := svc.ModifyDBInstance(input)
  2302  	if err != nil {
  2303  		if aerr, ok := err.(awserr.Error); ok {
  2304  			switch aerr.Code() {
  2305  			case rds.ErrCodeInvalidDBInstanceStateFault:
  2306  				fmt.Println(rds.ErrCodeInvalidDBInstanceStateFault, aerr.Error())
  2307  			case rds.ErrCodeInvalidDBSecurityGroupStateFault:
  2308  				fmt.Println(rds.ErrCodeInvalidDBSecurityGroupStateFault, aerr.Error())
  2309  			case rds.ErrCodeDBInstanceAlreadyExistsFault:
  2310  				fmt.Println(rds.ErrCodeDBInstanceAlreadyExistsFault, aerr.Error())
  2311  			case rds.ErrCodeDBInstanceNotFoundFault:
  2312  				fmt.Println(rds.ErrCodeDBInstanceNotFoundFault, aerr.Error())
  2313  			case rds.ErrCodeDBSecurityGroupNotFoundFault:
  2314  				fmt.Println(rds.ErrCodeDBSecurityGroupNotFoundFault, aerr.Error())
  2315  			case rds.ErrCodeDBParameterGroupNotFoundFault:
  2316  				fmt.Println(rds.ErrCodeDBParameterGroupNotFoundFault, aerr.Error())
  2317  			case rds.ErrCodeInsufficientDBInstanceCapacityFault:
  2318  				fmt.Println(rds.ErrCodeInsufficientDBInstanceCapacityFault, aerr.Error())
  2319  			case rds.ErrCodeStorageQuotaExceededFault:
  2320  				fmt.Println(rds.ErrCodeStorageQuotaExceededFault, aerr.Error())
  2321  			case rds.ErrCodeInvalidVPCNetworkStateFault:
  2322  				fmt.Println(rds.ErrCodeInvalidVPCNetworkStateFault, aerr.Error())
  2323  			case rds.ErrCodeProvisionedIopsNotAvailableInAZFault:
  2324  				fmt.Println(rds.ErrCodeProvisionedIopsNotAvailableInAZFault, aerr.Error())
  2325  			case rds.ErrCodeOptionGroupNotFoundFault:
  2326  				fmt.Println(rds.ErrCodeOptionGroupNotFoundFault, aerr.Error())
  2327  			case rds.ErrCodeDBUpgradeDependencyFailureFault:
  2328  				fmt.Println(rds.ErrCodeDBUpgradeDependencyFailureFault, aerr.Error())
  2329  			case rds.ErrCodeStorageTypeNotSupportedFault:
  2330  				fmt.Println(rds.ErrCodeStorageTypeNotSupportedFault, aerr.Error())
  2331  			case rds.ErrCodeAuthorizationNotFoundFault:
  2332  				fmt.Println(rds.ErrCodeAuthorizationNotFoundFault, aerr.Error())
  2333  			case rds.ErrCodeCertificateNotFoundFault:
  2334  				fmt.Println(rds.ErrCodeCertificateNotFoundFault, aerr.Error())
  2335  			case rds.ErrCodeDomainNotFoundFault:
  2336  				fmt.Println(rds.ErrCodeDomainNotFoundFault, aerr.Error())
  2337  			case rds.ErrCodeBackupPolicyNotFoundFault:
  2338  				fmt.Println(rds.ErrCodeBackupPolicyNotFoundFault, aerr.Error())
  2339  			case rds.ErrCodeKMSKeyNotAccessibleFault:
  2340  				fmt.Println(rds.ErrCodeKMSKeyNotAccessibleFault, aerr.Error())
  2341  			case rds.ErrCodeInvalidDBClusterStateFault:
  2342  				fmt.Println(rds.ErrCodeInvalidDBClusterStateFault, aerr.Error())
  2343  			default:
  2344  				fmt.Println(aerr.Error())
  2345  			}
  2346  		} else {
  2347  			// Print the error, cast err to awserr.Error to get the Code and
  2348  			// Message from an error.
  2349  			fmt.Println(err.Error())
  2350  		}
  2351  		return
  2352  	}
  2353  
  2354  	fmt.Println(result)
  2355  }
  2356  
  2357  // To change DB parameter group settings
  2358  //
  2359  // This example immediately changes the specified setting for the specified DB parameter
  2360  // group.
  2361  func ExampleRDS_ModifyDBParameterGroup_shared00() {
  2362  	svc := rds.New(session.New())
  2363  	input := &rds.ModifyDBParameterGroupInput{
  2364  		DBParameterGroupName: aws.String("mymysqlparametergroup"),
  2365  		Parameters: []*rds.Parameter{
  2366  			{
  2367  				ApplyMethod:    aws.String("immediate"),
  2368  				ParameterName:  aws.String("time_zone"),
  2369  				ParameterValue: aws.String("America/Phoenix"),
  2370  			},
  2371  		},
  2372  	}
  2373  
  2374  	result, err := svc.ModifyDBParameterGroup(input)
  2375  	if err != nil {
  2376  		if aerr, ok := err.(awserr.Error); ok {
  2377  			switch aerr.Code() {
  2378  			case rds.ErrCodeDBParameterGroupNotFoundFault:
  2379  				fmt.Println(rds.ErrCodeDBParameterGroupNotFoundFault, aerr.Error())
  2380  			case rds.ErrCodeInvalidDBParameterGroupStateFault:
  2381  				fmt.Println(rds.ErrCodeInvalidDBParameterGroupStateFault, aerr.Error())
  2382  			default:
  2383  				fmt.Println(aerr.Error())
  2384  			}
  2385  		} else {
  2386  			// Print the error, cast err to awserr.Error to get the Code and
  2387  			// Message from an error.
  2388  			fmt.Println(err.Error())
  2389  		}
  2390  		return
  2391  	}
  2392  
  2393  	fmt.Println(result)
  2394  }
  2395  
  2396  // To change DB snapshot attributes
  2397  //
  2398  // This example adds the specified attribute for the specified DB snapshot.
  2399  func ExampleRDS_ModifyDBSnapshotAttribute_shared00() {
  2400  	svc := rds.New(session.New())
  2401  	input := &rds.ModifyDBSnapshotAttributeInput{
  2402  		AttributeName:        aws.String("restore"),
  2403  		DBSnapshotIdentifier: aws.String("mydbsnapshot"),
  2404  		ValuesToAdd: []*string{
  2405  			aws.String("all"),
  2406  		},
  2407  	}
  2408  
  2409  	result, err := svc.ModifyDBSnapshotAttribute(input)
  2410  	if err != nil {
  2411  		if aerr, ok := err.(awserr.Error); ok {
  2412  			switch aerr.Code() {
  2413  			case rds.ErrCodeDBSnapshotNotFoundFault:
  2414  				fmt.Println(rds.ErrCodeDBSnapshotNotFoundFault, aerr.Error())
  2415  			case rds.ErrCodeInvalidDBSnapshotStateFault:
  2416  				fmt.Println(rds.ErrCodeInvalidDBSnapshotStateFault, aerr.Error())
  2417  			case rds.ErrCodeSharedSnapshotQuotaExceededFault:
  2418  				fmt.Println(rds.ErrCodeSharedSnapshotQuotaExceededFault, aerr.Error())
  2419  			default:
  2420  				fmt.Println(aerr.Error())
  2421  			}
  2422  		} else {
  2423  			// Print the error, cast err to awserr.Error to get the Code and
  2424  			// Message from an error.
  2425  			fmt.Println(err.Error())
  2426  		}
  2427  		return
  2428  	}
  2429  
  2430  	fmt.Println(result)
  2431  }
  2432  
  2433  // To change DB subnet group settings
  2434  //
  2435  // This example changes the specified setting for the specified DB subnet group.
  2436  func ExampleRDS_ModifyDBSubnetGroup_shared00() {
  2437  	svc := rds.New(session.New())
  2438  	input := &rds.ModifyDBSubnetGroupInput{
  2439  		DBSubnetGroupName: aws.String("mydbsubnetgroup"),
  2440  		SubnetIds: []*string{
  2441  			aws.String("subnet-70e1975a"),
  2442  			aws.String("subnet-747a5c49"),
  2443  		},
  2444  	}
  2445  
  2446  	result, err := svc.ModifyDBSubnetGroup(input)
  2447  	if err != nil {
  2448  		if aerr, ok := err.(awserr.Error); ok {
  2449  			switch aerr.Code() {
  2450  			case rds.ErrCodeDBSubnetGroupNotFoundFault:
  2451  				fmt.Println(rds.ErrCodeDBSubnetGroupNotFoundFault, aerr.Error())
  2452  			case rds.ErrCodeDBSubnetQuotaExceededFault:
  2453  				fmt.Println(rds.ErrCodeDBSubnetQuotaExceededFault, aerr.Error())
  2454  			case rds.ErrCodeSubnetAlreadyInUse:
  2455  				fmt.Println(rds.ErrCodeSubnetAlreadyInUse, aerr.Error())
  2456  			case rds.ErrCodeDBSubnetGroupDoesNotCoverEnoughAZs:
  2457  				fmt.Println(rds.ErrCodeDBSubnetGroupDoesNotCoverEnoughAZs, aerr.Error())
  2458  			case rds.ErrCodeInvalidSubnet:
  2459  				fmt.Println(rds.ErrCodeInvalidSubnet, aerr.Error())
  2460  			default:
  2461  				fmt.Println(aerr.Error())
  2462  			}
  2463  		} else {
  2464  			// Print the error, cast err to awserr.Error to get the Code and
  2465  			// Message from an error.
  2466  			fmt.Println(err.Error())
  2467  		}
  2468  		return
  2469  	}
  2470  
  2471  	fmt.Println(result)
  2472  }
  2473  
  2474  // To change event notification subscription settings
  2475  //
  2476  // This example changes the specified setting for the specified event notification subscription.
  2477  func ExampleRDS_ModifyEventSubscription_shared00() {
  2478  	svc := rds.New(session.New())
  2479  	input := &rds.ModifyEventSubscriptionInput{
  2480  		Enabled: aws.Bool(true),
  2481  		EventCategories: []*string{
  2482  			aws.String("deletion"),
  2483  			aws.String("low storage"),
  2484  		},
  2485  		SourceType:       aws.String("db-instance"),
  2486  		SubscriptionName: aws.String("mymysqleventsubscription"),
  2487  	}
  2488  
  2489  	result, err := svc.ModifyEventSubscription(input)
  2490  	if err != nil {
  2491  		if aerr, ok := err.(awserr.Error); ok {
  2492  			switch aerr.Code() {
  2493  			case rds.ErrCodeEventSubscriptionQuotaExceededFault:
  2494  				fmt.Println(rds.ErrCodeEventSubscriptionQuotaExceededFault, aerr.Error())
  2495  			case rds.ErrCodeSubscriptionNotFoundFault:
  2496  				fmt.Println(rds.ErrCodeSubscriptionNotFoundFault, aerr.Error())
  2497  			case rds.ErrCodeSNSInvalidTopicFault:
  2498  				fmt.Println(rds.ErrCodeSNSInvalidTopicFault, aerr.Error())
  2499  			case rds.ErrCodeSNSNoAuthorizationFault:
  2500  				fmt.Println(rds.ErrCodeSNSNoAuthorizationFault, aerr.Error())
  2501  			case rds.ErrCodeSNSTopicArnNotFoundFault:
  2502  				fmt.Println(rds.ErrCodeSNSTopicArnNotFoundFault, aerr.Error())
  2503  			case rds.ErrCodeSubscriptionCategoryNotFoundFault:
  2504  				fmt.Println(rds.ErrCodeSubscriptionCategoryNotFoundFault, aerr.Error())
  2505  			default:
  2506  				fmt.Println(aerr.Error())
  2507  			}
  2508  		} else {
  2509  			// Print the error, cast err to awserr.Error to get the Code and
  2510  			// Message from an error.
  2511  			fmt.Println(err.Error())
  2512  		}
  2513  		return
  2514  	}
  2515  
  2516  	fmt.Println(result)
  2517  }
  2518  
  2519  // To modify an option group
  2520  //
  2521  // The following example adds an option to an option group.
  2522  func ExampleRDS_ModifyOptionGroup_shared00() {
  2523  	svc := rds.New(session.New())
  2524  	input := &rds.ModifyOptionGroupInput{
  2525  		ApplyImmediately: aws.Bool(true),
  2526  		OptionGroupName:  aws.String("myawsuser-og02"),
  2527  		OptionsToInclude: []*rds.OptionConfiguration{
  2528  			{
  2529  				DBSecurityGroupMemberships: []*string{
  2530  					aws.String("default"),
  2531  				},
  2532  				OptionName: aws.String("MEMCACHED"),
  2533  			},
  2534  		},
  2535  	}
  2536  
  2537  	result, err := svc.ModifyOptionGroup(input)
  2538  	if err != nil {
  2539  		if aerr, ok := err.(awserr.Error); ok {
  2540  			switch aerr.Code() {
  2541  			case rds.ErrCodeInvalidOptionGroupStateFault:
  2542  				fmt.Println(rds.ErrCodeInvalidOptionGroupStateFault, aerr.Error())
  2543  			case rds.ErrCodeOptionGroupNotFoundFault:
  2544  				fmt.Println(rds.ErrCodeOptionGroupNotFoundFault, aerr.Error())
  2545  			default:
  2546  				fmt.Println(aerr.Error())
  2547  			}
  2548  		} else {
  2549  			// Print the error, cast err to awserr.Error to get the Code and
  2550  			// Message from an error.
  2551  			fmt.Println(err.Error())
  2552  		}
  2553  		return
  2554  	}
  2555  
  2556  	fmt.Println(result)
  2557  }
  2558  
  2559  // To promote a read replica
  2560  //
  2561  // This example promotes the specified read replica and sets its backup retention period
  2562  // and preferred backup window.
  2563  func ExampleRDS_PromoteReadReplica_shared00() {
  2564  	svc := rds.New(session.New())
  2565  	input := &rds.PromoteReadReplicaInput{
  2566  		BackupRetentionPeriod: aws.Int64(1),
  2567  		DBInstanceIdentifier:  aws.String("mydbreadreplica"),
  2568  		PreferredBackupWindow: aws.String("03:30-04:00"),
  2569  	}
  2570  
  2571  	result, err := svc.PromoteReadReplica(input)
  2572  	if err != nil {
  2573  		if aerr, ok := err.(awserr.Error); ok {
  2574  			switch aerr.Code() {
  2575  			case rds.ErrCodeInvalidDBInstanceStateFault:
  2576  				fmt.Println(rds.ErrCodeInvalidDBInstanceStateFault, aerr.Error())
  2577  			case rds.ErrCodeDBInstanceNotFoundFault:
  2578  				fmt.Println(rds.ErrCodeDBInstanceNotFoundFault, aerr.Error())
  2579  			default:
  2580  				fmt.Println(aerr.Error())
  2581  			}
  2582  		} else {
  2583  			// Print the error, cast err to awserr.Error to get the Code and
  2584  			// Message from an error.
  2585  			fmt.Println(err.Error())
  2586  		}
  2587  		return
  2588  	}
  2589  
  2590  	fmt.Println(result)
  2591  }
  2592  
  2593  // To purchase a reserved DB instance offering
  2594  //
  2595  // This example purchases a reserved DB instance offering that matches the specified
  2596  // settings.
  2597  func ExampleRDS_PurchaseReservedDBInstancesOffering_shared00() {
  2598  	svc := rds.New(session.New())
  2599  	input := &rds.PurchaseReservedDBInstancesOfferingInput{
  2600  		ReservedDBInstanceId:          aws.String("myreservationid"),
  2601  		ReservedDBInstancesOfferingId: aws.String("fb29428a-646d-4390-850e-5fe89926e727"),
  2602  	}
  2603  
  2604  	result, err := svc.PurchaseReservedDBInstancesOffering(input)
  2605  	if err != nil {
  2606  		if aerr, ok := err.(awserr.Error); ok {
  2607  			switch aerr.Code() {
  2608  			case rds.ErrCodeReservedDBInstancesOfferingNotFoundFault:
  2609  				fmt.Println(rds.ErrCodeReservedDBInstancesOfferingNotFoundFault, aerr.Error())
  2610  			case rds.ErrCodeReservedDBInstanceAlreadyExistsFault:
  2611  				fmt.Println(rds.ErrCodeReservedDBInstanceAlreadyExistsFault, aerr.Error())
  2612  			case rds.ErrCodeReservedDBInstanceQuotaExceededFault:
  2613  				fmt.Println(rds.ErrCodeReservedDBInstanceQuotaExceededFault, aerr.Error())
  2614  			default:
  2615  				fmt.Println(aerr.Error())
  2616  			}
  2617  		} else {
  2618  			// Print the error, cast err to awserr.Error to get the Code and
  2619  			// Message from an error.
  2620  			fmt.Println(err.Error())
  2621  		}
  2622  		return
  2623  	}
  2624  
  2625  	fmt.Println(result)
  2626  }
  2627  
  2628  // To reboot a DB instance
  2629  //
  2630  // This example reboots the specified DB instance without forcing a failover.
  2631  func ExampleRDS_RebootDBInstance_shared00() {
  2632  	svc := rds.New(session.New())
  2633  	input := &rds.RebootDBInstanceInput{
  2634  		DBInstanceIdentifier: aws.String("mymysqlinstance"),
  2635  		ForceFailover:        aws.Bool(false),
  2636  	}
  2637  
  2638  	result, err := svc.RebootDBInstance(input)
  2639  	if err != nil {
  2640  		if aerr, ok := err.(awserr.Error); ok {
  2641  			switch aerr.Code() {
  2642  			case rds.ErrCodeInvalidDBInstanceStateFault:
  2643  				fmt.Println(rds.ErrCodeInvalidDBInstanceStateFault, aerr.Error())
  2644  			case rds.ErrCodeDBInstanceNotFoundFault:
  2645  				fmt.Println(rds.ErrCodeDBInstanceNotFoundFault, aerr.Error())
  2646  			default:
  2647  				fmt.Println(aerr.Error())
  2648  			}
  2649  		} else {
  2650  			// Print the error, cast err to awserr.Error to get the Code and
  2651  			// Message from an error.
  2652  			fmt.Println(err.Error())
  2653  		}
  2654  		return
  2655  	}
  2656  
  2657  	fmt.Println(result)
  2658  }
  2659  
  2660  // To remove a source identifier from a DB event subscription
  2661  //
  2662  // This example removes the specified source identifier from the specified DB event
  2663  // subscription.
  2664  func ExampleRDS_RemoveSourceIdentifierFromSubscription_shared00() {
  2665  	svc := rds.New(session.New())
  2666  	input := &rds.RemoveSourceIdentifierFromSubscriptionInput{
  2667  		SourceIdentifier: aws.String("mymysqlinstance"),
  2668  		SubscriptionName: aws.String("myeventsubscription"),
  2669  	}
  2670  
  2671  	result, err := svc.RemoveSourceIdentifierFromSubscription(input)
  2672  	if err != nil {
  2673  		if aerr, ok := err.(awserr.Error); ok {
  2674  			switch aerr.Code() {
  2675  			case rds.ErrCodeSubscriptionNotFoundFault:
  2676  				fmt.Println(rds.ErrCodeSubscriptionNotFoundFault, aerr.Error())
  2677  			case rds.ErrCodeSourceNotFoundFault:
  2678  				fmt.Println(rds.ErrCodeSourceNotFoundFault, aerr.Error())
  2679  			default:
  2680  				fmt.Println(aerr.Error())
  2681  			}
  2682  		} else {
  2683  			// Print the error, cast err to awserr.Error to get the Code and
  2684  			// Message from an error.
  2685  			fmt.Println(err.Error())
  2686  		}
  2687  		return
  2688  	}
  2689  
  2690  	fmt.Println(result)
  2691  }
  2692  
  2693  // To remove tags from a resource
  2694  //
  2695  // This example removes the specified tag associated with the specified DB option group.
  2696  func ExampleRDS_RemoveTagsFromResource_shared00() {
  2697  	svc := rds.New(session.New())
  2698  	input := &rds.RemoveTagsFromResourceInput{
  2699  		ResourceName: aws.String("arn:aws:rds:us-east-1:992648334831:og:mydboptiongroup"),
  2700  		TagKeys: []*string{
  2701  			aws.String("MyKey"),
  2702  		},
  2703  	}
  2704  
  2705  	result, err := svc.RemoveTagsFromResource(input)
  2706  	if err != nil {
  2707  		if aerr, ok := err.(awserr.Error); ok {
  2708  			switch aerr.Code() {
  2709  			case rds.ErrCodeDBInstanceNotFoundFault:
  2710  				fmt.Println(rds.ErrCodeDBInstanceNotFoundFault, aerr.Error())
  2711  			case rds.ErrCodeDBSnapshotNotFoundFault:
  2712  				fmt.Println(rds.ErrCodeDBSnapshotNotFoundFault, aerr.Error())
  2713  			case rds.ErrCodeDBClusterNotFoundFault:
  2714  				fmt.Println(rds.ErrCodeDBClusterNotFoundFault, aerr.Error())
  2715  			case rds.ErrCodeDBProxyNotFoundFault:
  2716  				fmt.Println(rds.ErrCodeDBProxyNotFoundFault, aerr.Error())
  2717  			case rds.ErrCodeDBProxyTargetGroupNotFoundFault:
  2718  				fmt.Println(rds.ErrCodeDBProxyTargetGroupNotFoundFault, aerr.Error())
  2719  			default:
  2720  				fmt.Println(aerr.Error())
  2721  			}
  2722  		} else {
  2723  			// Print the error, cast err to awserr.Error to get the Code and
  2724  			// Message from an error.
  2725  			fmt.Println(err.Error())
  2726  		}
  2727  		return
  2728  	}
  2729  
  2730  	fmt.Println(result)
  2731  }
  2732  
  2733  // To reset the values of a DB cluster parameter group
  2734  //
  2735  // This example resets all parameters for the specified DB cluster parameter group to
  2736  // their default values.
  2737  func ExampleRDS_ResetDBClusterParameterGroup_shared00() {
  2738  	svc := rds.New(session.New())
  2739  	input := &rds.ResetDBClusterParameterGroupInput{
  2740  		DBClusterParameterGroupName: aws.String("mydbclusterparametergroup"),
  2741  		ResetAllParameters:          aws.Bool(true),
  2742  	}
  2743  
  2744  	result, err := svc.ResetDBClusterParameterGroup(input)
  2745  	if err != nil {
  2746  		if aerr, ok := err.(awserr.Error); ok {
  2747  			switch aerr.Code() {
  2748  			case rds.ErrCodeInvalidDBParameterGroupStateFault:
  2749  				fmt.Println(rds.ErrCodeInvalidDBParameterGroupStateFault, aerr.Error())
  2750  			case rds.ErrCodeDBParameterGroupNotFoundFault:
  2751  				fmt.Println(rds.ErrCodeDBParameterGroupNotFoundFault, aerr.Error())
  2752  			default:
  2753  				fmt.Println(aerr.Error())
  2754  			}
  2755  		} else {
  2756  			// Print the error, cast err to awserr.Error to get the Code and
  2757  			// Message from an error.
  2758  			fmt.Println(err.Error())
  2759  		}
  2760  		return
  2761  	}
  2762  
  2763  	fmt.Println(result)
  2764  }
  2765  
  2766  // To reset the values of a DB parameter group
  2767  //
  2768  // This example resets all parameters for the specified DB parameter group to their
  2769  // default values.
  2770  func ExampleRDS_ResetDBParameterGroup_shared00() {
  2771  	svc := rds.New(session.New())
  2772  	input := &rds.ResetDBParameterGroupInput{
  2773  		DBParameterGroupName: aws.String("mydbparametergroup"),
  2774  		ResetAllParameters:   aws.Bool(true),
  2775  	}
  2776  
  2777  	result, err := svc.ResetDBParameterGroup(input)
  2778  	if err != nil {
  2779  		if aerr, ok := err.(awserr.Error); ok {
  2780  			switch aerr.Code() {
  2781  			case rds.ErrCodeInvalidDBParameterGroupStateFault:
  2782  				fmt.Println(rds.ErrCodeInvalidDBParameterGroupStateFault, aerr.Error())
  2783  			case rds.ErrCodeDBParameterGroupNotFoundFault:
  2784  				fmt.Println(rds.ErrCodeDBParameterGroupNotFoundFault, aerr.Error())
  2785  			default:
  2786  				fmt.Println(aerr.Error())
  2787  			}
  2788  		} else {
  2789  			// Print the error, cast err to awserr.Error to get the Code and
  2790  			// Message from an error.
  2791  			fmt.Println(err.Error())
  2792  		}
  2793  		return
  2794  	}
  2795  
  2796  	fmt.Println(result)
  2797  }
  2798  
  2799  // To restore an Amazon Aurora DB cluster from a DB cluster snapshot
  2800  //
  2801  // The following example restores an Amazon Aurora DB cluster from a DB cluster snapshot.
  2802  func ExampleRDS_RestoreDBClusterFromSnapshot_shared00() {
  2803  	svc := rds.New(session.New())
  2804  	input := &rds.RestoreDBClusterFromSnapshotInput{
  2805  		DBClusterIdentifier: aws.String("restored-cluster1"),
  2806  		Engine:              aws.String("aurora"),
  2807  		SnapshotIdentifier:  aws.String("sample-cluster-snapshot1"),
  2808  	}
  2809  
  2810  	result, err := svc.RestoreDBClusterFromSnapshot(input)
  2811  	if err != nil {
  2812  		if aerr, ok := err.(awserr.Error); ok {
  2813  			switch aerr.Code() {
  2814  			case rds.ErrCodeDBClusterAlreadyExistsFault:
  2815  				fmt.Println(rds.ErrCodeDBClusterAlreadyExistsFault, aerr.Error())
  2816  			case rds.ErrCodeDBClusterQuotaExceededFault:
  2817  				fmt.Println(rds.ErrCodeDBClusterQuotaExceededFault, aerr.Error())
  2818  			case rds.ErrCodeStorageQuotaExceededFault:
  2819  				fmt.Println(rds.ErrCodeStorageQuotaExceededFault, aerr.Error())
  2820  			case rds.ErrCodeDBSubnetGroupNotFoundFault:
  2821  				fmt.Println(rds.ErrCodeDBSubnetGroupNotFoundFault, aerr.Error())
  2822  			case rds.ErrCodeDBSnapshotNotFoundFault:
  2823  				fmt.Println(rds.ErrCodeDBSnapshotNotFoundFault, aerr.Error())
  2824  			case rds.ErrCodeDBClusterSnapshotNotFoundFault:
  2825  				fmt.Println(rds.ErrCodeDBClusterSnapshotNotFoundFault, aerr.Error())
  2826  			case rds.ErrCodeInsufficientDBClusterCapacityFault:
  2827  				fmt.Println(rds.ErrCodeInsufficientDBClusterCapacityFault, aerr.Error())
  2828  			case rds.ErrCodeInsufficientStorageClusterCapacityFault:
  2829  				fmt.Println(rds.ErrCodeInsufficientStorageClusterCapacityFault, aerr.Error())
  2830  			case rds.ErrCodeInvalidDBSnapshotStateFault:
  2831  				fmt.Println(rds.ErrCodeInvalidDBSnapshotStateFault, aerr.Error())
  2832  			case rds.ErrCodeInvalidDBClusterSnapshotStateFault:
  2833  				fmt.Println(rds.ErrCodeInvalidDBClusterSnapshotStateFault, aerr.Error())
  2834  			case rds.ErrCodeInvalidVPCNetworkStateFault:
  2835  				fmt.Println(rds.ErrCodeInvalidVPCNetworkStateFault, aerr.Error())
  2836  			case rds.ErrCodeInvalidRestoreFault:
  2837  				fmt.Println(rds.ErrCodeInvalidRestoreFault, aerr.Error())
  2838  			case rds.ErrCodeInvalidSubnet:
  2839  				fmt.Println(rds.ErrCodeInvalidSubnet, aerr.Error())
  2840  			case rds.ErrCodeOptionGroupNotFoundFault:
  2841  				fmt.Println(rds.ErrCodeOptionGroupNotFoundFault, aerr.Error())
  2842  			case rds.ErrCodeKMSKeyNotAccessibleFault:
  2843  				fmt.Println(rds.ErrCodeKMSKeyNotAccessibleFault, aerr.Error())
  2844  			case rds.ErrCodeDomainNotFoundFault:
  2845  				fmt.Println(rds.ErrCodeDomainNotFoundFault, aerr.Error())
  2846  			case rds.ErrCodeDBClusterParameterGroupNotFoundFault:
  2847  				fmt.Println(rds.ErrCodeDBClusterParameterGroupNotFoundFault, aerr.Error())
  2848  			default:
  2849  				fmt.Println(aerr.Error())
  2850  			}
  2851  		} else {
  2852  			// Print the error, cast err to awserr.Error to get the Code and
  2853  			// Message from an error.
  2854  			fmt.Println(err.Error())
  2855  		}
  2856  		return
  2857  	}
  2858  
  2859  	fmt.Println(result)
  2860  }
  2861  
  2862  // To restore a DB cluster to a point in time.
  2863  //
  2864  // The following example restores a DB cluster to a new DB cluster at a point in time
  2865  // from the source DB cluster.
  2866  func ExampleRDS_RestoreDBClusterToPointInTime_shared00() {
  2867  	svc := rds.New(session.New())
  2868  	input := &rds.RestoreDBClusterToPointInTimeInput{
  2869  		DBClusterIdentifier:       aws.String("sample-restored-cluster1"),
  2870  		RestoreToTime:             parseTime("2006-01-02T15:04:05.999999999Z", "2016-09-13T18:45:00Z"),
  2871  		SourceDBClusterIdentifier: aws.String("sample-cluster1"),
  2872  	}
  2873  
  2874  	result, err := svc.RestoreDBClusterToPointInTime(input)
  2875  	if err != nil {
  2876  		if aerr, ok := err.(awserr.Error); ok {
  2877  			switch aerr.Code() {
  2878  			case rds.ErrCodeDBClusterAlreadyExistsFault:
  2879  				fmt.Println(rds.ErrCodeDBClusterAlreadyExistsFault, aerr.Error())
  2880  			case rds.ErrCodeDBClusterNotFoundFault:
  2881  				fmt.Println(rds.ErrCodeDBClusterNotFoundFault, aerr.Error())
  2882  			case rds.ErrCodeDBClusterQuotaExceededFault:
  2883  				fmt.Println(rds.ErrCodeDBClusterQuotaExceededFault, aerr.Error())
  2884  			case rds.ErrCodeDBClusterSnapshotNotFoundFault:
  2885  				fmt.Println(rds.ErrCodeDBClusterSnapshotNotFoundFault, aerr.Error())
  2886  			case rds.ErrCodeDBSubnetGroupNotFoundFault:
  2887  				fmt.Println(rds.ErrCodeDBSubnetGroupNotFoundFault, aerr.Error())
  2888  			case rds.ErrCodeInsufficientDBClusterCapacityFault:
  2889  				fmt.Println(rds.ErrCodeInsufficientDBClusterCapacityFault, aerr.Error())
  2890  			case rds.ErrCodeInsufficientStorageClusterCapacityFault:
  2891  				fmt.Println(rds.ErrCodeInsufficientStorageClusterCapacityFault, aerr.Error())
  2892  			case rds.ErrCodeInvalidDBClusterSnapshotStateFault:
  2893  				fmt.Println(rds.ErrCodeInvalidDBClusterSnapshotStateFault, aerr.Error())
  2894  			case rds.ErrCodeInvalidDBClusterStateFault:
  2895  				fmt.Println(rds.ErrCodeInvalidDBClusterStateFault, aerr.Error())
  2896  			case rds.ErrCodeInvalidDBSnapshotStateFault:
  2897  				fmt.Println(rds.ErrCodeInvalidDBSnapshotStateFault, aerr.Error())
  2898  			case rds.ErrCodeInvalidRestoreFault:
  2899  				fmt.Println(rds.ErrCodeInvalidRestoreFault, aerr.Error())
  2900  			case rds.ErrCodeInvalidSubnet:
  2901  				fmt.Println(rds.ErrCodeInvalidSubnet, aerr.Error())
  2902  			case rds.ErrCodeInvalidVPCNetworkStateFault:
  2903  				fmt.Println(rds.ErrCodeInvalidVPCNetworkStateFault, aerr.Error())
  2904  			case rds.ErrCodeKMSKeyNotAccessibleFault:
  2905  				fmt.Println(rds.ErrCodeKMSKeyNotAccessibleFault, aerr.Error())
  2906  			case rds.ErrCodeOptionGroupNotFoundFault:
  2907  				fmt.Println(rds.ErrCodeOptionGroupNotFoundFault, aerr.Error())
  2908  			case rds.ErrCodeStorageQuotaExceededFault:
  2909  				fmt.Println(rds.ErrCodeStorageQuotaExceededFault, aerr.Error())
  2910  			case rds.ErrCodeDomainNotFoundFault:
  2911  				fmt.Println(rds.ErrCodeDomainNotFoundFault, aerr.Error())
  2912  			case rds.ErrCodeDBClusterParameterGroupNotFoundFault:
  2913  				fmt.Println(rds.ErrCodeDBClusterParameterGroupNotFoundFault, aerr.Error())
  2914  			default:
  2915  				fmt.Println(aerr.Error())
  2916  			}
  2917  		} else {
  2918  			// Print the error, cast err to awserr.Error to get the Code and
  2919  			// Message from an error.
  2920  			fmt.Println(err.Error())
  2921  		}
  2922  		return
  2923  	}
  2924  
  2925  	fmt.Println(result)
  2926  }
  2927  
  2928  // To restore a DB instance from a DB snapshot.
  2929  //
  2930  // The following example restores a DB instance from a DB snapshot.
  2931  func ExampleRDS_RestoreDBInstanceFromDBSnapshot_shared00() {
  2932  	svc := rds.New(session.New())
  2933  	input := &rds.RestoreDBInstanceFromDBSnapshotInput{
  2934  		DBInstanceIdentifier: aws.String("mysqldb-restored"),
  2935  		DBSnapshotIdentifier: aws.String("rds:mysqldb-2014-04-22-08-15"),
  2936  	}
  2937  
  2938  	result, err := svc.RestoreDBInstanceFromDBSnapshot(input)
  2939  	if err != nil {
  2940  		if aerr, ok := err.(awserr.Error); ok {
  2941  			switch aerr.Code() {
  2942  			case rds.ErrCodeDBInstanceAlreadyExistsFault:
  2943  				fmt.Println(rds.ErrCodeDBInstanceAlreadyExistsFault, aerr.Error())
  2944  			case rds.ErrCodeDBSnapshotNotFoundFault:
  2945  				fmt.Println(rds.ErrCodeDBSnapshotNotFoundFault, aerr.Error())
  2946  			case rds.ErrCodeInstanceQuotaExceededFault:
  2947  				fmt.Println(rds.ErrCodeInstanceQuotaExceededFault, aerr.Error())
  2948  			case rds.ErrCodeInsufficientDBInstanceCapacityFault:
  2949  				fmt.Println(rds.ErrCodeInsufficientDBInstanceCapacityFault, aerr.Error())
  2950  			case rds.ErrCodeInvalidDBSnapshotStateFault:
  2951  				fmt.Println(rds.ErrCodeInvalidDBSnapshotStateFault, aerr.Error())
  2952  			case rds.ErrCodeStorageQuotaExceededFault:
  2953  				fmt.Println(rds.ErrCodeStorageQuotaExceededFault, aerr.Error())
  2954  			case rds.ErrCodeInvalidVPCNetworkStateFault:
  2955  				fmt.Println(rds.ErrCodeInvalidVPCNetworkStateFault, aerr.Error())
  2956  			case rds.ErrCodeInvalidRestoreFault:
  2957  				fmt.Println(rds.ErrCodeInvalidRestoreFault, aerr.Error())
  2958  			case rds.ErrCodeDBSubnetGroupNotFoundFault:
  2959  				fmt.Println(rds.ErrCodeDBSubnetGroupNotFoundFault, aerr.Error())
  2960  			case rds.ErrCodeDBSubnetGroupDoesNotCoverEnoughAZs:
  2961  				fmt.Println(rds.ErrCodeDBSubnetGroupDoesNotCoverEnoughAZs, aerr.Error())
  2962  			case rds.ErrCodeInvalidSubnet:
  2963  				fmt.Println(rds.ErrCodeInvalidSubnet, aerr.Error())
  2964  			case rds.ErrCodeProvisionedIopsNotAvailableInAZFault:
  2965  				fmt.Println(rds.ErrCodeProvisionedIopsNotAvailableInAZFault, aerr.Error())
  2966  			case rds.ErrCodeOptionGroupNotFoundFault:
  2967  				fmt.Println(rds.ErrCodeOptionGroupNotFoundFault, aerr.Error())
  2968  			case rds.ErrCodeStorageTypeNotSupportedFault:
  2969  				fmt.Println(rds.ErrCodeStorageTypeNotSupportedFault, aerr.Error())
  2970  			case rds.ErrCodeAuthorizationNotFoundFault:
  2971  				fmt.Println(rds.ErrCodeAuthorizationNotFoundFault, aerr.Error())
  2972  			case rds.ErrCodeKMSKeyNotAccessibleFault:
  2973  				fmt.Println(rds.ErrCodeKMSKeyNotAccessibleFault, aerr.Error())
  2974  			case rds.ErrCodeDBSecurityGroupNotFoundFault:
  2975  				fmt.Println(rds.ErrCodeDBSecurityGroupNotFoundFault, aerr.Error())
  2976  			case rds.ErrCodeDomainNotFoundFault:
  2977  				fmt.Println(rds.ErrCodeDomainNotFoundFault, aerr.Error())
  2978  			case rds.ErrCodeDBParameterGroupNotFoundFault:
  2979  				fmt.Println(rds.ErrCodeDBParameterGroupNotFoundFault, aerr.Error())
  2980  			case rds.ErrCodeBackupPolicyNotFoundFault:
  2981  				fmt.Println(rds.ErrCodeBackupPolicyNotFoundFault, aerr.Error())
  2982  			default:
  2983  				fmt.Println(aerr.Error())
  2984  			}
  2985  		} else {
  2986  			// Print the error, cast err to awserr.Error to get the Code and
  2987  			// Message from an error.
  2988  			fmt.Println(err.Error())
  2989  		}
  2990  		return
  2991  	}
  2992  
  2993  	fmt.Println(result)
  2994  }
  2995  
  2996  // To restore a DB instance to a point in time.
  2997  //
  2998  // The following example restores a DB instance to a new DB instance at a point in time
  2999  // from the source DB instance.
  3000  func ExampleRDS_RestoreDBInstanceToPointInTime_shared00() {
  3001  	svc := rds.New(session.New())
  3002  	input := &rds.RestoreDBInstanceToPointInTimeInput{
  3003  		RestoreTime:                parseTime("2006-01-02T15:04:05.999999999Z", "2016-09-13T18:45:00Z"),
  3004  		SourceDBInstanceIdentifier: aws.String("mysql-sample"),
  3005  		TargetDBInstanceIdentifier: aws.String("mysql-sample-restored"),
  3006  	}
  3007  
  3008  	result, err := svc.RestoreDBInstanceToPointInTime(input)
  3009  	if err != nil {
  3010  		if aerr, ok := err.(awserr.Error); ok {
  3011  			switch aerr.Code() {
  3012  			case rds.ErrCodeDBInstanceAlreadyExistsFault:
  3013  				fmt.Println(rds.ErrCodeDBInstanceAlreadyExistsFault, aerr.Error())
  3014  			case rds.ErrCodeDBInstanceNotFoundFault:
  3015  				fmt.Println(rds.ErrCodeDBInstanceNotFoundFault, aerr.Error())
  3016  			case rds.ErrCodeInstanceQuotaExceededFault:
  3017  				fmt.Println(rds.ErrCodeInstanceQuotaExceededFault, aerr.Error())
  3018  			case rds.ErrCodeInsufficientDBInstanceCapacityFault:
  3019  				fmt.Println(rds.ErrCodeInsufficientDBInstanceCapacityFault, aerr.Error())
  3020  			case rds.ErrCodeInvalidDBInstanceStateFault:
  3021  				fmt.Println(rds.ErrCodeInvalidDBInstanceStateFault, aerr.Error())
  3022  			case rds.ErrCodePointInTimeRestoreNotEnabledFault:
  3023  				fmt.Println(rds.ErrCodePointInTimeRestoreNotEnabledFault, aerr.Error())
  3024  			case rds.ErrCodeStorageQuotaExceededFault:
  3025  				fmt.Println(rds.ErrCodeStorageQuotaExceededFault, aerr.Error())
  3026  			case rds.ErrCodeInvalidVPCNetworkStateFault:
  3027  				fmt.Println(rds.ErrCodeInvalidVPCNetworkStateFault, aerr.Error())
  3028  			case rds.ErrCodeInvalidRestoreFault:
  3029  				fmt.Println(rds.ErrCodeInvalidRestoreFault, aerr.Error())
  3030  			case rds.ErrCodeDBSubnetGroupNotFoundFault:
  3031  				fmt.Println(rds.ErrCodeDBSubnetGroupNotFoundFault, aerr.Error())
  3032  			case rds.ErrCodeDBSubnetGroupDoesNotCoverEnoughAZs:
  3033  				fmt.Println(rds.ErrCodeDBSubnetGroupDoesNotCoverEnoughAZs, aerr.Error())
  3034  			case rds.ErrCodeInvalidSubnet:
  3035  				fmt.Println(rds.ErrCodeInvalidSubnet, aerr.Error())
  3036  			case rds.ErrCodeProvisionedIopsNotAvailableInAZFault:
  3037  				fmt.Println(rds.ErrCodeProvisionedIopsNotAvailableInAZFault, aerr.Error())
  3038  			case rds.ErrCodeOptionGroupNotFoundFault:
  3039  				fmt.Println(rds.ErrCodeOptionGroupNotFoundFault, aerr.Error())
  3040  			case rds.ErrCodeStorageTypeNotSupportedFault:
  3041  				fmt.Println(rds.ErrCodeStorageTypeNotSupportedFault, aerr.Error())
  3042  			case rds.ErrCodeAuthorizationNotFoundFault:
  3043  				fmt.Println(rds.ErrCodeAuthorizationNotFoundFault, aerr.Error())
  3044  			case rds.ErrCodeKMSKeyNotAccessibleFault:
  3045  				fmt.Println(rds.ErrCodeKMSKeyNotAccessibleFault, aerr.Error())
  3046  			case rds.ErrCodeDBSecurityGroupNotFoundFault:
  3047  				fmt.Println(rds.ErrCodeDBSecurityGroupNotFoundFault, aerr.Error())
  3048  			case rds.ErrCodeDomainNotFoundFault:
  3049  				fmt.Println(rds.ErrCodeDomainNotFoundFault, aerr.Error())
  3050  			case rds.ErrCodeBackupPolicyNotFoundFault:
  3051  				fmt.Println(rds.ErrCodeBackupPolicyNotFoundFault, aerr.Error())
  3052  			case rds.ErrCodeDBParameterGroupNotFoundFault:
  3053  				fmt.Println(rds.ErrCodeDBParameterGroupNotFoundFault, aerr.Error())
  3054  			case rds.ErrCodeDBInstanceAutomatedBackupNotFoundFault:
  3055  				fmt.Println(rds.ErrCodeDBInstanceAutomatedBackupNotFoundFault, aerr.Error())
  3056  			default:
  3057  				fmt.Println(aerr.Error())
  3058  			}
  3059  		} else {
  3060  			// Print the error, cast err to awserr.Error to get the Code and
  3061  			// Message from an error.
  3062  			fmt.Println(err.Error())
  3063  		}
  3064  		return
  3065  	}
  3066  
  3067  	fmt.Println(result)
  3068  }
  3069  
  3070  // To revoke ingress for a DB security group
  3071  //
  3072  // This example revokes ingress for the specified CIDR block associated with the specified
  3073  // DB security group.
  3074  func ExampleRDS_RevokeDBSecurityGroupIngress_shared00() {
  3075  	svc := rds.New(session.New())
  3076  	input := &rds.RevokeDBSecurityGroupIngressInput{
  3077  		CIDRIP:              aws.String("203.0.113.5/32"),
  3078  		DBSecurityGroupName: aws.String("mydbsecuritygroup"),
  3079  	}
  3080  
  3081  	result, err := svc.RevokeDBSecurityGroupIngress(input)
  3082  	if err != nil {
  3083  		if aerr, ok := err.(awserr.Error); ok {
  3084  			switch aerr.Code() {
  3085  			case rds.ErrCodeDBSecurityGroupNotFoundFault:
  3086  				fmt.Println(rds.ErrCodeDBSecurityGroupNotFoundFault, aerr.Error())
  3087  			case rds.ErrCodeAuthorizationNotFoundFault:
  3088  				fmt.Println(rds.ErrCodeAuthorizationNotFoundFault, aerr.Error())
  3089  			case rds.ErrCodeInvalidDBSecurityGroupStateFault:
  3090  				fmt.Println(rds.ErrCodeInvalidDBSecurityGroupStateFault, aerr.Error())
  3091  			default:
  3092  				fmt.Println(aerr.Error())
  3093  			}
  3094  		} else {
  3095  			// Print the error, cast err to awserr.Error to get the Code and
  3096  			// Message from an error.
  3097  			fmt.Println(err.Error())
  3098  		}
  3099  		return
  3100  	}
  3101  
  3102  	fmt.Println(result)
  3103  }