examples_test.go 54 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. package opsworks_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/opsworks"
  10. )
  11. var _ time.Duration
  12. var _ bytes.Buffer
  13. func ExampleOpsWorks_AssignInstance() {
  14. sess, err := session.NewSession()
  15. if err != nil {
  16. fmt.Println("failed to create session,", err)
  17. return
  18. }
  19. svc := opsworks.New(sess)
  20. params := &opsworks.AssignInstanceInput{
  21. InstanceId: aws.String("String"), // Required
  22. LayerIds: []*string{ // Required
  23. aws.String("String"), // Required
  24. // More values...
  25. },
  26. }
  27. resp, err := svc.AssignInstance(params)
  28. if err != nil {
  29. // Print the error, cast err to awserr.Error to get the Code and
  30. // Message from an error.
  31. fmt.Println(err.Error())
  32. return
  33. }
  34. // Pretty-print the response data.
  35. fmt.Println(resp)
  36. }
  37. func ExampleOpsWorks_AssignVolume() {
  38. sess, err := session.NewSession()
  39. if err != nil {
  40. fmt.Println("failed to create session,", err)
  41. return
  42. }
  43. svc := opsworks.New(sess)
  44. params := &opsworks.AssignVolumeInput{
  45. VolumeId: aws.String("String"), // Required
  46. InstanceId: aws.String("String"),
  47. }
  48. resp, err := svc.AssignVolume(params)
  49. if err != nil {
  50. // Print the error, cast err to awserr.Error to get the Code and
  51. // Message from an error.
  52. fmt.Println(err.Error())
  53. return
  54. }
  55. // Pretty-print the response data.
  56. fmt.Println(resp)
  57. }
  58. func ExampleOpsWorks_AssociateElasticIp() {
  59. sess, err := session.NewSession()
  60. if err != nil {
  61. fmt.Println("failed to create session,", err)
  62. return
  63. }
  64. svc := opsworks.New(sess)
  65. params := &opsworks.AssociateElasticIpInput{
  66. ElasticIp: aws.String("String"), // Required
  67. InstanceId: aws.String("String"),
  68. }
  69. resp, err := svc.AssociateElasticIp(params)
  70. if err != nil {
  71. // Print the error, cast err to awserr.Error to get the Code and
  72. // Message from an error.
  73. fmt.Println(err.Error())
  74. return
  75. }
  76. // Pretty-print the response data.
  77. fmt.Println(resp)
  78. }
  79. func ExampleOpsWorks_AttachElasticLoadBalancer() {
  80. sess, err := session.NewSession()
  81. if err != nil {
  82. fmt.Println("failed to create session,", err)
  83. return
  84. }
  85. svc := opsworks.New(sess)
  86. params := &opsworks.AttachElasticLoadBalancerInput{
  87. ElasticLoadBalancerName: aws.String("String"), // Required
  88. LayerId: aws.String("String"), // Required
  89. }
  90. resp, err := svc.AttachElasticLoadBalancer(params)
  91. if err != nil {
  92. // Print the error, cast err to awserr.Error to get the Code and
  93. // Message from an error.
  94. fmt.Println(err.Error())
  95. return
  96. }
  97. // Pretty-print the response data.
  98. fmt.Println(resp)
  99. }
  100. func ExampleOpsWorks_CloneStack() {
  101. sess, err := session.NewSession()
  102. if err != nil {
  103. fmt.Println("failed to create session,", err)
  104. return
  105. }
  106. svc := opsworks.New(sess)
  107. params := &opsworks.CloneStackInput{
  108. ServiceRoleArn: aws.String("String"), // Required
  109. SourceStackId: aws.String("String"), // Required
  110. AgentVersion: aws.String("String"),
  111. Attributes: map[string]*string{
  112. "Key": aws.String("String"), // Required
  113. // More values...
  114. },
  115. ChefConfiguration: &opsworks.ChefConfiguration{
  116. BerkshelfVersion: aws.String("String"),
  117. ManageBerkshelf: aws.Bool(true),
  118. },
  119. CloneAppIds: []*string{
  120. aws.String("String"), // Required
  121. // More values...
  122. },
  123. ClonePermissions: aws.Bool(true),
  124. ConfigurationManager: &opsworks.StackConfigurationManager{
  125. Name: aws.String("String"),
  126. Version: aws.String("String"),
  127. },
  128. CustomCookbooksSource: &opsworks.Source{
  129. Password: aws.String("String"),
  130. Revision: aws.String("String"),
  131. SshKey: aws.String("String"),
  132. Type: aws.String("SourceType"),
  133. Url: aws.String("String"),
  134. Username: aws.String("String"),
  135. },
  136. CustomJson: aws.String("String"),
  137. DefaultAvailabilityZone: aws.String("String"),
  138. DefaultInstanceProfileArn: aws.String("String"),
  139. DefaultOs: aws.String("String"),
  140. DefaultRootDeviceType: aws.String("RootDeviceType"),
  141. DefaultSshKeyName: aws.String("String"),
  142. DefaultSubnetId: aws.String("String"),
  143. HostnameTheme: aws.String("String"),
  144. Name: aws.String("String"),
  145. Region: aws.String("String"),
  146. UseCustomCookbooks: aws.Bool(true),
  147. UseOpsworksSecurityGroups: aws.Bool(true),
  148. VpcId: aws.String("String"),
  149. }
  150. resp, err := svc.CloneStack(params)
  151. if err != nil {
  152. // Print the error, cast err to awserr.Error to get the Code and
  153. // Message from an error.
  154. fmt.Println(err.Error())
  155. return
  156. }
  157. // Pretty-print the response data.
  158. fmt.Println(resp)
  159. }
  160. func ExampleOpsWorks_CreateApp() {
  161. sess, err := session.NewSession()
  162. if err != nil {
  163. fmt.Println("failed to create session,", err)
  164. return
  165. }
  166. svc := opsworks.New(sess)
  167. params := &opsworks.CreateAppInput{
  168. Name: aws.String("String"), // Required
  169. StackId: aws.String("String"), // Required
  170. Type: aws.String("AppType"), // Required
  171. AppSource: &opsworks.Source{
  172. Password: aws.String("String"),
  173. Revision: aws.String("String"),
  174. SshKey: aws.String("String"),
  175. Type: aws.String("SourceType"),
  176. Url: aws.String("String"),
  177. Username: aws.String("String"),
  178. },
  179. Attributes: map[string]*string{
  180. "Key": aws.String("String"), // Required
  181. // More values...
  182. },
  183. DataSources: []*opsworks.DataSource{
  184. { // Required
  185. Arn: aws.String("String"),
  186. DatabaseName: aws.String("String"),
  187. Type: aws.String("String"),
  188. },
  189. // More values...
  190. },
  191. Description: aws.String("String"),
  192. Domains: []*string{
  193. aws.String("String"), // Required
  194. // More values...
  195. },
  196. EnableSsl: aws.Bool(true),
  197. Environment: []*opsworks.EnvironmentVariable{
  198. { // Required
  199. Key: aws.String("String"), // Required
  200. Value: aws.String("String"), // Required
  201. Secure: aws.Bool(true),
  202. },
  203. // More values...
  204. },
  205. Shortname: aws.String("String"),
  206. SslConfiguration: &opsworks.SslConfiguration{
  207. Certificate: aws.String("String"), // Required
  208. PrivateKey: aws.String("String"), // Required
  209. Chain: aws.String("String"),
  210. },
  211. }
  212. resp, err := svc.CreateApp(params)
  213. if err != nil {
  214. // Print the error, cast err to awserr.Error to get the Code and
  215. // Message from an error.
  216. fmt.Println(err.Error())
  217. return
  218. }
  219. // Pretty-print the response data.
  220. fmt.Println(resp)
  221. }
  222. func ExampleOpsWorks_CreateDeployment() {
  223. sess, err := session.NewSession()
  224. if err != nil {
  225. fmt.Println("failed to create session,", err)
  226. return
  227. }
  228. svc := opsworks.New(sess)
  229. params := &opsworks.CreateDeploymentInput{
  230. Command: &opsworks.DeploymentCommand{ // Required
  231. Name: aws.String("DeploymentCommandName"), // Required
  232. Args: map[string][]*string{
  233. "Key": { // Required
  234. aws.String("String"), // Required
  235. // More values...
  236. },
  237. // More values...
  238. },
  239. },
  240. StackId: aws.String("String"), // Required
  241. AppId: aws.String("String"),
  242. Comment: aws.String("String"),
  243. CustomJson: aws.String("String"),
  244. InstanceIds: []*string{
  245. aws.String("String"), // Required
  246. // More values...
  247. },
  248. LayerIds: []*string{
  249. aws.String("String"), // Required
  250. // More values...
  251. },
  252. }
  253. resp, err := svc.CreateDeployment(params)
  254. if err != nil {
  255. // Print the error, cast err to awserr.Error to get the Code and
  256. // Message from an error.
  257. fmt.Println(err.Error())
  258. return
  259. }
  260. // Pretty-print the response data.
  261. fmt.Println(resp)
  262. }
  263. func ExampleOpsWorks_CreateInstance() {
  264. sess, err := session.NewSession()
  265. if err != nil {
  266. fmt.Println("failed to create session,", err)
  267. return
  268. }
  269. svc := opsworks.New(sess)
  270. params := &opsworks.CreateInstanceInput{
  271. InstanceType: aws.String("String"), // Required
  272. LayerIds: []*string{ // Required
  273. aws.String("String"), // Required
  274. // More values...
  275. },
  276. StackId: aws.String("String"), // Required
  277. AgentVersion: aws.String("String"),
  278. AmiId: aws.String("String"),
  279. Architecture: aws.String("Architecture"),
  280. AutoScalingType: aws.String("AutoScalingType"),
  281. AvailabilityZone: aws.String("String"),
  282. BlockDeviceMappings: []*opsworks.BlockDeviceMapping{
  283. { // Required
  284. DeviceName: aws.String("String"),
  285. Ebs: &opsworks.EbsBlockDevice{
  286. DeleteOnTermination: aws.Bool(true),
  287. Iops: aws.Int64(1),
  288. SnapshotId: aws.String("String"),
  289. VolumeSize: aws.Int64(1),
  290. VolumeType: aws.String("VolumeType"),
  291. },
  292. NoDevice: aws.String("String"),
  293. VirtualName: aws.String("String"),
  294. },
  295. // More values...
  296. },
  297. EbsOptimized: aws.Bool(true),
  298. Hostname: aws.String("String"),
  299. InstallUpdatesOnBoot: aws.Bool(true),
  300. Os: aws.String("String"),
  301. RootDeviceType: aws.String("RootDeviceType"),
  302. SshKeyName: aws.String("String"),
  303. SubnetId: aws.String("String"),
  304. Tenancy: aws.String("String"),
  305. VirtualizationType: aws.String("String"),
  306. }
  307. resp, err := svc.CreateInstance(params)
  308. if err != nil {
  309. // Print the error, cast err to awserr.Error to get the Code and
  310. // Message from an error.
  311. fmt.Println(err.Error())
  312. return
  313. }
  314. // Pretty-print the response data.
  315. fmt.Println(resp)
  316. }
  317. func ExampleOpsWorks_CreateLayer() {
  318. sess, err := session.NewSession()
  319. if err != nil {
  320. fmt.Println("failed to create session,", err)
  321. return
  322. }
  323. svc := opsworks.New(sess)
  324. params := &opsworks.CreateLayerInput{
  325. Name: aws.String("String"), // Required
  326. Shortname: aws.String("String"), // Required
  327. StackId: aws.String("String"), // Required
  328. Type: aws.String("LayerType"), // Required
  329. Attributes: map[string]*string{
  330. "Key": aws.String("String"), // Required
  331. // More values...
  332. },
  333. AutoAssignElasticIps: aws.Bool(true),
  334. AutoAssignPublicIps: aws.Bool(true),
  335. CustomInstanceProfileArn: aws.String("String"),
  336. CustomJson: aws.String("String"),
  337. CustomRecipes: &opsworks.Recipes{
  338. Configure: []*string{
  339. aws.String("String"), // Required
  340. // More values...
  341. },
  342. Deploy: []*string{
  343. aws.String("String"), // Required
  344. // More values...
  345. },
  346. Setup: []*string{
  347. aws.String("String"), // Required
  348. // More values...
  349. },
  350. Shutdown: []*string{
  351. aws.String("String"), // Required
  352. // More values...
  353. },
  354. Undeploy: []*string{
  355. aws.String("String"), // Required
  356. // More values...
  357. },
  358. },
  359. CustomSecurityGroupIds: []*string{
  360. aws.String("String"), // Required
  361. // More values...
  362. },
  363. EnableAutoHealing: aws.Bool(true),
  364. InstallUpdatesOnBoot: aws.Bool(true),
  365. LifecycleEventConfiguration: &opsworks.LifecycleEventConfiguration{
  366. Shutdown: &opsworks.ShutdownEventConfiguration{
  367. DelayUntilElbConnectionsDrained: aws.Bool(true),
  368. ExecutionTimeout: aws.Int64(1),
  369. },
  370. },
  371. Packages: []*string{
  372. aws.String("String"), // Required
  373. // More values...
  374. },
  375. UseEbsOptimizedInstances: aws.Bool(true),
  376. VolumeConfigurations: []*opsworks.VolumeConfiguration{
  377. { // Required
  378. MountPoint: aws.String("String"), // Required
  379. NumberOfDisks: aws.Int64(1), // Required
  380. Size: aws.Int64(1), // Required
  381. Iops: aws.Int64(1),
  382. RaidLevel: aws.Int64(1),
  383. VolumeType: aws.String("String"),
  384. },
  385. // More values...
  386. },
  387. }
  388. resp, err := svc.CreateLayer(params)
  389. if err != nil {
  390. // Print the error, cast err to awserr.Error to get the Code and
  391. // Message from an error.
  392. fmt.Println(err.Error())
  393. return
  394. }
  395. // Pretty-print the response data.
  396. fmt.Println(resp)
  397. }
  398. func ExampleOpsWorks_CreateStack() {
  399. sess, err := session.NewSession()
  400. if err != nil {
  401. fmt.Println("failed to create session,", err)
  402. return
  403. }
  404. svc := opsworks.New(sess)
  405. params := &opsworks.CreateStackInput{
  406. DefaultInstanceProfileArn: aws.String("String"), // Required
  407. Name: aws.String("String"), // Required
  408. Region: aws.String("String"), // Required
  409. ServiceRoleArn: aws.String("String"), // Required
  410. AgentVersion: aws.String("String"),
  411. Attributes: map[string]*string{
  412. "Key": aws.String("String"), // Required
  413. // More values...
  414. },
  415. ChefConfiguration: &opsworks.ChefConfiguration{
  416. BerkshelfVersion: aws.String("String"),
  417. ManageBerkshelf: aws.Bool(true),
  418. },
  419. ConfigurationManager: &opsworks.StackConfigurationManager{
  420. Name: aws.String("String"),
  421. Version: aws.String("String"),
  422. },
  423. CustomCookbooksSource: &opsworks.Source{
  424. Password: aws.String("String"),
  425. Revision: aws.String("String"),
  426. SshKey: aws.String("String"),
  427. Type: aws.String("SourceType"),
  428. Url: aws.String("String"),
  429. Username: aws.String("String"),
  430. },
  431. CustomJson: aws.String("String"),
  432. DefaultAvailabilityZone: aws.String("String"),
  433. DefaultOs: aws.String("String"),
  434. DefaultRootDeviceType: aws.String("RootDeviceType"),
  435. DefaultSshKeyName: aws.String("String"),
  436. DefaultSubnetId: aws.String("String"),
  437. HostnameTheme: aws.String("String"),
  438. UseCustomCookbooks: aws.Bool(true),
  439. UseOpsworksSecurityGroups: aws.Bool(true),
  440. VpcId: aws.String("String"),
  441. }
  442. resp, err := svc.CreateStack(params)
  443. if err != nil {
  444. // Print the error, cast err to awserr.Error to get the Code and
  445. // Message from an error.
  446. fmt.Println(err.Error())
  447. return
  448. }
  449. // Pretty-print the response data.
  450. fmt.Println(resp)
  451. }
  452. func ExampleOpsWorks_CreateUserProfile() {
  453. sess, err := session.NewSession()
  454. if err != nil {
  455. fmt.Println("failed to create session,", err)
  456. return
  457. }
  458. svc := opsworks.New(sess)
  459. params := &opsworks.CreateUserProfileInput{
  460. IamUserArn: aws.String("String"), // Required
  461. AllowSelfManagement: aws.Bool(true),
  462. SshPublicKey: aws.String("String"),
  463. SshUsername: aws.String("String"),
  464. }
  465. resp, err := svc.CreateUserProfile(params)
  466. if err != nil {
  467. // Print the error, cast err to awserr.Error to get the Code and
  468. // Message from an error.
  469. fmt.Println(err.Error())
  470. return
  471. }
  472. // Pretty-print the response data.
  473. fmt.Println(resp)
  474. }
  475. func ExampleOpsWorks_DeleteApp() {
  476. sess, err := session.NewSession()
  477. if err != nil {
  478. fmt.Println("failed to create session,", err)
  479. return
  480. }
  481. svc := opsworks.New(sess)
  482. params := &opsworks.DeleteAppInput{
  483. AppId: aws.String("String"), // Required
  484. }
  485. resp, err := svc.DeleteApp(params)
  486. if err != nil {
  487. // Print the error, cast err to awserr.Error to get the Code and
  488. // Message from an error.
  489. fmt.Println(err.Error())
  490. return
  491. }
  492. // Pretty-print the response data.
  493. fmt.Println(resp)
  494. }
  495. func ExampleOpsWorks_DeleteInstance() {
  496. sess, err := session.NewSession()
  497. if err != nil {
  498. fmt.Println("failed to create session,", err)
  499. return
  500. }
  501. svc := opsworks.New(sess)
  502. params := &opsworks.DeleteInstanceInput{
  503. InstanceId: aws.String("String"), // Required
  504. DeleteElasticIp: aws.Bool(true),
  505. DeleteVolumes: aws.Bool(true),
  506. }
  507. resp, err := svc.DeleteInstance(params)
  508. if err != nil {
  509. // Print the error, cast err to awserr.Error to get the Code and
  510. // Message from an error.
  511. fmt.Println(err.Error())
  512. return
  513. }
  514. // Pretty-print the response data.
  515. fmt.Println(resp)
  516. }
  517. func ExampleOpsWorks_DeleteLayer() {
  518. sess, err := session.NewSession()
  519. if err != nil {
  520. fmt.Println("failed to create session,", err)
  521. return
  522. }
  523. svc := opsworks.New(sess)
  524. params := &opsworks.DeleteLayerInput{
  525. LayerId: aws.String("String"), // Required
  526. }
  527. resp, err := svc.DeleteLayer(params)
  528. if err != nil {
  529. // Print the error, cast err to awserr.Error to get the Code and
  530. // Message from an error.
  531. fmt.Println(err.Error())
  532. return
  533. }
  534. // Pretty-print the response data.
  535. fmt.Println(resp)
  536. }
  537. func ExampleOpsWorks_DeleteStack() {
  538. sess, err := session.NewSession()
  539. if err != nil {
  540. fmt.Println("failed to create session,", err)
  541. return
  542. }
  543. svc := opsworks.New(sess)
  544. params := &opsworks.DeleteStackInput{
  545. StackId: aws.String("String"), // Required
  546. }
  547. resp, err := svc.DeleteStack(params)
  548. if err != nil {
  549. // Print the error, cast err to awserr.Error to get the Code and
  550. // Message from an error.
  551. fmt.Println(err.Error())
  552. return
  553. }
  554. // Pretty-print the response data.
  555. fmt.Println(resp)
  556. }
  557. func ExampleOpsWorks_DeleteUserProfile() {
  558. sess, err := session.NewSession()
  559. if err != nil {
  560. fmt.Println("failed to create session,", err)
  561. return
  562. }
  563. svc := opsworks.New(sess)
  564. params := &opsworks.DeleteUserProfileInput{
  565. IamUserArn: aws.String("String"), // Required
  566. }
  567. resp, err := svc.DeleteUserProfile(params)
  568. if err != nil {
  569. // Print the error, cast err to awserr.Error to get the Code and
  570. // Message from an error.
  571. fmt.Println(err.Error())
  572. return
  573. }
  574. // Pretty-print the response data.
  575. fmt.Println(resp)
  576. }
  577. func ExampleOpsWorks_DeregisterEcsCluster() {
  578. sess, err := session.NewSession()
  579. if err != nil {
  580. fmt.Println("failed to create session,", err)
  581. return
  582. }
  583. svc := opsworks.New(sess)
  584. params := &opsworks.DeregisterEcsClusterInput{
  585. EcsClusterArn: aws.String("String"), // Required
  586. }
  587. resp, err := svc.DeregisterEcsCluster(params)
  588. if err != nil {
  589. // Print the error, cast err to awserr.Error to get the Code and
  590. // Message from an error.
  591. fmt.Println(err.Error())
  592. return
  593. }
  594. // Pretty-print the response data.
  595. fmt.Println(resp)
  596. }
  597. func ExampleOpsWorks_DeregisterElasticIp() {
  598. sess, err := session.NewSession()
  599. if err != nil {
  600. fmt.Println("failed to create session,", err)
  601. return
  602. }
  603. svc := opsworks.New(sess)
  604. params := &opsworks.DeregisterElasticIpInput{
  605. ElasticIp: aws.String("String"), // Required
  606. }
  607. resp, err := svc.DeregisterElasticIp(params)
  608. if err != nil {
  609. // Print the error, cast err to awserr.Error to get the Code and
  610. // Message from an error.
  611. fmt.Println(err.Error())
  612. return
  613. }
  614. // Pretty-print the response data.
  615. fmt.Println(resp)
  616. }
  617. func ExampleOpsWorks_DeregisterInstance() {
  618. sess, err := session.NewSession()
  619. if err != nil {
  620. fmt.Println("failed to create session,", err)
  621. return
  622. }
  623. svc := opsworks.New(sess)
  624. params := &opsworks.DeregisterInstanceInput{
  625. InstanceId: aws.String("String"), // Required
  626. }
  627. resp, err := svc.DeregisterInstance(params)
  628. if err != nil {
  629. // Print the error, cast err to awserr.Error to get the Code and
  630. // Message from an error.
  631. fmt.Println(err.Error())
  632. return
  633. }
  634. // Pretty-print the response data.
  635. fmt.Println(resp)
  636. }
  637. func ExampleOpsWorks_DeregisterRdsDbInstance() {
  638. sess, err := session.NewSession()
  639. if err != nil {
  640. fmt.Println("failed to create session,", err)
  641. return
  642. }
  643. svc := opsworks.New(sess)
  644. params := &opsworks.DeregisterRdsDbInstanceInput{
  645. RdsDbInstanceArn: aws.String("String"), // Required
  646. }
  647. resp, err := svc.DeregisterRdsDbInstance(params)
  648. if err != nil {
  649. // Print the error, cast err to awserr.Error to get the Code and
  650. // Message from an error.
  651. fmt.Println(err.Error())
  652. return
  653. }
  654. // Pretty-print the response data.
  655. fmt.Println(resp)
  656. }
  657. func ExampleOpsWorks_DeregisterVolume() {
  658. sess, err := session.NewSession()
  659. if err != nil {
  660. fmt.Println("failed to create session,", err)
  661. return
  662. }
  663. svc := opsworks.New(sess)
  664. params := &opsworks.DeregisterVolumeInput{
  665. VolumeId: aws.String("String"), // Required
  666. }
  667. resp, err := svc.DeregisterVolume(params)
  668. if err != nil {
  669. // Print the error, cast err to awserr.Error to get the Code and
  670. // Message from an error.
  671. fmt.Println(err.Error())
  672. return
  673. }
  674. // Pretty-print the response data.
  675. fmt.Println(resp)
  676. }
  677. func ExampleOpsWorks_DescribeAgentVersions() {
  678. sess, err := session.NewSession()
  679. if err != nil {
  680. fmt.Println("failed to create session,", err)
  681. return
  682. }
  683. svc := opsworks.New(sess)
  684. params := &opsworks.DescribeAgentVersionsInput{
  685. ConfigurationManager: &opsworks.StackConfigurationManager{
  686. Name: aws.String("String"),
  687. Version: aws.String("String"),
  688. },
  689. StackId: aws.String("String"),
  690. }
  691. resp, err := svc.DescribeAgentVersions(params)
  692. if err != nil {
  693. // Print the error, cast err to awserr.Error to get the Code and
  694. // Message from an error.
  695. fmt.Println(err.Error())
  696. return
  697. }
  698. // Pretty-print the response data.
  699. fmt.Println(resp)
  700. }
  701. func ExampleOpsWorks_DescribeApps() {
  702. sess, err := session.NewSession()
  703. if err != nil {
  704. fmt.Println("failed to create session,", err)
  705. return
  706. }
  707. svc := opsworks.New(sess)
  708. params := &opsworks.DescribeAppsInput{
  709. AppIds: []*string{
  710. aws.String("String"), // Required
  711. // More values...
  712. },
  713. StackId: aws.String("String"),
  714. }
  715. resp, err := svc.DescribeApps(params)
  716. if err != nil {
  717. // Print the error, cast err to awserr.Error to get the Code and
  718. // Message from an error.
  719. fmt.Println(err.Error())
  720. return
  721. }
  722. // Pretty-print the response data.
  723. fmt.Println(resp)
  724. }
  725. func ExampleOpsWorks_DescribeCommands() {
  726. sess, err := session.NewSession()
  727. if err != nil {
  728. fmt.Println("failed to create session,", err)
  729. return
  730. }
  731. svc := opsworks.New(sess)
  732. params := &opsworks.DescribeCommandsInput{
  733. CommandIds: []*string{
  734. aws.String("String"), // Required
  735. // More values...
  736. },
  737. DeploymentId: aws.String("String"),
  738. InstanceId: aws.String("String"),
  739. }
  740. resp, err := svc.DescribeCommands(params)
  741. if err != nil {
  742. // Print the error, cast err to awserr.Error to get the Code and
  743. // Message from an error.
  744. fmt.Println(err.Error())
  745. return
  746. }
  747. // Pretty-print the response data.
  748. fmt.Println(resp)
  749. }
  750. func ExampleOpsWorks_DescribeDeployments() {
  751. sess, err := session.NewSession()
  752. if err != nil {
  753. fmt.Println("failed to create session,", err)
  754. return
  755. }
  756. svc := opsworks.New(sess)
  757. params := &opsworks.DescribeDeploymentsInput{
  758. AppId: aws.String("String"),
  759. DeploymentIds: []*string{
  760. aws.String("String"), // Required
  761. // More values...
  762. },
  763. StackId: aws.String("String"),
  764. }
  765. resp, err := svc.DescribeDeployments(params)
  766. if err != nil {
  767. // Print the error, cast err to awserr.Error to get the Code and
  768. // Message from an error.
  769. fmt.Println(err.Error())
  770. return
  771. }
  772. // Pretty-print the response data.
  773. fmt.Println(resp)
  774. }
  775. func ExampleOpsWorks_DescribeEcsClusters() {
  776. sess, err := session.NewSession()
  777. if err != nil {
  778. fmt.Println("failed to create session,", err)
  779. return
  780. }
  781. svc := opsworks.New(sess)
  782. params := &opsworks.DescribeEcsClustersInput{
  783. EcsClusterArns: []*string{
  784. aws.String("String"), // Required
  785. // More values...
  786. },
  787. MaxResults: aws.Int64(1),
  788. NextToken: aws.String("String"),
  789. StackId: aws.String("String"),
  790. }
  791. resp, err := svc.DescribeEcsClusters(params)
  792. if err != nil {
  793. // Print the error, cast err to awserr.Error to get the Code and
  794. // Message from an error.
  795. fmt.Println(err.Error())
  796. return
  797. }
  798. // Pretty-print the response data.
  799. fmt.Println(resp)
  800. }
  801. func ExampleOpsWorks_DescribeElasticIps() {
  802. sess, err := session.NewSession()
  803. if err != nil {
  804. fmt.Println("failed to create session,", err)
  805. return
  806. }
  807. svc := opsworks.New(sess)
  808. params := &opsworks.DescribeElasticIpsInput{
  809. InstanceId: aws.String("String"),
  810. Ips: []*string{
  811. aws.String("String"), // Required
  812. // More values...
  813. },
  814. StackId: aws.String("String"),
  815. }
  816. resp, err := svc.DescribeElasticIps(params)
  817. if err != nil {
  818. // Print the error, cast err to awserr.Error to get the Code and
  819. // Message from an error.
  820. fmt.Println(err.Error())
  821. return
  822. }
  823. // Pretty-print the response data.
  824. fmt.Println(resp)
  825. }
  826. func ExampleOpsWorks_DescribeElasticLoadBalancers() {
  827. sess, err := session.NewSession()
  828. if err != nil {
  829. fmt.Println("failed to create session,", err)
  830. return
  831. }
  832. svc := opsworks.New(sess)
  833. params := &opsworks.DescribeElasticLoadBalancersInput{
  834. LayerIds: []*string{
  835. aws.String("String"), // Required
  836. // More values...
  837. },
  838. StackId: aws.String("String"),
  839. }
  840. resp, err := svc.DescribeElasticLoadBalancers(params)
  841. if err != nil {
  842. // Print the error, cast err to awserr.Error to get the Code and
  843. // Message from an error.
  844. fmt.Println(err.Error())
  845. return
  846. }
  847. // Pretty-print the response data.
  848. fmt.Println(resp)
  849. }
  850. func ExampleOpsWorks_DescribeInstances() {
  851. sess, err := session.NewSession()
  852. if err != nil {
  853. fmt.Println("failed to create session,", err)
  854. return
  855. }
  856. svc := opsworks.New(sess)
  857. params := &opsworks.DescribeInstancesInput{
  858. InstanceIds: []*string{
  859. aws.String("String"), // Required
  860. // More values...
  861. },
  862. LayerId: aws.String("String"),
  863. StackId: aws.String("String"),
  864. }
  865. resp, err := svc.DescribeInstances(params)
  866. if err != nil {
  867. // Print the error, cast err to awserr.Error to get the Code and
  868. // Message from an error.
  869. fmt.Println(err.Error())
  870. return
  871. }
  872. // Pretty-print the response data.
  873. fmt.Println(resp)
  874. }
  875. func ExampleOpsWorks_DescribeLayers() {
  876. sess, err := session.NewSession()
  877. if err != nil {
  878. fmt.Println("failed to create session,", err)
  879. return
  880. }
  881. svc := opsworks.New(sess)
  882. params := &opsworks.DescribeLayersInput{
  883. LayerIds: []*string{
  884. aws.String("String"), // Required
  885. // More values...
  886. },
  887. StackId: aws.String("String"),
  888. }
  889. resp, err := svc.DescribeLayers(params)
  890. if err != nil {
  891. // Print the error, cast err to awserr.Error to get the Code and
  892. // Message from an error.
  893. fmt.Println(err.Error())
  894. return
  895. }
  896. // Pretty-print the response data.
  897. fmt.Println(resp)
  898. }
  899. func ExampleOpsWorks_DescribeLoadBasedAutoScaling() {
  900. sess, err := session.NewSession()
  901. if err != nil {
  902. fmt.Println("failed to create session,", err)
  903. return
  904. }
  905. svc := opsworks.New(sess)
  906. params := &opsworks.DescribeLoadBasedAutoScalingInput{
  907. LayerIds: []*string{ // Required
  908. aws.String("String"), // Required
  909. // More values...
  910. },
  911. }
  912. resp, err := svc.DescribeLoadBasedAutoScaling(params)
  913. if err != nil {
  914. // Print the error, cast err to awserr.Error to get the Code and
  915. // Message from an error.
  916. fmt.Println(err.Error())
  917. return
  918. }
  919. // Pretty-print the response data.
  920. fmt.Println(resp)
  921. }
  922. func ExampleOpsWorks_DescribeMyUserProfile() {
  923. sess, err := session.NewSession()
  924. if err != nil {
  925. fmt.Println("failed to create session,", err)
  926. return
  927. }
  928. svc := opsworks.New(sess)
  929. var params *opsworks.DescribeMyUserProfileInput
  930. resp, err := svc.DescribeMyUserProfile(params)
  931. if err != nil {
  932. // Print the error, cast err to awserr.Error to get the Code and
  933. // Message from an error.
  934. fmt.Println(err.Error())
  935. return
  936. }
  937. // Pretty-print the response data.
  938. fmt.Println(resp)
  939. }
  940. func ExampleOpsWorks_DescribePermissions() {
  941. sess, err := session.NewSession()
  942. if err != nil {
  943. fmt.Println("failed to create session,", err)
  944. return
  945. }
  946. svc := opsworks.New(sess)
  947. params := &opsworks.DescribePermissionsInput{
  948. IamUserArn: aws.String("String"),
  949. StackId: aws.String("String"),
  950. }
  951. resp, err := svc.DescribePermissions(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 ExampleOpsWorks_DescribeRaidArrays() {
  962. sess, err := session.NewSession()
  963. if err != nil {
  964. fmt.Println("failed to create session,", err)
  965. return
  966. }
  967. svc := opsworks.New(sess)
  968. params := &opsworks.DescribeRaidArraysInput{
  969. InstanceId: aws.String("String"),
  970. RaidArrayIds: []*string{
  971. aws.String("String"), // Required
  972. // More values...
  973. },
  974. StackId: aws.String("String"),
  975. }
  976. resp, err := svc.DescribeRaidArrays(params)
  977. if err != nil {
  978. // Print the error, cast err to awserr.Error to get the Code and
  979. // Message from an error.
  980. fmt.Println(err.Error())
  981. return
  982. }
  983. // Pretty-print the response data.
  984. fmt.Println(resp)
  985. }
  986. func ExampleOpsWorks_DescribeRdsDbInstances() {
  987. sess, err := session.NewSession()
  988. if err != nil {
  989. fmt.Println("failed to create session,", err)
  990. return
  991. }
  992. svc := opsworks.New(sess)
  993. params := &opsworks.DescribeRdsDbInstancesInput{
  994. StackId: aws.String("String"), // Required
  995. RdsDbInstanceArns: []*string{
  996. aws.String("String"), // Required
  997. // More values...
  998. },
  999. }
  1000. resp, err := svc.DescribeRdsDbInstances(params)
  1001. if err != nil {
  1002. // Print the error, cast err to awserr.Error to get the Code and
  1003. // Message from an error.
  1004. fmt.Println(err.Error())
  1005. return
  1006. }
  1007. // Pretty-print the response data.
  1008. fmt.Println(resp)
  1009. }
  1010. func ExampleOpsWorks_DescribeServiceErrors() {
  1011. sess, err := session.NewSession()
  1012. if err != nil {
  1013. fmt.Println("failed to create session,", err)
  1014. return
  1015. }
  1016. svc := opsworks.New(sess)
  1017. params := &opsworks.DescribeServiceErrorsInput{
  1018. InstanceId: aws.String("String"),
  1019. ServiceErrorIds: []*string{
  1020. aws.String("String"), // Required
  1021. // More values...
  1022. },
  1023. StackId: aws.String("String"),
  1024. }
  1025. resp, err := svc.DescribeServiceErrors(params)
  1026. if err != nil {
  1027. // Print the error, cast err to awserr.Error to get the Code and
  1028. // Message from an error.
  1029. fmt.Println(err.Error())
  1030. return
  1031. }
  1032. // Pretty-print the response data.
  1033. fmt.Println(resp)
  1034. }
  1035. func ExampleOpsWorks_DescribeStackProvisioningParameters() {
  1036. sess, err := session.NewSession()
  1037. if err != nil {
  1038. fmt.Println("failed to create session,", err)
  1039. return
  1040. }
  1041. svc := opsworks.New(sess)
  1042. params := &opsworks.DescribeStackProvisioningParametersInput{
  1043. StackId: aws.String("String"), // Required
  1044. }
  1045. resp, err := svc.DescribeStackProvisioningParameters(params)
  1046. if err != nil {
  1047. // Print the error, cast err to awserr.Error to get the Code and
  1048. // Message from an error.
  1049. fmt.Println(err.Error())
  1050. return
  1051. }
  1052. // Pretty-print the response data.
  1053. fmt.Println(resp)
  1054. }
  1055. func ExampleOpsWorks_DescribeStackSummary() {
  1056. sess, err := session.NewSession()
  1057. if err != nil {
  1058. fmt.Println("failed to create session,", err)
  1059. return
  1060. }
  1061. svc := opsworks.New(sess)
  1062. params := &opsworks.DescribeStackSummaryInput{
  1063. StackId: aws.String("String"), // Required
  1064. }
  1065. resp, err := svc.DescribeStackSummary(params)
  1066. if err != nil {
  1067. // Print the error, cast err to awserr.Error to get the Code and
  1068. // Message from an error.
  1069. fmt.Println(err.Error())
  1070. return
  1071. }
  1072. // Pretty-print the response data.
  1073. fmt.Println(resp)
  1074. }
  1075. func ExampleOpsWorks_DescribeStacks() {
  1076. sess, err := session.NewSession()
  1077. if err != nil {
  1078. fmt.Println("failed to create session,", err)
  1079. return
  1080. }
  1081. svc := opsworks.New(sess)
  1082. params := &opsworks.DescribeStacksInput{
  1083. StackIds: []*string{
  1084. aws.String("String"), // Required
  1085. // More values...
  1086. },
  1087. }
  1088. resp, err := svc.DescribeStacks(params)
  1089. if err != nil {
  1090. // Print the error, cast err to awserr.Error to get the Code and
  1091. // Message from an error.
  1092. fmt.Println(err.Error())
  1093. return
  1094. }
  1095. // Pretty-print the response data.
  1096. fmt.Println(resp)
  1097. }
  1098. func ExampleOpsWorks_DescribeTimeBasedAutoScaling() {
  1099. sess, err := session.NewSession()
  1100. if err != nil {
  1101. fmt.Println("failed to create session,", err)
  1102. return
  1103. }
  1104. svc := opsworks.New(sess)
  1105. params := &opsworks.DescribeTimeBasedAutoScalingInput{
  1106. InstanceIds: []*string{ // Required
  1107. aws.String("String"), // Required
  1108. // More values...
  1109. },
  1110. }
  1111. resp, err := svc.DescribeTimeBasedAutoScaling(params)
  1112. if err != nil {
  1113. // Print the error, cast err to awserr.Error to get the Code and
  1114. // Message from an error.
  1115. fmt.Println(err.Error())
  1116. return
  1117. }
  1118. // Pretty-print the response data.
  1119. fmt.Println(resp)
  1120. }
  1121. func ExampleOpsWorks_DescribeUserProfiles() {
  1122. sess, err := session.NewSession()
  1123. if err != nil {
  1124. fmt.Println("failed to create session,", err)
  1125. return
  1126. }
  1127. svc := opsworks.New(sess)
  1128. params := &opsworks.DescribeUserProfilesInput{
  1129. IamUserArns: []*string{
  1130. aws.String("String"), // Required
  1131. // More values...
  1132. },
  1133. }
  1134. resp, err := svc.DescribeUserProfiles(params)
  1135. if err != nil {
  1136. // Print the error, cast err to awserr.Error to get the Code and
  1137. // Message from an error.
  1138. fmt.Println(err.Error())
  1139. return
  1140. }
  1141. // Pretty-print the response data.
  1142. fmt.Println(resp)
  1143. }
  1144. func ExampleOpsWorks_DescribeVolumes() {
  1145. sess, err := session.NewSession()
  1146. if err != nil {
  1147. fmt.Println("failed to create session,", err)
  1148. return
  1149. }
  1150. svc := opsworks.New(sess)
  1151. params := &opsworks.DescribeVolumesInput{
  1152. InstanceId: aws.String("String"),
  1153. RaidArrayId: aws.String("String"),
  1154. StackId: aws.String("String"),
  1155. VolumeIds: []*string{
  1156. aws.String("String"), // Required
  1157. // More values...
  1158. },
  1159. }
  1160. resp, err := svc.DescribeVolumes(params)
  1161. if err != nil {
  1162. // Print the error, cast err to awserr.Error to get the Code and
  1163. // Message from an error.
  1164. fmt.Println(err.Error())
  1165. return
  1166. }
  1167. // Pretty-print the response data.
  1168. fmt.Println(resp)
  1169. }
  1170. func ExampleOpsWorks_DetachElasticLoadBalancer() {
  1171. sess, err := session.NewSession()
  1172. if err != nil {
  1173. fmt.Println("failed to create session,", err)
  1174. return
  1175. }
  1176. svc := opsworks.New(sess)
  1177. params := &opsworks.DetachElasticLoadBalancerInput{
  1178. ElasticLoadBalancerName: aws.String("String"), // Required
  1179. LayerId: aws.String("String"), // Required
  1180. }
  1181. resp, err := svc.DetachElasticLoadBalancer(params)
  1182. if err != nil {
  1183. // Print the error, cast err to awserr.Error to get the Code and
  1184. // Message from an error.
  1185. fmt.Println(err.Error())
  1186. return
  1187. }
  1188. // Pretty-print the response data.
  1189. fmt.Println(resp)
  1190. }
  1191. func ExampleOpsWorks_DisassociateElasticIp() {
  1192. sess, err := session.NewSession()
  1193. if err != nil {
  1194. fmt.Println("failed to create session,", err)
  1195. return
  1196. }
  1197. svc := opsworks.New(sess)
  1198. params := &opsworks.DisassociateElasticIpInput{
  1199. ElasticIp: aws.String("String"), // Required
  1200. }
  1201. resp, err := svc.DisassociateElasticIp(params)
  1202. if err != nil {
  1203. // Print the error, cast err to awserr.Error to get the Code and
  1204. // Message from an error.
  1205. fmt.Println(err.Error())
  1206. return
  1207. }
  1208. // Pretty-print the response data.
  1209. fmt.Println(resp)
  1210. }
  1211. func ExampleOpsWorks_GetHostnameSuggestion() {
  1212. sess, err := session.NewSession()
  1213. if err != nil {
  1214. fmt.Println("failed to create session,", err)
  1215. return
  1216. }
  1217. svc := opsworks.New(sess)
  1218. params := &opsworks.GetHostnameSuggestionInput{
  1219. LayerId: aws.String("String"), // Required
  1220. }
  1221. resp, err := svc.GetHostnameSuggestion(params)
  1222. if err != nil {
  1223. // Print the error, cast err to awserr.Error to get the Code and
  1224. // Message from an error.
  1225. fmt.Println(err.Error())
  1226. return
  1227. }
  1228. // Pretty-print the response data.
  1229. fmt.Println(resp)
  1230. }
  1231. func ExampleOpsWorks_GrantAccess() {
  1232. sess, err := session.NewSession()
  1233. if err != nil {
  1234. fmt.Println("failed to create session,", err)
  1235. return
  1236. }
  1237. svc := opsworks.New(sess)
  1238. params := &opsworks.GrantAccessInput{
  1239. InstanceId: aws.String("String"), // Required
  1240. ValidForInMinutes: aws.Int64(1),
  1241. }
  1242. resp, err := svc.GrantAccess(params)
  1243. if err != nil {
  1244. // Print the error, cast err to awserr.Error to get the Code and
  1245. // Message from an error.
  1246. fmt.Println(err.Error())
  1247. return
  1248. }
  1249. // Pretty-print the response data.
  1250. fmt.Println(resp)
  1251. }
  1252. func ExampleOpsWorks_RebootInstance() {
  1253. sess, err := session.NewSession()
  1254. if err != nil {
  1255. fmt.Println("failed to create session,", err)
  1256. return
  1257. }
  1258. svc := opsworks.New(sess)
  1259. params := &opsworks.RebootInstanceInput{
  1260. InstanceId: aws.String("String"), // Required
  1261. }
  1262. resp, err := svc.RebootInstance(params)
  1263. if err != nil {
  1264. // Print the error, cast err to awserr.Error to get the Code and
  1265. // Message from an error.
  1266. fmt.Println(err.Error())
  1267. return
  1268. }
  1269. // Pretty-print the response data.
  1270. fmt.Println(resp)
  1271. }
  1272. func ExampleOpsWorks_RegisterEcsCluster() {
  1273. sess, err := session.NewSession()
  1274. if err != nil {
  1275. fmt.Println("failed to create session,", err)
  1276. return
  1277. }
  1278. svc := opsworks.New(sess)
  1279. params := &opsworks.RegisterEcsClusterInput{
  1280. EcsClusterArn: aws.String("String"), // Required
  1281. StackId: aws.String("String"), // Required
  1282. }
  1283. resp, err := svc.RegisterEcsCluster(params)
  1284. if err != nil {
  1285. // Print the error, cast err to awserr.Error to get the Code and
  1286. // Message from an error.
  1287. fmt.Println(err.Error())
  1288. return
  1289. }
  1290. // Pretty-print the response data.
  1291. fmt.Println(resp)
  1292. }
  1293. func ExampleOpsWorks_RegisterElasticIp() {
  1294. sess, err := session.NewSession()
  1295. if err != nil {
  1296. fmt.Println("failed to create session,", err)
  1297. return
  1298. }
  1299. svc := opsworks.New(sess)
  1300. params := &opsworks.RegisterElasticIpInput{
  1301. ElasticIp: aws.String("String"), // Required
  1302. StackId: aws.String("String"), // Required
  1303. }
  1304. resp, err := svc.RegisterElasticIp(params)
  1305. if err != nil {
  1306. // Print the error, cast err to awserr.Error to get the Code and
  1307. // Message from an error.
  1308. fmt.Println(err.Error())
  1309. return
  1310. }
  1311. // Pretty-print the response data.
  1312. fmt.Println(resp)
  1313. }
  1314. func ExampleOpsWorks_RegisterInstance() {
  1315. sess, err := session.NewSession()
  1316. if err != nil {
  1317. fmt.Println("failed to create session,", err)
  1318. return
  1319. }
  1320. svc := opsworks.New(sess)
  1321. params := &opsworks.RegisterInstanceInput{
  1322. StackId: aws.String("String"), // Required
  1323. Hostname: aws.String("String"),
  1324. InstanceIdentity: &opsworks.InstanceIdentity{
  1325. Document: aws.String("String"),
  1326. Signature: aws.String("String"),
  1327. },
  1328. PrivateIp: aws.String("String"),
  1329. PublicIp: aws.String("String"),
  1330. RsaPublicKey: aws.String("String"),
  1331. RsaPublicKeyFingerprint: aws.String("String"),
  1332. }
  1333. resp, err := svc.RegisterInstance(params)
  1334. if err != nil {
  1335. // Print the error, cast err to awserr.Error to get the Code and
  1336. // Message from an error.
  1337. fmt.Println(err.Error())
  1338. return
  1339. }
  1340. // Pretty-print the response data.
  1341. fmt.Println(resp)
  1342. }
  1343. func ExampleOpsWorks_RegisterRdsDbInstance() {
  1344. sess, err := session.NewSession()
  1345. if err != nil {
  1346. fmt.Println("failed to create session,", err)
  1347. return
  1348. }
  1349. svc := opsworks.New(sess)
  1350. params := &opsworks.RegisterRdsDbInstanceInput{
  1351. DbPassword: aws.String("String"), // Required
  1352. DbUser: aws.String("String"), // Required
  1353. RdsDbInstanceArn: aws.String("String"), // Required
  1354. StackId: aws.String("String"), // Required
  1355. }
  1356. resp, err := svc.RegisterRdsDbInstance(params)
  1357. if err != nil {
  1358. // Print the error, cast err to awserr.Error to get the Code and
  1359. // Message from an error.
  1360. fmt.Println(err.Error())
  1361. return
  1362. }
  1363. // Pretty-print the response data.
  1364. fmt.Println(resp)
  1365. }
  1366. func ExampleOpsWorks_RegisterVolume() {
  1367. sess, err := session.NewSession()
  1368. if err != nil {
  1369. fmt.Println("failed to create session,", err)
  1370. return
  1371. }
  1372. svc := opsworks.New(sess)
  1373. params := &opsworks.RegisterVolumeInput{
  1374. StackId: aws.String("String"), // Required
  1375. Ec2VolumeId: aws.String("String"),
  1376. }
  1377. resp, err := svc.RegisterVolume(params)
  1378. if err != nil {
  1379. // Print the error, cast err to awserr.Error to get the Code and
  1380. // Message from an error.
  1381. fmt.Println(err.Error())
  1382. return
  1383. }
  1384. // Pretty-print the response data.
  1385. fmt.Println(resp)
  1386. }
  1387. func ExampleOpsWorks_SetLoadBasedAutoScaling() {
  1388. sess, err := session.NewSession()
  1389. if err != nil {
  1390. fmt.Println("failed to create session,", err)
  1391. return
  1392. }
  1393. svc := opsworks.New(sess)
  1394. params := &opsworks.SetLoadBasedAutoScalingInput{
  1395. LayerId: aws.String("String"), // Required
  1396. DownScaling: &opsworks.AutoScalingThresholds{
  1397. Alarms: []*string{
  1398. aws.String("String"), // Required
  1399. // More values...
  1400. },
  1401. CpuThreshold: aws.Float64(1.0),
  1402. IgnoreMetricsTime: aws.Int64(1),
  1403. InstanceCount: aws.Int64(1),
  1404. LoadThreshold: aws.Float64(1.0),
  1405. MemoryThreshold: aws.Float64(1.0),
  1406. ThresholdsWaitTime: aws.Int64(1),
  1407. },
  1408. Enable: aws.Bool(true),
  1409. UpScaling: &opsworks.AutoScalingThresholds{
  1410. Alarms: []*string{
  1411. aws.String("String"), // Required
  1412. // More values...
  1413. },
  1414. CpuThreshold: aws.Float64(1.0),
  1415. IgnoreMetricsTime: aws.Int64(1),
  1416. InstanceCount: aws.Int64(1),
  1417. LoadThreshold: aws.Float64(1.0),
  1418. MemoryThreshold: aws.Float64(1.0),
  1419. ThresholdsWaitTime: aws.Int64(1),
  1420. },
  1421. }
  1422. resp, err := svc.SetLoadBasedAutoScaling(params)
  1423. if err != nil {
  1424. // Print the error, cast err to awserr.Error to get the Code and
  1425. // Message from an error.
  1426. fmt.Println(err.Error())
  1427. return
  1428. }
  1429. // Pretty-print the response data.
  1430. fmt.Println(resp)
  1431. }
  1432. func ExampleOpsWorks_SetPermission() {
  1433. sess, err := session.NewSession()
  1434. if err != nil {
  1435. fmt.Println("failed to create session,", err)
  1436. return
  1437. }
  1438. svc := opsworks.New(sess)
  1439. params := &opsworks.SetPermissionInput{
  1440. IamUserArn: aws.String("String"), // Required
  1441. StackId: aws.String("String"), // Required
  1442. AllowSsh: aws.Bool(true),
  1443. AllowSudo: aws.Bool(true),
  1444. Level: aws.String("String"),
  1445. }
  1446. resp, err := svc.SetPermission(params)
  1447. if err != nil {
  1448. // Print the error, cast err to awserr.Error to get the Code and
  1449. // Message from an error.
  1450. fmt.Println(err.Error())
  1451. return
  1452. }
  1453. // Pretty-print the response data.
  1454. fmt.Println(resp)
  1455. }
  1456. func ExampleOpsWorks_SetTimeBasedAutoScaling() {
  1457. sess, err := session.NewSession()
  1458. if err != nil {
  1459. fmt.Println("failed to create session,", err)
  1460. return
  1461. }
  1462. svc := opsworks.New(sess)
  1463. params := &opsworks.SetTimeBasedAutoScalingInput{
  1464. InstanceId: aws.String("String"), // Required
  1465. AutoScalingSchedule: &opsworks.WeeklyAutoScalingSchedule{
  1466. Friday: map[string]*string{
  1467. "Key": aws.String("Switch"), // Required
  1468. // More values...
  1469. },
  1470. Monday: map[string]*string{
  1471. "Key": aws.String("Switch"), // Required
  1472. // More values...
  1473. },
  1474. Saturday: map[string]*string{
  1475. "Key": aws.String("Switch"), // Required
  1476. // More values...
  1477. },
  1478. Sunday: map[string]*string{
  1479. "Key": aws.String("Switch"), // Required
  1480. // More values...
  1481. },
  1482. Thursday: map[string]*string{
  1483. "Key": aws.String("Switch"), // Required
  1484. // More values...
  1485. },
  1486. Tuesday: map[string]*string{
  1487. "Key": aws.String("Switch"), // Required
  1488. // More values...
  1489. },
  1490. Wednesday: map[string]*string{
  1491. "Key": aws.String("Switch"), // Required
  1492. // More values...
  1493. },
  1494. },
  1495. }
  1496. resp, err := svc.SetTimeBasedAutoScaling(params)
  1497. if err != nil {
  1498. // Print the error, cast err to awserr.Error to get the Code and
  1499. // Message from an error.
  1500. fmt.Println(err.Error())
  1501. return
  1502. }
  1503. // Pretty-print the response data.
  1504. fmt.Println(resp)
  1505. }
  1506. func ExampleOpsWorks_StartInstance() {
  1507. sess, err := session.NewSession()
  1508. if err != nil {
  1509. fmt.Println("failed to create session,", err)
  1510. return
  1511. }
  1512. svc := opsworks.New(sess)
  1513. params := &opsworks.StartInstanceInput{
  1514. InstanceId: aws.String("String"), // Required
  1515. }
  1516. resp, err := svc.StartInstance(params)
  1517. if err != nil {
  1518. // Print the error, cast err to awserr.Error to get the Code and
  1519. // Message from an error.
  1520. fmt.Println(err.Error())
  1521. return
  1522. }
  1523. // Pretty-print the response data.
  1524. fmt.Println(resp)
  1525. }
  1526. func ExampleOpsWorks_StartStack() {
  1527. sess, err := session.NewSession()
  1528. if err != nil {
  1529. fmt.Println("failed to create session,", err)
  1530. return
  1531. }
  1532. svc := opsworks.New(sess)
  1533. params := &opsworks.StartStackInput{
  1534. StackId: aws.String("String"), // Required
  1535. }
  1536. resp, err := svc.StartStack(params)
  1537. if err != nil {
  1538. // Print the error, cast err to awserr.Error to get the Code and
  1539. // Message from an error.
  1540. fmt.Println(err.Error())
  1541. return
  1542. }
  1543. // Pretty-print the response data.
  1544. fmt.Println(resp)
  1545. }
  1546. func ExampleOpsWorks_StopInstance() {
  1547. sess, err := session.NewSession()
  1548. if err != nil {
  1549. fmt.Println("failed to create session,", err)
  1550. return
  1551. }
  1552. svc := opsworks.New(sess)
  1553. params := &opsworks.StopInstanceInput{
  1554. InstanceId: aws.String("String"), // Required
  1555. }
  1556. resp, err := svc.StopInstance(params)
  1557. if err != nil {
  1558. // Print the error, cast err to awserr.Error to get the Code and
  1559. // Message from an error.
  1560. fmt.Println(err.Error())
  1561. return
  1562. }
  1563. // Pretty-print the response data.
  1564. fmt.Println(resp)
  1565. }
  1566. func ExampleOpsWorks_StopStack() {
  1567. sess, err := session.NewSession()
  1568. if err != nil {
  1569. fmt.Println("failed to create session,", err)
  1570. return
  1571. }
  1572. svc := opsworks.New(sess)
  1573. params := &opsworks.StopStackInput{
  1574. StackId: aws.String("String"), // Required
  1575. }
  1576. resp, err := svc.StopStack(params)
  1577. if err != nil {
  1578. // Print the error, cast err to awserr.Error to get the Code and
  1579. // Message from an error.
  1580. fmt.Println(err.Error())
  1581. return
  1582. }
  1583. // Pretty-print the response data.
  1584. fmt.Println(resp)
  1585. }
  1586. func ExampleOpsWorks_UnassignInstance() {
  1587. sess, err := session.NewSession()
  1588. if err != nil {
  1589. fmt.Println("failed to create session,", err)
  1590. return
  1591. }
  1592. svc := opsworks.New(sess)
  1593. params := &opsworks.UnassignInstanceInput{
  1594. InstanceId: aws.String("String"), // Required
  1595. }
  1596. resp, err := svc.UnassignInstance(params)
  1597. if err != nil {
  1598. // Print the error, cast err to awserr.Error to get the Code and
  1599. // Message from an error.
  1600. fmt.Println(err.Error())
  1601. return
  1602. }
  1603. // Pretty-print the response data.
  1604. fmt.Println(resp)
  1605. }
  1606. func ExampleOpsWorks_UnassignVolume() {
  1607. sess, err := session.NewSession()
  1608. if err != nil {
  1609. fmt.Println("failed to create session,", err)
  1610. return
  1611. }
  1612. svc := opsworks.New(sess)
  1613. params := &opsworks.UnassignVolumeInput{
  1614. VolumeId: aws.String("String"), // Required
  1615. }
  1616. resp, err := svc.UnassignVolume(params)
  1617. if err != nil {
  1618. // Print the error, cast err to awserr.Error to get the Code and
  1619. // Message from an error.
  1620. fmt.Println(err.Error())
  1621. return
  1622. }
  1623. // Pretty-print the response data.
  1624. fmt.Println(resp)
  1625. }
  1626. func ExampleOpsWorks_UpdateApp() {
  1627. sess, err := session.NewSession()
  1628. if err != nil {
  1629. fmt.Println("failed to create session,", err)
  1630. return
  1631. }
  1632. svc := opsworks.New(sess)
  1633. params := &opsworks.UpdateAppInput{
  1634. AppId: aws.String("String"), // Required
  1635. AppSource: &opsworks.Source{
  1636. Password: aws.String("String"),
  1637. Revision: aws.String("String"),
  1638. SshKey: aws.String("String"),
  1639. Type: aws.String("SourceType"),
  1640. Url: aws.String("String"),
  1641. Username: aws.String("String"),
  1642. },
  1643. Attributes: map[string]*string{
  1644. "Key": aws.String("String"), // Required
  1645. // More values...
  1646. },
  1647. DataSources: []*opsworks.DataSource{
  1648. { // Required
  1649. Arn: aws.String("String"),
  1650. DatabaseName: aws.String("String"),
  1651. Type: aws.String("String"),
  1652. },
  1653. // More values...
  1654. },
  1655. Description: aws.String("String"),
  1656. Domains: []*string{
  1657. aws.String("String"), // Required
  1658. // More values...
  1659. },
  1660. EnableSsl: aws.Bool(true),
  1661. Environment: []*opsworks.EnvironmentVariable{
  1662. { // Required
  1663. Key: aws.String("String"), // Required
  1664. Value: aws.String("String"), // Required
  1665. Secure: aws.Bool(true),
  1666. },
  1667. // More values...
  1668. },
  1669. Name: aws.String("String"),
  1670. SslConfiguration: &opsworks.SslConfiguration{
  1671. Certificate: aws.String("String"), // Required
  1672. PrivateKey: aws.String("String"), // Required
  1673. Chain: aws.String("String"),
  1674. },
  1675. Type: aws.String("AppType"),
  1676. }
  1677. resp, err := svc.UpdateApp(params)
  1678. if err != nil {
  1679. // Print the error, cast err to awserr.Error to get the Code and
  1680. // Message from an error.
  1681. fmt.Println(err.Error())
  1682. return
  1683. }
  1684. // Pretty-print the response data.
  1685. fmt.Println(resp)
  1686. }
  1687. func ExampleOpsWorks_UpdateElasticIp() {
  1688. sess, err := session.NewSession()
  1689. if err != nil {
  1690. fmt.Println("failed to create session,", err)
  1691. return
  1692. }
  1693. svc := opsworks.New(sess)
  1694. params := &opsworks.UpdateElasticIpInput{
  1695. ElasticIp: aws.String("String"), // Required
  1696. Name: aws.String("String"),
  1697. }
  1698. resp, err := svc.UpdateElasticIp(params)
  1699. if err != nil {
  1700. // Print the error, cast err to awserr.Error to get the Code and
  1701. // Message from an error.
  1702. fmt.Println(err.Error())
  1703. return
  1704. }
  1705. // Pretty-print the response data.
  1706. fmt.Println(resp)
  1707. }
  1708. func ExampleOpsWorks_UpdateInstance() {
  1709. sess, err := session.NewSession()
  1710. if err != nil {
  1711. fmt.Println("failed to create session,", err)
  1712. return
  1713. }
  1714. svc := opsworks.New(sess)
  1715. params := &opsworks.UpdateInstanceInput{
  1716. InstanceId: aws.String("String"), // Required
  1717. AgentVersion: aws.String("String"),
  1718. AmiId: aws.String("String"),
  1719. Architecture: aws.String("Architecture"),
  1720. AutoScalingType: aws.String("AutoScalingType"),
  1721. EbsOptimized: aws.Bool(true),
  1722. Hostname: aws.String("String"),
  1723. InstallUpdatesOnBoot: aws.Bool(true),
  1724. InstanceType: aws.String("String"),
  1725. LayerIds: []*string{
  1726. aws.String("String"), // Required
  1727. // More values...
  1728. },
  1729. Os: aws.String("String"),
  1730. SshKeyName: aws.String("String"),
  1731. }
  1732. resp, err := svc.UpdateInstance(params)
  1733. if err != nil {
  1734. // Print the error, cast err to awserr.Error to get the Code and
  1735. // Message from an error.
  1736. fmt.Println(err.Error())
  1737. return
  1738. }
  1739. // Pretty-print the response data.
  1740. fmt.Println(resp)
  1741. }
  1742. func ExampleOpsWorks_UpdateLayer() {
  1743. sess, err := session.NewSession()
  1744. if err != nil {
  1745. fmt.Println("failed to create session,", err)
  1746. return
  1747. }
  1748. svc := opsworks.New(sess)
  1749. params := &opsworks.UpdateLayerInput{
  1750. LayerId: aws.String("String"), // Required
  1751. Attributes: map[string]*string{
  1752. "Key": aws.String("String"), // Required
  1753. // More values...
  1754. },
  1755. AutoAssignElasticIps: aws.Bool(true),
  1756. AutoAssignPublicIps: aws.Bool(true),
  1757. CustomInstanceProfileArn: aws.String("String"),
  1758. CustomJson: aws.String("String"),
  1759. CustomRecipes: &opsworks.Recipes{
  1760. Configure: []*string{
  1761. aws.String("String"), // Required
  1762. // More values...
  1763. },
  1764. Deploy: []*string{
  1765. aws.String("String"), // Required
  1766. // More values...
  1767. },
  1768. Setup: []*string{
  1769. aws.String("String"), // Required
  1770. // More values...
  1771. },
  1772. Shutdown: []*string{
  1773. aws.String("String"), // Required
  1774. // More values...
  1775. },
  1776. Undeploy: []*string{
  1777. aws.String("String"), // Required
  1778. // More values...
  1779. },
  1780. },
  1781. CustomSecurityGroupIds: []*string{
  1782. aws.String("String"), // Required
  1783. // More values...
  1784. },
  1785. EnableAutoHealing: aws.Bool(true),
  1786. InstallUpdatesOnBoot: aws.Bool(true),
  1787. LifecycleEventConfiguration: &opsworks.LifecycleEventConfiguration{
  1788. Shutdown: &opsworks.ShutdownEventConfiguration{
  1789. DelayUntilElbConnectionsDrained: aws.Bool(true),
  1790. ExecutionTimeout: aws.Int64(1),
  1791. },
  1792. },
  1793. Name: aws.String("String"),
  1794. Packages: []*string{
  1795. aws.String("String"), // Required
  1796. // More values...
  1797. },
  1798. Shortname: aws.String("String"),
  1799. UseEbsOptimizedInstances: aws.Bool(true),
  1800. VolumeConfigurations: []*opsworks.VolumeConfiguration{
  1801. { // Required
  1802. MountPoint: aws.String("String"), // Required
  1803. NumberOfDisks: aws.Int64(1), // Required
  1804. Size: aws.Int64(1), // Required
  1805. Iops: aws.Int64(1),
  1806. RaidLevel: aws.Int64(1),
  1807. VolumeType: aws.String("String"),
  1808. },
  1809. // More values...
  1810. },
  1811. }
  1812. resp, err := svc.UpdateLayer(params)
  1813. if err != nil {
  1814. // Print the error, cast err to awserr.Error to get the Code and
  1815. // Message from an error.
  1816. fmt.Println(err.Error())
  1817. return
  1818. }
  1819. // Pretty-print the response data.
  1820. fmt.Println(resp)
  1821. }
  1822. func ExampleOpsWorks_UpdateMyUserProfile() {
  1823. sess, err := session.NewSession()
  1824. if err != nil {
  1825. fmt.Println("failed to create session,", err)
  1826. return
  1827. }
  1828. svc := opsworks.New(sess)
  1829. params := &opsworks.UpdateMyUserProfileInput{
  1830. SshPublicKey: aws.String("String"),
  1831. }
  1832. resp, err := svc.UpdateMyUserProfile(params)
  1833. if err != nil {
  1834. // Print the error, cast err to awserr.Error to get the Code and
  1835. // Message from an error.
  1836. fmt.Println(err.Error())
  1837. return
  1838. }
  1839. // Pretty-print the response data.
  1840. fmt.Println(resp)
  1841. }
  1842. func ExampleOpsWorks_UpdateRdsDbInstance() {
  1843. sess, err := session.NewSession()
  1844. if err != nil {
  1845. fmt.Println("failed to create session,", err)
  1846. return
  1847. }
  1848. svc := opsworks.New(sess)
  1849. params := &opsworks.UpdateRdsDbInstanceInput{
  1850. RdsDbInstanceArn: aws.String("String"), // Required
  1851. DbPassword: aws.String("String"),
  1852. DbUser: aws.String("String"),
  1853. }
  1854. resp, err := svc.UpdateRdsDbInstance(params)
  1855. if err != nil {
  1856. // Print the error, cast err to awserr.Error to get the Code and
  1857. // Message from an error.
  1858. fmt.Println(err.Error())
  1859. return
  1860. }
  1861. // Pretty-print the response data.
  1862. fmt.Println(resp)
  1863. }
  1864. func ExampleOpsWorks_UpdateStack() {
  1865. sess, err := session.NewSession()
  1866. if err != nil {
  1867. fmt.Println("failed to create session,", err)
  1868. return
  1869. }
  1870. svc := opsworks.New(sess)
  1871. params := &opsworks.UpdateStackInput{
  1872. StackId: aws.String("String"), // Required
  1873. AgentVersion: aws.String("String"),
  1874. Attributes: map[string]*string{
  1875. "Key": aws.String("String"), // Required
  1876. // More values...
  1877. },
  1878. ChefConfiguration: &opsworks.ChefConfiguration{
  1879. BerkshelfVersion: aws.String("String"),
  1880. ManageBerkshelf: aws.Bool(true),
  1881. },
  1882. ConfigurationManager: &opsworks.StackConfigurationManager{
  1883. Name: aws.String("String"),
  1884. Version: aws.String("String"),
  1885. },
  1886. CustomCookbooksSource: &opsworks.Source{
  1887. Password: aws.String("String"),
  1888. Revision: aws.String("String"),
  1889. SshKey: aws.String("String"),
  1890. Type: aws.String("SourceType"),
  1891. Url: aws.String("String"),
  1892. Username: aws.String("String"),
  1893. },
  1894. CustomJson: aws.String("String"),
  1895. DefaultAvailabilityZone: aws.String("String"),
  1896. DefaultInstanceProfileArn: aws.String("String"),
  1897. DefaultOs: aws.String("String"),
  1898. DefaultRootDeviceType: aws.String("RootDeviceType"),
  1899. DefaultSshKeyName: aws.String("String"),
  1900. DefaultSubnetId: aws.String("String"),
  1901. HostnameTheme: aws.String("String"),
  1902. Name: aws.String("String"),
  1903. ServiceRoleArn: aws.String("String"),
  1904. UseCustomCookbooks: aws.Bool(true),
  1905. UseOpsworksSecurityGroups: aws.Bool(true),
  1906. }
  1907. resp, err := svc.UpdateStack(params)
  1908. if err != nil {
  1909. // Print the error, cast err to awserr.Error to get the Code and
  1910. // Message from an error.
  1911. fmt.Println(err.Error())
  1912. return
  1913. }
  1914. // Pretty-print the response data.
  1915. fmt.Println(resp)
  1916. }
  1917. func ExampleOpsWorks_UpdateUserProfile() {
  1918. sess, err := session.NewSession()
  1919. if err != nil {
  1920. fmt.Println("failed to create session,", err)
  1921. return
  1922. }
  1923. svc := opsworks.New(sess)
  1924. params := &opsworks.UpdateUserProfileInput{
  1925. IamUserArn: aws.String("String"), // Required
  1926. AllowSelfManagement: aws.Bool(true),
  1927. SshPublicKey: aws.String("String"),
  1928. SshUsername: aws.String("String"),
  1929. }
  1930. resp, err := svc.UpdateUserProfile(params)
  1931. if err != nil {
  1932. // Print the error, cast err to awserr.Error to get the Code and
  1933. // Message from an error.
  1934. fmt.Println(err.Error())
  1935. return
  1936. }
  1937. // Pretty-print the response data.
  1938. fmt.Println(resp)
  1939. }
  1940. func ExampleOpsWorks_UpdateVolume() {
  1941. sess, err := session.NewSession()
  1942. if err != nil {
  1943. fmt.Println("failed to create session,", err)
  1944. return
  1945. }
  1946. svc := opsworks.New(sess)
  1947. params := &opsworks.UpdateVolumeInput{
  1948. VolumeId: aws.String("String"), // Required
  1949. MountPoint: aws.String("String"),
  1950. Name: aws.String("String"),
  1951. }
  1952. resp, err := svc.UpdateVolume(params)
  1953. if err != nil {
  1954. // Print the error, cast err to awserr.Error to get the Code and
  1955. // Message from an error.
  1956. fmt.Println(err.Error())
  1957. return
  1958. }
  1959. // Pretty-print the response data.
  1960. fmt.Println(resp)
  1961. }