func ExampleLambda_UploadFunction() { svc := lambda.New(nil) params := &lambda.UploadFunctionInput{ FunctionName: aws.String("FunctionName"), // Required FunctionZip: bytes.NewReader([]byte("PAYLOAD")), // Required Handler: aws.String("Handler"), // Required Mode: aws.String("Mode"), // Required Role: aws.String("RoleArn"), // Required Runtime: aws.String("Runtime"), // Required Description: aws.String("Description"), MemorySize: aws.Long(1), Timeout: aws.Long(1), } resp, err := svc.UploadFunction(params) if awserr := aws.Error(err); awserr != nil { // A service error occurred. fmt.Println("Error:", awserr.Code, awserr.Message) } else if err != nil { // A non-service error occurred. panic(err) } // Pretty-print the response data. fmt.Println(awsutil.StringValue(resp)) }
func ExampleElastiCache_DescribeEvents() { svc := elasticache.New(nil) params := &elasticache.DescribeEventsInput{ Duration: aws.Long(1), EndTime: aws.Time(time.Now()), Marker: aws.String("String"), MaxRecords: aws.Long(1), SourceIdentifier: aws.String("String"), SourceType: aws.String("SourceType"), StartTime: aws.Time(time.Now()), } resp, err := svc.DescribeEvents(params) if awserr := aws.Error(err); awserr != nil { // A service error occurred. fmt.Println("Error:", awserr.Code, awserr.Message) } else if err != nil { // A non-service error occurred. panic(err) } // Pretty-print the response data. fmt.Println(awsutil.StringValue(resp)) }
func ExampleAutoScaling_PutScheduledUpdateGroupAction() { svc := autoscaling.New(nil) params := &autoscaling.PutScheduledUpdateGroupActionInput{ AutoScalingGroupName: aws.String("ResourceName"), // Required ScheduledActionName: aws.String("XmlStringMaxLen255"), // Required DesiredCapacity: aws.Long(1), EndTime: aws.Time(time.Now()), MaxSize: aws.Long(1), MinSize: aws.Long(1), Recurrence: aws.String("XmlStringMaxLen255"), StartTime: aws.Time(time.Now()), Time: aws.Time(time.Now()), } resp, err := svc.PutScheduledUpdateGroupAction(params) if awserr := aws.Error(err); awserr != nil { // A service error occurred. fmt.Println("Error:", awserr.Code, awserr.Message) } else if err != nil { // A non-service error occurred. panic(err) } // Pretty-print the response data. fmt.Println(awsutil.StringValue(resp)) }
func TestCreateDistribution(t *testing.T) { client := cloudfront.New(nil) _, serr := client.CreateDistribution(&cloudfront.CreateDistributionInput{ DistributionConfig: &cloudfront.DistributionConfig{ CallerReference: aws.String("ID1"), Enabled: aws.Boolean(true), Comment: aws.String("A comment"), Origins: &cloudfront.Origins{Quantity: aws.Long(0)}, DefaultCacheBehavior: &cloudfront.DefaultCacheBehavior{ ForwardedValues: &cloudfront.ForwardedValues{ Cookies: &cloudfront.CookiePreference{Forward: aws.String("cookie")}, QueryString: aws.Boolean(true), }, TargetOriginID: aws.String("origin"), TrustedSigners: &cloudfront.TrustedSigners{ Enabled: aws.Boolean(true), Quantity: aws.Long(0), }, ViewerProtocolPolicy: aws.String("policy"), MinTTL: aws.Long(0), }, }, }) err := aws.Error(serr) assert.NotNil(t, err) assert.Equal(t, "MalformedXML", err.Code) assertMatches(t, "validation errors detected", err.Message) }
func ExampleRoute53_CreateHealthCheck() { svc := route53.New(nil) params := &route53.CreateHealthCheckInput{ CallerReference: aws.String("HealthCheckNonce"), // Required HealthCheckConfig: &route53.HealthCheckConfig{ // Required Type: aws.String("HealthCheckType"), // Required FailureThreshold: aws.Long(1), FullyQualifiedDomainName: aws.String("FullyQualifiedDomainName"), IPAddress: aws.String("IPAddress"), Port: aws.Long(1), RequestInterval: aws.Long(1), ResourcePath: aws.String("ResourcePath"), SearchString: aws.String("SearchString"), }, } resp, err := svc.CreateHealthCheck(params) if awserr := aws.Error(err); awserr != nil { // A service error occurred. fmt.Println("Error:", awserr.Code, awserr.Message) } else if err != nil { // A non-service error occurred. panic(err) } // Pretty-print the response data. fmt.Println(awsutil.StringValue(resp)) }
func ExampleELB_ConfigureHealthCheck() { svc := elb.New(nil) params := &elb.ConfigureHealthCheckInput{ HealthCheck: &elb.HealthCheck{ // Required HealthyThreshold: aws.Long(1), // Required Interval: aws.Long(1), // Required Target: aws.String("HealthCheckTarget"), // Required Timeout: aws.Long(1), // Required UnhealthyThreshold: aws.Long(1), // Required }, LoadBalancerName: aws.String("AccessPointName"), // Required } resp, err := svc.ConfigureHealthCheck(params) if awserr := aws.Error(err); awserr != nil { // A service error occurred. fmt.Println("Error:", awserr.Code, awserr.Message) } else if err != nil { // A non-service error occurred. panic(err) } // Pretty-print the response data. fmt.Println(awsutil.StringValue(resp)) }
func ExampleDirectConnect_AllocatePublicVirtualInterface() { svc := directconnect.New(nil) params := &directconnect.AllocatePublicVirtualInterfaceInput{ ConnectionID: aws.String("ConnectionId"), // Required NewPublicVirtualInterfaceAllocation: &directconnect.NewPublicVirtualInterfaceAllocation{ // Required ASN: aws.Long(1), // Required AmazonAddress: aws.String("AmazonAddress"), // Required CustomerAddress: aws.String("CustomerAddress"), // Required RouteFilterPrefixes: []*directconnect.RouteFilterPrefix{ // Required &directconnect.RouteFilterPrefix{ // Required CIDR: aws.String("CIDR"), }, // More values... }, VLAN: aws.Long(1), // Required VirtualInterfaceName: aws.String("VirtualInterfaceName"), // Required AuthKey: aws.String("BGPAuthKey"), }, OwnerAccount: aws.String("OwnerAccount"), // Required } resp, err := svc.AllocatePublicVirtualInterface(params) if awserr := aws.Error(err); awserr != nil { // A service error occurred. fmt.Println("Error:", awserr.Code, awserr.Message) } else if err != nil { // A non-service error occurred. panic(err) } // Pretty-print the response data. fmt.Println(awsutil.StringValue(resp)) }
func ExampleRDS_CreateDBInstance() { svc := rds.New(nil) params := &rds.CreateDBInstanceInput{ AllocatedStorage: aws.Long(1), // Required DBInstanceClass: aws.String("String"), // Required DBInstanceIdentifier: aws.String("String"), // Required Engine: aws.String("String"), // Required MasterUserPassword: aws.String("String"), // Required MasterUsername: aws.String("String"), // Required AutoMinorVersionUpgrade: aws.Boolean(true), AvailabilityZone: aws.String("String"), BackupRetentionPeriod: aws.Long(1), CharacterSetName: aws.String("String"), DBName: aws.String("String"), DBParameterGroupName: aws.String("String"), DBSecurityGroups: []*string{ aws.String("String"), // Required // More values... }, DBSubnetGroupName: aws.String("String"), EngineVersion: aws.String("String"), IOPS: aws.Long(1), KMSKeyID: aws.String("String"), LicenseModel: aws.String("String"), MultiAZ: aws.Boolean(true), OptionGroupName: aws.String("String"), Port: aws.Long(1), PreferredBackupWindow: aws.String("String"), PreferredMaintenanceWindow: aws.String("String"), PubliclyAccessible: aws.Boolean(true), StorageEncrypted: aws.Boolean(true), StorageType: aws.String("String"), TDECredentialARN: aws.String("String"), TDECredentialPassword: aws.String("String"), Tags: []*rds.Tag{ &rds.Tag{ // Required Key: aws.String("String"), Value: aws.String("String"), }, // More values... }, VPCSecurityGroupIDs: []*string{ aws.String("String"), // Required // More values... }, } resp, err := svc.CreateDBInstance(params) if awserr := aws.Error(err); awserr != nil { // A service error occurred. fmt.Println("Error:", awserr.Code, awserr.Message) } else if err != nil { // A non-service error occurred. panic(err) } // Pretty-print the response data. fmt.Println(awsutil.StringValue(resp)) }
func ExampleELB_CreateLoadBalancerListeners() { svc := elb.New(nil) params := &elb.CreateLoadBalancerListenersInput{ Listeners: []*elb.Listener{ // Required &elb.Listener{ // Required InstancePort: aws.Long(1), // Required LoadBalancerPort: aws.Long(1), // Required Protocol: aws.String("Protocol"), // Required InstanceProtocol: aws.String("Protocol"), SSLCertificateID: aws.String("SSLCertificateId"), }, // More values... }, LoadBalancerName: aws.String("AccessPointName"), // Required } resp, err := svc.CreateLoadBalancerListeners(params) if awserr := aws.Error(err); awserr != nil { // A service error occurred. fmt.Println("Error:", awserr.Code, awserr.Message) } else if err != nil { // A non-service error occurred. panic(err) } // Pretty-print the response data. fmt.Println(awsutil.StringValue(resp)) }
func ExampleDirectConnect_CreatePrivateVirtualInterface() { svc := directconnect.New(nil) params := &directconnect.CreatePrivateVirtualInterfaceInput{ ConnectionID: aws.String("ConnectionId"), // Required NewPrivateVirtualInterface: &directconnect.NewPrivateVirtualInterface{ // Required ASN: aws.Long(1), // Required VLAN: aws.Long(1), // Required VirtualGatewayID: aws.String("VirtualGatewayId"), // Required VirtualInterfaceName: aws.String("VirtualInterfaceName"), // Required AmazonAddress: aws.String("AmazonAddress"), AuthKey: aws.String("BGPAuthKey"), CustomerAddress: aws.String("CustomerAddress"), }, } resp, err := svc.CreatePrivateVirtualInterface(params) if awserr := aws.Error(err); awserr != nil { // A service error occurred. fmt.Println("Error:", awserr.Code, awserr.Message) } else if err != nil { // A non-service error occurred. panic(err) } // Pretty-print the response data. fmt.Println(awsutil.StringValue(resp)) }
func ExampleRDS_DescribeDBLogFiles() { svc := rds.New(nil) params := &rds.DescribeDBLogFilesInput{ DBInstanceIdentifier: aws.String("String"), // Required FileLastWritten: aws.Long(1), FileSize: aws.Long(1), FilenameContains: aws.String("String"), Filters: []*rds.Filter{ &rds.Filter{ // Required Name: aws.String("String"), // Required Values: []*string{ // Required aws.String("String"), // Required // More values... }, }, // More values... }, Marker: aws.String("String"), MaxRecords: aws.Long(1), } resp, err := svc.DescribeDBLogFiles(params) if awserr := aws.Error(err); awserr != nil { // A service error occurred. fmt.Println("Error:", awserr.Code, awserr.Message) } else if err != nil { // A non-service error occurred. panic(err) } // Pretty-print the response data. fmt.Println(awsutil.StringValue(resp)) }
func ExampleECS_SubmitContainerStateChange() { svc := ecs.New(nil) params := &ecs.SubmitContainerStateChangeInput{ Cluster: aws.String("String"), ContainerName: aws.String("String"), ExitCode: aws.Long(1), NetworkBindings: []*ecs.NetworkBinding{ &ecs.NetworkBinding{ // Required BindIP: aws.String("String"), ContainerPort: aws.Long(1), HostPort: aws.Long(1), }, // More values... }, Reason: aws.String("String"), Status: aws.String("String"), Task: aws.String("String"), } resp, err := svc.SubmitContainerStateChange(params) if awserr := aws.Error(err); awserr != nil { // A service error occurred. fmt.Println("Error:", awserr.Code, awserr.Message) } else if err != nil { // A non-service error occurred. panic(err) } // Pretty-print the response data. fmt.Println(awsutil.StringValue(resp)) }
func ExampleCloudWatchLogs_GetLogEvents() { svc := cloudwatchlogs.New(nil) params := &cloudwatchlogs.GetLogEventsInput{ LogGroupName: aws.String("LogGroupName"), // Required LogStreamName: aws.String("LogStreamName"), // Required EndTime: aws.Long(1), Limit: aws.Long(1), NextToken: aws.String("NextToken"), StartFromHead: aws.Boolean(true), StartTime: aws.Long(1), } resp, err := svc.GetLogEvents(params) if awserr := aws.Error(err); awserr != nil { // A service error occurred. fmt.Println("Error:", awserr.Code, awserr.Message) } else if err != nil { // A non-service error occurred. panic(err) } // Pretty-print the response data. fmt.Println(awsutil.StringValue(resp)) }
func ExampleRoute53_UpdateHealthCheck() { svc := route53.New(nil) params := &route53.UpdateHealthCheckInput{ HealthCheckID: aws.String("HealthCheckId"), // Required FailureThreshold: aws.Long(1), FullyQualifiedDomainName: aws.String("FullyQualifiedDomainName"), HealthCheckVersion: aws.Long(1), IPAddress: aws.String("IPAddress"), Port: aws.Long(1), ResourcePath: aws.String("ResourcePath"), SearchString: aws.String("SearchString"), } resp, err := svc.UpdateHealthCheck(params) if awserr := aws.Error(err); awserr != nil { // A service error occurred. fmt.Println("Error:", awserr.Code, awserr.Message) } else if err != nil { // A non-service error occurred. panic(err) } // Pretty-print the response data. fmt.Println(awsutil.StringValue(resp)) }
func ExampleECS_CreateService() { svc := ecs.New(nil) params := &ecs.CreateServiceInput{ ServiceName: aws.String("String"), // Required ClientToken: aws.String("String"), Cluster: aws.String("String"), DesiredCount: aws.Long(1), LoadBalancers: []*ecs.LoadBalancer{ &ecs.LoadBalancer{ // Required ContainerName: aws.String("String"), ContainerPort: aws.Long(1), LoadBalancerName: aws.String("String"), }, // More values... }, Role: aws.String("String"), TaskDefinition: aws.String("String"), } resp, err := svc.CreateService(params) if awserr := aws.Error(err); awserr != nil { // A service error occurred. fmt.Println("Error:", awserr.Code, awserr.Message) } else if err != nil { // A non-service error occurred. panic(err) } // Pretty-print the response data. fmt.Println(awsutil.StringValue(resp)) }
func ExampleCognitoSync_ListRecords() { svc := cognitosync.New(nil) params := &cognitosync.ListRecordsInput{ DatasetName: aws.String("DatasetName"), // Required IdentityID: aws.String("IdentityId"), // Required IdentityPoolID: aws.String("IdentityPoolId"), // Required LastSyncCount: aws.Long(1), MaxResults: aws.Long(1), NextToken: aws.String("String"), SyncSessionToken: aws.String("SyncSessionToken"), } resp, err := svc.ListRecords(params) if awserr := aws.Error(err); awserr != nil { // A service error occurred. fmt.Println("Error:", awserr.Code, awserr.Message) } else if err != nil { // A non-service error occurred. panic(err) } // Pretty-print the response data. fmt.Println(awsutil.StringValue(resp)) }
func ExampleCloudSearchDomain_Search() { svc := cloudsearchdomain.New(nil) params := &cloudsearchdomain.SearchInput{ Query: aws.String("Query"), // Required Cursor: aws.String("Cursor"), Expr: aws.String("Expr"), Facet: aws.String("Facet"), FilterQuery: aws.String("FilterQuery"), Highlight: aws.String("Highlight"), Partial: aws.Boolean(true), QueryOptions: aws.String("QueryOptions"), QueryParser: aws.String("QueryParser"), Return: aws.String("Return"), Size: aws.Long(1), Sort: aws.String("Sort"), Start: aws.Long(1), } resp, err := svc.Search(params) if awserr := aws.Error(err); awserr != nil { // A service error occurred. fmt.Println("Error:", awserr.Code, awserr.Message) } else if err != nil { // A non-service error occurred. panic(err) } // Pretty-print the response data. fmt.Println(awsutil.StringValue(resp)) }
func ExampleSQS_ReceiveMessage() { svc := sqs.New(nil) params := &sqs.ReceiveMessageInput{ QueueURL: aws.String("String"), // Required AttributeNames: []*string{ aws.String("QueueAttributeName"), // Required // More values... }, MaxNumberOfMessages: aws.Long(1), MessageAttributeNames: []*string{ aws.String("MessageAttributeName"), // Required // More values... }, VisibilityTimeout: aws.Long(1), WaitTimeSeconds: aws.Long(1), } resp, err := svc.ReceiveMessage(params) if awserr := aws.Error(err); awserr != nil { // A service error occurred. fmt.Println("Error:", awserr.Code, awserr.Message) } else if err != nil { // A non-service error occurred. panic(err) } // Pretty-print the response data. fmt.Println(awsutil.StringValue(resp)) }
func ExampleS3_UploadPart() { svc := s3.New(nil) params := &s3.UploadPartInput{ Bucket: aws.String("BucketName"), // Required Key: aws.String("ObjectKey"), // Required PartNumber: aws.Long(1), // Required UploadID: aws.String("MultipartUploadId"), // Required Body: bytes.NewReader([]byte("PAYLOAD")), ContentLength: aws.Long(1), RequestPayer: aws.String("RequestPayer"), SSECustomerAlgorithm: aws.String("SSECustomerAlgorithm"), SSECustomerKey: aws.String("SSECustomerKey"), SSECustomerKeyMD5: aws.String("SSECustomerKeyMD5"), } resp, err := svc.UploadPart(params) if awserr := aws.Error(err); awserr != nil { // A service error occurred. fmt.Println("Error:", awserr.Code, awserr.Message) } else if err != nil { // A non-service error occurred. panic(err) } // Pretty-print the response data. fmt.Println(awsutil.StringValue(resp)) }
func ExampleElastiCache_CreateCacheCluster() { svc := elasticache.New(nil) params := &elasticache.CreateCacheClusterInput{ CacheClusterID: aws.String("String"), // Required AZMode: aws.String("AZMode"), AutoMinorVersionUpgrade: aws.Boolean(true), CacheNodeType: aws.String("String"), CacheParameterGroupName: aws.String("String"), CacheSecurityGroupNames: []*string{ aws.String("String"), // Required // More values... }, CacheSubnetGroupName: aws.String("String"), Engine: aws.String("String"), EngineVersion: aws.String("String"), NotificationTopicARN: aws.String("String"), NumCacheNodes: aws.Long(1), Port: aws.Long(1), PreferredAvailabilityZone: aws.String("String"), PreferredAvailabilityZones: []*string{ aws.String("String"), // Required // More values... }, PreferredMaintenanceWindow: aws.String("String"), ReplicationGroupID: aws.String("String"), SecurityGroupIDs: []*string{ aws.String("String"), // Required // More values... }, SnapshotARNs: []*string{ aws.String("String"), // Required // More values... }, SnapshotName: aws.String("String"), SnapshotRetentionLimit: aws.Long(1), SnapshotWindow: aws.String("String"), Tags: []*elasticache.Tag{ &elasticache.Tag{ // Required Key: aws.String("String"), Value: aws.String("String"), }, // More values... }, } resp, err := svc.CreateCacheCluster(params) if awserr := aws.Error(err); awserr != nil { // A service error occurred. fmt.Println("Error:", awserr.Code, awserr.Message) } else if err != nil { // A non-service error occurred. panic(err) } // Pretty-print the response data. fmt.Println(awsutil.StringValue(resp)) }
func ExampleAutoScaling_CreateLaunchConfiguration() { svc := autoscaling.New(nil) params := &autoscaling.CreateLaunchConfigurationInput{ LaunchConfigurationName: aws.String("XmlStringMaxLen255"), // Required AssociatePublicIPAddress: aws.Boolean(true), BlockDeviceMappings: []*autoscaling.BlockDeviceMapping{ &autoscaling.BlockDeviceMapping{ // Required DeviceName: aws.String("XmlStringMaxLen255"), // Required EBS: &autoscaling.EBS{ DeleteOnTermination: aws.Boolean(true), IOPS: aws.Long(1), SnapshotID: aws.String("XmlStringMaxLen255"), VolumeSize: aws.Long(1), VolumeType: aws.String("BlockDeviceEbsVolumeType"), }, NoDevice: aws.Boolean(true), VirtualName: aws.String("XmlStringMaxLen255"), }, // More values... }, ClassicLinkVPCID: aws.String("XmlStringMaxLen255"), ClassicLinkVPCSecurityGroups: []*string{ aws.String("XmlStringMaxLen255"), // Required // More values... }, EBSOptimized: aws.Boolean(true), IAMInstanceProfile: aws.String("XmlStringMaxLen1600"), ImageID: aws.String("XmlStringMaxLen255"), InstanceID: aws.String("XmlStringMaxLen16"), InstanceMonitoring: &autoscaling.InstanceMonitoring{ Enabled: aws.Boolean(true), }, InstanceType: aws.String("XmlStringMaxLen255"), KernelID: aws.String("XmlStringMaxLen255"), KeyName: aws.String("XmlStringMaxLen255"), PlacementTenancy: aws.String("XmlStringMaxLen64"), RAMDiskID: aws.String("XmlStringMaxLen255"), SecurityGroups: []*string{ aws.String("XmlString"), // Required // More values... }, SpotPrice: aws.String("SpotPrice"), UserData: aws.String("XmlStringUserData"), } resp, err := svc.CreateLaunchConfiguration(params) if awserr := aws.Error(err); awserr != nil { // A service error occurred. fmt.Println("Error:", awserr.Code, awserr.Message) } else if err != nil { // A non-service error occurred. panic(err) } // Pretty-print the response data. fmt.Println(awsutil.StringValue(resp)) }
func ExampleRedshift_CreateCluster() { svc := redshift.New(nil) params := &redshift.CreateClusterInput{ ClusterIdentifier: aws.String("String"), // Required MasterUserPassword: aws.String("String"), // Required MasterUsername: aws.String("String"), // Required NodeType: aws.String("String"), // Required AllowVersionUpgrade: aws.Boolean(true), AutomatedSnapshotRetentionPeriod: aws.Long(1), AvailabilityZone: aws.String("String"), ClusterParameterGroupName: aws.String("String"), ClusterSecurityGroups: []*string{ aws.String("String"), // Required // More values... }, ClusterSubnetGroupName: aws.String("String"), ClusterType: aws.String("String"), ClusterVersion: aws.String("String"), DBName: aws.String("String"), ElasticIP: aws.String("String"), Encrypted: aws.Boolean(true), HSMClientCertificateIdentifier: aws.String("String"), HSMConfigurationIdentifier: aws.String("String"), KMSKeyID: aws.String("String"), NumberOfNodes: aws.Long(1), Port: aws.Long(1), PreferredMaintenanceWindow: aws.String("String"), PubliclyAccessible: aws.Boolean(true), Tags: []*redshift.Tag{ &redshift.Tag{ // Required Key: aws.String("String"), Value: aws.String("String"), }, // More values... }, VPCSecurityGroupIDs: []*string{ aws.String("String"), // Required // More values... }, } resp, err := svc.CreateCluster(params) if awserr := aws.Error(err); awserr != nil { // A service error occurred. fmt.Println("Error:", awserr.Code, awserr.Message) } else if err != nil { // A non-service error occurred. panic(err) } // Pretty-print the response data. fmt.Println(awsutil.StringValue(resp)) }
func ExampleRoute53_ChangeResourceRecordSets() { svc := route53.New(nil) params := &route53.ChangeResourceRecordSetsInput{ ChangeBatch: &route53.ChangeBatch{ // Required Changes: []*route53.Change{ // Required &route53.Change{ // Required Action: aws.String("ChangeAction"), // Required ResourceRecordSet: &route53.ResourceRecordSet{ // Required Name: aws.String("DNSName"), // Required Type: aws.String("RRType"), // Required AliasTarget: &route53.AliasTarget{ DNSName: aws.String("DNSName"), // Required EvaluateTargetHealth: aws.Boolean(true), // Required HostedZoneID: aws.String("ResourceId"), // Required }, Failover: aws.String("ResourceRecordSetFailover"), GeoLocation: &route53.GeoLocation{ ContinentCode: aws.String("GeoLocationContinentCode"), CountryCode: aws.String("GeoLocationCountryCode"), SubdivisionCode: aws.String("GeoLocationSubdivisionCode"), }, HealthCheckID: aws.String("HealthCheckId"), Region: aws.String("ResourceRecordSetRegion"), ResourceRecords: []*route53.ResourceRecord{ &route53.ResourceRecord{ // Required Value: aws.String("RData"), // Required }, // More values... }, SetIdentifier: aws.String("ResourceRecordSetIdentifier"), TTL: aws.Long(1), Weight: aws.Long(1), }, }, // More values... }, Comment: aws.String("ResourceDescription"), }, HostedZoneID: aws.String("ResourceId"), // Required } resp, err := svc.ChangeResourceRecordSets(params) if awserr := aws.Error(err); awserr != nil { // A service error occurred. fmt.Println("Error:", awserr.Code, awserr.Message) } else if err != nil { // A non-service error occurred. panic(err) } // Pretty-print the response data. fmt.Println(awsutil.StringValue(resp)) }
func ExampleAutoScaling_CreateAutoScalingGroup() { svc := autoscaling.New(nil) params := &autoscaling.CreateAutoScalingGroupInput{ AutoScalingGroupName: aws.String("XmlStringMaxLen255"), // Required MaxSize: aws.Long(1), // Required MinSize: aws.Long(1), // Required AvailabilityZones: []*string{ aws.String("XmlStringMaxLen255"), // Required // More values... }, DefaultCooldown: aws.Long(1), DesiredCapacity: aws.Long(1), HealthCheckGracePeriod: aws.Long(1), HealthCheckType: aws.String("XmlStringMaxLen32"), InstanceID: aws.String("XmlStringMaxLen16"), LaunchConfigurationName: aws.String("ResourceName"), LoadBalancerNames: []*string{ aws.String("XmlStringMaxLen255"), // Required // More values... }, PlacementGroup: aws.String("XmlStringMaxLen255"), Tags: []*autoscaling.Tag{ &autoscaling.Tag{ // Required Key: aws.String("TagKey"), // Required PropagateAtLaunch: aws.Boolean(true), ResourceID: aws.String("XmlString"), ResourceType: aws.String("XmlString"), Value: aws.String("TagValue"), }, // More values... }, TerminationPolicies: []*string{ aws.String("XmlStringMaxLen1600"), // Required // More values... }, VPCZoneIdentifier: aws.String("XmlStringMaxLen255"), } resp, err := svc.CreateAutoScalingGroup(params) if awserr := aws.Error(err); awserr != nil { // A service error occurred. fmt.Println("Error:", awserr.Code, awserr.Message) } else if err != nil { // A non-service error occurred. panic(err) } // Pretty-print the response data. fmt.Println(awsutil.StringValue(resp)) }
func ExampleCloudFront_UpdateStreamingDistribution() { svc := cloudfront.New(nil) params := &cloudfront.UpdateStreamingDistributionInput{ ID: aws.String("string"), // Required StreamingDistributionConfig: &cloudfront.StreamingDistributionConfig{ // Required CallerReference: aws.String("string"), // Required Comment: aws.String("string"), // Required Enabled: aws.Boolean(true), // Required S3Origin: &cloudfront.S3Origin{ // Required DomainName: aws.String("string"), // Required OriginAccessIdentity: aws.String("string"), // Required }, TrustedSigners: &cloudfront.TrustedSigners{ // Required Enabled: aws.Boolean(true), // Required Quantity: aws.Long(1), // Required Items: []*string{ aws.String("string"), // Required // More values... }, }, Aliases: &cloudfront.Aliases{ Quantity: aws.Long(1), // Required Items: []*string{ aws.String("string"), // Required // More values... }, }, Logging: &cloudfront.StreamingLoggingConfig{ Bucket: aws.String("string"), // Required Enabled: aws.Boolean(true), // Required Prefix: aws.String("string"), // Required }, PriceClass: aws.String("PriceClass"), }, IfMatch: aws.String("string"), } resp, err := svc.UpdateStreamingDistribution(params) if awserr := aws.Error(err); awserr != nil { // A service error occurred. fmt.Println("Error:", awserr.Code, awserr.Message) } else if err != nil { // A non-service error occurred. panic(err) } // Pretty-print the response data. fmt.Println(awsutil.StringValue(resp)) }
func ExampleELB_CreateLoadBalancer() { svc := elb.New(nil) params := &elb.CreateLoadBalancerInput{ Listeners: []*elb.Listener{ // Required &elb.Listener{ // Required InstancePort: aws.Long(1), // Required LoadBalancerPort: aws.Long(1), // Required Protocol: aws.String("Protocol"), // Required InstanceProtocol: aws.String("Protocol"), SSLCertificateID: aws.String("SSLCertificateId"), }, // More values... }, LoadBalancerName: aws.String("AccessPointName"), // Required AvailabilityZones: []*string{ aws.String("AvailabilityZone"), // Required // More values... }, Scheme: aws.String("LoadBalancerScheme"), SecurityGroups: []*string{ aws.String("SecurityGroupId"), // Required // More values... }, Subnets: []*string{ aws.String("SubnetId"), // Required // More values... }, Tags: []*elb.Tag{ &elb.Tag{ // Required Key: aws.String("TagKey"), // Required Value: aws.String("TagValue"), }, // More values... }, } resp, err := svc.CreateLoadBalancer(params) if awserr := aws.Error(err); awserr != nil { // A service error occurred. fmt.Println("Error:", awserr.Code, awserr.Message) } else if err != nil { // A non-service error occurred. panic(err) } // Pretty-print the response data. fmt.Println(awsutil.StringValue(resp)) }
func ExampleCloudWatch_PutMetricAlarm() { svc := cloudwatch.New(nil) params := &cloudwatch.PutMetricAlarmInput{ AlarmName: aws.String("AlarmName"), // Required ComparisonOperator: aws.String("ComparisonOperator"), // Required EvaluationPeriods: aws.Long(1), // Required MetricName: aws.String("MetricName"), // Required Namespace: aws.String("Namespace"), // Required Period: aws.Long(1), // Required Statistic: aws.String("Statistic"), // Required Threshold: aws.Double(1.0), // Required ActionsEnabled: aws.Boolean(true), AlarmActions: []*string{ aws.String("ResourceName"), // Required // More values... }, AlarmDescription: aws.String("AlarmDescription"), Dimensions: []*cloudwatch.Dimension{ &cloudwatch.Dimension{ // Required Name: aws.String("DimensionName"), // Required Value: aws.String("DimensionValue"), // Required }, // More values... }, InsufficientDataActions: []*string{ aws.String("ResourceName"), // Required // More values... }, OKActions: []*string{ aws.String("ResourceName"), // Required // More values... }, Unit: aws.String("StandardUnit"), } resp, err := svc.PutMetricAlarm(params) if awserr := aws.Error(err); awserr != nil { // A service error occurred. fmt.Println("Error:", awserr.Code, awserr.Message) } else if err != nil { // A non-service error occurred. panic(err) } // Pretty-print the response data. fmt.Println(awsutil.StringValue(resp)) }
func ExampleConfigService_GetResourceConfigHistory() { svc := configservice.New(nil) params := &configservice.GetResourceConfigHistoryInput{ ResourceID: aws.String("ResourceId"), // Required ResourceType: aws.String("ResourceType"), // Required ChronologicalOrder: aws.String("ChronologicalOrder"), EarlierTime: aws.Time(time.Now()), LaterTime: aws.Time(time.Now()), Limit: aws.Long(1), NextToken: aws.String("NextToken"), } resp, err := svc.GetResourceConfigHistory(params) if awserr := aws.Error(err); awserr != nil { // A service error occurred. fmt.Println("Error:", awserr.Code, awserr.Message) } else if err != nil { // A non-service error occurred. panic(err) } // Pretty-print the response data. fmt.Println(awsutil.StringValue(resp)) }
func ExampleLambda_AddEventSource() { svc := lambda.New(nil) params := &lambda.AddEventSourceInput{ EventSource: aws.String("String"), // Required FunctionName: aws.String("FunctionName"), // Required Role: aws.String("RoleArn"), // Required BatchSize: aws.Long(1), Parameters: &map[string]*string{ "Key": aws.String("String"), // Required // More values... }, } resp, err := svc.AddEventSource(params) if awserr := aws.Error(err); awserr != nil { // A service error occurred. fmt.Println("Error:", awserr.Code, awserr.Message) } else if err != nil { // A non-service error occurred. panic(err) } // Pretty-print the response data. fmt.Println(awsutil.StringValue(resp)) }
func ExampleSSM_ListDocuments() { svc := ssm.New(nil) params := &ssm.ListDocumentsInput{ DocumentFilterList: []*ssm.DocumentFilter{ &ssm.DocumentFilter{ // Required Key: aws.String("DocumentFilterKey"), // Required Value: aws.String("DocumentFilterValue"), // Required }, // More values... }, MaxResults: aws.Long(1), NextToken: aws.String("NextToken"), } resp, err := svc.ListDocuments(params) if awserr := aws.Error(err); awserr != nil { // A service error occurred. fmt.Println("Error:", awserr.Code, awserr.Message) } else if err != nil { // A non-service error occurred. panic(err) } // Pretty-print the response data. fmt.Println(awsutil.StringValue(resp)) }