12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889 |
- // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
- package opsworks_test
- import (
- "bytes"
- "fmt"
- "time"
- "github.com/aws/aws-sdk-go/aws"
- "github.com/aws/aws-sdk-go/service/opsworks"
- )
- var _ time.Duration
- var _ bytes.Buffer
- func ExampleOpsWorks_AssignInstance() {
- svc := opsworks.New(nil)
- params := &opsworks.AssignInstanceInput{
- InstanceId: aws.String("String"), // Required
- LayerIds: []*string{ // Required
- aws.String("String"), // Required
- // More values...
- },
- }
- resp, err := svc.AssignInstance(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleOpsWorks_AssignVolume() {
- svc := opsworks.New(nil)
- params := &opsworks.AssignVolumeInput{
- VolumeId: aws.String("String"), // Required
- InstanceId: aws.String("String"),
- }
- resp, err := svc.AssignVolume(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleOpsWorks_AssociateElasticIp() {
- svc := opsworks.New(nil)
- params := &opsworks.AssociateElasticIpInput{
- ElasticIp: aws.String("String"), // Required
- InstanceId: aws.String("String"),
- }
- resp, err := svc.AssociateElasticIp(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleOpsWorks_AttachElasticLoadBalancer() {
- svc := opsworks.New(nil)
- params := &opsworks.AttachElasticLoadBalancerInput{
- ElasticLoadBalancerName: aws.String("String"), // Required
- LayerId: aws.String("String"), // Required
- }
- resp, err := svc.AttachElasticLoadBalancer(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleOpsWorks_CloneStack() {
- svc := opsworks.New(nil)
- params := &opsworks.CloneStackInput{
- ServiceRoleArn: aws.String("String"), // Required
- SourceStackId: aws.String("String"), // Required
- AgentVersion: aws.String("String"),
- Attributes: map[string]*string{
- "Key": aws.String("String"), // Required
- // More values...
- },
- ChefConfiguration: &opsworks.ChefConfiguration{
- BerkshelfVersion: aws.String("String"),
- ManageBerkshelf: aws.Bool(true),
- },
- CloneAppIds: []*string{
- aws.String("String"), // Required
- // More values...
- },
- ClonePermissions: aws.Bool(true),
- ConfigurationManager: &opsworks.StackConfigurationManager{
- Name: aws.String("String"),
- Version: aws.String("String"),
- },
- CustomCookbooksSource: &opsworks.Source{
- Password: aws.String("String"),
- Revision: aws.String("String"),
- SshKey: aws.String("String"),
- Type: aws.String("SourceType"),
- Url: aws.String("String"),
- Username: aws.String("String"),
- },
- CustomJson: aws.String("String"),
- DefaultAvailabilityZone: aws.String("String"),
- DefaultInstanceProfileArn: aws.String("String"),
- DefaultOs: aws.String("String"),
- DefaultRootDeviceType: aws.String("RootDeviceType"),
- DefaultSshKeyName: aws.String("String"),
- DefaultSubnetId: aws.String("String"),
- HostnameTheme: aws.String("String"),
- Name: aws.String("String"),
- Region: aws.String("String"),
- UseCustomCookbooks: aws.Bool(true),
- UseOpsworksSecurityGroups: aws.Bool(true),
- VpcId: aws.String("String"),
- }
- resp, err := svc.CloneStack(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleOpsWorks_CreateApp() {
- svc := opsworks.New(nil)
- params := &opsworks.CreateAppInput{
- Name: aws.String("String"), // Required
- StackId: aws.String("String"), // Required
- Type: aws.String("AppType"), // Required
- AppSource: &opsworks.Source{
- Password: aws.String("String"),
- Revision: aws.String("String"),
- SshKey: aws.String("String"),
- Type: aws.String("SourceType"),
- Url: aws.String("String"),
- Username: aws.String("String"),
- },
- Attributes: map[string]*string{
- "Key": aws.String("String"), // Required
- // More values...
- },
- DataSources: []*opsworks.DataSource{
- { // Required
- Arn: aws.String("String"),
- DatabaseName: aws.String("String"),
- Type: aws.String("String"),
- },
- // More values...
- },
- Description: aws.String("String"),
- Domains: []*string{
- aws.String("String"), // Required
- // More values...
- },
- EnableSsl: aws.Bool(true),
- Environment: []*opsworks.EnvironmentVariable{
- { // Required
- Key: aws.String("String"), // Required
- Value: aws.String("String"), // Required
- Secure: aws.Bool(true),
- },
- // More values...
- },
- Shortname: aws.String("String"),
- SslConfiguration: &opsworks.SslConfiguration{
- Certificate: aws.String("String"), // Required
- PrivateKey: aws.String("String"), // Required
- Chain: aws.String("String"),
- },
- }
- resp, err := svc.CreateApp(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleOpsWorks_CreateDeployment() {
- svc := opsworks.New(nil)
- params := &opsworks.CreateDeploymentInput{
- Command: &opsworks.DeploymentCommand{ // Required
- Name: aws.String("DeploymentCommandName"), // Required
- Args: map[string][]*string{
- "Key": { // Required
- aws.String("String"), // Required
- // More values...
- },
- // More values...
- },
- },
- StackId: aws.String("String"), // Required
- AppId: aws.String("String"),
- Comment: aws.String("String"),
- CustomJson: aws.String("String"),
- InstanceIds: []*string{
- aws.String("String"), // Required
- // More values...
- },
- }
- resp, err := svc.CreateDeployment(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleOpsWorks_CreateInstance() {
- svc := opsworks.New(nil)
- params := &opsworks.CreateInstanceInput{
- InstanceType: aws.String("String"), // Required
- LayerIds: []*string{ // Required
- aws.String("String"), // Required
- // More values...
- },
- StackId: aws.String("String"), // Required
- AgentVersion: aws.String("String"),
- AmiId: aws.String("String"),
- Architecture: aws.String("Architecture"),
- AutoScalingType: aws.String("AutoScalingType"),
- AvailabilityZone: aws.String("String"),
- BlockDeviceMappings: []*opsworks.BlockDeviceMapping{
- { // Required
- DeviceName: aws.String("String"),
- Ebs: &opsworks.EbsBlockDevice{
- DeleteOnTermination: aws.Bool(true),
- Iops: aws.Int64(1),
- SnapshotId: aws.String("String"),
- VolumeSize: aws.Int64(1),
- VolumeType: aws.String("VolumeType"),
- },
- NoDevice: aws.String("String"),
- VirtualName: aws.String("String"),
- },
- // More values...
- },
- EbsOptimized: aws.Bool(true),
- Hostname: aws.String("String"),
- InstallUpdatesOnBoot: aws.Bool(true),
- Os: aws.String("String"),
- RootDeviceType: aws.String("RootDeviceType"),
- SshKeyName: aws.String("String"),
- SubnetId: aws.String("String"),
- VirtualizationType: aws.String("String"),
- }
- resp, err := svc.CreateInstance(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleOpsWorks_CreateLayer() {
- svc := opsworks.New(nil)
- params := &opsworks.CreateLayerInput{
- Name: aws.String("String"), // Required
- Shortname: aws.String("String"), // Required
- StackId: aws.String("String"), // Required
- Type: aws.String("LayerType"), // Required
- Attributes: map[string]*string{
- "Key": aws.String("String"), // Required
- // More values...
- },
- AutoAssignElasticIps: aws.Bool(true),
- AutoAssignPublicIps: aws.Bool(true),
- CustomInstanceProfileArn: aws.String("String"),
- CustomJson: aws.String("String"),
- CustomRecipes: &opsworks.Recipes{
- Configure: []*string{
- aws.String("String"), // Required
- // More values...
- },
- Deploy: []*string{
- aws.String("String"), // Required
- // More values...
- },
- Setup: []*string{
- aws.String("String"), // Required
- // More values...
- },
- Shutdown: []*string{
- aws.String("String"), // Required
- // More values...
- },
- Undeploy: []*string{
- aws.String("String"), // Required
- // More values...
- },
- },
- CustomSecurityGroupIds: []*string{
- aws.String("String"), // Required
- // More values...
- },
- EnableAutoHealing: aws.Bool(true),
- InstallUpdatesOnBoot: aws.Bool(true),
- LifecycleEventConfiguration: &opsworks.LifecycleEventConfiguration{
- Shutdown: &opsworks.ShutdownEventConfiguration{
- DelayUntilElbConnectionsDrained: aws.Bool(true),
- ExecutionTimeout: aws.Int64(1),
- },
- },
- Packages: []*string{
- aws.String("String"), // Required
- // More values...
- },
- UseEbsOptimizedInstances: aws.Bool(true),
- VolumeConfigurations: []*opsworks.VolumeConfiguration{
- { // Required
- MountPoint: aws.String("String"), // Required
- NumberOfDisks: aws.Int64(1), // Required
- Size: aws.Int64(1), // Required
- Iops: aws.Int64(1),
- RaidLevel: aws.Int64(1),
- VolumeType: aws.String("String"),
- },
- // More values...
- },
- }
- resp, err := svc.CreateLayer(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleOpsWorks_CreateStack() {
- svc := opsworks.New(nil)
- params := &opsworks.CreateStackInput{
- DefaultInstanceProfileArn: aws.String("String"), // Required
- Name: aws.String("String"), // Required
- Region: aws.String("String"), // Required
- ServiceRoleArn: aws.String("String"), // Required
- AgentVersion: aws.String("String"),
- Attributes: map[string]*string{
- "Key": aws.String("String"), // Required
- // More values...
- },
- ChefConfiguration: &opsworks.ChefConfiguration{
- BerkshelfVersion: aws.String("String"),
- ManageBerkshelf: aws.Bool(true),
- },
- ConfigurationManager: &opsworks.StackConfigurationManager{
- Name: aws.String("String"),
- Version: aws.String("String"),
- },
- CustomCookbooksSource: &opsworks.Source{
- Password: aws.String("String"),
- Revision: aws.String("String"),
- SshKey: aws.String("String"),
- Type: aws.String("SourceType"),
- Url: aws.String("String"),
- Username: aws.String("String"),
- },
- CustomJson: aws.String("String"),
- DefaultAvailabilityZone: aws.String("String"),
- DefaultOs: aws.String("String"),
- DefaultRootDeviceType: aws.String("RootDeviceType"),
- DefaultSshKeyName: aws.String("String"),
- DefaultSubnetId: aws.String("String"),
- HostnameTheme: aws.String("String"),
- UseCustomCookbooks: aws.Bool(true),
- UseOpsworksSecurityGroups: aws.Bool(true),
- VpcId: aws.String("String"),
- }
- resp, err := svc.CreateStack(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleOpsWorks_CreateUserProfile() {
- svc := opsworks.New(nil)
- params := &opsworks.CreateUserProfileInput{
- IamUserArn: aws.String("String"), // Required
- AllowSelfManagement: aws.Bool(true),
- SshPublicKey: aws.String("String"),
- SshUsername: aws.String("String"),
- }
- resp, err := svc.CreateUserProfile(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleOpsWorks_DeleteApp() {
- svc := opsworks.New(nil)
- params := &opsworks.DeleteAppInput{
- AppId: aws.String("String"), // Required
- }
- resp, err := svc.DeleteApp(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleOpsWorks_DeleteInstance() {
- svc := opsworks.New(nil)
- params := &opsworks.DeleteInstanceInput{
- InstanceId: aws.String("String"), // Required
- DeleteElasticIp: aws.Bool(true),
- DeleteVolumes: aws.Bool(true),
- }
- resp, err := svc.DeleteInstance(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleOpsWorks_DeleteLayer() {
- svc := opsworks.New(nil)
- params := &opsworks.DeleteLayerInput{
- LayerId: aws.String("String"), // Required
- }
- resp, err := svc.DeleteLayer(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleOpsWorks_DeleteStack() {
- svc := opsworks.New(nil)
- params := &opsworks.DeleteStackInput{
- StackId: aws.String("String"), // Required
- }
- resp, err := svc.DeleteStack(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleOpsWorks_DeleteUserProfile() {
- svc := opsworks.New(nil)
- params := &opsworks.DeleteUserProfileInput{
- IamUserArn: aws.String("String"), // Required
- }
- resp, err := svc.DeleteUserProfile(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleOpsWorks_DeregisterEcsCluster() {
- svc := opsworks.New(nil)
- params := &opsworks.DeregisterEcsClusterInput{
- EcsClusterArn: aws.String("String"), // Required
- }
- resp, err := svc.DeregisterEcsCluster(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleOpsWorks_DeregisterElasticIp() {
- svc := opsworks.New(nil)
- params := &opsworks.DeregisterElasticIpInput{
- ElasticIp: aws.String("String"), // Required
- }
- resp, err := svc.DeregisterElasticIp(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleOpsWorks_DeregisterInstance() {
- svc := opsworks.New(nil)
- params := &opsworks.DeregisterInstanceInput{
- InstanceId: aws.String("String"), // Required
- }
- resp, err := svc.DeregisterInstance(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleOpsWorks_DeregisterRdsDbInstance() {
- svc := opsworks.New(nil)
- params := &opsworks.DeregisterRdsDbInstanceInput{
- RdsDbInstanceArn: aws.String("String"), // Required
- }
- resp, err := svc.DeregisterRdsDbInstance(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleOpsWorks_DeregisterVolume() {
- svc := opsworks.New(nil)
- params := &opsworks.DeregisterVolumeInput{
- VolumeId: aws.String("String"), // Required
- }
- resp, err := svc.DeregisterVolume(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleOpsWorks_DescribeAgentVersions() {
- svc := opsworks.New(nil)
- params := &opsworks.DescribeAgentVersionsInput{
- ConfigurationManager: &opsworks.StackConfigurationManager{
- Name: aws.String("String"),
- Version: aws.String("String"),
- },
- StackId: aws.String("String"),
- }
- resp, err := svc.DescribeAgentVersions(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleOpsWorks_DescribeApps() {
- svc := opsworks.New(nil)
- params := &opsworks.DescribeAppsInput{
- AppIds: []*string{
- aws.String("String"), // Required
- // More values...
- },
- StackId: aws.String("String"),
- }
- resp, err := svc.DescribeApps(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleOpsWorks_DescribeCommands() {
- svc := opsworks.New(nil)
- params := &opsworks.DescribeCommandsInput{
- CommandIds: []*string{
- aws.String("String"), // Required
- // More values...
- },
- DeploymentId: aws.String("String"),
- InstanceId: aws.String("String"),
- }
- resp, err := svc.DescribeCommands(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleOpsWorks_DescribeDeployments() {
- svc := opsworks.New(nil)
- params := &opsworks.DescribeDeploymentsInput{
- AppId: aws.String("String"),
- DeploymentIds: []*string{
- aws.String("String"), // Required
- // More values...
- },
- StackId: aws.String("String"),
- }
- resp, err := svc.DescribeDeployments(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleOpsWorks_DescribeEcsClusters() {
- svc := opsworks.New(nil)
- params := &opsworks.DescribeEcsClustersInput{
- EcsClusterArns: []*string{
- aws.String("String"), // Required
- // More values...
- },
- MaxResults: aws.Int64(1),
- NextToken: aws.String("String"),
- StackId: aws.String("String"),
- }
- resp, err := svc.DescribeEcsClusters(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleOpsWorks_DescribeElasticIps() {
- svc := opsworks.New(nil)
- params := &opsworks.DescribeElasticIpsInput{
- InstanceId: aws.String("String"),
- Ips: []*string{
- aws.String("String"), // Required
- // More values...
- },
- StackId: aws.String("String"),
- }
- resp, err := svc.DescribeElasticIps(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleOpsWorks_DescribeElasticLoadBalancers() {
- svc := opsworks.New(nil)
- params := &opsworks.DescribeElasticLoadBalancersInput{
- LayerIds: []*string{
- aws.String("String"), // Required
- // More values...
- },
- StackId: aws.String("String"),
- }
- resp, err := svc.DescribeElasticLoadBalancers(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleOpsWorks_DescribeInstances() {
- svc := opsworks.New(nil)
- params := &opsworks.DescribeInstancesInput{
- InstanceIds: []*string{
- aws.String("String"), // Required
- // More values...
- },
- LayerId: aws.String("String"),
- StackId: aws.String("String"),
- }
- resp, err := svc.DescribeInstances(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleOpsWorks_DescribeLayers() {
- svc := opsworks.New(nil)
- params := &opsworks.DescribeLayersInput{
- LayerIds: []*string{
- aws.String("String"), // Required
- // More values...
- },
- StackId: aws.String("String"),
- }
- resp, err := svc.DescribeLayers(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleOpsWorks_DescribeLoadBasedAutoScaling() {
- svc := opsworks.New(nil)
- params := &opsworks.DescribeLoadBasedAutoScalingInput{
- LayerIds: []*string{ // Required
- aws.String("String"), // Required
- // More values...
- },
- }
- resp, err := svc.DescribeLoadBasedAutoScaling(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleOpsWorks_DescribeMyUserProfile() {
- svc := opsworks.New(nil)
- var params *opsworks.DescribeMyUserProfileInput
- resp, err := svc.DescribeMyUserProfile(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleOpsWorks_DescribePermissions() {
- svc := opsworks.New(nil)
- params := &opsworks.DescribePermissionsInput{
- IamUserArn: aws.String("String"),
- StackId: aws.String("String"),
- }
- resp, err := svc.DescribePermissions(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleOpsWorks_DescribeRaidArrays() {
- svc := opsworks.New(nil)
- params := &opsworks.DescribeRaidArraysInput{
- InstanceId: aws.String("String"),
- RaidArrayIds: []*string{
- aws.String("String"), // Required
- // More values...
- },
- StackId: aws.String("String"),
- }
- resp, err := svc.DescribeRaidArrays(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleOpsWorks_DescribeRdsDbInstances() {
- svc := opsworks.New(nil)
- params := &opsworks.DescribeRdsDbInstancesInput{
- StackId: aws.String("String"), // Required
- RdsDbInstanceArns: []*string{
- aws.String("String"), // Required
- // More values...
- },
- }
- resp, err := svc.DescribeRdsDbInstances(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleOpsWorks_DescribeServiceErrors() {
- svc := opsworks.New(nil)
- params := &opsworks.DescribeServiceErrorsInput{
- InstanceId: aws.String("String"),
- ServiceErrorIds: []*string{
- aws.String("String"), // Required
- // More values...
- },
- StackId: aws.String("String"),
- }
- resp, err := svc.DescribeServiceErrors(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleOpsWorks_DescribeStackProvisioningParameters() {
- svc := opsworks.New(nil)
- params := &opsworks.DescribeStackProvisioningParametersInput{
- StackId: aws.String("String"), // Required
- }
- resp, err := svc.DescribeStackProvisioningParameters(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleOpsWorks_DescribeStackSummary() {
- svc := opsworks.New(nil)
- params := &opsworks.DescribeStackSummaryInput{
- StackId: aws.String("String"), // Required
- }
- resp, err := svc.DescribeStackSummary(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleOpsWorks_DescribeStacks() {
- svc := opsworks.New(nil)
- params := &opsworks.DescribeStacksInput{
- StackIds: []*string{
- aws.String("String"), // Required
- // More values...
- },
- }
- resp, err := svc.DescribeStacks(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleOpsWorks_DescribeTimeBasedAutoScaling() {
- svc := opsworks.New(nil)
- params := &opsworks.DescribeTimeBasedAutoScalingInput{
- InstanceIds: []*string{ // Required
- aws.String("String"), // Required
- // More values...
- },
- }
- resp, err := svc.DescribeTimeBasedAutoScaling(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleOpsWorks_DescribeUserProfiles() {
- svc := opsworks.New(nil)
- params := &opsworks.DescribeUserProfilesInput{
- IamUserArns: []*string{
- aws.String("String"), // Required
- // More values...
- },
- }
- resp, err := svc.DescribeUserProfiles(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleOpsWorks_DescribeVolumes() {
- svc := opsworks.New(nil)
- params := &opsworks.DescribeVolumesInput{
- InstanceId: aws.String("String"),
- RaidArrayId: aws.String("String"),
- StackId: aws.String("String"),
- VolumeIds: []*string{
- aws.String("String"), // Required
- // More values...
- },
- }
- resp, err := svc.DescribeVolumes(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleOpsWorks_DetachElasticLoadBalancer() {
- svc := opsworks.New(nil)
- params := &opsworks.DetachElasticLoadBalancerInput{
- ElasticLoadBalancerName: aws.String("String"), // Required
- LayerId: aws.String("String"), // Required
- }
- resp, err := svc.DetachElasticLoadBalancer(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleOpsWorks_DisassociateElasticIp() {
- svc := opsworks.New(nil)
- params := &opsworks.DisassociateElasticIpInput{
- ElasticIp: aws.String("String"), // Required
- }
- resp, err := svc.DisassociateElasticIp(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleOpsWorks_GetHostnameSuggestion() {
- svc := opsworks.New(nil)
- params := &opsworks.GetHostnameSuggestionInput{
- LayerId: aws.String("String"), // Required
- }
- resp, err := svc.GetHostnameSuggestion(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleOpsWorks_GrantAccess() {
- svc := opsworks.New(nil)
- params := &opsworks.GrantAccessInput{
- InstanceId: aws.String("String"), // Required
- ValidForInMinutes: aws.Int64(1),
- }
- resp, err := svc.GrantAccess(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleOpsWorks_RebootInstance() {
- svc := opsworks.New(nil)
- params := &opsworks.RebootInstanceInput{
- InstanceId: aws.String("String"), // Required
- }
- resp, err := svc.RebootInstance(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleOpsWorks_RegisterEcsCluster() {
- svc := opsworks.New(nil)
- params := &opsworks.RegisterEcsClusterInput{
- EcsClusterArn: aws.String("String"), // Required
- StackId: aws.String("String"), // Required
- }
- resp, err := svc.RegisterEcsCluster(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleOpsWorks_RegisterElasticIp() {
- svc := opsworks.New(nil)
- params := &opsworks.RegisterElasticIpInput{
- ElasticIp: aws.String("String"), // Required
- StackId: aws.String("String"), // Required
- }
- resp, err := svc.RegisterElasticIp(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleOpsWorks_RegisterInstance() {
- svc := opsworks.New(nil)
- params := &opsworks.RegisterInstanceInput{
- StackId: aws.String("String"), // Required
- Hostname: aws.String("String"),
- InstanceIdentity: &opsworks.InstanceIdentity{
- Document: aws.String("String"),
- Signature: aws.String("String"),
- },
- PrivateIp: aws.String("String"),
- PublicIp: aws.String("String"),
- RsaPublicKey: aws.String("String"),
- RsaPublicKeyFingerprint: aws.String("String"),
- }
- resp, err := svc.RegisterInstance(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleOpsWorks_RegisterRdsDbInstance() {
- svc := opsworks.New(nil)
- params := &opsworks.RegisterRdsDbInstanceInput{
- DbPassword: aws.String("String"), // Required
- DbUser: aws.String("String"), // Required
- RdsDbInstanceArn: aws.String("String"), // Required
- StackId: aws.String("String"), // Required
- }
- resp, err := svc.RegisterRdsDbInstance(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleOpsWorks_RegisterVolume() {
- svc := opsworks.New(nil)
- params := &opsworks.RegisterVolumeInput{
- StackId: aws.String("String"), // Required
- Ec2VolumeId: aws.String("String"),
- }
- resp, err := svc.RegisterVolume(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleOpsWorks_SetLoadBasedAutoScaling() {
- svc := opsworks.New(nil)
- params := &opsworks.SetLoadBasedAutoScalingInput{
- LayerId: aws.String("String"), // Required
- DownScaling: &opsworks.AutoScalingThresholds{
- Alarms: []*string{
- aws.String("String"), // Required
- // More values...
- },
- CpuThreshold: aws.Float64(1.0),
- IgnoreMetricsTime: aws.Int64(1),
- InstanceCount: aws.Int64(1),
- LoadThreshold: aws.Float64(1.0),
- MemoryThreshold: aws.Float64(1.0),
- ThresholdsWaitTime: aws.Int64(1),
- },
- Enable: aws.Bool(true),
- UpScaling: &opsworks.AutoScalingThresholds{
- Alarms: []*string{
- aws.String("String"), // Required
- // More values...
- },
- CpuThreshold: aws.Float64(1.0),
- IgnoreMetricsTime: aws.Int64(1),
- InstanceCount: aws.Int64(1),
- LoadThreshold: aws.Float64(1.0),
- MemoryThreshold: aws.Float64(1.0),
- ThresholdsWaitTime: aws.Int64(1),
- },
- }
- resp, err := svc.SetLoadBasedAutoScaling(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleOpsWorks_SetPermission() {
- svc := opsworks.New(nil)
- params := &opsworks.SetPermissionInput{
- IamUserArn: aws.String("String"), // Required
- StackId: aws.String("String"), // Required
- AllowSsh: aws.Bool(true),
- AllowSudo: aws.Bool(true),
- Level: aws.String("String"),
- }
- resp, err := svc.SetPermission(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleOpsWorks_SetTimeBasedAutoScaling() {
- svc := opsworks.New(nil)
- params := &opsworks.SetTimeBasedAutoScalingInput{
- InstanceId: aws.String("String"), // Required
- AutoScalingSchedule: &opsworks.WeeklyAutoScalingSchedule{
- Friday: map[string]*string{
- "Key": aws.String("Switch"), // Required
- // More values...
- },
- Monday: map[string]*string{
- "Key": aws.String("Switch"), // Required
- // More values...
- },
- Saturday: map[string]*string{
- "Key": aws.String("Switch"), // Required
- // More values...
- },
- Sunday: map[string]*string{
- "Key": aws.String("Switch"), // Required
- // More values...
- },
- Thursday: map[string]*string{
- "Key": aws.String("Switch"), // Required
- // More values...
- },
- Tuesday: map[string]*string{
- "Key": aws.String("Switch"), // Required
- // More values...
- },
- Wednesday: map[string]*string{
- "Key": aws.String("Switch"), // Required
- // More values...
- },
- },
- }
- resp, err := svc.SetTimeBasedAutoScaling(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleOpsWorks_StartInstance() {
- svc := opsworks.New(nil)
- params := &opsworks.StartInstanceInput{
- InstanceId: aws.String("String"), // Required
- }
- resp, err := svc.StartInstance(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleOpsWorks_StartStack() {
- svc := opsworks.New(nil)
- params := &opsworks.StartStackInput{
- StackId: aws.String("String"), // Required
- }
- resp, err := svc.StartStack(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleOpsWorks_StopInstance() {
- svc := opsworks.New(nil)
- params := &opsworks.StopInstanceInput{
- InstanceId: aws.String("String"), // Required
- }
- resp, err := svc.StopInstance(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleOpsWorks_StopStack() {
- svc := opsworks.New(nil)
- params := &opsworks.StopStackInput{
- StackId: aws.String("String"), // Required
- }
- resp, err := svc.StopStack(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleOpsWorks_UnassignInstance() {
- svc := opsworks.New(nil)
- params := &opsworks.UnassignInstanceInput{
- InstanceId: aws.String("String"), // Required
- }
- resp, err := svc.UnassignInstance(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleOpsWorks_UnassignVolume() {
- svc := opsworks.New(nil)
- params := &opsworks.UnassignVolumeInput{
- VolumeId: aws.String("String"), // Required
- }
- resp, err := svc.UnassignVolume(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleOpsWorks_UpdateApp() {
- svc := opsworks.New(nil)
- params := &opsworks.UpdateAppInput{
- AppId: aws.String("String"), // Required
- AppSource: &opsworks.Source{
- Password: aws.String("String"),
- Revision: aws.String("String"),
- SshKey: aws.String("String"),
- Type: aws.String("SourceType"),
- Url: aws.String("String"),
- Username: aws.String("String"),
- },
- Attributes: map[string]*string{
- "Key": aws.String("String"), // Required
- // More values...
- },
- DataSources: []*opsworks.DataSource{
- { // Required
- Arn: aws.String("String"),
- DatabaseName: aws.String("String"),
- Type: aws.String("String"),
- },
- // More values...
- },
- Description: aws.String("String"),
- Domains: []*string{
- aws.String("String"), // Required
- // More values...
- },
- EnableSsl: aws.Bool(true),
- Environment: []*opsworks.EnvironmentVariable{
- { // Required
- Key: aws.String("String"), // Required
- Value: aws.String("String"), // Required
- Secure: aws.Bool(true),
- },
- // More values...
- },
- Name: aws.String("String"),
- SslConfiguration: &opsworks.SslConfiguration{
- Certificate: aws.String("String"), // Required
- PrivateKey: aws.String("String"), // Required
- Chain: aws.String("String"),
- },
- Type: aws.String("AppType"),
- }
- resp, err := svc.UpdateApp(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleOpsWorks_UpdateElasticIp() {
- svc := opsworks.New(nil)
- params := &opsworks.UpdateElasticIpInput{
- ElasticIp: aws.String("String"), // Required
- Name: aws.String("String"),
- }
- resp, err := svc.UpdateElasticIp(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleOpsWorks_UpdateInstance() {
- svc := opsworks.New(nil)
- params := &opsworks.UpdateInstanceInput{
- InstanceId: aws.String("String"), // Required
- AgentVersion: aws.String("String"),
- AmiId: aws.String("String"),
- Architecture: aws.String("Architecture"),
- AutoScalingType: aws.String("AutoScalingType"),
- EbsOptimized: aws.Bool(true),
- Hostname: aws.String("String"),
- InstallUpdatesOnBoot: aws.Bool(true),
- InstanceType: aws.String("String"),
- LayerIds: []*string{
- aws.String("String"), // Required
- // More values...
- },
- Os: aws.String("String"),
- SshKeyName: aws.String("String"),
- }
- resp, err := svc.UpdateInstance(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleOpsWorks_UpdateLayer() {
- svc := opsworks.New(nil)
- params := &opsworks.UpdateLayerInput{
- LayerId: aws.String("String"), // Required
- Attributes: map[string]*string{
- "Key": aws.String("String"), // Required
- // More values...
- },
- AutoAssignElasticIps: aws.Bool(true),
- AutoAssignPublicIps: aws.Bool(true),
- CustomInstanceProfileArn: aws.String("String"),
- CustomJson: aws.String("String"),
- CustomRecipes: &opsworks.Recipes{
- Configure: []*string{
- aws.String("String"), // Required
- // More values...
- },
- Deploy: []*string{
- aws.String("String"), // Required
- // More values...
- },
- Setup: []*string{
- aws.String("String"), // Required
- // More values...
- },
- Shutdown: []*string{
- aws.String("String"), // Required
- // More values...
- },
- Undeploy: []*string{
- aws.String("String"), // Required
- // More values...
- },
- },
- CustomSecurityGroupIds: []*string{
- aws.String("String"), // Required
- // More values...
- },
- EnableAutoHealing: aws.Bool(true),
- InstallUpdatesOnBoot: aws.Bool(true),
- LifecycleEventConfiguration: &opsworks.LifecycleEventConfiguration{
- Shutdown: &opsworks.ShutdownEventConfiguration{
- DelayUntilElbConnectionsDrained: aws.Bool(true),
- ExecutionTimeout: aws.Int64(1),
- },
- },
- Name: aws.String("String"),
- Packages: []*string{
- aws.String("String"), // Required
- // More values...
- },
- Shortname: aws.String("String"),
- UseEbsOptimizedInstances: aws.Bool(true),
- VolumeConfigurations: []*opsworks.VolumeConfiguration{
- { // Required
- MountPoint: aws.String("String"), // Required
- NumberOfDisks: aws.Int64(1), // Required
- Size: aws.Int64(1), // Required
- Iops: aws.Int64(1),
- RaidLevel: aws.Int64(1),
- VolumeType: aws.String("String"),
- },
- // More values...
- },
- }
- resp, err := svc.UpdateLayer(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleOpsWorks_UpdateMyUserProfile() {
- svc := opsworks.New(nil)
- params := &opsworks.UpdateMyUserProfileInput{
- SshPublicKey: aws.String("String"),
- }
- resp, err := svc.UpdateMyUserProfile(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleOpsWorks_UpdateRdsDbInstance() {
- svc := opsworks.New(nil)
- params := &opsworks.UpdateRdsDbInstanceInput{
- RdsDbInstanceArn: aws.String("String"), // Required
- DbPassword: aws.String("String"),
- DbUser: aws.String("String"),
- }
- resp, err := svc.UpdateRdsDbInstance(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleOpsWorks_UpdateStack() {
- svc := opsworks.New(nil)
- params := &opsworks.UpdateStackInput{
- StackId: aws.String("String"), // Required
- AgentVersion: aws.String("String"),
- Attributes: map[string]*string{
- "Key": aws.String("String"), // Required
- // More values...
- },
- ChefConfiguration: &opsworks.ChefConfiguration{
- BerkshelfVersion: aws.String("String"),
- ManageBerkshelf: aws.Bool(true),
- },
- ConfigurationManager: &opsworks.StackConfigurationManager{
- Name: aws.String("String"),
- Version: aws.String("String"),
- },
- CustomCookbooksSource: &opsworks.Source{
- Password: aws.String("String"),
- Revision: aws.String("String"),
- SshKey: aws.String("String"),
- Type: aws.String("SourceType"),
- Url: aws.String("String"),
- Username: aws.String("String"),
- },
- CustomJson: aws.String("String"),
- DefaultAvailabilityZone: aws.String("String"),
- DefaultInstanceProfileArn: aws.String("String"),
- DefaultOs: aws.String("String"),
- DefaultRootDeviceType: aws.String("RootDeviceType"),
- DefaultSshKeyName: aws.String("String"),
- DefaultSubnetId: aws.String("String"),
- HostnameTheme: aws.String("String"),
- Name: aws.String("String"),
- ServiceRoleArn: aws.String("String"),
- UseCustomCookbooks: aws.Bool(true),
- UseOpsworksSecurityGroups: aws.Bool(true),
- }
- resp, err := svc.UpdateStack(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleOpsWorks_UpdateUserProfile() {
- svc := opsworks.New(nil)
- params := &opsworks.UpdateUserProfileInput{
- IamUserArn: aws.String("String"), // Required
- AllowSelfManagement: aws.Bool(true),
- SshPublicKey: aws.String("String"),
- SshUsername: aws.String("String"),
- }
- resp, err := svc.UpdateUserProfile(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
- func ExampleOpsWorks_UpdateVolume() {
- svc := opsworks.New(nil)
- params := &opsworks.UpdateVolumeInput{
- VolumeId: aws.String("String"), // Required
- MountPoint: aws.String("String"),
- Name: aws.String("String"),
- }
- resp, err := svc.UpdateVolume(params)
- if err != nil {
- // Print the error, cast err to awserr.Error to get the Code and
- // Message from an error.
- fmt.Println(err.Error())
- return
- }
- // Pretty-print the response data.
- fmt.Println(resp)
- }
|