examples_test.go 75 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. package rds_test
  3. import (
  4. "bytes"
  5. "fmt"
  6. "time"
  7. "github.com/aws/aws-sdk-go/aws"
  8. "github.com/aws/aws-sdk-go/aws/session"
  9. "github.com/aws/aws-sdk-go/service/rds"
  10. )
  11. var _ time.Duration
  12. var _ bytes.Buffer
  13. func ExampleRDS_AddRoleToDBCluster() {
  14. sess, err := session.NewSession()
  15. if err != nil {
  16. fmt.Println("failed to create session,", err)
  17. return
  18. }
  19. svc := rds.New(sess)
  20. params := &rds.AddRoleToDBClusterInput{
  21. DBClusterIdentifier: aws.String("String"), // Required
  22. RoleArn: aws.String("String"), // Required
  23. }
  24. resp, err := svc.AddRoleToDBCluster(params)
  25. if err != nil {
  26. // Print the error, cast err to awserr.Error to get the Code and
  27. // Message from an error.
  28. fmt.Println(err.Error())
  29. return
  30. }
  31. // Pretty-print the response data.
  32. fmt.Println(resp)
  33. }
  34. func ExampleRDS_AddSourceIdentifierToSubscription() {
  35. sess, err := session.NewSession()
  36. if err != nil {
  37. fmt.Println("failed to create session,", err)
  38. return
  39. }
  40. svc := rds.New(sess)
  41. params := &rds.AddSourceIdentifierToSubscriptionInput{
  42. SourceIdentifier: aws.String("String"), // Required
  43. SubscriptionName: aws.String("String"), // Required
  44. }
  45. resp, err := svc.AddSourceIdentifierToSubscription(params)
  46. if err != nil {
  47. // Print the error, cast err to awserr.Error to get the Code and
  48. // Message from an error.
  49. fmt.Println(err.Error())
  50. return
  51. }
  52. // Pretty-print the response data.
  53. fmt.Println(resp)
  54. }
  55. func ExampleRDS_AddTagsToResource() {
  56. sess, err := session.NewSession()
  57. if err != nil {
  58. fmt.Println("failed to create session,", err)
  59. return
  60. }
  61. svc := rds.New(sess)
  62. params := &rds.AddTagsToResourceInput{
  63. ResourceName: aws.String("String"), // Required
  64. Tags: []*rds.Tag{ // Required
  65. { // Required
  66. Key: aws.String("String"),
  67. Value: aws.String("String"),
  68. },
  69. // More values...
  70. },
  71. }
  72. resp, err := svc.AddTagsToResource(params)
  73. if err != nil {
  74. // Print the error, cast err to awserr.Error to get the Code and
  75. // Message from an error.
  76. fmt.Println(err.Error())
  77. return
  78. }
  79. // Pretty-print the response data.
  80. fmt.Println(resp)
  81. }
  82. func ExampleRDS_ApplyPendingMaintenanceAction() {
  83. sess, err := session.NewSession()
  84. if err != nil {
  85. fmt.Println("failed to create session,", err)
  86. return
  87. }
  88. svc := rds.New(sess)
  89. params := &rds.ApplyPendingMaintenanceActionInput{
  90. ApplyAction: aws.String("String"), // Required
  91. OptInType: aws.String("String"), // Required
  92. ResourceIdentifier: aws.String("String"), // Required
  93. }
  94. resp, err := svc.ApplyPendingMaintenanceAction(params)
  95. if err != nil {
  96. // Print the error, cast err to awserr.Error to get the Code and
  97. // Message from an error.
  98. fmt.Println(err.Error())
  99. return
  100. }
  101. // Pretty-print the response data.
  102. fmt.Println(resp)
  103. }
  104. func ExampleRDS_AuthorizeDBSecurityGroupIngress() {
  105. sess, err := session.NewSession()
  106. if err != nil {
  107. fmt.Println("failed to create session,", err)
  108. return
  109. }
  110. svc := rds.New(sess)
  111. params := &rds.AuthorizeDBSecurityGroupIngressInput{
  112. DBSecurityGroupName: aws.String("String"), // Required
  113. CIDRIP: aws.String("String"),
  114. EC2SecurityGroupId: aws.String("String"),
  115. EC2SecurityGroupName: aws.String("String"),
  116. EC2SecurityGroupOwnerId: aws.String("String"),
  117. }
  118. resp, err := svc.AuthorizeDBSecurityGroupIngress(params)
  119. if err != nil {
  120. // Print the error, cast err to awserr.Error to get the Code and
  121. // Message from an error.
  122. fmt.Println(err.Error())
  123. return
  124. }
  125. // Pretty-print the response data.
  126. fmt.Println(resp)
  127. }
  128. func ExampleRDS_CopyDBClusterParameterGroup() {
  129. sess, err := session.NewSession()
  130. if err != nil {
  131. fmt.Println("failed to create session,", err)
  132. return
  133. }
  134. svc := rds.New(sess)
  135. params := &rds.CopyDBClusterParameterGroupInput{
  136. SourceDBClusterParameterGroupIdentifier: aws.String("String"), // Required
  137. TargetDBClusterParameterGroupDescription: aws.String("String"), // Required
  138. TargetDBClusterParameterGroupIdentifier: aws.String("String"), // Required
  139. Tags: []*rds.Tag{
  140. { // Required
  141. Key: aws.String("String"),
  142. Value: aws.String("String"),
  143. },
  144. // More values...
  145. },
  146. }
  147. resp, err := svc.CopyDBClusterParameterGroup(params)
  148. if err != nil {
  149. // Print the error, cast err to awserr.Error to get the Code and
  150. // Message from an error.
  151. fmt.Println(err.Error())
  152. return
  153. }
  154. // Pretty-print the response data.
  155. fmt.Println(resp)
  156. }
  157. func ExampleRDS_CopyDBClusterSnapshot() {
  158. sess, err := session.NewSession()
  159. if err != nil {
  160. fmt.Println("failed to create session,", err)
  161. return
  162. }
  163. svc := rds.New(sess)
  164. params := &rds.CopyDBClusterSnapshotInput{
  165. SourceDBClusterSnapshotIdentifier: aws.String("String"), // Required
  166. TargetDBClusterSnapshotIdentifier: aws.String("String"), // Required
  167. Tags: []*rds.Tag{
  168. { // Required
  169. Key: aws.String("String"),
  170. Value: aws.String("String"),
  171. },
  172. // More values...
  173. },
  174. }
  175. resp, err := svc.CopyDBClusterSnapshot(params)
  176. if err != nil {
  177. // Print the error, cast err to awserr.Error to get the Code and
  178. // Message from an error.
  179. fmt.Println(err.Error())
  180. return
  181. }
  182. // Pretty-print the response data.
  183. fmt.Println(resp)
  184. }
  185. func ExampleRDS_CopyDBParameterGroup() {
  186. sess, err := session.NewSession()
  187. if err != nil {
  188. fmt.Println("failed to create session,", err)
  189. return
  190. }
  191. svc := rds.New(sess)
  192. params := &rds.CopyDBParameterGroupInput{
  193. SourceDBParameterGroupIdentifier: aws.String("String"), // Required
  194. TargetDBParameterGroupDescription: aws.String("String"), // Required
  195. TargetDBParameterGroupIdentifier: aws.String("String"), // Required
  196. Tags: []*rds.Tag{
  197. { // Required
  198. Key: aws.String("String"),
  199. Value: aws.String("String"),
  200. },
  201. // More values...
  202. },
  203. }
  204. resp, err := svc.CopyDBParameterGroup(params)
  205. if err != nil {
  206. // Print the error, cast err to awserr.Error to get the Code and
  207. // Message from an error.
  208. fmt.Println(err.Error())
  209. return
  210. }
  211. // Pretty-print the response data.
  212. fmt.Println(resp)
  213. }
  214. func ExampleRDS_CopyDBSnapshot() {
  215. sess, err := session.NewSession()
  216. if err != nil {
  217. fmt.Println("failed to create session,", err)
  218. return
  219. }
  220. svc := rds.New(sess)
  221. params := &rds.CopyDBSnapshotInput{
  222. SourceDBSnapshotIdentifier: aws.String("String"), // Required
  223. TargetDBSnapshotIdentifier: aws.String("String"), // Required
  224. CopyTags: aws.Bool(true),
  225. KmsKeyId: aws.String("String"),
  226. Tags: []*rds.Tag{
  227. { // Required
  228. Key: aws.String("String"),
  229. Value: aws.String("String"),
  230. },
  231. // More values...
  232. },
  233. }
  234. resp, err := svc.CopyDBSnapshot(params)
  235. if err != nil {
  236. // Print the error, cast err to awserr.Error to get the Code and
  237. // Message from an error.
  238. fmt.Println(err.Error())
  239. return
  240. }
  241. // Pretty-print the response data.
  242. fmt.Println(resp)
  243. }
  244. func ExampleRDS_CopyOptionGroup() {
  245. sess, err := session.NewSession()
  246. if err != nil {
  247. fmt.Println("failed to create session,", err)
  248. return
  249. }
  250. svc := rds.New(sess)
  251. params := &rds.CopyOptionGroupInput{
  252. SourceOptionGroupIdentifier: aws.String("String"), // Required
  253. TargetOptionGroupDescription: aws.String("String"), // Required
  254. TargetOptionGroupIdentifier: aws.String("String"), // Required
  255. Tags: []*rds.Tag{
  256. { // Required
  257. Key: aws.String("String"),
  258. Value: aws.String("String"),
  259. },
  260. // More values...
  261. },
  262. }
  263. resp, err := svc.CopyOptionGroup(params)
  264. if err != nil {
  265. // Print the error, cast err to awserr.Error to get the Code and
  266. // Message from an error.
  267. fmt.Println(err.Error())
  268. return
  269. }
  270. // Pretty-print the response data.
  271. fmt.Println(resp)
  272. }
  273. func ExampleRDS_CreateDBCluster() {
  274. sess, err := session.NewSession()
  275. if err != nil {
  276. fmt.Println("failed to create session,", err)
  277. return
  278. }
  279. svc := rds.New(sess)
  280. params := &rds.CreateDBClusterInput{
  281. DBClusterIdentifier: aws.String("String"), // Required
  282. Engine: aws.String("String"), // Required
  283. AvailabilityZones: []*string{
  284. aws.String("String"), // Required
  285. // More values...
  286. },
  287. BackupRetentionPeriod: aws.Int64(1),
  288. CharacterSetName: aws.String("String"),
  289. DBClusterParameterGroupName: aws.String("String"),
  290. DBSubnetGroupName: aws.String("String"),
  291. DatabaseName: aws.String("String"),
  292. EngineVersion: aws.String("String"),
  293. KmsKeyId: aws.String("String"),
  294. MasterUserPassword: aws.String("String"),
  295. MasterUsername: aws.String("String"),
  296. OptionGroupName: aws.String("String"),
  297. Port: aws.Int64(1),
  298. PreferredBackupWindow: aws.String("String"),
  299. PreferredMaintenanceWindow: aws.String("String"),
  300. ReplicationSourceIdentifier: aws.String("String"),
  301. StorageEncrypted: aws.Bool(true),
  302. Tags: []*rds.Tag{
  303. { // Required
  304. Key: aws.String("String"),
  305. Value: aws.String("String"),
  306. },
  307. // More values...
  308. },
  309. VpcSecurityGroupIds: []*string{
  310. aws.String("String"), // Required
  311. // More values...
  312. },
  313. }
  314. resp, err := svc.CreateDBCluster(params)
  315. if err != nil {
  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. return
  320. }
  321. // Pretty-print the response data.
  322. fmt.Println(resp)
  323. }
  324. func ExampleRDS_CreateDBClusterParameterGroup() {
  325. sess, err := session.NewSession()
  326. if err != nil {
  327. fmt.Println("failed to create session,", err)
  328. return
  329. }
  330. svc := rds.New(sess)
  331. params := &rds.CreateDBClusterParameterGroupInput{
  332. DBClusterParameterGroupName: aws.String("String"), // Required
  333. DBParameterGroupFamily: aws.String("String"), // Required
  334. Description: aws.String("String"), // Required
  335. Tags: []*rds.Tag{
  336. { // Required
  337. Key: aws.String("String"),
  338. Value: aws.String("String"),
  339. },
  340. // More values...
  341. },
  342. }
  343. resp, err := svc.CreateDBClusterParameterGroup(params)
  344. if err != nil {
  345. // Print the error, cast err to awserr.Error to get the Code and
  346. // Message from an error.
  347. fmt.Println(err.Error())
  348. return
  349. }
  350. // Pretty-print the response data.
  351. fmt.Println(resp)
  352. }
  353. func ExampleRDS_CreateDBClusterSnapshot() {
  354. sess, err := session.NewSession()
  355. if err != nil {
  356. fmt.Println("failed to create session,", err)
  357. return
  358. }
  359. svc := rds.New(sess)
  360. params := &rds.CreateDBClusterSnapshotInput{
  361. DBClusterIdentifier: aws.String("String"), // Required
  362. DBClusterSnapshotIdentifier: aws.String("String"), // Required
  363. Tags: []*rds.Tag{
  364. { // Required
  365. Key: aws.String("String"),
  366. Value: aws.String("String"),
  367. },
  368. // More values...
  369. },
  370. }
  371. resp, err := svc.CreateDBClusterSnapshot(params)
  372. if err != nil {
  373. // Print the error, cast err to awserr.Error to get the Code and
  374. // Message from an error.
  375. fmt.Println(err.Error())
  376. return
  377. }
  378. // Pretty-print the response data.
  379. fmt.Println(resp)
  380. }
  381. func ExampleRDS_CreateDBInstance() {
  382. sess, err := session.NewSession()
  383. if err != nil {
  384. fmt.Println("failed to create session,", err)
  385. return
  386. }
  387. svc := rds.New(sess)
  388. params := &rds.CreateDBInstanceInput{
  389. DBInstanceClass: aws.String("String"), // Required
  390. DBInstanceIdentifier: aws.String("String"), // Required
  391. Engine: aws.String("String"), // Required
  392. AllocatedStorage: aws.Int64(1),
  393. AutoMinorVersionUpgrade: aws.Bool(true),
  394. AvailabilityZone: aws.String("String"),
  395. BackupRetentionPeriod: aws.Int64(1),
  396. CharacterSetName: aws.String("String"),
  397. CopyTagsToSnapshot: aws.Bool(true),
  398. DBClusterIdentifier: aws.String("String"),
  399. DBName: aws.String("String"),
  400. DBParameterGroupName: aws.String("String"),
  401. DBSecurityGroups: []*string{
  402. aws.String("String"), // Required
  403. // More values...
  404. },
  405. DBSubnetGroupName: aws.String("String"),
  406. Domain: aws.String("String"),
  407. DomainIAMRoleName: aws.String("String"),
  408. EngineVersion: aws.String("String"),
  409. Iops: aws.Int64(1),
  410. KmsKeyId: aws.String("String"),
  411. LicenseModel: aws.String("String"),
  412. MasterUserPassword: aws.String("String"),
  413. MasterUsername: aws.String("String"),
  414. MonitoringInterval: aws.Int64(1),
  415. MonitoringRoleArn: aws.String("String"),
  416. MultiAZ: aws.Bool(true),
  417. OptionGroupName: aws.String("String"),
  418. Port: aws.Int64(1),
  419. PreferredBackupWindow: aws.String("String"),
  420. PreferredMaintenanceWindow: aws.String("String"),
  421. PromotionTier: aws.Int64(1),
  422. PubliclyAccessible: aws.Bool(true),
  423. StorageEncrypted: aws.Bool(true),
  424. StorageType: aws.String("String"),
  425. Tags: []*rds.Tag{
  426. { // Required
  427. Key: aws.String("String"),
  428. Value: aws.String("String"),
  429. },
  430. // More values...
  431. },
  432. TdeCredentialArn: aws.String("String"),
  433. TdeCredentialPassword: aws.String("String"),
  434. Timezone: aws.String("String"),
  435. VpcSecurityGroupIds: []*string{
  436. aws.String("String"), // Required
  437. // More values...
  438. },
  439. }
  440. resp, err := svc.CreateDBInstance(params)
  441. if err != nil {
  442. // Print the error, cast err to awserr.Error to get the Code and
  443. // Message from an error.
  444. fmt.Println(err.Error())
  445. return
  446. }
  447. // Pretty-print the response data.
  448. fmt.Println(resp)
  449. }
  450. func ExampleRDS_CreateDBInstanceReadReplica() {
  451. sess, err := session.NewSession()
  452. if err != nil {
  453. fmt.Println("failed to create session,", err)
  454. return
  455. }
  456. svc := rds.New(sess)
  457. params := &rds.CreateDBInstanceReadReplicaInput{
  458. DBInstanceIdentifier: aws.String("String"), // Required
  459. SourceDBInstanceIdentifier: aws.String("String"), // Required
  460. AutoMinorVersionUpgrade: aws.Bool(true),
  461. AvailabilityZone: aws.String("String"),
  462. CopyTagsToSnapshot: aws.Bool(true),
  463. DBInstanceClass: aws.String("String"),
  464. DBSubnetGroupName: aws.String("String"),
  465. Iops: aws.Int64(1),
  466. MonitoringInterval: aws.Int64(1),
  467. MonitoringRoleArn: aws.String("String"),
  468. OptionGroupName: aws.String("String"),
  469. Port: aws.Int64(1),
  470. PubliclyAccessible: aws.Bool(true),
  471. StorageType: aws.String("String"),
  472. Tags: []*rds.Tag{
  473. { // Required
  474. Key: aws.String("String"),
  475. Value: aws.String("String"),
  476. },
  477. // More values...
  478. },
  479. }
  480. resp, err := svc.CreateDBInstanceReadReplica(params)
  481. if err != nil {
  482. // Print the error, cast err to awserr.Error to get the Code and
  483. // Message from an error.
  484. fmt.Println(err.Error())
  485. return
  486. }
  487. // Pretty-print the response data.
  488. fmt.Println(resp)
  489. }
  490. func ExampleRDS_CreateDBParameterGroup() {
  491. sess, err := session.NewSession()
  492. if err != nil {
  493. fmt.Println("failed to create session,", err)
  494. return
  495. }
  496. svc := rds.New(sess)
  497. params := &rds.CreateDBParameterGroupInput{
  498. DBParameterGroupFamily: aws.String("String"), // Required
  499. DBParameterGroupName: aws.String("String"), // Required
  500. Description: aws.String("String"), // Required
  501. Tags: []*rds.Tag{
  502. { // Required
  503. Key: aws.String("String"),
  504. Value: aws.String("String"),
  505. },
  506. // More values...
  507. },
  508. }
  509. resp, err := svc.CreateDBParameterGroup(params)
  510. if err != nil {
  511. // Print the error, cast err to awserr.Error to get the Code and
  512. // Message from an error.
  513. fmt.Println(err.Error())
  514. return
  515. }
  516. // Pretty-print the response data.
  517. fmt.Println(resp)
  518. }
  519. func ExampleRDS_CreateDBSecurityGroup() {
  520. sess, err := session.NewSession()
  521. if err != nil {
  522. fmt.Println("failed to create session,", err)
  523. return
  524. }
  525. svc := rds.New(sess)
  526. params := &rds.CreateDBSecurityGroupInput{
  527. DBSecurityGroupDescription: aws.String("String"), // Required
  528. DBSecurityGroupName: aws.String("String"), // Required
  529. Tags: []*rds.Tag{
  530. { // Required
  531. Key: aws.String("String"),
  532. Value: aws.String("String"),
  533. },
  534. // More values...
  535. },
  536. }
  537. resp, err := svc.CreateDBSecurityGroup(params)
  538. if err != nil {
  539. // Print the error, cast err to awserr.Error to get the Code and
  540. // Message from an error.
  541. fmt.Println(err.Error())
  542. return
  543. }
  544. // Pretty-print the response data.
  545. fmt.Println(resp)
  546. }
  547. func ExampleRDS_CreateDBSnapshot() {
  548. sess, err := session.NewSession()
  549. if err != nil {
  550. fmt.Println("failed to create session,", err)
  551. return
  552. }
  553. svc := rds.New(sess)
  554. params := &rds.CreateDBSnapshotInput{
  555. DBInstanceIdentifier: aws.String("String"), // Required
  556. DBSnapshotIdentifier: aws.String("String"), // Required
  557. Tags: []*rds.Tag{
  558. { // Required
  559. Key: aws.String("String"),
  560. Value: aws.String("String"),
  561. },
  562. // More values...
  563. },
  564. }
  565. resp, err := svc.CreateDBSnapshot(params)
  566. if err != nil {
  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. return
  571. }
  572. // Pretty-print the response data.
  573. fmt.Println(resp)
  574. }
  575. func ExampleRDS_CreateDBSubnetGroup() {
  576. sess, err := session.NewSession()
  577. if err != nil {
  578. fmt.Println("failed to create session,", err)
  579. return
  580. }
  581. svc := rds.New(sess)
  582. params := &rds.CreateDBSubnetGroupInput{
  583. DBSubnetGroupDescription: aws.String("String"), // Required
  584. DBSubnetGroupName: aws.String("String"), // Required
  585. SubnetIds: []*string{ // Required
  586. aws.String("String"), // Required
  587. // More values...
  588. },
  589. Tags: []*rds.Tag{
  590. { // Required
  591. Key: aws.String("String"),
  592. Value: aws.String("String"),
  593. },
  594. // More values...
  595. },
  596. }
  597. resp, err := svc.CreateDBSubnetGroup(params)
  598. if err != nil {
  599. // Print the error, cast err to awserr.Error to get the Code and
  600. // Message from an error.
  601. fmt.Println(err.Error())
  602. return
  603. }
  604. // Pretty-print the response data.
  605. fmt.Println(resp)
  606. }
  607. func ExampleRDS_CreateEventSubscription() {
  608. sess, err := session.NewSession()
  609. if err != nil {
  610. fmt.Println("failed to create session,", err)
  611. return
  612. }
  613. svc := rds.New(sess)
  614. params := &rds.CreateEventSubscriptionInput{
  615. SnsTopicArn: aws.String("String"), // Required
  616. SubscriptionName: aws.String("String"), // Required
  617. Enabled: aws.Bool(true),
  618. EventCategories: []*string{
  619. aws.String("String"), // Required
  620. // More values...
  621. },
  622. SourceIds: []*string{
  623. aws.String("String"), // Required
  624. // More values...
  625. },
  626. SourceType: aws.String("String"),
  627. Tags: []*rds.Tag{
  628. { // Required
  629. Key: aws.String("String"),
  630. Value: aws.String("String"),
  631. },
  632. // More values...
  633. },
  634. }
  635. resp, err := svc.CreateEventSubscription(params)
  636. if err != nil {
  637. // Print the error, cast err to awserr.Error to get the Code and
  638. // Message from an error.
  639. fmt.Println(err.Error())
  640. return
  641. }
  642. // Pretty-print the response data.
  643. fmt.Println(resp)
  644. }
  645. func ExampleRDS_CreateOptionGroup() {
  646. sess, err := session.NewSession()
  647. if err != nil {
  648. fmt.Println("failed to create session,", err)
  649. return
  650. }
  651. svc := rds.New(sess)
  652. params := &rds.CreateOptionGroupInput{
  653. EngineName: aws.String("String"), // Required
  654. MajorEngineVersion: aws.String("String"), // Required
  655. OptionGroupDescription: aws.String("String"), // Required
  656. OptionGroupName: aws.String("String"), // Required
  657. Tags: []*rds.Tag{
  658. { // Required
  659. Key: aws.String("String"),
  660. Value: aws.String("String"),
  661. },
  662. // More values...
  663. },
  664. }
  665. resp, err := svc.CreateOptionGroup(params)
  666. if err != nil {
  667. // Print the error, cast err to awserr.Error to get the Code and
  668. // Message from an error.
  669. fmt.Println(err.Error())
  670. return
  671. }
  672. // Pretty-print the response data.
  673. fmt.Println(resp)
  674. }
  675. func ExampleRDS_DeleteDBCluster() {
  676. sess, err := session.NewSession()
  677. if err != nil {
  678. fmt.Println("failed to create session,", err)
  679. return
  680. }
  681. svc := rds.New(sess)
  682. params := &rds.DeleteDBClusterInput{
  683. DBClusterIdentifier: aws.String("String"), // Required
  684. FinalDBSnapshotIdentifier: aws.String("String"),
  685. SkipFinalSnapshot: aws.Bool(true),
  686. }
  687. resp, err := svc.DeleteDBCluster(params)
  688. if err != nil {
  689. // Print the error, cast err to awserr.Error to get the Code and
  690. // Message from an error.
  691. fmt.Println(err.Error())
  692. return
  693. }
  694. // Pretty-print the response data.
  695. fmt.Println(resp)
  696. }
  697. func ExampleRDS_DeleteDBClusterParameterGroup() {
  698. sess, err := session.NewSession()
  699. if err != nil {
  700. fmt.Println("failed to create session,", err)
  701. return
  702. }
  703. svc := rds.New(sess)
  704. params := &rds.DeleteDBClusterParameterGroupInput{
  705. DBClusterParameterGroupName: aws.String("String"), // Required
  706. }
  707. resp, err := svc.DeleteDBClusterParameterGroup(params)
  708. if err != nil {
  709. // Print the error, cast err to awserr.Error to get the Code and
  710. // Message from an error.
  711. fmt.Println(err.Error())
  712. return
  713. }
  714. // Pretty-print the response data.
  715. fmt.Println(resp)
  716. }
  717. func ExampleRDS_DeleteDBClusterSnapshot() {
  718. sess, err := session.NewSession()
  719. if err != nil {
  720. fmt.Println("failed to create session,", err)
  721. return
  722. }
  723. svc := rds.New(sess)
  724. params := &rds.DeleteDBClusterSnapshotInput{
  725. DBClusterSnapshotIdentifier: aws.String("String"), // Required
  726. }
  727. resp, err := svc.DeleteDBClusterSnapshot(params)
  728. if err != nil {
  729. // Print the error, cast err to awserr.Error to get the Code and
  730. // Message from an error.
  731. fmt.Println(err.Error())
  732. return
  733. }
  734. // Pretty-print the response data.
  735. fmt.Println(resp)
  736. }
  737. func ExampleRDS_DeleteDBInstance() {
  738. sess, err := session.NewSession()
  739. if err != nil {
  740. fmt.Println("failed to create session,", err)
  741. return
  742. }
  743. svc := rds.New(sess)
  744. params := &rds.DeleteDBInstanceInput{
  745. DBInstanceIdentifier: aws.String("String"), // Required
  746. FinalDBSnapshotIdentifier: aws.String("String"),
  747. SkipFinalSnapshot: aws.Bool(true),
  748. }
  749. resp, err := svc.DeleteDBInstance(params)
  750. if err != nil {
  751. // Print the error, cast err to awserr.Error to get the Code and
  752. // Message from an error.
  753. fmt.Println(err.Error())
  754. return
  755. }
  756. // Pretty-print the response data.
  757. fmt.Println(resp)
  758. }
  759. func ExampleRDS_DeleteDBParameterGroup() {
  760. sess, err := session.NewSession()
  761. if err != nil {
  762. fmt.Println("failed to create session,", err)
  763. return
  764. }
  765. svc := rds.New(sess)
  766. params := &rds.DeleteDBParameterGroupInput{
  767. DBParameterGroupName: aws.String("String"), // Required
  768. }
  769. resp, err := svc.DeleteDBParameterGroup(params)
  770. if err != nil {
  771. // Print the error, cast err to awserr.Error to get the Code and
  772. // Message from an error.
  773. fmt.Println(err.Error())
  774. return
  775. }
  776. // Pretty-print the response data.
  777. fmt.Println(resp)
  778. }
  779. func ExampleRDS_DeleteDBSecurityGroup() {
  780. sess, err := session.NewSession()
  781. if err != nil {
  782. fmt.Println("failed to create session,", err)
  783. return
  784. }
  785. svc := rds.New(sess)
  786. params := &rds.DeleteDBSecurityGroupInput{
  787. DBSecurityGroupName: aws.String("String"), // Required
  788. }
  789. resp, err := svc.DeleteDBSecurityGroup(params)
  790. if err != nil {
  791. // Print the error, cast err to awserr.Error to get the Code and
  792. // Message from an error.
  793. fmt.Println(err.Error())
  794. return
  795. }
  796. // Pretty-print the response data.
  797. fmt.Println(resp)
  798. }
  799. func ExampleRDS_DeleteDBSnapshot() {
  800. sess, err := session.NewSession()
  801. if err != nil {
  802. fmt.Println("failed to create session,", err)
  803. return
  804. }
  805. svc := rds.New(sess)
  806. params := &rds.DeleteDBSnapshotInput{
  807. DBSnapshotIdentifier: aws.String("String"), // Required
  808. }
  809. resp, err := svc.DeleteDBSnapshot(params)
  810. if err != nil {
  811. // Print the error, cast err to awserr.Error to get the Code and
  812. // Message from an error.
  813. fmt.Println(err.Error())
  814. return
  815. }
  816. // Pretty-print the response data.
  817. fmt.Println(resp)
  818. }
  819. func ExampleRDS_DeleteDBSubnetGroup() {
  820. sess, err := session.NewSession()
  821. if err != nil {
  822. fmt.Println("failed to create session,", err)
  823. return
  824. }
  825. svc := rds.New(sess)
  826. params := &rds.DeleteDBSubnetGroupInput{
  827. DBSubnetGroupName: aws.String("String"), // Required
  828. }
  829. resp, err := svc.DeleteDBSubnetGroup(params)
  830. if err != nil {
  831. // Print the error, cast err to awserr.Error to get the Code and
  832. // Message from an error.
  833. fmt.Println(err.Error())
  834. return
  835. }
  836. // Pretty-print the response data.
  837. fmt.Println(resp)
  838. }
  839. func ExampleRDS_DeleteEventSubscription() {
  840. sess, err := session.NewSession()
  841. if err != nil {
  842. fmt.Println("failed to create session,", err)
  843. return
  844. }
  845. svc := rds.New(sess)
  846. params := &rds.DeleteEventSubscriptionInput{
  847. SubscriptionName: aws.String("String"), // Required
  848. }
  849. resp, err := svc.DeleteEventSubscription(params)
  850. if err != nil {
  851. // Print the error, cast err to awserr.Error to get the Code and
  852. // Message from an error.
  853. fmt.Println(err.Error())
  854. return
  855. }
  856. // Pretty-print the response data.
  857. fmt.Println(resp)
  858. }
  859. func ExampleRDS_DeleteOptionGroup() {
  860. sess, err := session.NewSession()
  861. if err != nil {
  862. fmt.Println("failed to create session,", err)
  863. return
  864. }
  865. svc := rds.New(sess)
  866. params := &rds.DeleteOptionGroupInput{
  867. OptionGroupName: aws.String("String"), // Required
  868. }
  869. resp, err := svc.DeleteOptionGroup(params)
  870. if err != nil {
  871. // Print the error, cast err to awserr.Error to get the Code and
  872. // Message from an error.
  873. fmt.Println(err.Error())
  874. return
  875. }
  876. // Pretty-print the response data.
  877. fmt.Println(resp)
  878. }
  879. func ExampleRDS_DescribeAccountAttributes() {
  880. sess, err := session.NewSession()
  881. if err != nil {
  882. fmt.Println("failed to create session,", err)
  883. return
  884. }
  885. svc := rds.New(sess)
  886. var params *rds.DescribeAccountAttributesInput
  887. resp, err := svc.DescribeAccountAttributes(params)
  888. if err != nil {
  889. // Print the error, cast err to awserr.Error to get the Code and
  890. // Message from an error.
  891. fmt.Println(err.Error())
  892. return
  893. }
  894. // Pretty-print the response data.
  895. fmt.Println(resp)
  896. }
  897. func ExampleRDS_DescribeCertificates() {
  898. sess, err := session.NewSession()
  899. if err != nil {
  900. fmt.Println("failed to create session,", err)
  901. return
  902. }
  903. svc := rds.New(sess)
  904. params := &rds.DescribeCertificatesInput{
  905. CertificateIdentifier: aws.String("String"),
  906. Filters: []*rds.Filter{
  907. { // Required
  908. Name: aws.String("String"), // Required
  909. Values: []*string{ // Required
  910. aws.String("String"), // Required
  911. // More values...
  912. },
  913. },
  914. // More values...
  915. },
  916. Marker: aws.String("String"),
  917. MaxRecords: aws.Int64(1),
  918. }
  919. resp, err := svc.DescribeCertificates(params)
  920. if err != nil {
  921. // Print the error, cast err to awserr.Error to get the Code and
  922. // Message from an error.
  923. fmt.Println(err.Error())
  924. return
  925. }
  926. // Pretty-print the response data.
  927. fmt.Println(resp)
  928. }
  929. func ExampleRDS_DescribeDBClusterParameterGroups() {
  930. sess, err := session.NewSession()
  931. if err != nil {
  932. fmt.Println("failed to create session,", err)
  933. return
  934. }
  935. svc := rds.New(sess)
  936. params := &rds.DescribeDBClusterParameterGroupsInput{
  937. DBClusterParameterGroupName: aws.String("String"),
  938. Filters: []*rds.Filter{
  939. { // Required
  940. Name: aws.String("String"), // Required
  941. Values: []*string{ // Required
  942. aws.String("String"), // Required
  943. // More values...
  944. },
  945. },
  946. // More values...
  947. },
  948. Marker: aws.String("String"),
  949. MaxRecords: aws.Int64(1),
  950. }
  951. resp, err := svc.DescribeDBClusterParameterGroups(params)
  952. if err != nil {
  953. // Print the error, cast err to awserr.Error to get the Code and
  954. // Message from an error.
  955. fmt.Println(err.Error())
  956. return
  957. }
  958. // Pretty-print the response data.
  959. fmt.Println(resp)
  960. }
  961. func ExampleRDS_DescribeDBClusterParameters() {
  962. sess, err := session.NewSession()
  963. if err != nil {
  964. fmt.Println("failed to create session,", err)
  965. return
  966. }
  967. svc := rds.New(sess)
  968. params := &rds.DescribeDBClusterParametersInput{
  969. DBClusterParameterGroupName: aws.String("String"), // Required
  970. Filters: []*rds.Filter{
  971. { // Required
  972. Name: aws.String("String"), // Required
  973. Values: []*string{ // Required
  974. aws.String("String"), // Required
  975. // More values...
  976. },
  977. },
  978. // More values...
  979. },
  980. Marker: aws.String("String"),
  981. MaxRecords: aws.Int64(1),
  982. Source: aws.String("String"),
  983. }
  984. resp, err := svc.DescribeDBClusterParameters(params)
  985. if err != nil {
  986. // Print the error, cast err to awserr.Error to get the Code and
  987. // Message from an error.
  988. fmt.Println(err.Error())
  989. return
  990. }
  991. // Pretty-print the response data.
  992. fmt.Println(resp)
  993. }
  994. func ExampleRDS_DescribeDBClusterSnapshotAttributes() {
  995. sess, err := session.NewSession()
  996. if err != nil {
  997. fmt.Println("failed to create session,", err)
  998. return
  999. }
  1000. svc := rds.New(sess)
  1001. params := &rds.DescribeDBClusterSnapshotAttributesInput{
  1002. DBClusterSnapshotIdentifier: aws.String("String"), // Required
  1003. }
  1004. resp, err := svc.DescribeDBClusterSnapshotAttributes(params)
  1005. if err != nil {
  1006. // Print the error, cast err to awserr.Error to get the Code and
  1007. // Message from an error.
  1008. fmt.Println(err.Error())
  1009. return
  1010. }
  1011. // Pretty-print the response data.
  1012. fmt.Println(resp)
  1013. }
  1014. func ExampleRDS_DescribeDBClusterSnapshots() {
  1015. sess, err := session.NewSession()
  1016. if err != nil {
  1017. fmt.Println("failed to create session,", err)
  1018. return
  1019. }
  1020. svc := rds.New(sess)
  1021. params := &rds.DescribeDBClusterSnapshotsInput{
  1022. DBClusterIdentifier: aws.String("String"),
  1023. DBClusterSnapshotIdentifier: aws.String("String"),
  1024. Filters: []*rds.Filter{
  1025. { // Required
  1026. Name: aws.String("String"), // Required
  1027. Values: []*string{ // Required
  1028. aws.String("String"), // Required
  1029. // More values...
  1030. },
  1031. },
  1032. // More values...
  1033. },
  1034. IncludePublic: aws.Bool(true),
  1035. IncludeShared: aws.Bool(true),
  1036. Marker: aws.String("String"),
  1037. MaxRecords: aws.Int64(1),
  1038. SnapshotType: aws.String("String"),
  1039. }
  1040. resp, err := svc.DescribeDBClusterSnapshots(params)
  1041. if err != nil {
  1042. // Print the error, cast err to awserr.Error to get the Code and
  1043. // Message from an error.
  1044. fmt.Println(err.Error())
  1045. return
  1046. }
  1047. // Pretty-print the response data.
  1048. fmt.Println(resp)
  1049. }
  1050. func ExampleRDS_DescribeDBClusters() {
  1051. sess, err := session.NewSession()
  1052. if err != nil {
  1053. fmt.Println("failed to create session,", err)
  1054. return
  1055. }
  1056. svc := rds.New(sess)
  1057. params := &rds.DescribeDBClustersInput{
  1058. DBClusterIdentifier: aws.String("String"),
  1059. Filters: []*rds.Filter{
  1060. { // Required
  1061. Name: aws.String("String"), // Required
  1062. Values: []*string{ // Required
  1063. aws.String("String"), // Required
  1064. // More values...
  1065. },
  1066. },
  1067. // More values...
  1068. },
  1069. Marker: aws.String("String"),
  1070. MaxRecords: aws.Int64(1),
  1071. }
  1072. resp, err := svc.DescribeDBClusters(params)
  1073. if err != nil {
  1074. // Print the error, cast err to awserr.Error to get the Code and
  1075. // Message from an error.
  1076. fmt.Println(err.Error())
  1077. return
  1078. }
  1079. // Pretty-print the response data.
  1080. fmt.Println(resp)
  1081. }
  1082. func ExampleRDS_DescribeDBEngineVersions() {
  1083. sess, err := session.NewSession()
  1084. if err != nil {
  1085. fmt.Println("failed to create session,", err)
  1086. return
  1087. }
  1088. svc := rds.New(sess)
  1089. params := &rds.DescribeDBEngineVersionsInput{
  1090. DBParameterGroupFamily: aws.String("String"),
  1091. DefaultOnly: aws.Bool(true),
  1092. Engine: aws.String("String"),
  1093. EngineVersion: aws.String("String"),
  1094. Filters: []*rds.Filter{
  1095. { // Required
  1096. Name: aws.String("String"), // Required
  1097. Values: []*string{ // Required
  1098. aws.String("String"), // Required
  1099. // More values...
  1100. },
  1101. },
  1102. // More values...
  1103. },
  1104. ListSupportedCharacterSets: aws.Bool(true),
  1105. ListSupportedTimezones: aws.Bool(true),
  1106. Marker: aws.String("String"),
  1107. MaxRecords: aws.Int64(1),
  1108. }
  1109. resp, err := svc.DescribeDBEngineVersions(params)
  1110. if err != nil {
  1111. // Print the error, cast err to awserr.Error to get the Code and
  1112. // Message from an error.
  1113. fmt.Println(err.Error())
  1114. return
  1115. }
  1116. // Pretty-print the response data.
  1117. fmt.Println(resp)
  1118. }
  1119. func ExampleRDS_DescribeDBInstances() {
  1120. sess, err := session.NewSession()
  1121. if err != nil {
  1122. fmt.Println("failed to create session,", err)
  1123. return
  1124. }
  1125. svc := rds.New(sess)
  1126. params := &rds.DescribeDBInstancesInput{
  1127. DBInstanceIdentifier: aws.String("String"),
  1128. Filters: []*rds.Filter{
  1129. { // Required
  1130. Name: aws.String("String"), // Required
  1131. Values: []*string{ // Required
  1132. aws.String("String"), // Required
  1133. // More values...
  1134. },
  1135. },
  1136. // More values...
  1137. },
  1138. Marker: aws.String("String"),
  1139. MaxRecords: aws.Int64(1),
  1140. }
  1141. resp, err := svc.DescribeDBInstances(params)
  1142. if err != nil {
  1143. // Print the error, cast err to awserr.Error to get the Code and
  1144. // Message from an error.
  1145. fmt.Println(err.Error())
  1146. return
  1147. }
  1148. // Pretty-print the response data.
  1149. fmt.Println(resp)
  1150. }
  1151. func ExampleRDS_DescribeDBLogFiles() {
  1152. sess, err := session.NewSession()
  1153. if err != nil {
  1154. fmt.Println("failed to create session,", err)
  1155. return
  1156. }
  1157. svc := rds.New(sess)
  1158. params := &rds.DescribeDBLogFilesInput{
  1159. DBInstanceIdentifier: aws.String("String"), // Required
  1160. FileLastWritten: aws.Int64(1),
  1161. FileSize: aws.Int64(1),
  1162. FilenameContains: aws.String("String"),
  1163. Filters: []*rds.Filter{
  1164. { // Required
  1165. Name: aws.String("String"), // Required
  1166. Values: []*string{ // Required
  1167. aws.String("String"), // Required
  1168. // More values...
  1169. },
  1170. },
  1171. // More values...
  1172. },
  1173. Marker: aws.String("String"),
  1174. MaxRecords: aws.Int64(1),
  1175. }
  1176. resp, err := svc.DescribeDBLogFiles(params)
  1177. if err != nil {
  1178. // Print the error, cast err to awserr.Error to get the Code and
  1179. // Message from an error.
  1180. fmt.Println(err.Error())
  1181. return
  1182. }
  1183. // Pretty-print the response data.
  1184. fmt.Println(resp)
  1185. }
  1186. func ExampleRDS_DescribeDBParameterGroups() {
  1187. sess, err := session.NewSession()
  1188. if err != nil {
  1189. fmt.Println("failed to create session,", err)
  1190. return
  1191. }
  1192. svc := rds.New(sess)
  1193. params := &rds.DescribeDBParameterGroupsInput{
  1194. DBParameterGroupName: aws.String("String"),
  1195. Filters: []*rds.Filter{
  1196. { // Required
  1197. Name: aws.String("String"), // Required
  1198. Values: []*string{ // Required
  1199. aws.String("String"), // Required
  1200. // More values...
  1201. },
  1202. },
  1203. // More values...
  1204. },
  1205. Marker: aws.String("String"),
  1206. MaxRecords: aws.Int64(1),
  1207. }
  1208. resp, err := svc.DescribeDBParameterGroups(params)
  1209. if err != nil {
  1210. // Print the error, cast err to awserr.Error to get the Code and
  1211. // Message from an error.
  1212. fmt.Println(err.Error())
  1213. return
  1214. }
  1215. // Pretty-print the response data.
  1216. fmt.Println(resp)
  1217. }
  1218. func ExampleRDS_DescribeDBParameters() {
  1219. sess, err := session.NewSession()
  1220. if err != nil {
  1221. fmt.Println("failed to create session,", err)
  1222. return
  1223. }
  1224. svc := rds.New(sess)
  1225. params := &rds.DescribeDBParametersInput{
  1226. DBParameterGroupName: aws.String("String"), // Required
  1227. Filters: []*rds.Filter{
  1228. { // Required
  1229. Name: aws.String("String"), // Required
  1230. Values: []*string{ // Required
  1231. aws.String("String"), // Required
  1232. // More values...
  1233. },
  1234. },
  1235. // More values...
  1236. },
  1237. Marker: aws.String("String"),
  1238. MaxRecords: aws.Int64(1),
  1239. Source: aws.String("String"),
  1240. }
  1241. resp, err := svc.DescribeDBParameters(params)
  1242. if err != nil {
  1243. // Print the error, cast err to awserr.Error to get the Code and
  1244. // Message from an error.
  1245. fmt.Println(err.Error())
  1246. return
  1247. }
  1248. // Pretty-print the response data.
  1249. fmt.Println(resp)
  1250. }
  1251. func ExampleRDS_DescribeDBSecurityGroups() {
  1252. sess, err := session.NewSession()
  1253. if err != nil {
  1254. fmt.Println("failed to create session,", err)
  1255. return
  1256. }
  1257. svc := rds.New(sess)
  1258. params := &rds.DescribeDBSecurityGroupsInput{
  1259. DBSecurityGroupName: aws.String("String"),
  1260. Filters: []*rds.Filter{
  1261. { // Required
  1262. Name: aws.String("String"), // Required
  1263. Values: []*string{ // Required
  1264. aws.String("String"), // Required
  1265. // More values...
  1266. },
  1267. },
  1268. // More values...
  1269. },
  1270. Marker: aws.String("String"),
  1271. MaxRecords: aws.Int64(1),
  1272. }
  1273. resp, err := svc.DescribeDBSecurityGroups(params)
  1274. if err != nil {
  1275. // Print the error, cast err to awserr.Error to get the Code and
  1276. // Message from an error.
  1277. fmt.Println(err.Error())
  1278. return
  1279. }
  1280. // Pretty-print the response data.
  1281. fmt.Println(resp)
  1282. }
  1283. func ExampleRDS_DescribeDBSnapshotAttributes() {
  1284. sess, err := session.NewSession()
  1285. if err != nil {
  1286. fmt.Println("failed to create session,", err)
  1287. return
  1288. }
  1289. svc := rds.New(sess)
  1290. params := &rds.DescribeDBSnapshotAttributesInput{
  1291. DBSnapshotIdentifier: aws.String("String"), // Required
  1292. }
  1293. resp, err := svc.DescribeDBSnapshotAttributes(params)
  1294. if err != nil {
  1295. // Print the error, cast err to awserr.Error to get the Code and
  1296. // Message from an error.
  1297. fmt.Println(err.Error())
  1298. return
  1299. }
  1300. // Pretty-print the response data.
  1301. fmt.Println(resp)
  1302. }
  1303. func ExampleRDS_DescribeDBSnapshots() {
  1304. sess, err := session.NewSession()
  1305. if err != nil {
  1306. fmt.Println("failed to create session,", err)
  1307. return
  1308. }
  1309. svc := rds.New(sess)
  1310. params := &rds.DescribeDBSnapshotsInput{
  1311. DBInstanceIdentifier: aws.String("String"),
  1312. DBSnapshotIdentifier: aws.String("String"),
  1313. Filters: []*rds.Filter{
  1314. { // Required
  1315. Name: aws.String("String"), // Required
  1316. Values: []*string{ // Required
  1317. aws.String("String"), // Required
  1318. // More values...
  1319. },
  1320. },
  1321. // More values...
  1322. },
  1323. IncludePublic: aws.Bool(true),
  1324. IncludeShared: aws.Bool(true),
  1325. Marker: aws.String("String"),
  1326. MaxRecords: aws.Int64(1),
  1327. SnapshotType: aws.String("String"),
  1328. }
  1329. resp, err := svc.DescribeDBSnapshots(params)
  1330. if err != nil {
  1331. // Print the error, cast err to awserr.Error to get the Code and
  1332. // Message from an error.
  1333. fmt.Println(err.Error())
  1334. return
  1335. }
  1336. // Pretty-print the response data.
  1337. fmt.Println(resp)
  1338. }
  1339. func ExampleRDS_DescribeDBSubnetGroups() {
  1340. sess, err := session.NewSession()
  1341. if err != nil {
  1342. fmt.Println("failed to create session,", err)
  1343. return
  1344. }
  1345. svc := rds.New(sess)
  1346. params := &rds.DescribeDBSubnetGroupsInput{
  1347. DBSubnetGroupName: aws.String("String"),
  1348. Filters: []*rds.Filter{
  1349. { // Required
  1350. Name: aws.String("String"), // Required
  1351. Values: []*string{ // Required
  1352. aws.String("String"), // Required
  1353. // More values...
  1354. },
  1355. },
  1356. // More values...
  1357. },
  1358. Marker: aws.String("String"),
  1359. MaxRecords: aws.Int64(1),
  1360. }
  1361. resp, err := svc.DescribeDBSubnetGroups(params)
  1362. if err != nil {
  1363. // Print the error, cast err to awserr.Error to get the Code and
  1364. // Message from an error.
  1365. fmt.Println(err.Error())
  1366. return
  1367. }
  1368. // Pretty-print the response data.
  1369. fmt.Println(resp)
  1370. }
  1371. func ExampleRDS_DescribeEngineDefaultClusterParameters() {
  1372. sess, err := session.NewSession()
  1373. if err != nil {
  1374. fmt.Println("failed to create session,", err)
  1375. return
  1376. }
  1377. svc := rds.New(sess)
  1378. params := &rds.DescribeEngineDefaultClusterParametersInput{
  1379. DBParameterGroupFamily: aws.String("String"), // Required
  1380. Filters: []*rds.Filter{
  1381. { // Required
  1382. Name: aws.String("String"), // Required
  1383. Values: []*string{ // Required
  1384. aws.String("String"), // Required
  1385. // More values...
  1386. },
  1387. },
  1388. // More values...
  1389. },
  1390. Marker: aws.String("String"),
  1391. MaxRecords: aws.Int64(1),
  1392. }
  1393. resp, err := svc.DescribeEngineDefaultClusterParameters(params)
  1394. if err != nil {
  1395. // Print the error, cast err to awserr.Error to get the Code and
  1396. // Message from an error.
  1397. fmt.Println(err.Error())
  1398. return
  1399. }
  1400. // Pretty-print the response data.
  1401. fmt.Println(resp)
  1402. }
  1403. func ExampleRDS_DescribeEngineDefaultParameters() {
  1404. sess, err := session.NewSession()
  1405. if err != nil {
  1406. fmt.Println("failed to create session,", err)
  1407. return
  1408. }
  1409. svc := rds.New(sess)
  1410. params := &rds.DescribeEngineDefaultParametersInput{
  1411. DBParameterGroupFamily: aws.String("String"), // Required
  1412. Filters: []*rds.Filter{
  1413. { // Required
  1414. Name: aws.String("String"), // Required
  1415. Values: []*string{ // Required
  1416. aws.String("String"), // Required
  1417. // More values...
  1418. },
  1419. },
  1420. // More values...
  1421. },
  1422. Marker: aws.String("String"),
  1423. MaxRecords: aws.Int64(1),
  1424. }
  1425. resp, err := svc.DescribeEngineDefaultParameters(params)
  1426. if err != nil {
  1427. // Print the error, cast err to awserr.Error to get the Code and
  1428. // Message from an error.
  1429. fmt.Println(err.Error())
  1430. return
  1431. }
  1432. // Pretty-print the response data.
  1433. fmt.Println(resp)
  1434. }
  1435. func ExampleRDS_DescribeEventCategories() {
  1436. sess, err := session.NewSession()
  1437. if err != nil {
  1438. fmt.Println("failed to create session,", err)
  1439. return
  1440. }
  1441. svc := rds.New(sess)
  1442. params := &rds.DescribeEventCategoriesInput{
  1443. Filters: []*rds.Filter{
  1444. { // Required
  1445. Name: aws.String("String"), // Required
  1446. Values: []*string{ // Required
  1447. aws.String("String"), // Required
  1448. // More values...
  1449. },
  1450. },
  1451. // More values...
  1452. },
  1453. SourceType: aws.String("String"),
  1454. }
  1455. resp, err := svc.DescribeEventCategories(params)
  1456. if err != nil {
  1457. // Print the error, cast err to awserr.Error to get the Code and
  1458. // Message from an error.
  1459. fmt.Println(err.Error())
  1460. return
  1461. }
  1462. // Pretty-print the response data.
  1463. fmt.Println(resp)
  1464. }
  1465. func ExampleRDS_DescribeEventSubscriptions() {
  1466. sess, err := session.NewSession()
  1467. if err != nil {
  1468. fmt.Println("failed to create session,", err)
  1469. return
  1470. }
  1471. svc := rds.New(sess)
  1472. params := &rds.DescribeEventSubscriptionsInput{
  1473. Filters: []*rds.Filter{
  1474. { // Required
  1475. Name: aws.String("String"), // Required
  1476. Values: []*string{ // Required
  1477. aws.String("String"), // Required
  1478. // More values...
  1479. },
  1480. },
  1481. // More values...
  1482. },
  1483. Marker: aws.String("String"),
  1484. MaxRecords: aws.Int64(1),
  1485. SubscriptionName: aws.String("String"),
  1486. }
  1487. resp, err := svc.DescribeEventSubscriptions(params)
  1488. if err != nil {
  1489. // Print the error, cast err to awserr.Error to get the Code and
  1490. // Message from an error.
  1491. fmt.Println(err.Error())
  1492. return
  1493. }
  1494. // Pretty-print the response data.
  1495. fmt.Println(resp)
  1496. }
  1497. func ExampleRDS_DescribeEvents() {
  1498. sess, err := session.NewSession()
  1499. if err != nil {
  1500. fmt.Println("failed to create session,", err)
  1501. return
  1502. }
  1503. svc := rds.New(sess)
  1504. params := &rds.DescribeEventsInput{
  1505. Duration: aws.Int64(1),
  1506. EndTime: aws.Time(time.Now()),
  1507. EventCategories: []*string{
  1508. aws.String("String"), // Required
  1509. // More values...
  1510. },
  1511. Filters: []*rds.Filter{
  1512. { // Required
  1513. Name: aws.String("String"), // Required
  1514. Values: []*string{ // Required
  1515. aws.String("String"), // Required
  1516. // More values...
  1517. },
  1518. },
  1519. // More values...
  1520. },
  1521. Marker: aws.String("String"),
  1522. MaxRecords: aws.Int64(1),
  1523. SourceIdentifier: aws.String("String"),
  1524. SourceType: aws.String("SourceType"),
  1525. StartTime: aws.Time(time.Now()),
  1526. }
  1527. resp, err := svc.DescribeEvents(params)
  1528. if err != nil {
  1529. // Print the error, cast err to awserr.Error to get the Code and
  1530. // Message from an error.
  1531. fmt.Println(err.Error())
  1532. return
  1533. }
  1534. // Pretty-print the response data.
  1535. fmt.Println(resp)
  1536. }
  1537. func ExampleRDS_DescribeOptionGroupOptions() {
  1538. sess, err := session.NewSession()
  1539. if err != nil {
  1540. fmt.Println("failed to create session,", err)
  1541. return
  1542. }
  1543. svc := rds.New(sess)
  1544. params := &rds.DescribeOptionGroupOptionsInput{
  1545. EngineName: aws.String("String"), // Required
  1546. Filters: []*rds.Filter{
  1547. { // Required
  1548. Name: aws.String("String"), // Required
  1549. Values: []*string{ // Required
  1550. aws.String("String"), // Required
  1551. // More values...
  1552. },
  1553. },
  1554. // More values...
  1555. },
  1556. MajorEngineVersion: aws.String("String"),
  1557. Marker: aws.String("String"),
  1558. MaxRecords: aws.Int64(1),
  1559. }
  1560. resp, err := svc.DescribeOptionGroupOptions(params)
  1561. if err != nil {
  1562. // Print the error, cast err to awserr.Error to get the Code and
  1563. // Message from an error.
  1564. fmt.Println(err.Error())
  1565. return
  1566. }
  1567. // Pretty-print the response data.
  1568. fmt.Println(resp)
  1569. }
  1570. func ExampleRDS_DescribeOptionGroups() {
  1571. sess, err := session.NewSession()
  1572. if err != nil {
  1573. fmt.Println("failed to create session,", err)
  1574. return
  1575. }
  1576. svc := rds.New(sess)
  1577. params := &rds.DescribeOptionGroupsInput{
  1578. EngineName: aws.String("String"),
  1579. Filters: []*rds.Filter{
  1580. { // Required
  1581. Name: aws.String("String"), // Required
  1582. Values: []*string{ // Required
  1583. aws.String("String"), // Required
  1584. // More values...
  1585. },
  1586. },
  1587. // More values...
  1588. },
  1589. MajorEngineVersion: aws.String("String"),
  1590. Marker: aws.String("String"),
  1591. MaxRecords: aws.Int64(1),
  1592. OptionGroupName: aws.String("String"),
  1593. }
  1594. resp, err := svc.DescribeOptionGroups(params)
  1595. if err != nil {
  1596. // Print the error, cast err to awserr.Error to get the Code and
  1597. // Message from an error.
  1598. fmt.Println(err.Error())
  1599. return
  1600. }
  1601. // Pretty-print the response data.
  1602. fmt.Println(resp)
  1603. }
  1604. func ExampleRDS_DescribeOrderableDBInstanceOptions() {
  1605. sess, err := session.NewSession()
  1606. if err != nil {
  1607. fmt.Println("failed to create session,", err)
  1608. return
  1609. }
  1610. svc := rds.New(sess)
  1611. params := &rds.DescribeOrderableDBInstanceOptionsInput{
  1612. Engine: aws.String("String"), // Required
  1613. DBInstanceClass: aws.String("String"),
  1614. EngineVersion: aws.String("String"),
  1615. Filters: []*rds.Filter{
  1616. { // Required
  1617. Name: aws.String("String"), // Required
  1618. Values: []*string{ // Required
  1619. aws.String("String"), // Required
  1620. // More values...
  1621. },
  1622. },
  1623. // More values...
  1624. },
  1625. LicenseModel: aws.String("String"),
  1626. Marker: aws.String("String"),
  1627. MaxRecords: aws.Int64(1),
  1628. Vpc: aws.Bool(true),
  1629. }
  1630. resp, err := svc.DescribeOrderableDBInstanceOptions(params)
  1631. if err != nil {
  1632. // Print the error, cast err to awserr.Error to get the Code and
  1633. // Message from an error.
  1634. fmt.Println(err.Error())
  1635. return
  1636. }
  1637. // Pretty-print the response data.
  1638. fmt.Println(resp)
  1639. }
  1640. func ExampleRDS_DescribePendingMaintenanceActions() {
  1641. sess, err := session.NewSession()
  1642. if err != nil {
  1643. fmt.Println("failed to create session,", err)
  1644. return
  1645. }
  1646. svc := rds.New(sess)
  1647. params := &rds.DescribePendingMaintenanceActionsInput{
  1648. Filters: []*rds.Filter{
  1649. { // Required
  1650. Name: aws.String("String"), // Required
  1651. Values: []*string{ // Required
  1652. aws.String("String"), // Required
  1653. // More values...
  1654. },
  1655. },
  1656. // More values...
  1657. },
  1658. Marker: aws.String("String"),
  1659. MaxRecords: aws.Int64(1),
  1660. ResourceIdentifier: aws.String("String"),
  1661. }
  1662. resp, err := svc.DescribePendingMaintenanceActions(params)
  1663. if err != nil {
  1664. // Print the error, cast err to awserr.Error to get the Code and
  1665. // Message from an error.
  1666. fmt.Println(err.Error())
  1667. return
  1668. }
  1669. // Pretty-print the response data.
  1670. fmt.Println(resp)
  1671. }
  1672. func ExampleRDS_DescribeReservedDBInstances() {
  1673. sess, err := session.NewSession()
  1674. if err != nil {
  1675. fmt.Println("failed to create session,", err)
  1676. return
  1677. }
  1678. svc := rds.New(sess)
  1679. params := &rds.DescribeReservedDBInstancesInput{
  1680. DBInstanceClass: aws.String("String"),
  1681. Duration: aws.String("String"),
  1682. Filters: []*rds.Filter{
  1683. { // Required
  1684. Name: aws.String("String"), // Required
  1685. Values: []*string{ // Required
  1686. aws.String("String"), // Required
  1687. // More values...
  1688. },
  1689. },
  1690. // More values...
  1691. },
  1692. Marker: aws.String("String"),
  1693. MaxRecords: aws.Int64(1),
  1694. MultiAZ: aws.Bool(true),
  1695. OfferingType: aws.String("String"),
  1696. ProductDescription: aws.String("String"),
  1697. ReservedDBInstanceId: aws.String("String"),
  1698. ReservedDBInstancesOfferingId: aws.String("String"),
  1699. }
  1700. resp, err := svc.DescribeReservedDBInstances(params)
  1701. if err != nil {
  1702. // Print the error, cast err to awserr.Error to get the Code and
  1703. // Message from an error.
  1704. fmt.Println(err.Error())
  1705. return
  1706. }
  1707. // Pretty-print the response data.
  1708. fmt.Println(resp)
  1709. }
  1710. func ExampleRDS_DescribeReservedDBInstancesOfferings() {
  1711. sess, err := session.NewSession()
  1712. if err != nil {
  1713. fmt.Println("failed to create session,", err)
  1714. return
  1715. }
  1716. svc := rds.New(sess)
  1717. params := &rds.DescribeReservedDBInstancesOfferingsInput{
  1718. DBInstanceClass: aws.String("String"),
  1719. Duration: aws.String("String"),
  1720. Filters: []*rds.Filter{
  1721. { // Required
  1722. Name: aws.String("String"), // Required
  1723. Values: []*string{ // Required
  1724. aws.String("String"), // Required
  1725. // More values...
  1726. },
  1727. },
  1728. // More values...
  1729. },
  1730. Marker: aws.String("String"),
  1731. MaxRecords: aws.Int64(1),
  1732. MultiAZ: aws.Bool(true),
  1733. OfferingType: aws.String("String"),
  1734. ProductDescription: aws.String("String"),
  1735. ReservedDBInstancesOfferingId: aws.String("String"),
  1736. }
  1737. resp, err := svc.DescribeReservedDBInstancesOfferings(params)
  1738. if err != nil {
  1739. // Print the error, cast err to awserr.Error to get the Code and
  1740. // Message from an error.
  1741. fmt.Println(err.Error())
  1742. return
  1743. }
  1744. // Pretty-print the response data.
  1745. fmt.Println(resp)
  1746. }
  1747. func ExampleRDS_DescribeSourceRegions() {
  1748. sess, err := session.NewSession()
  1749. if err != nil {
  1750. fmt.Println("failed to create session,", err)
  1751. return
  1752. }
  1753. svc := rds.New(sess)
  1754. params := &rds.DescribeSourceRegionsInput{
  1755. Filters: []*rds.Filter{
  1756. { // Required
  1757. Name: aws.String("String"), // Required
  1758. Values: []*string{ // Required
  1759. aws.String("String"), // Required
  1760. // More values...
  1761. },
  1762. },
  1763. // More values...
  1764. },
  1765. Marker: aws.String("String"),
  1766. MaxRecords: aws.Int64(1),
  1767. RegionName: aws.String("String"),
  1768. }
  1769. resp, err := svc.DescribeSourceRegions(params)
  1770. if err != nil {
  1771. // Print the error, cast err to awserr.Error to get the Code and
  1772. // Message from an error.
  1773. fmt.Println(err.Error())
  1774. return
  1775. }
  1776. // Pretty-print the response data.
  1777. fmt.Println(resp)
  1778. }
  1779. func ExampleRDS_DownloadDBLogFilePortion() {
  1780. sess, err := session.NewSession()
  1781. if err != nil {
  1782. fmt.Println("failed to create session,", err)
  1783. return
  1784. }
  1785. svc := rds.New(sess)
  1786. params := &rds.DownloadDBLogFilePortionInput{
  1787. DBInstanceIdentifier: aws.String("String"), // Required
  1788. LogFileName: aws.String("String"), // Required
  1789. Marker: aws.String("String"),
  1790. NumberOfLines: aws.Int64(1),
  1791. }
  1792. resp, err := svc.DownloadDBLogFilePortion(params)
  1793. if err != nil {
  1794. // Print the error, cast err to awserr.Error to get the Code and
  1795. // Message from an error.
  1796. fmt.Println(err.Error())
  1797. return
  1798. }
  1799. // Pretty-print the response data.
  1800. fmt.Println(resp)
  1801. }
  1802. func ExampleRDS_FailoverDBCluster() {
  1803. sess, err := session.NewSession()
  1804. if err != nil {
  1805. fmt.Println("failed to create session,", err)
  1806. return
  1807. }
  1808. svc := rds.New(sess)
  1809. params := &rds.FailoverDBClusterInput{
  1810. DBClusterIdentifier: aws.String("String"),
  1811. TargetDBInstanceIdentifier: aws.String("String"),
  1812. }
  1813. resp, err := svc.FailoverDBCluster(params)
  1814. if err != nil {
  1815. // Print the error, cast err to awserr.Error to get the Code and
  1816. // Message from an error.
  1817. fmt.Println(err.Error())
  1818. return
  1819. }
  1820. // Pretty-print the response data.
  1821. fmt.Println(resp)
  1822. }
  1823. func ExampleRDS_ListTagsForResource() {
  1824. sess, err := session.NewSession()
  1825. if err != nil {
  1826. fmt.Println("failed to create session,", err)
  1827. return
  1828. }
  1829. svc := rds.New(sess)
  1830. params := &rds.ListTagsForResourceInput{
  1831. ResourceName: aws.String("String"), // Required
  1832. Filters: []*rds.Filter{
  1833. { // Required
  1834. Name: aws.String("String"), // Required
  1835. Values: []*string{ // Required
  1836. aws.String("String"), // Required
  1837. // More values...
  1838. },
  1839. },
  1840. // More values...
  1841. },
  1842. }
  1843. resp, err := svc.ListTagsForResource(params)
  1844. if err != nil {
  1845. // Print the error, cast err to awserr.Error to get the Code and
  1846. // Message from an error.
  1847. fmt.Println(err.Error())
  1848. return
  1849. }
  1850. // Pretty-print the response data.
  1851. fmt.Println(resp)
  1852. }
  1853. func ExampleRDS_ModifyDBCluster() {
  1854. sess, err := session.NewSession()
  1855. if err != nil {
  1856. fmt.Println("failed to create session,", err)
  1857. return
  1858. }
  1859. svc := rds.New(sess)
  1860. params := &rds.ModifyDBClusterInput{
  1861. DBClusterIdentifier: aws.String("String"), // Required
  1862. ApplyImmediately: aws.Bool(true),
  1863. BackupRetentionPeriod: aws.Int64(1),
  1864. DBClusterParameterGroupName: aws.String("String"),
  1865. MasterUserPassword: aws.String("String"),
  1866. NewDBClusterIdentifier: aws.String("String"),
  1867. OptionGroupName: aws.String("String"),
  1868. Port: aws.Int64(1),
  1869. PreferredBackupWindow: aws.String("String"),
  1870. PreferredMaintenanceWindow: aws.String("String"),
  1871. VpcSecurityGroupIds: []*string{
  1872. aws.String("String"), // Required
  1873. // More values...
  1874. },
  1875. }
  1876. resp, err := svc.ModifyDBCluster(params)
  1877. if err != nil {
  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. return
  1882. }
  1883. // Pretty-print the response data.
  1884. fmt.Println(resp)
  1885. }
  1886. func ExampleRDS_ModifyDBClusterParameterGroup() {
  1887. sess, err := session.NewSession()
  1888. if err != nil {
  1889. fmt.Println("failed to create session,", err)
  1890. return
  1891. }
  1892. svc := rds.New(sess)
  1893. params := &rds.ModifyDBClusterParameterGroupInput{
  1894. DBClusterParameterGroupName: aws.String("String"), // Required
  1895. Parameters: []*rds.Parameter{ // Required
  1896. { // Required
  1897. AllowedValues: aws.String("String"),
  1898. ApplyMethod: aws.String("ApplyMethod"),
  1899. ApplyType: aws.String("String"),
  1900. DataType: aws.String("String"),
  1901. Description: aws.String("String"),
  1902. IsModifiable: aws.Bool(true),
  1903. MinimumEngineVersion: aws.String("String"),
  1904. ParameterName: aws.String("String"),
  1905. ParameterValue: aws.String("String"),
  1906. Source: aws.String("String"),
  1907. },
  1908. // More values...
  1909. },
  1910. }
  1911. resp, err := svc.ModifyDBClusterParameterGroup(params)
  1912. if err != nil {
  1913. // Print the error, cast err to awserr.Error to get the Code and
  1914. // Message from an error.
  1915. fmt.Println(err.Error())
  1916. return
  1917. }
  1918. // Pretty-print the response data.
  1919. fmt.Println(resp)
  1920. }
  1921. func ExampleRDS_ModifyDBClusterSnapshotAttribute() {
  1922. sess, err := session.NewSession()
  1923. if err != nil {
  1924. fmt.Println("failed to create session,", err)
  1925. return
  1926. }
  1927. svc := rds.New(sess)
  1928. params := &rds.ModifyDBClusterSnapshotAttributeInput{
  1929. AttributeName: aws.String("String"), // Required
  1930. DBClusterSnapshotIdentifier: aws.String("String"), // Required
  1931. ValuesToAdd: []*string{
  1932. aws.String("String"), // Required
  1933. // More values...
  1934. },
  1935. ValuesToRemove: []*string{
  1936. aws.String("String"), // Required
  1937. // More values...
  1938. },
  1939. }
  1940. resp, err := svc.ModifyDBClusterSnapshotAttribute(params)
  1941. if err != nil {
  1942. // Print the error, cast err to awserr.Error to get the Code and
  1943. // Message from an error.
  1944. fmt.Println(err.Error())
  1945. return
  1946. }
  1947. // Pretty-print the response data.
  1948. fmt.Println(resp)
  1949. }
  1950. func ExampleRDS_ModifyDBInstance() {
  1951. sess, err := session.NewSession()
  1952. if err != nil {
  1953. fmt.Println("failed to create session,", err)
  1954. return
  1955. }
  1956. svc := rds.New(sess)
  1957. params := &rds.ModifyDBInstanceInput{
  1958. DBInstanceIdentifier: aws.String("String"), // Required
  1959. AllocatedStorage: aws.Int64(1),
  1960. AllowMajorVersionUpgrade: aws.Bool(true),
  1961. ApplyImmediately: aws.Bool(true),
  1962. AutoMinorVersionUpgrade: aws.Bool(true),
  1963. BackupRetentionPeriod: aws.Int64(1),
  1964. CACertificateIdentifier: aws.String("String"),
  1965. CopyTagsToSnapshot: aws.Bool(true),
  1966. DBInstanceClass: aws.String("String"),
  1967. DBParameterGroupName: aws.String("String"),
  1968. DBPortNumber: aws.Int64(1),
  1969. DBSecurityGroups: []*string{
  1970. aws.String("String"), // Required
  1971. // More values...
  1972. },
  1973. DBSubnetGroupName: aws.String("String"),
  1974. Domain: aws.String("String"),
  1975. DomainIAMRoleName: aws.String("String"),
  1976. EngineVersion: aws.String("String"),
  1977. Iops: aws.Int64(1),
  1978. LicenseModel: aws.String("String"),
  1979. MasterUserPassword: aws.String("String"),
  1980. MonitoringInterval: aws.Int64(1),
  1981. MonitoringRoleArn: aws.String("String"),
  1982. MultiAZ: aws.Bool(true),
  1983. NewDBInstanceIdentifier: aws.String("String"),
  1984. OptionGroupName: aws.String("String"),
  1985. PreferredBackupWindow: aws.String("String"),
  1986. PreferredMaintenanceWindow: aws.String("String"),
  1987. PromotionTier: aws.Int64(1),
  1988. PubliclyAccessible: aws.Bool(true),
  1989. StorageType: aws.String("String"),
  1990. TdeCredentialArn: aws.String("String"),
  1991. TdeCredentialPassword: aws.String("String"),
  1992. VpcSecurityGroupIds: []*string{
  1993. aws.String("String"), // Required
  1994. // More values...
  1995. },
  1996. }
  1997. resp, err := svc.ModifyDBInstance(params)
  1998. if err != nil {
  1999. // Print the error, cast err to awserr.Error to get the Code and
  2000. // Message from an error.
  2001. fmt.Println(err.Error())
  2002. return
  2003. }
  2004. // Pretty-print the response data.
  2005. fmt.Println(resp)
  2006. }
  2007. func ExampleRDS_ModifyDBParameterGroup() {
  2008. sess, err := session.NewSession()
  2009. if err != nil {
  2010. fmt.Println("failed to create session,", err)
  2011. return
  2012. }
  2013. svc := rds.New(sess)
  2014. params := &rds.ModifyDBParameterGroupInput{
  2015. DBParameterGroupName: aws.String("String"), // Required
  2016. Parameters: []*rds.Parameter{ // Required
  2017. { // Required
  2018. AllowedValues: aws.String("String"),
  2019. ApplyMethod: aws.String("ApplyMethod"),
  2020. ApplyType: aws.String("String"),
  2021. DataType: aws.String("String"),
  2022. Description: aws.String("String"),
  2023. IsModifiable: aws.Bool(true),
  2024. MinimumEngineVersion: aws.String("String"),
  2025. ParameterName: aws.String("String"),
  2026. ParameterValue: aws.String("String"),
  2027. Source: aws.String("String"),
  2028. },
  2029. // More values...
  2030. },
  2031. }
  2032. resp, err := svc.ModifyDBParameterGroup(params)
  2033. if err != nil {
  2034. // Print the error, cast err to awserr.Error to get the Code and
  2035. // Message from an error.
  2036. fmt.Println(err.Error())
  2037. return
  2038. }
  2039. // Pretty-print the response data.
  2040. fmt.Println(resp)
  2041. }
  2042. func ExampleRDS_ModifyDBSnapshotAttribute() {
  2043. sess, err := session.NewSession()
  2044. if err != nil {
  2045. fmt.Println("failed to create session,", err)
  2046. return
  2047. }
  2048. svc := rds.New(sess)
  2049. params := &rds.ModifyDBSnapshotAttributeInput{
  2050. AttributeName: aws.String("String"), // Required
  2051. DBSnapshotIdentifier: aws.String("String"), // Required
  2052. ValuesToAdd: []*string{
  2053. aws.String("String"), // Required
  2054. // More values...
  2055. },
  2056. ValuesToRemove: []*string{
  2057. aws.String("String"), // Required
  2058. // More values...
  2059. },
  2060. }
  2061. resp, err := svc.ModifyDBSnapshotAttribute(params)
  2062. if err != nil {
  2063. // Print the error, cast err to awserr.Error to get the Code and
  2064. // Message from an error.
  2065. fmt.Println(err.Error())
  2066. return
  2067. }
  2068. // Pretty-print the response data.
  2069. fmt.Println(resp)
  2070. }
  2071. func ExampleRDS_ModifyDBSubnetGroup() {
  2072. sess, err := session.NewSession()
  2073. if err != nil {
  2074. fmt.Println("failed to create session,", err)
  2075. return
  2076. }
  2077. svc := rds.New(sess)
  2078. params := &rds.ModifyDBSubnetGroupInput{
  2079. DBSubnetGroupName: aws.String("String"), // Required
  2080. SubnetIds: []*string{ // Required
  2081. aws.String("String"), // Required
  2082. // More values...
  2083. },
  2084. DBSubnetGroupDescription: aws.String("String"),
  2085. }
  2086. resp, err := svc.ModifyDBSubnetGroup(params)
  2087. if err != nil {
  2088. // Print the error, cast err to awserr.Error to get the Code and
  2089. // Message from an error.
  2090. fmt.Println(err.Error())
  2091. return
  2092. }
  2093. // Pretty-print the response data.
  2094. fmt.Println(resp)
  2095. }
  2096. func ExampleRDS_ModifyEventSubscription() {
  2097. sess, err := session.NewSession()
  2098. if err != nil {
  2099. fmt.Println("failed to create session,", err)
  2100. return
  2101. }
  2102. svc := rds.New(sess)
  2103. params := &rds.ModifyEventSubscriptionInput{
  2104. SubscriptionName: aws.String("String"), // Required
  2105. Enabled: aws.Bool(true),
  2106. EventCategories: []*string{
  2107. aws.String("String"), // Required
  2108. // More values...
  2109. },
  2110. SnsTopicArn: aws.String("String"),
  2111. SourceType: aws.String("String"),
  2112. }
  2113. resp, err := svc.ModifyEventSubscription(params)
  2114. if err != nil {
  2115. // Print the error, cast err to awserr.Error to get the Code and
  2116. // Message from an error.
  2117. fmt.Println(err.Error())
  2118. return
  2119. }
  2120. // Pretty-print the response data.
  2121. fmt.Println(resp)
  2122. }
  2123. func ExampleRDS_ModifyOptionGroup() {
  2124. sess, err := session.NewSession()
  2125. if err != nil {
  2126. fmt.Println("failed to create session,", err)
  2127. return
  2128. }
  2129. svc := rds.New(sess)
  2130. params := &rds.ModifyOptionGroupInput{
  2131. OptionGroupName: aws.String("String"), // Required
  2132. ApplyImmediately: aws.Bool(true),
  2133. OptionsToInclude: []*rds.OptionConfiguration{
  2134. { // Required
  2135. OptionName: aws.String("String"), // Required
  2136. DBSecurityGroupMemberships: []*string{
  2137. aws.String("String"), // Required
  2138. // More values...
  2139. },
  2140. OptionSettings: []*rds.OptionSetting{
  2141. { // Required
  2142. AllowedValues: aws.String("String"),
  2143. ApplyType: aws.String("String"),
  2144. DataType: aws.String("String"),
  2145. DefaultValue: aws.String("String"),
  2146. Description: aws.String("String"),
  2147. IsCollection: aws.Bool(true),
  2148. IsModifiable: aws.Bool(true),
  2149. Name: aws.String("String"),
  2150. Value: aws.String("String"),
  2151. },
  2152. // More values...
  2153. },
  2154. OptionVersion: aws.String("String"),
  2155. Port: aws.Int64(1),
  2156. VpcSecurityGroupMemberships: []*string{
  2157. aws.String("String"), // Required
  2158. // More values...
  2159. },
  2160. },
  2161. // More values...
  2162. },
  2163. OptionsToRemove: []*string{
  2164. aws.String("String"), // Required
  2165. // More values...
  2166. },
  2167. }
  2168. resp, err := svc.ModifyOptionGroup(params)
  2169. if err != nil {
  2170. // Print the error, cast err to awserr.Error to get the Code and
  2171. // Message from an error.
  2172. fmt.Println(err.Error())
  2173. return
  2174. }
  2175. // Pretty-print the response data.
  2176. fmt.Println(resp)
  2177. }
  2178. func ExampleRDS_PromoteReadReplica() {
  2179. sess, err := session.NewSession()
  2180. if err != nil {
  2181. fmt.Println("failed to create session,", err)
  2182. return
  2183. }
  2184. svc := rds.New(sess)
  2185. params := &rds.PromoteReadReplicaInput{
  2186. DBInstanceIdentifier: aws.String("String"), // Required
  2187. BackupRetentionPeriod: aws.Int64(1),
  2188. PreferredBackupWindow: aws.String("String"),
  2189. }
  2190. resp, err := svc.PromoteReadReplica(params)
  2191. if err != nil {
  2192. // Print the error, cast err to awserr.Error to get the Code and
  2193. // Message from an error.
  2194. fmt.Println(err.Error())
  2195. return
  2196. }
  2197. // Pretty-print the response data.
  2198. fmt.Println(resp)
  2199. }
  2200. func ExampleRDS_PromoteReadReplicaDBCluster() {
  2201. sess, err := session.NewSession()
  2202. if err != nil {
  2203. fmt.Println("failed to create session,", err)
  2204. return
  2205. }
  2206. svc := rds.New(sess)
  2207. params := &rds.PromoteReadReplicaDBClusterInput{
  2208. DBClusterIdentifier: aws.String("String"), // Required
  2209. }
  2210. resp, err := svc.PromoteReadReplicaDBCluster(params)
  2211. if err != nil {
  2212. // Print the error, cast err to awserr.Error to get the Code and
  2213. // Message from an error.
  2214. fmt.Println(err.Error())
  2215. return
  2216. }
  2217. // Pretty-print the response data.
  2218. fmt.Println(resp)
  2219. }
  2220. func ExampleRDS_PurchaseReservedDBInstancesOffering() {
  2221. sess, err := session.NewSession()
  2222. if err != nil {
  2223. fmt.Println("failed to create session,", err)
  2224. return
  2225. }
  2226. svc := rds.New(sess)
  2227. params := &rds.PurchaseReservedDBInstancesOfferingInput{
  2228. ReservedDBInstancesOfferingId: aws.String("String"), // Required
  2229. DBInstanceCount: aws.Int64(1),
  2230. ReservedDBInstanceId: aws.String("String"),
  2231. Tags: []*rds.Tag{
  2232. { // Required
  2233. Key: aws.String("String"),
  2234. Value: aws.String("String"),
  2235. },
  2236. // More values...
  2237. },
  2238. }
  2239. resp, err := svc.PurchaseReservedDBInstancesOffering(params)
  2240. if err != nil {
  2241. // Print the error, cast err to awserr.Error to get the Code and
  2242. // Message from an error.
  2243. fmt.Println(err.Error())
  2244. return
  2245. }
  2246. // Pretty-print the response data.
  2247. fmt.Println(resp)
  2248. }
  2249. func ExampleRDS_RebootDBInstance() {
  2250. sess, err := session.NewSession()
  2251. if err != nil {
  2252. fmt.Println("failed to create session,", err)
  2253. return
  2254. }
  2255. svc := rds.New(sess)
  2256. params := &rds.RebootDBInstanceInput{
  2257. DBInstanceIdentifier: aws.String("String"), // Required
  2258. ForceFailover: aws.Bool(true),
  2259. }
  2260. resp, err := svc.RebootDBInstance(params)
  2261. if err != nil {
  2262. // Print the error, cast err to awserr.Error to get the Code and
  2263. // Message from an error.
  2264. fmt.Println(err.Error())
  2265. return
  2266. }
  2267. // Pretty-print the response data.
  2268. fmt.Println(resp)
  2269. }
  2270. func ExampleRDS_RemoveRoleFromDBCluster() {
  2271. sess, err := session.NewSession()
  2272. if err != nil {
  2273. fmt.Println("failed to create session,", err)
  2274. return
  2275. }
  2276. svc := rds.New(sess)
  2277. params := &rds.RemoveRoleFromDBClusterInput{
  2278. DBClusterIdentifier: aws.String("String"), // Required
  2279. RoleArn: aws.String("String"), // Required
  2280. }
  2281. resp, err := svc.RemoveRoleFromDBCluster(params)
  2282. if err != nil {
  2283. // Print the error, cast err to awserr.Error to get the Code and
  2284. // Message from an error.
  2285. fmt.Println(err.Error())
  2286. return
  2287. }
  2288. // Pretty-print the response data.
  2289. fmt.Println(resp)
  2290. }
  2291. func ExampleRDS_RemoveSourceIdentifierFromSubscription() {
  2292. sess, err := session.NewSession()
  2293. if err != nil {
  2294. fmt.Println("failed to create session,", err)
  2295. return
  2296. }
  2297. svc := rds.New(sess)
  2298. params := &rds.RemoveSourceIdentifierFromSubscriptionInput{
  2299. SourceIdentifier: aws.String("String"), // Required
  2300. SubscriptionName: aws.String("String"), // Required
  2301. }
  2302. resp, err := svc.RemoveSourceIdentifierFromSubscription(params)
  2303. if err != nil {
  2304. // Print the error, cast err to awserr.Error to get the Code and
  2305. // Message from an error.
  2306. fmt.Println(err.Error())
  2307. return
  2308. }
  2309. // Pretty-print the response data.
  2310. fmt.Println(resp)
  2311. }
  2312. func ExampleRDS_RemoveTagsFromResource() {
  2313. sess, err := session.NewSession()
  2314. if err != nil {
  2315. fmt.Println("failed to create session,", err)
  2316. return
  2317. }
  2318. svc := rds.New(sess)
  2319. params := &rds.RemoveTagsFromResourceInput{
  2320. ResourceName: aws.String("String"), // Required
  2321. TagKeys: []*string{ // Required
  2322. aws.String("String"), // Required
  2323. // More values...
  2324. },
  2325. }
  2326. resp, err := svc.RemoveTagsFromResource(params)
  2327. if err != nil {
  2328. // Print the error, cast err to awserr.Error to get the Code and
  2329. // Message from an error.
  2330. fmt.Println(err.Error())
  2331. return
  2332. }
  2333. // Pretty-print the response data.
  2334. fmt.Println(resp)
  2335. }
  2336. func ExampleRDS_ResetDBClusterParameterGroup() {
  2337. sess, err := session.NewSession()
  2338. if err != nil {
  2339. fmt.Println("failed to create session,", err)
  2340. return
  2341. }
  2342. svc := rds.New(sess)
  2343. params := &rds.ResetDBClusterParameterGroupInput{
  2344. DBClusterParameterGroupName: aws.String("String"), // Required
  2345. Parameters: []*rds.Parameter{
  2346. { // Required
  2347. AllowedValues: aws.String("String"),
  2348. ApplyMethod: aws.String("ApplyMethod"),
  2349. ApplyType: aws.String("String"),
  2350. DataType: aws.String("String"),
  2351. Description: aws.String("String"),
  2352. IsModifiable: aws.Bool(true),
  2353. MinimumEngineVersion: aws.String("String"),
  2354. ParameterName: aws.String("String"),
  2355. ParameterValue: aws.String("String"),
  2356. Source: aws.String("String"),
  2357. },
  2358. // More values...
  2359. },
  2360. ResetAllParameters: aws.Bool(true),
  2361. }
  2362. resp, err := svc.ResetDBClusterParameterGroup(params)
  2363. if err != nil {
  2364. // Print the error, cast err to awserr.Error to get the Code and
  2365. // Message from an error.
  2366. fmt.Println(err.Error())
  2367. return
  2368. }
  2369. // Pretty-print the response data.
  2370. fmt.Println(resp)
  2371. }
  2372. func ExampleRDS_ResetDBParameterGroup() {
  2373. sess, err := session.NewSession()
  2374. if err != nil {
  2375. fmt.Println("failed to create session,", err)
  2376. return
  2377. }
  2378. svc := rds.New(sess)
  2379. params := &rds.ResetDBParameterGroupInput{
  2380. DBParameterGroupName: aws.String("String"), // Required
  2381. Parameters: []*rds.Parameter{
  2382. { // Required
  2383. AllowedValues: aws.String("String"),
  2384. ApplyMethod: aws.String("ApplyMethod"),
  2385. ApplyType: aws.String("String"),
  2386. DataType: aws.String("String"),
  2387. Description: aws.String("String"),
  2388. IsModifiable: aws.Bool(true),
  2389. MinimumEngineVersion: aws.String("String"),
  2390. ParameterName: aws.String("String"),
  2391. ParameterValue: aws.String("String"),
  2392. Source: aws.String("String"),
  2393. },
  2394. // More values...
  2395. },
  2396. ResetAllParameters: aws.Bool(true),
  2397. }
  2398. resp, err := svc.ResetDBParameterGroup(params)
  2399. if err != nil {
  2400. // Print the error, cast err to awserr.Error to get the Code and
  2401. // Message from an error.
  2402. fmt.Println(err.Error())
  2403. return
  2404. }
  2405. // Pretty-print the response data.
  2406. fmt.Println(resp)
  2407. }
  2408. func ExampleRDS_RestoreDBClusterFromS3() {
  2409. sess, err := session.NewSession()
  2410. if err != nil {
  2411. fmt.Println("failed to create session,", err)
  2412. return
  2413. }
  2414. svc := rds.New(sess)
  2415. params := &rds.RestoreDBClusterFromS3Input{
  2416. DBClusterIdentifier: aws.String("String"), // Required
  2417. Engine: aws.String("String"), // Required
  2418. MasterUserPassword: aws.String("String"), // Required
  2419. MasterUsername: aws.String("String"), // Required
  2420. S3BucketName: aws.String("String"), // Required
  2421. S3IngestionRoleArn: aws.String("String"), // Required
  2422. SourceEngine: aws.String("String"), // Required
  2423. SourceEngineVersion: aws.String("String"), // Required
  2424. AvailabilityZones: []*string{
  2425. aws.String("String"), // Required
  2426. // More values...
  2427. },
  2428. BackupRetentionPeriod: aws.Int64(1),
  2429. CharacterSetName: aws.String("String"),
  2430. DBClusterParameterGroupName: aws.String("String"),
  2431. DBSubnetGroupName: aws.String("String"),
  2432. DatabaseName: aws.String("String"),
  2433. EngineVersion: aws.String("String"),
  2434. KmsKeyId: aws.String("String"),
  2435. OptionGroupName: aws.String("String"),
  2436. Port: aws.Int64(1),
  2437. PreferredBackupWindow: aws.String("String"),
  2438. PreferredMaintenanceWindow: aws.String("String"),
  2439. S3Prefix: aws.String("String"),
  2440. StorageEncrypted: aws.Bool(true),
  2441. Tags: []*rds.Tag{
  2442. { // Required
  2443. Key: aws.String("String"),
  2444. Value: aws.String("String"),
  2445. },
  2446. // More values...
  2447. },
  2448. VpcSecurityGroupIds: []*string{
  2449. aws.String("String"), // Required
  2450. // More values...
  2451. },
  2452. }
  2453. resp, err := svc.RestoreDBClusterFromS3(params)
  2454. if err != nil {
  2455. // Print the error, cast err to awserr.Error to get the Code and
  2456. // Message from an error.
  2457. fmt.Println(err.Error())
  2458. return
  2459. }
  2460. // Pretty-print the response data.
  2461. fmt.Println(resp)
  2462. }
  2463. func ExampleRDS_RestoreDBClusterFromSnapshot() {
  2464. sess, err := session.NewSession()
  2465. if err != nil {
  2466. fmt.Println("failed to create session,", err)
  2467. return
  2468. }
  2469. svc := rds.New(sess)
  2470. params := &rds.RestoreDBClusterFromSnapshotInput{
  2471. DBClusterIdentifier: aws.String("String"), // Required
  2472. Engine: aws.String("String"), // Required
  2473. SnapshotIdentifier: aws.String("String"), // Required
  2474. AvailabilityZones: []*string{
  2475. aws.String("String"), // Required
  2476. // More values...
  2477. },
  2478. DBSubnetGroupName: aws.String("String"),
  2479. DatabaseName: aws.String("String"),
  2480. EngineVersion: aws.String("String"),
  2481. KmsKeyId: aws.String("String"),
  2482. OptionGroupName: aws.String("String"),
  2483. Port: aws.Int64(1),
  2484. Tags: []*rds.Tag{
  2485. { // Required
  2486. Key: aws.String("String"),
  2487. Value: aws.String("String"),
  2488. },
  2489. // More values...
  2490. },
  2491. VpcSecurityGroupIds: []*string{
  2492. aws.String("String"), // Required
  2493. // More values...
  2494. },
  2495. }
  2496. resp, err := svc.RestoreDBClusterFromSnapshot(params)
  2497. if err != nil {
  2498. // Print the error, cast err to awserr.Error to get the Code and
  2499. // Message from an error.
  2500. fmt.Println(err.Error())
  2501. return
  2502. }
  2503. // Pretty-print the response data.
  2504. fmt.Println(resp)
  2505. }
  2506. func ExampleRDS_RestoreDBClusterToPointInTime() {
  2507. sess, err := session.NewSession()
  2508. if err != nil {
  2509. fmt.Println("failed to create session,", err)
  2510. return
  2511. }
  2512. svc := rds.New(sess)
  2513. params := &rds.RestoreDBClusterToPointInTimeInput{
  2514. DBClusterIdentifier: aws.String("String"), // Required
  2515. SourceDBClusterIdentifier: aws.String("String"), // Required
  2516. DBSubnetGroupName: aws.String("String"),
  2517. KmsKeyId: aws.String("String"),
  2518. OptionGroupName: aws.String("String"),
  2519. Port: aws.Int64(1),
  2520. RestoreToTime: aws.Time(time.Now()),
  2521. Tags: []*rds.Tag{
  2522. { // Required
  2523. Key: aws.String("String"),
  2524. Value: aws.String("String"),
  2525. },
  2526. // More values...
  2527. },
  2528. UseLatestRestorableTime: aws.Bool(true),
  2529. VpcSecurityGroupIds: []*string{
  2530. aws.String("String"), // Required
  2531. // More values...
  2532. },
  2533. }
  2534. resp, err := svc.RestoreDBClusterToPointInTime(params)
  2535. if err != nil {
  2536. // Print the error, cast err to awserr.Error to get the Code and
  2537. // Message from an error.
  2538. fmt.Println(err.Error())
  2539. return
  2540. }
  2541. // Pretty-print the response data.
  2542. fmt.Println(resp)
  2543. }
  2544. func ExampleRDS_RestoreDBInstanceFromDBSnapshot() {
  2545. sess, err := session.NewSession()
  2546. if err != nil {
  2547. fmt.Println("failed to create session,", err)
  2548. return
  2549. }
  2550. svc := rds.New(sess)
  2551. params := &rds.RestoreDBInstanceFromDBSnapshotInput{
  2552. DBInstanceIdentifier: aws.String("String"), // Required
  2553. DBSnapshotIdentifier: aws.String("String"), // Required
  2554. AutoMinorVersionUpgrade: aws.Bool(true),
  2555. AvailabilityZone: aws.String("String"),
  2556. CopyTagsToSnapshot: aws.Bool(true),
  2557. DBInstanceClass: aws.String("String"),
  2558. DBName: aws.String("String"),
  2559. DBSubnetGroupName: aws.String("String"),
  2560. Domain: aws.String("String"),
  2561. DomainIAMRoleName: aws.String("String"),
  2562. Engine: aws.String("String"),
  2563. Iops: aws.Int64(1),
  2564. LicenseModel: aws.String("String"),
  2565. MultiAZ: aws.Bool(true),
  2566. OptionGroupName: aws.String("String"),
  2567. Port: aws.Int64(1),
  2568. PubliclyAccessible: aws.Bool(true),
  2569. StorageType: aws.String("String"),
  2570. Tags: []*rds.Tag{
  2571. { // Required
  2572. Key: aws.String("String"),
  2573. Value: aws.String("String"),
  2574. },
  2575. // More values...
  2576. },
  2577. TdeCredentialArn: aws.String("String"),
  2578. TdeCredentialPassword: aws.String("String"),
  2579. }
  2580. resp, err := svc.RestoreDBInstanceFromDBSnapshot(params)
  2581. if err != nil {
  2582. // Print the error, cast err to awserr.Error to get the Code and
  2583. // Message from an error.
  2584. fmt.Println(err.Error())
  2585. return
  2586. }
  2587. // Pretty-print the response data.
  2588. fmt.Println(resp)
  2589. }
  2590. func ExampleRDS_RestoreDBInstanceToPointInTime() {
  2591. sess, err := session.NewSession()
  2592. if err != nil {
  2593. fmt.Println("failed to create session,", err)
  2594. return
  2595. }
  2596. svc := rds.New(sess)
  2597. params := &rds.RestoreDBInstanceToPointInTimeInput{
  2598. SourceDBInstanceIdentifier: aws.String("String"), // Required
  2599. TargetDBInstanceIdentifier: aws.String("String"), // Required
  2600. AutoMinorVersionUpgrade: aws.Bool(true),
  2601. AvailabilityZone: aws.String("String"),
  2602. CopyTagsToSnapshot: aws.Bool(true),
  2603. DBInstanceClass: aws.String("String"),
  2604. DBName: aws.String("String"),
  2605. DBSubnetGroupName: aws.String("String"),
  2606. Domain: aws.String("String"),
  2607. DomainIAMRoleName: aws.String("String"),
  2608. Engine: aws.String("String"),
  2609. Iops: aws.Int64(1),
  2610. LicenseModel: aws.String("String"),
  2611. MultiAZ: aws.Bool(true),
  2612. OptionGroupName: aws.String("String"),
  2613. Port: aws.Int64(1),
  2614. PubliclyAccessible: aws.Bool(true),
  2615. RestoreTime: aws.Time(time.Now()),
  2616. StorageType: aws.String("String"),
  2617. Tags: []*rds.Tag{
  2618. { // Required
  2619. Key: aws.String("String"),
  2620. Value: aws.String("String"),
  2621. },
  2622. // More values...
  2623. },
  2624. TdeCredentialArn: aws.String("String"),
  2625. TdeCredentialPassword: aws.String("String"),
  2626. UseLatestRestorableTime: aws.Bool(true),
  2627. }
  2628. resp, err := svc.RestoreDBInstanceToPointInTime(params)
  2629. if err != nil {
  2630. // Print the error, cast err to awserr.Error to get the Code and
  2631. // Message from an error.
  2632. fmt.Println(err.Error())
  2633. return
  2634. }
  2635. // Pretty-print the response data.
  2636. fmt.Println(resp)
  2637. }
  2638. func ExampleRDS_RevokeDBSecurityGroupIngress() {
  2639. sess, err := session.NewSession()
  2640. if err != nil {
  2641. fmt.Println("failed to create session,", err)
  2642. return
  2643. }
  2644. svc := rds.New(sess)
  2645. params := &rds.RevokeDBSecurityGroupIngressInput{
  2646. DBSecurityGroupName: aws.String("String"), // Required
  2647. CIDRIP: aws.String("String"),
  2648. EC2SecurityGroupId: aws.String("String"),
  2649. EC2SecurityGroupName: aws.String("String"),
  2650. EC2SecurityGroupOwnerId: aws.String("String"),
  2651. }
  2652. resp, err := svc.RevokeDBSecurityGroupIngress(params)
  2653. if err != nil {
  2654. // Print the error, cast err to awserr.Error to get the Code and
  2655. // Message from an error.
  2656. fmt.Println(err.Error())
  2657. return
  2658. }
  2659. // Pretty-print the response data.
  2660. fmt.Println(resp)
  2661. }