AWS SDK for Go (PILOT)
API Reference

PREVIEW DOCUMENTATION - This is a preview of a new format for the AWS SDK for Go API Reference documentation. For the current AWS SDK for Go API Reference, see https://docs.aws.amazon.com/sdk-for-go/api/.

We welcome your feedback on this new version of the documentation. Send your comments to aws-sdkdocs-feedback@amazon.com.

ElastiCache

import "github.com/aws/aws-sdk-go/service/elasticache"

type ElastiCache struct { *client.Client }

ElastiCache provides the API operation methods for making requests to Amazon ElastiCache. See this package's package overview docs for details on the service.

ElastiCache methods are safe to use concurrently. It is not safe to modify mutate any of the struct's properties though.

Client

Type: *client.Client

Method

AddTagsToResource

func (c *ElastiCache) AddTagsToResource(input *AddTagsToResourceInput) (*TagListMessage, error)

AddTagsToResource API operation for Amazon ElastiCache.

Adds up to 50 cost allocation tags to the named resource. A cost allocation tag is a key-value pair where the key and value are case-sensitive. You can use cost allocation tags to categorize and track your AWS costs.

When you apply tags to your ElastiCache resources, AWS generates a cost allocation report as a comma-separated value (CSV) file with your usage and costs aggregated by your tags. You can apply tags that represent business categories (such as cost centers, application names, or owners) to organize your costs across multiple services. For more information, see Using Cost Allocation Tags in Amazon ElastiCache (https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/Tagging.html) in the ElastiCache User Guide.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon ElastiCache's API operation AddTagsToResource for usage and error information.

Returned Error Codes:

  • ErrCodeCacheClusterNotFoundFault "CacheClusterNotFound" The requested cluster ID does not refer to an existing cluster.

  • ErrCodeSnapshotNotFoundFault "SnapshotNotFoundFault" The requested snapshot name does not refer to an existing snapshot.

  • ErrCodeTagQuotaPerResourceExceeded "TagQuotaPerResourceExceeded" The request cannot be processed because it would cause the resource to have more than the allowed number of tags. The maximum number of tags permitted on a resource is 50.

  • ErrCodeInvalidARNFault "InvalidARN" The requested Amazon Resource Name (ARN) does not refer to an existing resource.

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/AddTagsToResource

Example

ElastiCache AddTagsToResource shared00

AddTagsToResource

Adds up to 10 tags, key/value pairs, to a cluster or snapshot resource.

{ svc := elasticache.New(session.New()) input := &elasticache.AddTagsToResourceInput{ ResourceName: aws.String("arn:aws:elasticache:us-east-1:1234567890:cluster:my-mem-cluster"), Tags: []*elasticache.Tag{ { Key: aws.String("APIVersion"), Value: aws.String("20150202"), }, { Key: aws.String("Service"), Value: aws.String("ElastiCache"), }, }, } result, err := svc.AddTagsToResource(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elasticache.ErrCodeCacheClusterNotFoundFault: fmt.Println(elasticache.ErrCodeCacheClusterNotFoundFault, aerr.Error()) case elasticache.ErrCodeSnapshotNotFoundFault: fmt.Println(elasticache.ErrCodeSnapshotNotFoundFault, aerr.Error()) case elasticache.ErrCodeTagQuotaPerResourceExceeded: fmt.Println(elasticache.ErrCodeTagQuotaPerResourceExceeded, aerr.Error()) case elasticache.ErrCodeInvalidARNFault: fmt.Println(elasticache.ErrCodeInvalidARNFault, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

AddTagsToResourceRequest

func (c *ElastiCache) AddTagsToResourceRequest(input *AddTagsToResourceInput) (req *request.Request, output *TagListMessage)

AddTagsToResourceRequest generates a "aws/request.Request" representing the client's request for the AddTagsToResource operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See AddTagsToResource for more information on using the AddTagsToResource API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the AddTagsToResourceRequest method. req, resp := client.AddTagsToResourceRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/AddTagsToResource

AddTagsToResourceWithContext

func (c *ElastiCache) AddTagsToResourceWithContext(ctx aws.Context, input *AddTagsToResourceInput, opts ...request.Option) (*TagListMessage, error)

AddTagsToResourceWithContext is the same as AddTagsToResource with the addition of the ability to pass a context and additional request options.

See AddTagsToResource for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

AuthorizeCacheSecurityGroupIngress

func (c *ElastiCache) AuthorizeCacheSecurityGroupIngress(input *AuthorizeCacheSecurityGroupIngressInput) (*AuthorizeCacheSecurityGroupIngressOutput, error)

AuthorizeCacheSecurityGroupIngress API operation for Amazon ElastiCache.

Allows network ingress to a cache security group. Applications using ElastiCache must be running on Amazon EC2, and Amazon EC2 security groups are used as the authorization mechanism.

You cannot authorize ingress from an Amazon EC2 security group in one region to an ElastiCache cluster in another region.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon ElastiCache's API operation AuthorizeCacheSecurityGroupIngress for usage and error information.

Returned Error Codes:

  • ErrCodeCacheSecurityGroupNotFoundFault "CacheSecurityGroupNotFound" The requested cache security group name does not refer to an existing cache security group.

  • ErrCodeInvalidCacheSecurityGroupStateFault "InvalidCacheSecurityGroupState" The current state of the cache security group does not allow deletion.

  • ErrCodeAuthorizationAlreadyExistsFault "AuthorizationAlreadyExists" The specified Amazon EC2 security group is already authorized for the specified cache security group.

  • ErrCodeInvalidParameterValueException "InvalidParameterValue" The value for a parameter is invalid.

  • ErrCodeInvalidParameterCombinationException "InvalidParameterCombination" Two or more incompatible parameters were specified.

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/AuthorizeCacheSecurityGroupIngress

Example

ElastiCache AuthorizeCacheSecurityGroupIngress shared00

AuthorizeCacheCacheSecurityGroupIngress

Allows network ingress to a cache security group. Applications using ElastiCache must be running on Amazon EC2. Amazon EC2 security groups are used as the authorization mechanism.

{ svc := elasticache.New(session.New()) input := &elasticache.AuthorizeCacheSecurityGroupIngressInput{ CacheSecurityGroupName: aws.String("my-sec-grp"), EC2SecurityGroupName: aws.String("my-ec2-sec-grp"), EC2SecurityGroupOwnerId: aws.String("1234567890"), } result, err := svc.AuthorizeCacheSecurityGroupIngress(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elasticache.ErrCodeCacheSecurityGroupNotFoundFault: fmt.Println(elasticache.ErrCodeCacheSecurityGroupNotFoundFault, aerr.Error()) case elasticache.ErrCodeInvalidCacheSecurityGroupStateFault: fmt.Println(elasticache.ErrCodeInvalidCacheSecurityGroupStateFault, aerr.Error()) case elasticache.ErrCodeAuthorizationAlreadyExistsFault: fmt.Println(elasticache.ErrCodeAuthorizationAlreadyExistsFault, aerr.Error()) case elasticache.ErrCodeInvalidParameterValueException: fmt.Println(elasticache.ErrCodeInvalidParameterValueException, aerr.Error()) case elasticache.ErrCodeInvalidParameterCombinationException: fmt.Println(elasticache.ErrCodeInvalidParameterCombinationException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

AuthorizeCacheSecurityGroupIngressRequest

func (c *ElastiCache) AuthorizeCacheSecurityGroupIngressRequest(input *AuthorizeCacheSecurityGroupIngressInput) (req *request.Request, output *AuthorizeCacheSecurityGroupIngressOutput)

AuthorizeCacheSecurityGroupIngressRequest generates a "aws/request.Request" representing the client's request for the AuthorizeCacheSecurityGroupIngress operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See AuthorizeCacheSecurityGroupIngress for more information on using the AuthorizeCacheSecurityGroupIngress API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the AuthorizeCacheSecurityGroupIngressRequest method. req, resp := client.AuthorizeCacheSecurityGroupIngressRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/AuthorizeCacheSecurityGroupIngress

AuthorizeCacheSecurityGroupIngressWithContext

func (c *ElastiCache) AuthorizeCacheSecurityGroupIngressWithContext(ctx aws.Context, input *AuthorizeCacheSecurityGroupIngressInput, opts ...request.Option) (*AuthorizeCacheSecurityGroupIngressOutput, error)

AuthorizeCacheSecurityGroupIngressWithContext is the same as AuthorizeCacheSecurityGroupIngress with the addition of the ability to pass a context and additional request options.

See AuthorizeCacheSecurityGroupIngress for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

CopySnapshot

func (c *ElastiCache) CopySnapshot(input *CopySnapshotInput) (*CopySnapshotOutput, error)

CopySnapshot API operation for Amazon ElastiCache.

Makes a copy of an existing snapshot.

This operation is valid for Redis only.

Users or groups that have permissions to use the CopySnapshot operation can create their own Amazon S3 buckets and copy snapshots to it. To control access to your snapshots, use an IAM policy to control who has the ability to use the CopySnapshot operation. For more information about using IAM to control the use of ElastiCache operations, see Exporting Snapshots (https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/Snapshots.Exporting.html) and Authentication & Access Control (https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/IAM.html).

You could receive the following error messages.

Error Messages

  • Error Message: The S3 bucket %s is outside of the region.

Solution: Create an Amazon S3 bucket in the same region as your snapshot.

For more information, see Step 1: Create an Amazon S3 Bucket (http://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/Snapshots.Exporting.html#Snapshots.Exporting.CreateBucket) in the ElastiCache User Guide.
  • Error Message: The S3 bucket %s does not exist.

Solution: Create an Amazon S3 bucket in the same region as your snapshot.

For more information, see Step 1: Create an Amazon S3 Bucket (http://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/Snapshots.Exporting.html#Snapshots.Exporting.CreateBucket) in the ElastiCache User Guide.
  • Error Message: The S3 bucket %s is not owned by the authenticated user.

Solution: Create an Amazon S3 bucket in the same region as your snapshot.

For more information, see Step 1: Create an Amazon S3 Bucket (http://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/Snapshots.Exporting.html#Snapshots.Exporting.CreateBucket) in the ElastiCache User Guide.
  • Error Message: The authenticated user does not have sufficient permissions to perform the desired activity.

Solution: Contact your system administrator to get the needed permissions.

  • Error Message: The S3 bucket %s already contains an object with key

%s.

Solution: Give the TargetSnapshotName a new and unique value. If exporting

a snapshot, you could alternatively create a new Amazon S3 bucket and use this same value for TargetSnapshotName.
  • Error Message: ElastiCache has not been granted READ permissions %s on the S3 Bucket.

Solution: Add List and Read permissions on the bucket. For more information,

see Step 2: Grant ElastiCache Access to Your Amazon S3 Bucket (http://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/Snapshots.Exporting.html#Snapshots.Exporting.GrantAccess) in the ElastiCache User Guide.
  • Error Message: ElastiCache has not been granted WRITE permissions %s on the S3 Bucket.

Solution: Add Upload/Delete permissions on the bucket. For more information,

see Step 2: Grant ElastiCache Access to Your Amazon S3 Bucket (http://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/Snapshots.Exporting.html#Snapshots.Exporting.GrantAccess) in the ElastiCache User Guide.
  • Error Message: ElastiCache has not been granted READ_ACP permissions

%s on the S3 Bucket.

Solution: Add View Permissions on the bucket. For more information, see Step

2: Grant ElastiCache Access to Your Amazon S3 Bucket (http://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/Snapshots.Exporting.html#Snapshots.Exporting.GrantAccess) in the ElastiCache User Guide.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon ElastiCache's API operation CopySnapshot for usage and error information.

Returned Error Codes:

  • ErrCodeSnapshotAlreadyExistsFault "SnapshotAlreadyExistsFault" You already have a snapshot with the given name.

  • ErrCodeSnapshotNotFoundFault "SnapshotNotFoundFault" The requested snapshot name does not refer to an existing snapshot.

  • ErrCodeSnapshotQuotaExceededFault "SnapshotQuotaExceededFault" The request cannot be processed because it would exceed the maximum number of snapshots.

  • ErrCodeInvalidSnapshotStateFault "InvalidSnapshotState" The current state of the snapshot does not allow the requested operation to occur.

  • ErrCodeInvalidParameterValueException "InvalidParameterValue" The value for a parameter is invalid.

  • ErrCodeInvalidParameterCombinationException "InvalidParameterCombination" Two or more incompatible parameters were specified.

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/CopySnapshot

Example

ElastiCache CopySnapshot shared00

CopySnapshot

Copies a snapshot to a specified name.

{ svc := elasticache.New(session.New()) input := &elasticache.CopySnapshotInput{ SourceSnapshotName: aws.String("my-snapshot"), TargetBucket: aws.String(""), TargetSnapshotName: aws.String("my-snapshot-copy"), } result, err := svc.CopySnapshot(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elasticache.ErrCodeSnapshotAlreadyExistsFault: fmt.Println(elasticache.ErrCodeSnapshotAlreadyExistsFault, aerr.Error()) case elasticache.ErrCodeSnapshotNotFoundFault: fmt.Println(elasticache.ErrCodeSnapshotNotFoundFault, aerr.Error()) case elasticache.ErrCodeSnapshotQuotaExceededFault: fmt.Println(elasticache.ErrCodeSnapshotQuotaExceededFault, aerr.Error()) case elasticache.ErrCodeInvalidSnapshotStateFault: fmt.Println(elasticache.ErrCodeInvalidSnapshotStateFault, aerr.Error()) case elasticache.ErrCodeInvalidParameterValueException: fmt.Println(elasticache.ErrCodeInvalidParameterValueException, aerr.Error()) case elasticache.ErrCodeInvalidParameterCombinationException: fmt.Println(elasticache.ErrCodeInvalidParameterCombinationException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

CopySnapshotRequest

func (c *ElastiCache) CopySnapshotRequest(input *CopySnapshotInput) (req *request.Request, output *CopySnapshotOutput)

CopySnapshotRequest generates a "aws/request.Request" representing the client's request for the CopySnapshot operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See CopySnapshot for more information on using the CopySnapshot API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the CopySnapshotRequest method. req, resp := client.CopySnapshotRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/CopySnapshot

CopySnapshotWithContext

func (c *ElastiCache) CopySnapshotWithContext(ctx aws.Context, input *CopySnapshotInput, opts ...request.Option) (*CopySnapshotOutput, error)

CopySnapshotWithContext is the same as CopySnapshot with the addition of the ability to pass a context and additional request options.

See CopySnapshot for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

CreateCacheCluster

func (c *ElastiCache) CreateCacheCluster(input *CreateCacheClusterInput) (*CreateCacheClusterOutput, error)

CreateCacheCluster API operation for Amazon ElastiCache.

Creates a cluster. All nodes in the cluster run the same protocol-compliant cache engine software, either Memcached or Redis.

This operation is not supported for Redis (cluster mode enabled) clusters.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon ElastiCache's API operation CreateCacheCluster for usage and error information.

Returned Error Codes:

  • ErrCodeReplicationGroupNotFoundFault "ReplicationGroupNotFoundFault" The specified replication group does not exist.

  • ErrCodeInvalidReplicationGroupStateFault "InvalidReplicationGroupState" The requested replication group is not in the available state.

  • ErrCodeCacheClusterAlreadyExistsFault "CacheClusterAlreadyExists" You already have a cluster with the given identifier.

  • ErrCodeInsufficientCacheClusterCapacityFault "InsufficientCacheClusterCapacity" The requested cache node type is not available in the specified Availability Zone.

  • ErrCodeCacheSecurityGroupNotFoundFault "CacheSecurityGroupNotFound" The requested cache security group name does not refer to an existing cache security group.

  • ErrCodeCacheSubnetGroupNotFoundFault "CacheSubnetGroupNotFoundFault" The requested cache subnet group name does not refer to an existing cache subnet group.

  • ErrCodeClusterQuotaForCustomerExceededFault "ClusterQuotaForCustomerExceeded" The request cannot be processed because it would exceed the allowed number of clusters per customer.

  • ErrCodeNodeQuotaForClusterExceededFault "NodeQuotaForClusterExceeded" The request cannot be processed because it would exceed the allowed number of cache nodes in a single cluster.

  • ErrCodeNodeQuotaForCustomerExceededFault "NodeQuotaForCustomerExceeded" The request cannot be processed because it would exceed the allowed number of cache nodes per customer.

  • ErrCodeCacheParameterGroupNotFoundFault "CacheParameterGroupNotFound" The requested cache parameter group name does not refer to an existing cache parameter group.

  • ErrCodeInvalidVPCNetworkStateFault "InvalidVPCNetworkStateFault" The VPC network is in an invalid state.

  • ErrCodeTagQuotaPerResourceExceeded "TagQuotaPerResourceExceeded" The request cannot be processed because it would cause the resource to have more than the allowed number of tags. The maximum number of tags permitted on a resource is 50.

  • ErrCodeInvalidParameterValueException "InvalidParameterValue" The value for a parameter is invalid.

  • ErrCodeInvalidParameterCombinationException "InvalidParameterCombination" Two or more incompatible parameters were specified.

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/CreateCacheCluster

Examples

ElastiCache CreateCacheCluster shared00

CreateCacheCluster

Creates a Memcached cluster with 2 nodes.

{ svc := elasticache.New(session.New()) input := &elasticache.CreateCacheClusterInput{ AZMode: aws.String("cross-az"), CacheClusterId: aws.String("my-memcached-cluster"), CacheNodeType: aws.String("cache.r3.large"), CacheSubnetGroupName: aws.String("default"), Engine: aws.String("memcached"), EngineVersion: aws.String("1.4.24"), NumCacheNodes: aws.Int64(2), Port: aws.Int64(11211), } result, err := svc.CreateCacheCluster(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elasticache.ErrCodeReplicationGroupNotFoundFault: fmt.Println(elasticache.ErrCodeReplicationGroupNotFoundFault, aerr.Error()) case elasticache.ErrCodeInvalidReplicationGroupStateFault: fmt.Println(elasticache.ErrCodeInvalidReplicationGroupStateFault, aerr.Error()) case elasticache.ErrCodeCacheClusterAlreadyExistsFault: fmt.Println(elasticache.ErrCodeCacheClusterAlreadyExistsFault, aerr.Error()) case elasticache.ErrCodeInsufficientCacheClusterCapacityFault: fmt.Println(elasticache.ErrCodeInsufficientCacheClusterCapacityFault, aerr.Error()) case elasticache.ErrCodeCacheSecurityGroupNotFoundFault: fmt.Println(elasticache.ErrCodeCacheSecurityGroupNotFoundFault, aerr.Error()) case elasticache.ErrCodeCacheSubnetGroupNotFoundFault: fmt.Println(elasticache.ErrCodeCacheSubnetGroupNotFoundFault, aerr.Error()) case elasticache.ErrCodeClusterQuotaForCustomerExceededFault: fmt.Println(elasticache.ErrCodeClusterQuotaForCustomerExceededFault, aerr.Error()) case elasticache.ErrCodeNodeQuotaForClusterExceededFault: fmt.Println(elasticache.ErrCodeNodeQuotaForClusterExceededFault, aerr.Error()) case elasticache.ErrCodeNodeQuotaForCustomerExceededFault: fmt.Println(elasticache.ErrCodeNodeQuotaForCustomerExceededFault, aerr.Error()) case elasticache.ErrCodeCacheParameterGroupNotFoundFault: fmt.Println(elasticache.ErrCodeCacheParameterGroupNotFoundFault, aerr.Error()) case elasticache.ErrCodeInvalidVPCNetworkStateFault: fmt.Println(elasticache.ErrCodeInvalidVPCNetworkStateFault, aerr.Error()) case elasticache.ErrCodeTagQuotaPerResourceExceeded: fmt.Println(elasticache.ErrCodeTagQuotaPerResourceExceeded, aerr.Error()) case elasticache.ErrCodeInvalidParameterValueException: fmt.Println(elasticache.ErrCodeInvalidParameterValueException, aerr.Error()) case elasticache.ErrCodeInvalidParameterCombinationException: fmt.Println(elasticache.ErrCodeInvalidParameterCombinationException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }
ElastiCache CreateCacheCluster shared01

CreateCacheCluster

Creates a Redis cluster with 1 node.

{ svc := elasticache.New(session.New()) input := &elasticache.CreateCacheClusterInput{ AutoMinorVersionUpgrade: aws.Bool(true), CacheClusterId: aws.String("my-redis"), CacheNodeType: aws.String("cache.r3.larage"), CacheSubnetGroupName: aws.String("default"), Engine: aws.String("redis"), EngineVersion: aws.String("3.2.4"), NumCacheNodes: aws.Int64(1), Port: aws.Int64(6379), PreferredAvailabilityZone: aws.String("us-east-1c"), SnapshotRetentionLimit: aws.Int64(7), } result, err := svc.CreateCacheCluster(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elasticache.ErrCodeReplicationGroupNotFoundFault: fmt.Println(elasticache.ErrCodeReplicationGroupNotFoundFault, aerr.Error()) case elasticache.ErrCodeInvalidReplicationGroupStateFault: fmt.Println(elasticache.ErrCodeInvalidReplicationGroupStateFault, aerr.Error()) case elasticache.ErrCodeCacheClusterAlreadyExistsFault: fmt.Println(elasticache.ErrCodeCacheClusterAlreadyExistsFault, aerr.Error()) case elasticache.ErrCodeInsufficientCacheClusterCapacityFault: fmt.Println(elasticache.ErrCodeInsufficientCacheClusterCapacityFault, aerr.Error()) case elasticache.ErrCodeCacheSecurityGroupNotFoundFault: fmt.Println(elasticache.ErrCodeCacheSecurityGroupNotFoundFault, aerr.Error()) case elasticache.ErrCodeCacheSubnetGroupNotFoundFault: fmt.Println(elasticache.ErrCodeCacheSubnetGroupNotFoundFault, aerr.Error()) case elasticache.ErrCodeClusterQuotaForCustomerExceededFault: fmt.Println(elasticache.ErrCodeClusterQuotaForCustomerExceededFault, aerr.Error()) case elasticache.ErrCodeNodeQuotaForClusterExceededFault: fmt.Println(elasticache.ErrCodeNodeQuotaForClusterExceededFault, aerr.Error()) case elasticache.ErrCodeNodeQuotaForCustomerExceededFault: fmt.Println(elasticache.ErrCodeNodeQuotaForCustomerExceededFault, aerr.Error()) case elasticache.ErrCodeCacheParameterGroupNotFoundFault: fmt.Println(elasticache.ErrCodeCacheParameterGroupNotFoundFault, aerr.Error()) case elasticache.ErrCodeInvalidVPCNetworkStateFault: fmt.Println(elasticache.ErrCodeInvalidVPCNetworkStateFault, aerr.Error()) case elasticache.ErrCodeTagQuotaPerResourceExceeded: fmt.Println(elasticache.ErrCodeTagQuotaPerResourceExceeded, aerr.Error()) case elasticache.ErrCodeInvalidParameterValueException: fmt.Println(elasticache.ErrCodeInvalidParameterValueException, aerr.Error()) case elasticache.ErrCodeInvalidParameterCombinationException: fmt.Println(elasticache.ErrCodeInvalidParameterCombinationException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

CreateCacheClusterRequest

func (c *ElastiCache) CreateCacheClusterRequest(input *CreateCacheClusterInput) (req *request.Request, output *CreateCacheClusterOutput)

CreateCacheClusterRequest generates a "aws/request.Request" representing the client's request for the CreateCacheCluster operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See CreateCacheCluster for more information on using the CreateCacheCluster API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the CreateCacheClusterRequest method. req, resp := client.CreateCacheClusterRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/CreateCacheCluster

CreateCacheClusterWithContext

func (c *ElastiCache) CreateCacheClusterWithContext(ctx aws.Context, input *CreateCacheClusterInput, opts ...request.Option) (*CreateCacheClusterOutput, error)

CreateCacheClusterWithContext is the same as CreateCacheCluster with the addition of the ability to pass a context and additional request options.

See CreateCacheCluster for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

CreateCacheParameterGroup

func (c *ElastiCache) CreateCacheParameterGroup(input *CreateCacheParameterGroupInput) (*CreateCacheParameterGroupOutput, error)

CreateCacheParameterGroup API operation for Amazon ElastiCache.

Creates a new Amazon ElastiCache cache parameter group. An ElastiCache cache parameter group is a collection of parameters and their values that are applied to all of the nodes in any cluster or replication group using the CacheParameterGroup.

A newly created CacheParameterGroup is an exact duplicate of the default parameter group for the CacheParameterGroupFamily. To customize the newly created CacheParameterGroup you can change the values of specific parameters. For more information, see:

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon ElastiCache's API operation CreateCacheParameterGroup for usage and error information.

Returned Error Codes:

  • ErrCodeCacheParameterGroupQuotaExceededFault "CacheParameterGroupQuotaExceeded" The request cannot be processed because it would exceed the maximum number of cache security groups.

  • ErrCodeCacheParameterGroupAlreadyExistsFault "CacheParameterGroupAlreadyExists" A cache parameter group with the requested name already exists.

  • ErrCodeInvalidCacheParameterGroupStateFault "InvalidCacheParameterGroupState" The current state of the cache parameter group does not allow the requested operation to occur.

  • ErrCodeInvalidParameterValueException "InvalidParameterValue" The value for a parameter is invalid.

  • ErrCodeInvalidParameterCombinationException "InvalidParameterCombination" Two or more incompatible parameters were specified.

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/CreateCacheParameterGroup

Example

ElastiCache CreateCacheParameterGroup shared00

CreateCacheParameterGroup

Creates the Amazon ElastiCache parameter group custom-redis2-8.

{ svc := elasticache.New(session.New()) input := &elasticache.CreateCacheParameterGroupInput{ CacheParameterGroupFamily: aws.String("redis2.8"), CacheParameterGroupName: aws.String("custom-redis2-8"), Description: aws.String("Custom Redis 2.8 parameter group."), } result, err := svc.CreateCacheParameterGroup(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elasticache.ErrCodeCacheParameterGroupQuotaExceededFault: fmt.Println(elasticache.ErrCodeCacheParameterGroupQuotaExceededFault, aerr.Error()) case elasticache.ErrCodeCacheParameterGroupAlreadyExistsFault: fmt.Println(elasticache.ErrCodeCacheParameterGroupAlreadyExistsFault, aerr.Error()) case elasticache.ErrCodeInvalidCacheParameterGroupStateFault: fmt.Println(elasticache.ErrCodeInvalidCacheParameterGroupStateFault, aerr.Error()) case elasticache.ErrCodeInvalidParameterValueException: fmt.Println(elasticache.ErrCodeInvalidParameterValueException, aerr.Error()) case elasticache.ErrCodeInvalidParameterCombinationException: fmt.Println(elasticache.ErrCodeInvalidParameterCombinationException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

CreateCacheParameterGroupRequest

func (c *ElastiCache) CreateCacheParameterGroupRequest(input *CreateCacheParameterGroupInput) (req *request.Request, output *CreateCacheParameterGroupOutput)

CreateCacheParameterGroupRequest generates a "aws/request.Request" representing the client's request for the CreateCacheParameterGroup operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See CreateCacheParameterGroup for more information on using the CreateCacheParameterGroup API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the CreateCacheParameterGroupRequest method. req, resp := client.CreateCacheParameterGroupRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/CreateCacheParameterGroup

CreateCacheParameterGroupWithContext

func (c *ElastiCache) CreateCacheParameterGroupWithContext(ctx aws.Context, input *CreateCacheParameterGroupInput, opts ...request.Option) (*CreateCacheParameterGroupOutput, error)

CreateCacheParameterGroupWithContext is the same as CreateCacheParameterGroup with the addition of the ability to pass a context and additional request options.

See CreateCacheParameterGroup for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

CreateCacheSecurityGroup

func (c *ElastiCache) CreateCacheSecurityGroup(input *CreateCacheSecurityGroupInput) (*CreateCacheSecurityGroupOutput, error)

CreateCacheSecurityGroup API operation for Amazon ElastiCache.

Creates a new cache security group. Use a cache security group to control access to one or more clusters.

Cache security groups are only used when you are creating a cluster outside of an Amazon Virtual Private Cloud (Amazon VPC). If you are creating a cluster inside of a VPC, use a cache subnet group instead. For more information, see CreateCacheSubnetGroup (https://docs.aws.amazon.com/AmazonElastiCache/latest/APIReference/API_CreateCacheSubnetGroup.html).

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon ElastiCache's API operation CreateCacheSecurityGroup for usage and error information.

Returned Error Codes:

  • ErrCodeCacheSecurityGroupAlreadyExistsFault "CacheSecurityGroupAlreadyExists" A cache security group with the specified name already exists.

  • ErrCodeCacheSecurityGroupQuotaExceededFault "QuotaExceeded.CacheSecurityGroup" The request cannot be processed because it would exceed the allowed number of cache security groups.

  • ErrCodeInvalidParameterValueException "InvalidParameterValue" The value for a parameter is invalid.

  • ErrCodeInvalidParameterCombinationException "InvalidParameterCombination" Two or more incompatible parameters were specified.

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/CreateCacheSecurityGroup

Example

ElastiCache CreateCacheSecurityGroup shared00

CreateCacheSecurityGroup

Creates an ElastiCache security group. ElastiCache security groups are only for clusters not running in an AWS VPC.

{ svc := elasticache.New(session.New()) input := &elasticache.CreateCacheSecurityGroupInput{ CacheSecurityGroupName: aws.String("my-cache-sec-grp"), Description: aws.String("Example ElastiCache security group."), } result, err := svc.CreateCacheSecurityGroup(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elasticache.ErrCodeCacheSecurityGroupAlreadyExistsFault: fmt.Println(elasticache.ErrCodeCacheSecurityGroupAlreadyExistsFault, aerr.Error()) case elasticache.ErrCodeCacheSecurityGroupQuotaExceededFault: fmt.Println(elasticache.ErrCodeCacheSecurityGroupQuotaExceededFault, aerr.Error()) case elasticache.ErrCodeInvalidParameterValueException: fmt.Println(elasticache.ErrCodeInvalidParameterValueException, aerr.Error()) case elasticache.ErrCodeInvalidParameterCombinationException: fmt.Println(elasticache.ErrCodeInvalidParameterCombinationException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

CreateCacheSecurityGroupRequest

func (c *ElastiCache) CreateCacheSecurityGroupRequest(input *CreateCacheSecurityGroupInput) (req *request.Request, output *CreateCacheSecurityGroupOutput)

CreateCacheSecurityGroupRequest generates a "aws/request.Request" representing the client's request for the CreateCacheSecurityGroup operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See CreateCacheSecurityGroup for more information on using the CreateCacheSecurityGroup API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the CreateCacheSecurityGroupRequest method. req, resp := client.CreateCacheSecurityGroupRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/CreateCacheSecurityGroup

CreateCacheSecurityGroupWithContext

func (c *ElastiCache) CreateCacheSecurityGroupWithContext(ctx aws.Context, input *CreateCacheSecurityGroupInput, opts ...request.Option) (*CreateCacheSecurityGroupOutput, error)

CreateCacheSecurityGroupWithContext is the same as CreateCacheSecurityGroup with the addition of the ability to pass a context and additional request options.

See CreateCacheSecurityGroup for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

CreateCacheSubnetGroup

func (c *ElastiCache) CreateCacheSubnetGroup(input *CreateCacheSubnetGroupInput) (*CreateCacheSubnetGroupOutput, error)

CreateCacheSubnetGroup API operation for Amazon ElastiCache.

Creates a new cache subnet group.

Use this parameter only when you are creating a cluster in an Amazon Virtual Private Cloud (Amazon VPC).

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon ElastiCache's API operation CreateCacheSubnetGroup for usage and error information.

Returned Error Codes:

  • ErrCodeCacheSubnetGroupAlreadyExistsFault "CacheSubnetGroupAlreadyExists" The requested cache subnet group name is already in use by an existing cache subnet group.

  • ErrCodeCacheSubnetGroupQuotaExceededFault "CacheSubnetGroupQuotaExceeded" The request cannot be processed because it would exceed the allowed number of cache subnet groups.

  • ErrCodeCacheSubnetQuotaExceededFault "CacheSubnetQuotaExceededFault" The request cannot be processed because it would exceed the allowed number of subnets in a cache subnet group.

  • ErrCodeInvalidSubnet "InvalidSubnet" An invalid subnet identifier was specified.

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/CreateCacheSubnetGroup

Example

ElastiCache CreateCacheSubnetGroup shared00

CreateCacheSubnet

Creates a new cache subnet group.

{ svc := elasticache.New(session.New()) input := &elasticache.CreateCacheSubnetGroupInput{ CacheSubnetGroupDescription: aws.String("Sample subnet group"), CacheSubnetGroupName: aws.String("my-sn-grp2"), SubnetIds: []*string{ aws.String("subnet-6f28c982"), aws.String("subnet-bcd382f3"), aws.String("subnet-845b3e7c0"), }, } result, err := svc.CreateCacheSubnetGroup(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elasticache.ErrCodeCacheSubnetGroupAlreadyExistsFault: fmt.Println(elasticache.ErrCodeCacheSubnetGroupAlreadyExistsFault, aerr.Error()) case elasticache.ErrCodeCacheSubnetGroupQuotaExceededFault: fmt.Println(elasticache.ErrCodeCacheSubnetGroupQuotaExceededFault, aerr.Error()) case elasticache.ErrCodeCacheSubnetQuotaExceededFault: fmt.Println(elasticache.ErrCodeCacheSubnetQuotaExceededFault, aerr.Error()) case elasticache.ErrCodeInvalidSubnet: fmt.Println(elasticache.ErrCodeInvalidSubnet, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

CreateCacheSubnetGroupRequest

func (c *ElastiCache) CreateCacheSubnetGroupRequest(input *CreateCacheSubnetGroupInput) (req *request.Request, output *CreateCacheSubnetGroupOutput)

CreateCacheSubnetGroupRequest generates a "aws/request.Request" representing the client's request for the CreateCacheSubnetGroup operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See CreateCacheSubnetGroup for more information on using the CreateCacheSubnetGroup API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the CreateCacheSubnetGroupRequest method. req, resp := client.CreateCacheSubnetGroupRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/CreateCacheSubnetGroup

CreateCacheSubnetGroupWithContext

func (c *ElastiCache) CreateCacheSubnetGroupWithContext(ctx aws.Context, input *CreateCacheSubnetGroupInput, opts ...request.Option) (*CreateCacheSubnetGroupOutput, error)

CreateCacheSubnetGroupWithContext is the same as CreateCacheSubnetGroup with the addition of the ability to pass a context and additional request options.

See CreateCacheSubnetGroup for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

CreateReplicationGroup

func (c *ElastiCache) CreateReplicationGroup(input *CreateReplicationGroupInput) (*CreateReplicationGroupOutput, error)

CreateReplicationGroup API operation for Amazon ElastiCache.

Creates a Redis (cluster mode disabled) or a Redis (cluster mode enabled) replication group.

A Redis (cluster mode disabled) replication group is a collection of clusters, where one of the clusters is a read/write primary and the others are read-only replicas. Writes to the primary are asynchronously propagated to the replicas.

A Redis (cluster mode enabled) replication group is a collection of 1 to 15 node groups (shards). Each node group (shard) has one read/write primary node and up to 5 read-only replica nodes. Writes to the primary are asynchronously propagated to the replicas. Redis (cluster mode enabled) replication groups partition the data across node groups (shards).

When a Redis (cluster mode disabled) replication group has been successfully created, you can add one or more read replicas to it, up to a total of 5 read replicas. You cannot alter a Redis (cluster mode enabled) replication group after it has been created. However, if you need to increase or decrease the number of node groups (console: shards), you can avail yourself of ElastiCache for Redis' enhanced backup and restore. For more information, see Restoring From a Backup with Cluster Resizing (https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/backups-restoring.html) in the ElastiCache User Guide.

This operation is valid for Redis only.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon ElastiCache's API operation CreateReplicationGroup for usage and error information.

Returned Error Codes:

  • ErrCodeCacheClusterNotFoundFault "CacheClusterNotFound" The requested cluster ID does not refer to an existing cluster.

  • ErrCodeInvalidCacheClusterStateFault "InvalidCacheClusterState" The requested cluster is not in the available state.

  • ErrCodeReplicationGroupAlreadyExistsFault "ReplicationGroupAlreadyExists" The specified replication group already exists.

  • ErrCodeInsufficientCacheClusterCapacityFault "InsufficientCacheClusterCapacity" The requested cache node type is not available in the specified Availability Zone.

  • ErrCodeCacheSecurityGroupNotFoundFault "CacheSecurityGroupNotFound" The requested cache security group name does not refer to an existing cache security group.

  • ErrCodeCacheSubnetGroupNotFoundFault "CacheSubnetGroupNotFoundFault" The requested cache subnet group name does not refer to an existing cache subnet group.

  • ErrCodeClusterQuotaForCustomerExceededFault "ClusterQuotaForCustomerExceeded" The request cannot be processed because it would exceed the allowed number of clusters per customer.

  • ErrCodeNodeQuotaForClusterExceededFault "NodeQuotaForClusterExceeded" The request cannot be processed because it would exceed the allowed number of cache nodes in a single cluster.

  • ErrCodeNodeQuotaForCustomerExceededFault "NodeQuotaForCustomerExceeded" The request cannot be processed because it would exceed the allowed number of cache nodes per customer.

  • ErrCodeCacheParameterGroupNotFoundFault "CacheParameterGroupNotFound" The requested cache parameter group name does not refer to an existing cache parameter group.

  • ErrCodeInvalidVPCNetworkStateFault "InvalidVPCNetworkStateFault" The VPC network is in an invalid state.

  • ErrCodeTagQuotaPerResourceExceeded "TagQuotaPerResourceExceeded" The request cannot be processed because it would cause the resource to have more than the allowed number of tags. The maximum number of tags permitted on a resource is 50.

  • ErrCodeNodeGroupsPerReplicationGroupQuotaExceededFault "NodeGroupsPerReplicationGroupQuotaExceeded" The request cannot be processed because it would exceed the maximum allowed number of node groups (shards) in a single replication group. The default maximum is 15

  • ErrCodeInvalidParameterValueException "InvalidParameterValue" The value for a parameter is invalid.

  • ErrCodeInvalidParameterCombinationException "InvalidParameterCombination" Two or more incompatible parameters were specified.

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/CreateReplicationGroup

Examples

ElastiCache CreateReplicationGroup shared00

CreateCacheReplicationGroup

Creates a Redis replication group with 3 nodes.

{ svc := elasticache.New(session.New()) input := &elasticache.CreateReplicationGroupInput{ AutomaticFailoverEnabled: aws.Bool(true), CacheNodeType: aws.String("cache.m3.medium"), Engine: aws.String("redis"), EngineVersion: aws.String("2.8.24"), NumCacheClusters: aws.Int64(3), ReplicationGroupDescription: aws.String("A Redis replication group."), ReplicationGroupId: aws.String("my-redis-rg"), SnapshotRetentionLimit: aws.Int64(30), } result, err := svc.CreateReplicationGroup(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elasticache.ErrCodeCacheClusterNotFoundFault: fmt.Println(elasticache.ErrCodeCacheClusterNotFoundFault, aerr.Error()) case elasticache.ErrCodeInvalidCacheClusterStateFault: fmt.Println(elasticache.ErrCodeInvalidCacheClusterStateFault, aerr.Error()) case elasticache.ErrCodeReplicationGroupAlreadyExistsFault: fmt.Println(elasticache.ErrCodeReplicationGroupAlreadyExistsFault, aerr.Error()) case elasticache.ErrCodeInsufficientCacheClusterCapacityFault: fmt.Println(elasticache.ErrCodeInsufficientCacheClusterCapacityFault, aerr.Error()) case elasticache.ErrCodeCacheSecurityGroupNotFoundFault: fmt.Println(elasticache.ErrCodeCacheSecurityGroupNotFoundFault, aerr.Error()) case elasticache.ErrCodeCacheSubnetGroupNotFoundFault: fmt.Println(elasticache.ErrCodeCacheSubnetGroupNotFoundFault, aerr.Error()) case elasticache.ErrCodeClusterQuotaForCustomerExceededFault: fmt.Println(elasticache.ErrCodeClusterQuotaForCustomerExceededFault, aerr.Error()) case elasticache.ErrCodeNodeQuotaForClusterExceededFault: fmt.Println(elasticache.ErrCodeNodeQuotaForClusterExceededFault, aerr.Error()) case elasticache.ErrCodeNodeQuotaForCustomerExceededFault: fmt.Println(elasticache.ErrCodeNodeQuotaForCustomerExceededFault, aerr.Error()) case elasticache.ErrCodeCacheParameterGroupNotFoundFault: fmt.Println(elasticache.ErrCodeCacheParameterGroupNotFoundFault, aerr.Error()) case elasticache.ErrCodeInvalidVPCNetworkStateFault: fmt.Println(elasticache.ErrCodeInvalidVPCNetworkStateFault, aerr.Error()) case elasticache.ErrCodeTagQuotaPerResourceExceeded: fmt.Println(elasticache.ErrCodeTagQuotaPerResourceExceeded, aerr.Error()) case elasticache.ErrCodeNodeGroupsPerReplicationGroupQuotaExceededFault: fmt.Println(elasticache.ErrCodeNodeGroupsPerReplicationGroupQuotaExceededFault, aerr.Error()) case elasticache.ErrCodeInvalidParameterValueException: fmt.Println(elasticache.ErrCodeInvalidParameterValueException, aerr.Error()) case elasticache.ErrCodeInvalidParameterCombinationException: fmt.Println(elasticache.ErrCodeInvalidParameterCombinationException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }
ElastiCache CreateReplicationGroup shared01

CreateReplicationGroup

Creates a Redis (cluster mode enabled) replication group with two shards. One shard has one read replica node and the other shard has two read replicas.

{ svc := elasticache.New(session.New()) input := &elasticache.CreateReplicationGroupInput{ AutoMinorVersionUpgrade: aws.Bool(true), CacheNodeType: aws.String("cache.m3.medium"), CacheParameterGroupName: aws.String("default.redis3.2.cluster.on"), Engine: aws.String("redis"), EngineVersion: aws.String("3.2.4"), NodeGroupConfiguration: []*elasticache.NodeGroupConfiguration{ { PrimaryAvailabilityZone: aws.String("us-east-1c"), ReplicaAvailabilityZones: []*string{ aws.String("us-east-1b"), }, ReplicaCount: aws.Int64(1), Slots: aws.String("0-8999"), }, { PrimaryAvailabilityZone: aws.String("us-east-1a"), ReplicaAvailabilityZones: []*string{ aws.String("us-east-1a"), aws.String("us-east-1c"), }, ReplicaCount: aws.Int64(2), Slots: aws.String("9000-16383"), }, }, NumNodeGroups: aws.Int64(2), ReplicationGroupDescription: aws.String("A multi-sharded replication group"), ReplicationGroupId: aws.String("clustered-redis-rg"), SnapshotRetentionLimit: aws.Int64(8), } result, err := svc.CreateReplicationGroup(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elasticache.ErrCodeCacheClusterNotFoundFault: fmt.Println(elasticache.ErrCodeCacheClusterNotFoundFault, aerr.Error()) case elasticache.ErrCodeInvalidCacheClusterStateFault: fmt.Println(elasticache.ErrCodeInvalidCacheClusterStateFault, aerr.Error()) case elasticache.ErrCodeReplicationGroupAlreadyExistsFault: fmt.Println(elasticache.ErrCodeReplicationGroupAlreadyExistsFault, aerr.Error()) case elasticache.ErrCodeInsufficientCacheClusterCapacityFault: fmt.Println(elasticache.ErrCodeInsufficientCacheClusterCapacityFault, aerr.Error()) case elasticache.ErrCodeCacheSecurityGroupNotFoundFault: fmt.Println(elasticache.ErrCodeCacheSecurityGroupNotFoundFault, aerr.Error()) case elasticache.ErrCodeCacheSubnetGroupNotFoundFault: fmt.Println(elasticache.ErrCodeCacheSubnetGroupNotFoundFault, aerr.Error()) case elasticache.ErrCodeClusterQuotaForCustomerExceededFault: fmt.Println(elasticache.ErrCodeClusterQuotaForCustomerExceededFault, aerr.Error()) case elasticache.ErrCodeNodeQuotaForClusterExceededFault: fmt.Println(elasticache.ErrCodeNodeQuotaForClusterExceededFault, aerr.Error()) case elasticache.ErrCodeNodeQuotaForCustomerExceededFault: fmt.Println(elasticache.ErrCodeNodeQuotaForCustomerExceededFault, aerr.Error()) case elasticache.ErrCodeCacheParameterGroupNotFoundFault: fmt.Println(elasticache.ErrCodeCacheParameterGroupNotFoundFault, aerr.Error()) case elasticache.ErrCodeInvalidVPCNetworkStateFault: fmt.Println(elasticache.ErrCodeInvalidVPCNetworkStateFault, aerr.Error()) case elasticache.ErrCodeTagQuotaPerResourceExceeded: fmt.Println(elasticache.ErrCodeTagQuotaPerResourceExceeded, aerr.Error()) case elasticache.ErrCodeNodeGroupsPerReplicationGroupQuotaExceededFault: fmt.Println(elasticache.ErrCodeNodeGroupsPerReplicationGroupQuotaExceededFault, aerr.Error()) case elasticache.ErrCodeInvalidParameterValueException: fmt.Println(elasticache.ErrCodeInvalidParameterValueException, aerr.Error()) case elasticache.ErrCodeInvalidParameterCombinationException: fmt.Println(elasticache.ErrCodeInvalidParameterCombinationException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

CreateReplicationGroupRequest

func (c *ElastiCache) CreateReplicationGroupRequest(input *CreateReplicationGroupInput) (req *request.Request, output *CreateReplicationGroupOutput)

CreateReplicationGroupRequest generates a "aws/request.Request" representing the client's request for the CreateReplicationGroup operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See CreateReplicationGroup for more information on using the CreateReplicationGroup API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the CreateReplicationGroupRequest method. req, resp := client.CreateReplicationGroupRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/CreateReplicationGroup

CreateReplicationGroupWithContext

func (c *ElastiCache) CreateReplicationGroupWithContext(ctx aws.Context, input *CreateReplicationGroupInput, opts ...request.Option) (*CreateReplicationGroupOutput, error)

CreateReplicationGroupWithContext is the same as CreateReplicationGroup with the addition of the ability to pass a context and additional request options.

See CreateReplicationGroup for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

CreateSnapshot

func (c *ElastiCache) CreateSnapshot(input *CreateSnapshotInput) (*CreateSnapshotOutput, error)

CreateSnapshot API operation for Amazon ElastiCache.

Creates a copy of an entire cluster or replication group at a specific moment in time.

This operation is valid for Redis only.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon ElastiCache's API operation CreateSnapshot for usage and error information.

Returned Error Codes:

  • ErrCodeSnapshotAlreadyExistsFault "SnapshotAlreadyExistsFault" You already have a snapshot with the given name.

  • ErrCodeCacheClusterNotFoundFault "CacheClusterNotFound" The requested cluster ID does not refer to an existing cluster.

  • ErrCodeReplicationGroupNotFoundFault "ReplicationGroupNotFoundFault" The specified replication group does not exist.

  • ErrCodeInvalidCacheClusterStateFault "InvalidCacheClusterState" The requested cluster is not in the available state.

  • ErrCodeInvalidReplicationGroupStateFault "InvalidReplicationGroupState" The requested replication group is not in the available state.

  • ErrCodeSnapshotQuotaExceededFault "SnapshotQuotaExceededFault" The request cannot be processed because it would exceed the maximum number of snapshots.

  • ErrCodeSnapshotFeatureNotSupportedFault "SnapshotFeatureNotSupportedFault" You attempted one of the following operations:

  • Creating a snapshot of a Redis cluster running on a cache.t1.micro cache node.

  • Creating a snapshot of a cluster that is running Memcached rather than Redis.

Neither of these are supported by ElastiCache.
  • ErrCodeInvalidParameterCombinationException "InvalidParameterCombination" Two or more incompatible parameters were specified.

  • ErrCodeInvalidParameterValueException "InvalidParameterValue" The value for a parameter is invalid.

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/CreateSnapshot

Examples

ElastiCache CreateSnapshot shared00

CreateSnapshot - NonClustered Redis, no read-replicas

Creates a snapshot of a non-clustered Redis cluster that has only one node.

{ svc := elasticache.New(session.New()) input := &elasticache.CreateSnapshotInput{ CacheClusterId: aws.String("onenoderedis"), SnapshotName: aws.String("snapshot-1"), } result, err := svc.CreateSnapshot(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elasticache.ErrCodeSnapshotAlreadyExistsFault: fmt.Println(elasticache.ErrCodeSnapshotAlreadyExistsFault, aerr.Error()) case elasticache.ErrCodeCacheClusterNotFoundFault: fmt.Println(elasticache.ErrCodeCacheClusterNotFoundFault, aerr.Error()) case elasticache.ErrCodeReplicationGroupNotFoundFault: fmt.Println(elasticache.ErrCodeReplicationGroupNotFoundFault, aerr.Error()) case elasticache.ErrCodeInvalidCacheClusterStateFault: fmt.Println(elasticache.ErrCodeInvalidCacheClusterStateFault, aerr.Error()) case elasticache.ErrCodeInvalidReplicationGroupStateFault: fmt.Println(elasticache.ErrCodeInvalidReplicationGroupStateFault, aerr.Error()) case elasticache.ErrCodeSnapshotQuotaExceededFault: fmt.Println(elasticache.ErrCodeSnapshotQuotaExceededFault, aerr.Error()) case elasticache.ErrCodeSnapshotFeatureNotSupportedFault: fmt.Println(elasticache.ErrCodeSnapshotFeatureNotSupportedFault, aerr.Error()) case elasticache.ErrCodeInvalidParameterCombinationException: fmt.Println(elasticache.ErrCodeInvalidParameterCombinationException, aerr.Error()) case elasticache.ErrCodeInvalidParameterValueException: fmt.Println(elasticache.ErrCodeInvalidParameterValueException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }
ElastiCache CreateSnapshot shared01

CreateSnapshot - NonClustered Redis, 2 read-replicas

Creates a snapshot of a non-clustered Redis cluster that has only three nodes, primary and two read-replicas. CacheClusterId must be a specific node in the cluster.

{ svc := elasticache.New(session.New()) input := &elasticache.CreateSnapshotInput{ CacheClusterId: aws.String("threenoderedis-001"), SnapshotName: aws.String("snapshot-2"), } result, err := svc.CreateSnapshot(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elasticache.ErrCodeSnapshotAlreadyExistsFault: fmt.Println(elasticache.ErrCodeSnapshotAlreadyExistsFault, aerr.Error()) case elasticache.ErrCodeCacheClusterNotFoundFault: fmt.Println(elasticache.ErrCodeCacheClusterNotFoundFault, aerr.Error()) case elasticache.ErrCodeReplicationGroupNotFoundFault: fmt.Println(elasticache.ErrCodeReplicationGroupNotFoundFault, aerr.Error()) case elasticache.ErrCodeInvalidCacheClusterStateFault: fmt.Println(elasticache.ErrCodeInvalidCacheClusterStateFault, aerr.Error()) case elasticache.ErrCodeInvalidReplicationGroupStateFault: fmt.Println(elasticache.ErrCodeInvalidReplicationGroupStateFault, aerr.Error()) case elasticache.ErrCodeSnapshotQuotaExceededFault: fmt.Println(elasticache.ErrCodeSnapshotQuotaExceededFault, aerr.Error()) case elasticache.ErrCodeSnapshotFeatureNotSupportedFault: fmt.Println(elasticache.ErrCodeSnapshotFeatureNotSupportedFault, aerr.Error()) case elasticache.ErrCodeInvalidParameterCombinationException: fmt.Println(elasticache.ErrCodeInvalidParameterCombinationException, aerr.Error()) case elasticache.ErrCodeInvalidParameterValueException: fmt.Println(elasticache.ErrCodeInvalidParameterValueException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }
ElastiCache CreateSnapshot shared02

CreateSnapshot-clustered Redis

Creates a snapshot of a clustered Redis cluster that has 2 shards, each with a primary and 4 read-replicas.

{ svc := elasticache.New(session.New()) input := &elasticache.CreateSnapshotInput{ ReplicationGroupId: aws.String("clusteredredis"), SnapshotName: aws.String("snapshot-2x5"), } result, err := svc.CreateSnapshot(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elasticache.ErrCodeSnapshotAlreadyExistsFault: fmt.Println(elasticache.ErrCodeSnapshotAlreadyExistsFault, aerr.Error()) case elasticache.ErrCodeCacheClusterNotFoundFault: fmt.Println(elasticache.ErrCodeCacheClusterNotFoundFault, aerr.Error()) case elasticache.ErrCodeReplicationGroupNotFoundFault: fmt.Println(elasticache.ErrCodeReplicationGroupNotFoundFault, aerr.Error()) case elasticache.ErrCodeInvalidCacheClusterStateFault: fmt.Println(elasticache.ErrCodeInvalidCacheClusterStateFault, aerr.Error()) case elasticache.ErrCodeInvalidReplicationGroupStateFault: fmt.Println(elasticache.ErrCodeInvalidReplicationGroupStateFault, aerr.Error()) case elasticache.ErrCodeSnapshotQuotaExceededFault: fmt.Println(elasticache.ErrCodeSnapshotQuotaExceededFault, aerr.Error()) case elasticache.ErrCodeSnapshotFeatureNotSupportedFault: fmt.Println(elasticache.ErrCodeSnapshotFeatureNotSupportedFault, aerr.Error()) case elasticache.ErrCodeInvalidParameterCombinationException: fmt.Println(elasticache.ErrCodeInvalidParameterCombinationException, aerr.Error()) case elasticache.ErrCodeInvalidParameterValueException: fmt.Println(elasticache.ErrCodeInvalidParameterValueException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

CreateSnapshotRequest

func (c *ElastiCache) CreateSnapshotRequest(input *CreateSnapshotInput) (req *request.Request, output *CreateSnapshotOutput)

CreateSnapshotRequest generates a "aws/request.Request" representing the client's request for the CreateSnapshot operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See CreateSnapshot for more information on using the CreateSnapshot API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the CreateSnapshotRequest method. req, resp := client.CreateSnapshotRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/CreateSnapshot

CreateSnapshotWithContext

func (c *ElastiCache) CreateSnapshotWithContext(ctx aws.Context, input *CreateSnapshotInput, opts ...request.Option) (*CreateSnapshotOutput, error)

CreateSnapshotWithContext is the same as CreateSnapshot with the addition of the ability to pass a context and additional request options.

See CreateSnapshot for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DecreaseReplicaCount

func (c *ElastiCache) DecreaseReplicaCount(input *DecreaseReplicaCountInput) (*DecreaseReplicaCountOutput, error)

DecreaseReplicaCount API operation for Amazon ElastiCache.

Dynamically decreases the number of replics in a Redis (cluster mode disabled) replication group or the number of replica nodes in one or more node groups (shards) of a Redis (cluster mode enabled) replication group. This operation is performed with no cluster down time.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon ElastiCache's API operation DecreaseReplicaCount for usage and error information.

Returned Error Codes:

  • ErrCodeReplicationGroupNotFoundFault "ReplicationGroupNotFoundFault" The specified replication group does not exist.

  • ErrCodeInvalidReplicationGroupStateFault "InvalidReplicationGroupState" The requested replication group is not in the available state.

  • ErrCodeInvalidCacheClusterStateFault "InvalidCacheClusterState" The requested cluster is not in the available state.

  • ErrCodeInvalidVPCNetworkStateFault "InvalidVPCNetworkStateFault" The VPC network is in an invalid state.

  • ErrCodeInsufficientCacheClusterCapacityFault "InsufficientCacheClusterCapacity" The requested cache node type is not available in the specified Availability Zone.

  • ErrCodeClusterQuotaForCustomerExceededFault "ClusterQuotaForCustomerExceeded" The request cannot be processed because it would exceed the allowed number of clusters per customer.

  • ErrCodeNodeGroupsPerReplicationGroupQuotaExceededFault "NodeGroupsPerReplicationGroupQuotaExceeded" The request cannot be processed because it would exceed the maximum allowed number of node groups (shards) in a single replication group. The default maximum is 15

  • ErrCodeNodeQuotaForCustomerExceededFault "NodeQuotaForCustomerExceeded" The request cannot be processed because it would exceed the allowed number of cache nodes per customer.

  • ErrCodeServiceLinkedRoleNotFoundFault "ServiceLinkedRoleNotFoundFault" The specified service linked role (SLR) was not found.

  • ErrCodeNoOperationFault "NoOperationFault" The operation was not performed because no changes were required.

  • ErrCodeInvalidParameterValueException "InvalidParameterValue" The value for a parameter is invalid.

  • ErrCodeInvalidParameterCombinationException "InvalidParameterCombination" Two or more incompatible parameters were specified.

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DecreaseReplicaCount

DecreaseReplicaCountRequest

func (c *ElastiCache) DecreaseReplicaCountRequest(input *DecreaseReplicaCountInput) (req *request.Request, output *DecreaseReplicaCountOutput)

DecreaseReplicaCountRequest generates a "aws/request.Request" representing the client's request for the DecreaseReplicaCount operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DecreaseReplicaCount for more information on using the DecreaseReplicaCount API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DecreaseReplicaCountRequest method. req, resp := client.DecreaseReplicaCountRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DecreaseReplicaCount

DecreaseReplicaCountWithContext

func (c *ElastiCache) DecreaseReplicaCountWithContext(ctx aws.Context, input *DecreaseReplicaCountInput, opts ...request.Option) (*DecreaseReplicaCountOutput, error)

DecreaseReplicaCountWithContext is the same as DecreaseReplicaCount with the addition of the ability to pass a context and additional request options.

See DecreaseReplicaCount for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DeleteCacheCluster

func (c *ElastiCache) DeleteCacheCluster(input *DeleteCacheClusterInput) (*DeleteCacheClusterOutput, error)

DeleteCacheCluster API operation for Amazon ElastiCache.

Deletes a previously provisioned cluster. DeleteCacheCluster deletes all associated cache nodes, node endpoints and the cluster itself. When you receive a successful response from this operation, Amazon ElastiCache immediately begins deleting the cluster; you cannot cancel or revert this operation.

This operation cannot be used to delete a cluster that is the last read replica of a replication group or node group (shard) that has Multi-AZ mode enabled or a cluster from a Redis (cluster mode enabled) replication group.

This operation is not valid for Redis (cluster mode enabled) clusters.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon ElastiCache's API operation DeleteCacheCluster for usage and error information.

Returned Error Codes:

  • ErrCodeCacheClusterNotFoundFault "CacheClusterNotFound" The requested cluster ID does not refer to an existing cluster.

  • ErrCodeInvalidCacheClusterStateFault "InvalidCacheClusterState" The requested cluster is not in the available state.

  • ErrCodeSnapshotAlreadyExistsFault "SnapshotAlreadyExistsFault" You already have a snapshot with the given name.

  • ErrCodeSnapshotFeatureNotSupportedFault "SnapshotFeatureNotSupportedFault" You attempted one of the following operations:

  • Creating a snapshot of a Redis cluster running on a cache.t1.micro cache node.

  • Creating a snapshot of a cluster that is running Memcached rather than Redis.

Neither of these are supported by ElastiCache.
  • ErrCodeSnapshotQuotaExceededFault "SnapshotQuotaExceededFault" The request cannot be processed because it would exceed the maximum number of snapshots.

  • ErrCodeInvalidParameterValueException "InvalidParameterValue" The value for a parameter is invalid.

  • ErrCodeInvalidParameterCombinationException "InvalidParameterCombination" Two or more incompatible parameters were specified.

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DeleteCacheCluster

Example

ElastiCache DeleteCacheCluster shared00

DeleteCacheCluster

Deletes an Amazon ElastiCache cluster.

{ svc := elasticache.New(session.New()) input := &elasticache.DeleteCacheClusterInput{ CacheClusterId: aws.String("my-memcached"), } result, err := svc.DeleteCacheCluster(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elasticache.ErrCodeCacheClusterNotFoundFault: fmt.Println(elasticache.ErrCodeCacheClusterNotFoundFault, aerr.Error()) case elasticache.ErrCodeInvalidCacheClusterStateFault: fmt.Println(elasticache.ErrCodeInvalidCacheClusterStateFault, aerr.Error()) case elasticache.ErrCodeSnapshotAlreadyExistsFault: fmt.Println(elasticache.ErrCodeSnapshotAlreadyExistsFault, aerr.Error()) case elasticache.ErrCodeSnapshotFeatureNotSupportedFault: fmt.Println(elasticache.ErrCodeSnapshotFeatureNotSupportedFault, aerr.Error()) case elasticache.ErrCodeSnapshotQuotaExceededFault: fmt.Println(elasticache.ErrCodeSnapshotQuotaExceededFault, aerr.Error()) case elasticache.ErrCodeInvalidParameterValueException: fmt.Println(elasticache.ErrCodeInvalidParameterValueException, aerr.Error()) case elasticache.ErrCodeInvalidParameterCombinationException: fmt.Println(elasticache.ErrCodeInvalidParameterCombinationException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

DeleteCacheClusterRequest

func (c *ElastiCache) DeleteCacheClusterRequest(input *DeleteCacheClusterInput) (req *request.Request, output *DeleteCacheClusterOutput)

DeleteCacheClusterRequest generates a "aws/request.Request" representing the client's request for the DeleteCacheCluster operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DeleteCacheCluster for more information on using the DeleteCacheCluster API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DeleteCacheClusterRequest method. req, resp := client.DeleteCacheClusterRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DeleteCacheCluster

DeleteCacheClusterWithContext

func (c *ElastiCache) DeleteCacheClusterWithContext(ctx aws.Context, input *DeleteCacheClusterInput, opts ...request.Option) (*DeleteCacheClusterOutput, error)

DeleteCacheClusterWithContext is the same as DeleteCacheCluster with the addition of the ability to pass a context and additional request options.

See DeleteCacheCluster for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DeleteCacheParameterGroup

func (c *ElastiCache) DeleteCacheParameterGroup(input *DeleteCacheParameterGroupInput) (*DeleteCacheParameterGroupOutput, error)

DeleteCacheParameterGroup API operation for Amazon ElastiCache.

Deletes the specified cache parameter group. You cannot delete a cache parameter group if it is associated with any cache clusters.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon ElastiCache's API operation DeleteCacheParameterGroup for usage and error information.

Returned Error Codes:

  • ErrCodeInvalidCacheParameterGroupStateFault "InvalidCacheParameterGroupState" The current state of the cache parameter group does not allow the requested operation to occur.

  • ErrCodeCacheParameterGroupNotFoundFault "CacheParameterGroupNotFound" The requested cache parameter group name does not refer to an existing cache parameter group.

  • ErrCodeInvalidParameterValueException "InvalidParameterValue" The value for a parameter is invalid.

  • ErrCodeInvalidParameterCombinationException "InvalidParameterCombination" Two or more incompatible parameters were specified.

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DeleteCacheParameterGroup

Example

ElastiCache DeleteCacheParameterGroup shared00

DeleteCacheParameterGroup

Deletes the Amazon ElastiCache parameter group custom-mem1-4.

{ svc := elasticache.New(session.New()) input := &elasticache.DeleteCacheParameterGroupInput{ CacheParameterGroupName: aws.String("custom-mem1-4"), } result, err := svc.DeleteCacheParameterGroup(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elasticache.ErrCodeInvalidCacheParameterGroupStateFault: fmt.Println(elasticache.ErrCodeInvalidCacheParameterGroupStateFault, aerr.Error()) case elasticache.ErrCodeCacheParameterGroupNotFoundFault: fmt.Println(elasticache.ErrCodeCacheParameterGroupNotFoundFault, aerr.Error()) case elasticache.ErrCodeInvalidParameterValueException: fmt.Println(elasticache.ErrCodeInvalidParameterValueException, aerr.Error()) case elasticache.ErrCodeInvalidParameterCombinationException: fmt.Println(elasticache.ErrCodeInvalidParameterCombinationException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

DeleteCacheParameterGroupRequest

func (c *ElastiCache) DeleteCacheParameterGroupRequest(input *DeleteCacheParameterGroupInput) (req *request.Request, output *DeleteCacheParameterGroupOutput)

DeleteCacheParameterGroupRequest generates a "aws/request.Request" representing the client's request for the DeleteCacheParameterGroup operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DeleteCacheParameterGroup for more information on using the DeleteCacheParameterGroup API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DeleteCacheParameterGroupRequest method. req, resp := client.DeleteCacheParameterGroupRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DeleteCacheParameterGroup

DeleteCacheParameterGroupWithContext

func (c *ElastiCache) DeleteCacheParameterGroupWithContext(ctx aws.Context, input *DeleteCacheParameterGroupInput, opts ...request.Option) (*DeleteCacheParameterGroupOutput, error)

DeleteCacheParameterGroupWithContext is the same as DeleteCacheParameterGroup with the addition of the ability to pass a context and additional request options.

See DeleteCacheParameterGroup for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DeleteCacheSecurityGroup

func (c *ElastiCache) DeleteCacheSecurityGroup(input *DeleteCacheSecurityGroupInput) (*DeleteCacheSecurityGroupOutput, error)

DeleteCacheSecurityGroup API operation for Amazon ElastiCache.

Deletes a cache security group.

You cannot delete a cache security group if it is associated with any clusters.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon ElastiCache's API operation DeleteCacheSecurityGroup for usage and error information.

Returned Error Codes:

  • ErrCodeInvalidCacheSecurityGroupStateFault "InvalidCacheSecurityGroupState" The current state of the cache security group does not allow deletion.

  • ErrCodeCacheSecurityGroupNotFoundFault "CacheSecurityGroupNotFound" The requested cache security group name does not refer to an existing cache security group.

  • ErrCodeInvalidParameterValueException "InvalidParameterValue" The value for a parameter is invalid.

  • ErrCodeInvalidParameterCombinationException "InvalidParameterCombination" Two or more incompatible parameters were specified.

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DeleteCacheSecurityGroup

Example

ElastiCache DeleteCacheSecurityGroup shared00

DeleteCacheSecurityGroup

Deletes a cache security group.

{ svc := elasticache.New(session.New()) input := &elasticache.DeleteCacheSecurityGroupInput{ CacheSecurityGroupName: aws.String("my-sec-group"), } result, err := svc.DeleteCacheSecurityGroup(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elasticache.ErrCodeInvalidCacheSecurityGroupStateFault: fmt.Println(elasticache.ErrCodeInvalidCacheSecurityGroupStateFault, aerr.Error()) case elasticache.ErrCodeCacheSecurityGroupNotFoundFault: fmt.Println(elasticache.ErrCodeCacheSecurityGroupNotFoundFault, aerr.Error()) case elasticache.ErrCodeInvalidParameterValueException: fmt.Println(elasticache.ErrCodeInvalidParameterValueException, aerr.Error()) case elasticache.ErrCodeInvalidParameterCombinationException: fmt.Println(elasticache.ErrCodeInvalidParameterCombinationException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

DeleteCacheSecurityGroupRequest

func (c *ElastiCache) DeleteCacheSecurityGroupRequest(input *DeleteCacheSecurityGroupInput) (req *request.Request, output *DeleteCacheSecurityGroupOutput)

DeleteCacheSecurityGroupRequest generates a "aws/request.Request" representing the client's request for the DeleteCacheSecurityGroup operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DeleteCacheSecurityGroup for more information on using the DeleteCacheSecurityGroup API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DeleteCacheSecurityGroupRequest method. req, resp := client.DeleteCacheSecurityGroupRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DeleteCacheSecurityGroup

DeleteCacheSecurityGroupWithContext

func (c *ElastiCache) DeleteCacheSecurityGroupWithContext(ctx aws.Context, input *DeleteCacheSecurityGroupInput, opts ...request.Option) (*DeleteCacheSecurityGroupOutput, error)

DeleteCacheSecurityGroupWithContext is the same as DeleteCacheSecurityGroup with the addition of the ability to pass a context and additional request options.

See DeleteCacheSecurityGroup for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DeleteCacheSubnetGroup

func (c *ElastiCache) DeleteCacheSubnetGroup(input *DeleteCacheSubnetGroupInput) (*DeleteCacheSubnetGroupOutput, error)

DeleteCacheSubnetGroup API operation for Amazon ElastiCache.

Deletes a cache subnet group.

You cannot delete a cache subnet group if it is associated with any clusters.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon ElastiCache's API operation DeleteCacheSubnetGroup for usage and error information.

Returned Error Codes:

  • ErrCodeCacheSubnetGroupInUse "CacheSubnetGroupInUse" The requested cache subnet group is currently in use.

  • ErrCodeCacheSubnetGroupNotFoundFault "CacheSubnetGroupNotFoundFault" The requested cache subnet group name does not refer to an existing cache subnet group.

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DeleteCacheSubnetGroup

Example

ElastiCache DeleteCacheSubnetGroup shared00

DeleteCacheSubnetGroup

Deletes the Amazon ElastiCache subnet group my-subnet-group.

{ svc := elasticache.New(session.New()) input := &elasticache.DeleteCacheSubnetGroupInput{ CacheSubnetGroupName: aws.String("my-subnet-group"), } result, err := svc.DeleteCacheSubnetGroup(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elasticache.ErrCodeCacheSubnetGroupInUse: fmt.Println(elasticache.ErrCodeCacheSubnetGroupInUse, aerr.Error()) case elasticache.ErrCodeCacheSubnetGroupNotFoundFault: fmt.Println(elasticache.ErrCodeCacheSubnetGroupNotFoundFault, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

DeleteCacheSubnetGroupRequest

func (c *ElastiCache) DeleteCacheSubnetGroupRequest(input *DeleteCacheSubnetGroupInput) (req *request.Request, output *DeleteCacheSubnetGroupOutput)

DeleteCacheSubnetGroupRequest generates a "aws/request.Request" representing the client's request for the DeleteCacheSubnetGroup operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DeleteCacheSubnetGroup for more information on using the DeleteCacheSubnetGroup API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DeleteCacheSubnetGroupRequest method. req, resp := client.DeleteCacheSubnetGroupRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DeleteCacheSubnetGroup

DeleteCacheSubnetGroupWithContext

func (c *ElastiCache) DeleteCacheSubnetGroupWithContext(ctx aws.Context, input *DeleteCacheSubnetGroupInput, opts ...request.Option) (*DeleteCacheSubnetGroupOutput, error)

DeleteCacheSubnetGroupWithContext is the same as DeleteCacheSubnetGroup with the addition of the ability to pass a context and additional request options.

See DeleteCacheSubnetGroup for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DeleteReplicationGroup

func (c *ElastiCache) DeleteReplicationGroup(input *DeleteReplicationGroupInput) (*DeleteReplicationGroupOutput, error)

DeleteReplicationGroup API operation for Amazon ElastiCache.

Deletes an existing replication group. By default, this operation deletes the entire replication group, including the primary/primaries and all of the read replicas. If the replication group has only one primary, you can optionally delete only the read replicas, while retaining the primary by setting RetainPrimaryCluster=true.

When you receive a successful response from this operation, Amazon ElastiCache immediately begins deleting the selected resources; you cannot cancel or revert this operation.

This operation is valid for Redis only.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon ElastiCache's API operation DeleteReplicationGroup for usage and error information.

Returned Error Codes:

  • ErrCodeReplicationGroupNotFoundFault "ReplicationGroupNotFoundFault" The specified replication group does not exist.

  • ErrCodeInvalidReplicationGroupStateFault "InvalidReplicationGroupState" The requested replication group is not in the available state.

  • ErrCodeSnapshotAlreadyExistsFault "SnapshotAlreadyExistsFault" You already have a snapshot with the given name.

  • ErrCodeSnapshotFeatureNotSupportedFault "SnapshotFeatureNotSupportedFault" You attempted one of the following operations:

  • Creating a snapshot of a Redis cluster running on a cache.t1.micro cache node.

  • Creating a snapshot of a cluster that is running Memcached rather than Redis.

Neither of these are supported by ElastiCache.
  • ErrCodeSnapshotQuotaExceededFault "SnapshotQuotaExceededFault" The request cannot be processed because it would exceed the maximum number of snapshots.

  • ErrCodeInvalidParameterValueException "InvalidParameterValue" The value for a parameter is invalid.

  • ErrCodeInvalidParameterCombinationException "InvalidParameterCombination" Two or more incompatible parameters were specified.

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DeleteReplicationGroup

Example

ElastiCache DeleteReplicationGroup shared00

DeleteReplicationGroup

Deletes the Amazon ElastiCache replication group my-redis-rg.

{ svc := elasticache.New(session.New()) input := &elasticache.DeleteReplicationGroupInput{ ReplicationGroupId: aws.String("my-redis-rg"), RetainPrimaryCluster: aws.Bool(false), } result, err := svc.DeleteReplicationGroup(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elasticache.ErrCodeReplicationGroupNotFoundFault: fmt.Println(elasticache.ErrCodeReplicationGroupNotFoundFault, aerr.Error()) case elasticache.ErrCodeInvalidReplicationGroupStateFault: fmt.Println(elasticache.ErrCodeInvalidReplicationGroupStateFault, aerr.Error()) case elasticache.ErrCodeSnapshotAlreadyExistsFault: fmt.Println(elasticache.ErrCodeSnapshotAlreadyExistsFault, aerr.Error()) case elasticache.ErrCodeSnapshotFeatureNotSupportedFault: fmt.Println(elasticache.ErrCodeSnapshotFeatureNotSupportedFault, aerr.Error()) case elasticache.ErrCodeSnapshotQuotaExceededFault: fmt.Println(elasticache.ErrCodeSnapshotQuotaExceededFault, aerr.Error()) case elasticache.ErrCodeInvalidParameterValueException: fmt.Println(elasticache.ErrCodeInvalidParameterValueException, aerr.Error()) case elasticache.ErrCodeInvalidParameterCombinationException: fmt.Println(elasticache.ErrCodeInvalidParameterCombinationException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

DeleteReplicationGroupRequest

func (c *ElastiCache) DeleteReplicationGroupRequest(input *DeleteReplicationGroupInput) (req *request.Request, output *DeleteReplicationGroupOutput)

DeleteReplicationGroupRequest generates a "aws/request.Request" representing the client's request for the DeleteReplicationGroup operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DeleteReplicationGroup for more information on using the DeleteReplicationGroup API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DeleteReplicationGroupRequest method. req, resp := client.DeleteReplicationGroupRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DeleteReplicationGroup

DeleteReplicationGroupWithContext

func (c *ElastiCache) DeleteReplicationGroupWithContext(ctx aws.Context, input *DeleteReplicationGroupInput, opts ...request.Option) (*DeleteReplicationGroupOutput, error)

DeleteReplicationGroupWithContext is the same as DeleteReplicationGroup with the addition of the ability to pass a context and additional request options.

See DeleteReplicationGroup for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DeleteSnapshot

func (c *ElastiCache) DeleteSnapshot(input *DeleteSnapshotInput) (*DeleteSnapshotOutput, error)

DeleteSnapshot API operation for Amazon ElastiCache.

Deletes an existing snapshot. When you receive a successful response from this operation, ElastiCache immediately begins deleting the snapshot; you cannot cancel or revert this operation.

This operation is valid for Redis only.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon ElastiCache's API operation DeleteSnapshot for usage and error information.

Returned Error Codes:

  • ErrCodeSnapshotNotFoundFault "SnapshotNotFoundFault" The requested snapshot name does not refer to an existing snapshot.

  • ErrCodeInvalidSnapshotStateFault "InvalidSnapshotState" The current state of the snapshot does not allow the requested operation to occur.

  • ErrCodeInvalidParameterValueException "InvalidParameterValue" The value for a parameter is invalid.

  • ErrCodeInvalidParameterCombinationException "InvalidParameterCombination" Two or more incompatible parameters were specified.

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DeleteSnapshot

Example

ElastiCache DeleteSnapshot shared00

DeleteSnapshot

Deletes the Redis snapshot snapshot-20160822.

{ svc := elasticache.New(session.New()) input := &elasticache.DeleteSnapshotInput{ SnapshotName: aws.String("snapshot-20161212"), } result, err := svc.DeleteSnapshot(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elasticache.ErrCodeSnapshotNotFoundFault: fmt.Println(elasticache.ErrCodeSnapshotNotFoundFault, aerr.Error()) case elasticache.ErrCodeInvalidSnapshotStateFault: fmt.Println(elasticache.ErrCodeInvalidSnapshotStateFault, aerr.Error()) case elasticache.ErrCodeInvalidParameterValueException: fmt.Println(elasticache.ErrCodeInvalidParameterValueException, aerr.Error()) case elasticache.ErrCodeInvalidParameterCombinationException: fmt.Println(elasticache.ErrCodeInvalidParameterCombinationException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

DeleteSnapshotRequest

func (c *ElastiCache) DeleteSnapshotRequest(input *DeleteSnapshotInput) (req *request.Request, output *DeleteSnapshotOutput)

DeleteSnapshotRequest generates a "aws/request.Request" representing the client's request for the DeleteSnapshot operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DeleteSnapshot for more information on using the DeleteSnapshot API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DeleteSnapshotRequest method. req, resp := client.DeleteSnapshotRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DeleteSnapshot

DeleteSnapshotWithContext

func (c *ElastiCache) DeleteSnapshotWithContext(ctx aws.Context, input *DeleteSnapshotInput, opts ...request.Option) (*DeleteSnapshotOutput, error)

DeleteSnapshotWithContext is the same as DeleteSnapshot with the addition of the ability to pass a context and additional request options.

See DeleteSnapshot for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DescribeCacheClusters

func (c *ElastiCache) DescribeCacheClusters(input *DescribeCacheClustersInput) (*DescribeCacheClustersOutput, error)

DescribeCacheClusters API operation for Amazon ElastiCache.

Returns information about all provisioned clusters if no cluster identifier is specified, or about a specific cache cluster if a cluster identifier is supplied.

By default, abbreviated information about the clusters is returned. You can use the optional ShowCacheNodeInfo flag to retrieve detailed information about the cache nodes associated with the clusters. These details include the DNS address and port for the cache node endpoint.

If the cluster is in the creating state, only cluster-level information is displayed until all of the nodes are successfully provisioned.

If the cluster is in the deleting state, only cluster-level information is displayed.

If cache nodes are currently being added to the cluster, node endpoint information and creation time for the additional nodes are not displayed until they are completely provisioned. When the cluster state is available, the cluster is ready for use.

If cache nodes are currently being removed from the cluster, no endpoint information for the removed nodes is displayed.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon ElastiCache's API operation DescribeCacheClusters for usage and error information.

Returned Error Codes:

  • ErrCodeCacheClusterNotFoundFault "CacheClusterNotFound" The requested cluster ID does not refer to an existing cluster.

  • ErrCodeInvalidParameterValueException "InvalidParameterValue" The value for a parameter is invalid.

  • ErrCodeInvalidParameterCombinationException "InvalidParameterCombination" Two or more incompatible parameters were specified.

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeCacheClusters

Examples

ElastiCache DescribeCacheClusters shared00

DescribeCacheClusters

Lists the details for up to 50 cache clusters.

{ svc := elasticache.New(session.New()) input := &elasticache.DescribeCacheClustersInput{ CacheClusterId: aws.String("my-mem-cluster"), } result, err := svc.DescribeCacheClusters(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elasticache.ErrCodeCacheClusterNotFoundFault: fmt.Println(elasticache.ErrCodeCacheClusterNotFoundFault, aerr.Error()) case elasticache.ErrCodeInvalidParameterValueException: fmt.Println(elasticache.ErrCodeInvalidParameterValueException, aerr.Error()) case elasticache.ErrCodeInvalidParameterCombinationException: fmt.Println(elasticache.ErrCodeInvalidParameterCombinationException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }
ElastiCache DescribeCacheClusters shared01

DescribeCacheClusters

Lists the details for the cache cluster my-mem-cluster.

{ svc := elasticache.New(session.New()) input := &elasticache.DescribeCacheClustersInput{ CacheClusterId: aws.String("my-mem-cluster"), ShowCacheNodeInfo: aws.Bool(true), } result, err := svc.DescribeCacheClusters(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elasticache.ErrCodeCacheClusterNotFoundFault: fmt.Println(elasticache.ErrCodeCacheClusterNotFoundFault, aerr.Error()) case elasticache.ErrCodeInvalidParameterValueException: fmt.Println(elasticache.ErrCodeInvalidParameterValueException, aerr.Error()) case elasticache.ErrCodeInvalidParameterCombinationException: fmt.Println(elasticache.ErrCodeInvalidParameterCombinationException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

DescribeCacheClustersPages

func (c *ElastiCache) DescribeCacheClustersPages(input *DescribeCacheClustersInput, fn func(*DescribeCacheClustersOutput, bool) bool) error

DescribeCacheClustersPages iterates over the pages of a DescribeCacheClusters operation, calling the "fn" function with the response data for each page. To stop iterating, return false from the fn function.

See DescribeCacheClusters method for more information on how to use this operation.

Note: This operation can generate multiple requests to a service.

// Example iterating over at most 3 pages of a DescribeCacheClusters operation. pageNum := 0 err := client.DescribeCacheClustersPages(params, func(page *DescribeCacheClustersOutput, lastPage bool) bool { pageNum++ fmt.Println(page) return pageNum <= 3 })

See Also

For more information about using this API, see AWS API Documentation.

DescribeCacheClustersPagesWithContext

func (c *ElastiCache) DescribeCacheClustersPagesWithContext(ctx aws.Context, input *DescribeCacheClustersInput, fn func(*DescribeCacheClustersOutput, bool) bool, opts ...request.Option) error

DescribeCacheClustersPagesWithContext same as DescribeCacheClustersPages except it takes a Context and allows setting request options on the pages.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DescribeCacheClustersRequest

func (c *ElastiCache) DescribeCacheClustersRequest(input *DescribeCacheClustersInput) (req *request.Request, output *DescribeCacheClustersOutput)

DescribeCacheClustersRequest generates a "aws/request.Request" representing the client's request for the DescribeCacheClusters operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DescribeCacheClusters for more information on using the DescribeCacheClusters API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DescribeCacheClustersRequest method. req, resp := client.DescribeCacheClustersRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeCacheClusters

DescribeCacheClustersWithContext

func (c *ElastiCache) DescribeCacheClustersWithContext(ctx aws.Context, input *DescribeCacheClustersInput, opts ...request.Option) (*DescribeCacheClustersOutput, error)

DescribeCacheClustersWithContext is the same as DescribeCacheClusters with the addition of the ability to pass a context and additional request options.

See DescribeCacheClusters for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DescribeCacheEngineVersions

func (c *ElastiCache) DescribeCacheEngineVersions(input *DescribeCacheEngineVersionsInput) (*DescribeCacheEngineVersionsOutput, error)

DescribeCacheEngineVersions API operation for Amazon ElastiCache.

Returns a list of the available cache engines and their versions.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon ElastiCache's API operation DescribeCacheEngineVersions for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeCacheEngineVersions

Examples

ElastiCache DescribeCacheEngineVersions shared00

DescribeCacheEngineVersions

Lists the details for up to 25 Memcached and Redis cache engine versions.

{ svc := elasticache.New(session.New()) input := &elasticache.DescribeCacheEngineVersionsInput{} result, err := svc.DescribeCacheEngineVersions(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }
ElastiCache DescribeCacheEngineVersions shared01

DescribeCacheEngineVersions

Lists the details for up to 50 Redis cache engine versions.

{ svc := elasticache.New(session.New()) input := &elasticache.DescribeCacheEngineVersionsInput{ DefaultOnly: aws.Bool(false), Engine: aws.String("redis"), MaxRecords: aws.Int64(50), } result, err := svc.DescribeCacheEngineVersions(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

DescribeCacheEngineVersionsPages

func (c *ElastiCache) DescribeCacheEngineVersionsPages(input *DescribeCacheEngineVersionsInput, fn func(*DescribeCacheEngineVersionsOutput, bool) bool) error

DescribeCacheEngineVersionsPages iterates over the pages of a DescribeCacheEngineVersions operation, calling the "fn" function with the response data for each page. To stop iterating, return false from the fn function.

See DescribeCacheEngineVersions method for more information on how to use this operation.

Note: This operation can generate multiple requests to a service.

// Example iterating over at most 3 pages of a DescribeCacheEngineVersions operation. pageNum := 0 err := client.DescribeCacheEngineVersionsPages(params, func(page *DescribeCacheEngineVersionsOutput, lastPage bool) bool { pageNum++ fmt.Println(page) return pageNum <= 3 })

See Also

For more information about using this API, see AWS API Documentation.

DescribeCacheEngineVersionsPagesWithContext

func (c *ElastiCache) DescribeCacheEngineVersionsPagesWithContext(ctx aws.Context, input *DescribeCacheEngineVersionsInput, fn func(*DescribeCacheEngineVersionsOutput, bool) bool, opts ...request.Option) error

DescribeCacheEngineVersionsPagesWithContext same as DescribeCacheEngineVersionsPages except it takes a Context and allows setting request options on the pages.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DescribeCacheEngineVersionsRequest

func (c *ElastiCache) DescribeCacheEngineVersionsRequest(input *DescribeCacheEngineVersionsInput) (req *request.Request, output *DescribeCacheEngineVersionsOutput)

DescribeCacheEngineVersionsRequest generates a "aws/request.Request" representing the client's request for the DescribeCacheEngineVersions operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DescribeCacheEngineVersions for more information on using the DescribeCacheEngineVersions API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DescribeCacheEngineVersionsRequest method. req, resp := client.DescribeCacheEngineVersionsRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeCacheEngineVersions

DescribeCacheEngineVersionsWithContext

func (c *ElastiCache) DescribeCacheEngineVersionsWithContext(ctx aws.Context, input *DescribeCacheEngineVersionsInput, opts ...request.Option) (*DescribeCacheEngineVersionsOutput, error)

DescribeCacheEngineVersionsWithContext is the same as DescribeCacheEngineVersions with the addition of the ability to pass a context and additional request options.

See DescribeCacheEngineVersions for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DescribeCacheParameterGroups

func (c *ElastiCache) DescribeCacheParameterGroups(input *DescribeCacheParameterGroupsInput) (*DescribeCacheParameterGroupsOutput, error)

DescribeCacheParameterGroups API operation for Amazon ElastiCache.

Returns a list of cache parameter group descriptions. If a cache parameter group name is specified, the list contains only the descriptions for that group.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon ElastiCache's API operation DescribeCacheParameterGroups for usage and error information.

Returned Error Codes:

  • ErrCodeCacheParameterGroupNotFoundFault "CacheParameterGroupNotFound" The requested cache parameter group name does not refer to an existing cache parameter group.

  • ErrCodeInvalidParameterValueException "InvalidParameterValue" The value for a parameter is invalid.

  • ErrCodeInvalidParameterCombinationException "InvalidParameterCombination" Two or more incompatible parameters were specified.

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeCacheParameterGroups

Example

ElastiCache DescribeCacheParameterGroups shared00

DescribeCacheParameterGroups

Returns a list of cache parameter group descriptions. If a cache parameter group name is specified, the list contains only the descriptions for that group.

{ svc := elasticache.New(session.New()) input := &elasticache.DescribeCacheParameterGroupsInput{ CacheParameterGroupName: aws.String("custom-mem1-4"), } result, err := svc.DescribeCacheParameterGroups(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elasticache.ErrCodeCacheParameterGroupNotFoundFault: fmt.Println(elasticache.ErrCodeCacheParameterGroupNotFoundFault, aerr.Error()) case elasticache.ErrCodeInvalidParameterValueException: fmt.Println(elasticache.ErrCodeInvalidParameterValueException, aerr.Error()) case elasticache.ErrCodeInvalidParameterCombinationException: fmt.Println(elasticache.ErrCodeInvalidParameterCombinationException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

DescribeCacheParameterGroupsPages

func (c *ElastiCache) DescribeCacheParameterGroupsPages(input *DescribeCacheParameterGroupsInput, fn func(*DescribeCacheParameterGroupsOutput, bool) bool) error

DescribeCacheParameterGroupsPages iterates over the pages of a DescribeCacheParameterGroups operation, calling the "fn" function with the response data for each page. To stop iterating, return false from the fn function.

See DescribeCacheParameterGroups method for more information on how to use this operation.

Note: This operation can generate multiple requests to a service.

// Example iterating over at most 3 pages of a DescribeCacheParameterGroups operation. pageNum := 0 err := client.DescribeCacheParameterGroupsPages(params, func(page *DescribeCacheParameterGroupsOutput, lastPage bool) bool { pageNum++ fmt.Println(page) return pageNum <= 3 })

See Also

For more information about using this API, see AWS API Documentation.

DescribeCacheParameterGroupsPagesWithContext

func (c *ElastiCache) DescribeCacheParameterGroupsPagesWithContext(ctx aws.Context, input *DescribeCacheParameterGroupsInput, fn func(*DescribeCacheParameterGroupsOutput, bool) bool, opts ...request.Option) error

DescribeCacheParameterGroupsPagesWithContext same as DescribeCacheParameterGroupsPages except it takes a Context and allows setting request options on the pages.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DescribeCacheParameterGroupsRequest

func (c *ElastiCache) DescribeCacheParameterGroupsRequest(input *DescribeCacheParameterGroupsInput) (req *request.Request, output *DescribeCacheParameterGroupsOutput)

DescribeCacheParameterGroupsRequest generates a "aws/request.Request" representing the client's request for the DescribeCacheParameterGroups operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DescribeCacheParameterGroups for more information on using the DescribeCacheParameterGroups API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DescribeCacheParameterGroupsRequest method. req, resp := client.DescribeCacheParameterGroupsRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeCacheParameterGroups

DescribeCacheParameterGroupsWithContext

func (c *ElastiCache) DescribeCacheParameterGroupsWithContext(ctx aws.Context, input *DescribeCacheParameterGroupsInput, opts ...request.Option) (*DescribeCacheParameterGroupsOutput, error)

DescribeCacheParameterGroupsWithContext is the same as DescribeCacheParameterGroups with the addition of the ability to pass a context and additional request options.

See DescribeCacheParameterGroups for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DescribeCacheParameters

func (c *ElastiCache) DescribeCacheParameters(input *DescribeCacheParametersInput) (*DescribeCacheParametersOutput, error)

DescribeCacheParameters API operation for Amazon ElastiCache.

Returns the detailed parameter list for a particular cache parameter group.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon ElastiCache's API operation DescribeCacheParameters for usage and error information.

Returned Error Codes:

  • ErrCodeCacheParameterGroupNotFoundFault "CacheParameterGroupNotFound" The requested cache parameter group name does not refer to an existing cache parameter group.

  • ErrCodeInvalidParameterValueException "InvalidParameterValue" The value for a parameter is invalid.

  • ErrCodeInvalidParameterCombinationException "InvalidParameterCombination" Two or more incompatible parameters were specified.

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeCacheParameters

Example

ElastiCache DescribeCacheParameters shared00

DescribeCacheParameters

Lists up to 100 user parameter values for the parameter group custom.redis2.8.

{ svc := elasticache.New(session.New()) input := &elasticache.DescribeCacheParametersInput{ CacheParameterGroupName: aws.String("custom-redis2-8"), MaxRecords: aws.Int64(100), Source: aws.String("user"), } result, err := svc.DescribeCacheParameters(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elasticache.ErrCodeCacheParameterGroupNotFoundFault: fmt.Println(elasticache.ErrCodeCacheParameterGroupNotFoundFault, aerr.Error()) case elasticache.ErrCodeInvalidParameterValueException: fmt.Println(elasticache.ErrCodeInvalidParameterValueException, aerr.Error()) case elasticache.ErrCodeInvalidParameterCombinationException: fmt.Println(elasticache.ErrCodeInvalidParameterCombinationException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

DescribeCacheParametersPages

func (c *ElastiCache) DescribeCacheParametersPages(input *DescribeCacheParametersInput, fn func(*DescribeCacheParametersOutput, bool) bool) error

DescribeCacheParametersPages iterates over the pages of a DescribeCacheParameters operation, calling the "fn" function with the response data for each page. To stop iterating, return false from the fn function.

See DescribeCacheParameters method for more information on how to use this operation.

Note: This operation can generate multiple requests to a service.

// Example iterating over at most 3 pages of a DescribeCacheParameters operation. pageNum := 0 err := client.DescribeCacheParametersPages(params, func(page *DescribeCacheParametersOutput, lastPage bool) bool { pageNum++ fmt.Println(page) return pageNum <= 3 })

See Also

For more information about using this API, see AWS API Documentation.

DescribeCacheParametersPagesWithContext

func (c *ElastiCache) DescribeCacheParametersPagesWithContext(ctx aws.Context, input *DescribeCacheParametersInput, fn func(*DescribeCacheParametersOutput, bool) bool, opts ...request.Option) error

DescribeCacheParametersPagesWithContext same as DescribeCacheParametersPages except it takes a Context and allows setting request options on the pages.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DescribeCacheParametersRequest

func (c *ElastiCache) DescribeCacheParametersRequest(input *DescribeCacheParametersInput) (req *request.Request, output *DescribeCacheParametersOutput)

DescribeCacheParametersRequest generates a "aws/request.Request" representing the client's request for the DescribeCacheParameters operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DescribeCacheParameters for more information on using the DescribeCacheParameters API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DescribeCacheParametersRequest method. req, resp := client.DescribeCacheParametersRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeCacheParameters

DescribeCacheParametersWithContext

func (c *ElastiCache) DescribeCacheParametersWithContext(ctx aws.Context, input *DescribeCacheParametersInput, opts ...request.Option) (*DescribeCacheParametersOutput, error)

DescribeCacheParametersWithContext is the same as DescribeCacheParameters with the addition of the ability to pass a context and additional request options.

See DescribeCacheParameters for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DescribeCacheSecurityGroups

func (c *ElastiCache) DescribeCacheSecurityGroups(input *DescribeCacheSecurityGroupsInput) (*DescribeCacheSecurityGroupsOutput, error)

DescribeCacheSecurityGroups API operation for Amazon ElastiCache.

Returns a list of cache security group descriptions. If a cache security group name is specified, the list contains only the description of that group.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon ElastiCache's API operation DescribeCacheSecurityGroups for usage and error information.

Returned Error Codes:

  • ErrCodeCacheSecurityGroupNotFoundFault "CacheSecurityGroupNotFound" The requested cache security group name does not refer to an existing cache security group.

  • ErrCodeInvalidParameterValueException "InvalidParameterValue" The value for a parameter is invalid.

  • ErrCodeInvalidParameterCombinationException "InvalidParameterCombination" Two or more incompatible parameters were specified.

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeCacheSecurityGroups

Example

ElastiCache DescribeCacheSecurityGroups shared00

DescribeCacheSecurityGroups

Returns a list of cache security group descriptions. If a cache security group name is specified, the list contains only the description of that group.

{ svc := elasticache.New(session.New()) input := &elasticache.DescribeCacheSecurityGroupsInput{ CacheSecurityGroupName: aws.String("my-sec-group"), } result, err := svc.DescribeCacheSecurityGroups(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elasticache.ErrCodeCacheSecurityGroupNotFoundFault: fmt.Println(elasticache.ErrCodeCacheSecurityGroupNotFoundFault, aerr.Error()) case elasticache.ErrCodeInvalidParameterValueException: fmt.Println(elasticache.ErrCodeInvalidParameterValueException, aerr.Error()) case elasticache.ErrCodeInvalidParameterCombinationException: fmt.Println(elasticache.ErrCodeInvalidParameterCombinationException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

DescribeCacheSecurityGroupsPages

func (c *ElastiCache) DescribeCacheSecurityGroupsPages(input *DescribeCacheSecurityGroupsInput, fn func(*DescribeCacheSecurityGroupsOutput, bool) bool) error

DescribeCacheSecurityGroupsPages iterates over the pages of a DescribeCacheSecurityGroups operation, calling the "fn" function with the response data for each page. To stop iterating, return false from the fn function.

See DescribeCacheSecurityGroups method for more information on how to use this operation.

Note: This operation can generate multiple requests to a service.

// Example iterating over at most 3 pages of a DescribeCacheSecurityGroups operation. pageNum := 0 err := client.DescribeCacheSecurityGroupsPages(params, func(page *DescribeCacheSecurityGroupsOutput, lastPage bool) bool { pageNum++ fmt.Println(page) return pageNum <= 3 })

See Also

For more information about using this API, see AWS API Documentation.

DescribeCacheSecurityGroupsPagesWithContext

func (c *ElastiCache) DescribeCacheSecurityGroupsPagesWithContext(ctx aws.Context, input *DescribeCacheSecurityGroupsInput, fn func(*DescribeCacheSecurityGroupsOutput, bool) bool, opts ...request.Option) error

DescribeCacheSecurityGroupsPagesWithContext same as DescribeCacheSecurityGroupsPages except it takes a Context and allows setting request options on the pages.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DescribeCacheSecurityGroupsRequest

func (c *ElastiCache) DescribeCacheSecurityGroupsRequest(input *DescribeCacheSecurityGroupsInput) (req *request.Request, output *DescribeCacheSecurityGroupsOutput)

DescribeCacheSecurityGroupsRequest generates a "aws/request.Request" representing the client's request for the DescribeCacheSecurityGroups operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DescribeCacheSecurityGroups for more information on using the DescribeCacheSecurityGroups API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DescribeCacheSecurityGroupsRequest method. req, resp := client.DescribeCacheSecurityGroupsRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeCacheSecurityGroups

DescribeCacheSecurityGroupsWithContext

func (c *ElastiCache) DescribeCacheSecurityGroupsWithContext(ctx aws.Context, input *DescribeCacheSecurityGroupsInput, opts ...request.Option) (*DescribeCacheSecurityGroupsOutput, error)

DescribeCacheSecurityGroupsWithContext is the same as DescribeCacheSecurityGroups with the addition of the ability to pass a context and additional request options.

See DescribeCacheSecurityGroups for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DescribeCacheSubnetGroups

func (c *ElastiCache) DescribeCacheSubnetGroups(input *DescribeCacheSubnetGroupsInput) (*DescribeCacheSubnetGroupsOutput, error)

DescribeCacheSubnetGroups API operation for Amazon ElastiCache.

Returns a list of cache subnet group descriptions. If a subnet group name is specified, the list contains only the description of that group.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon ElastiCache's API operation DescribeCacheSubnetGroups for usage and error information.

Returned Error Codes:

  • ErrCodeCacheSubnetGroupNotFoundFault "CacheSubnetGroupNotFoundFault" The requested cache subnet group name does not refer to an existing cache subnet group.

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeCacheSubnetGroups

Example

ElastiCache DescribeCacheSubnetGroups shared00

DescribeCacheSubnetGroups

Describes up to 25 cache subnet groups.

{ svc := elasticache.New(session.New()) input := &elasticache.DescribeCacheSubnetGroupsInput{ MaxRecords: aws.Int64(25), } result, err := svc.DescribeCacheSubnetGroups(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elasticache.ErrCodeCacheSubnetGroupNotFoundFault: fmt.Println(elasticache.ErrCodeCacheSubnetGroupNotFoundFault, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

DescribeCacheSubnetGroupsPages

func (c *ElastiCache) DescribeCacheSubnetGroupsPages(input *DescribeCacheSubnetGroupsInput, fn func(*DescribeCacheSubnetGroupsOutput, bool) bool) error

DescribeCacheSubnetGroupsPages iterates over the pages of a DescribeCacheSubnetGroups operation, calling the "fn" function with the response data for each page. To stop iterating, return false from the fn function.

See DescribeCacheSubnetGroups method for more information on how to use this operation.

Note: This operation can generate multiple requests to a service.

// Example iterating over at most 3 pages of a DescribeCacheSubnetGroups operation. pageNum := 0 err := client.DescribeCacheSubnetGroupsPages(params, func(page *DescribeCacheSubnetGroupsOutput, lastPage bool) bool { pageNum++ fmt.Println(page) return pageNum <= 3 })

See Also

For more information about using this API, see AWS API Documentation.

DescribeCacheSubnetGroupsPagesWithContext

func (c *ElastiCache) DescribeCacheSubnetGroupsPagesWithContext(ctx aws.Context, input *DescribeCacheSubnetGroupsInput, fn func(*DescribeCacheSubnetGroupsOutput, bool) bool, opts ...request.Option) error

DescribeCacheSubnetGroupsPagesWithContext same as DescribeCacheSubnetGroupsPages except it takes a Context and allows setting request options on the pages.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DescribeCacheSubnetGroupsRequest

func (c *ElastiCache) DescribeCacheSubnetGroupsRequest(input *DescribeCacheSubnetGroupsInput) (req *request.Request, output *DescribeCacheSubnetGroupsOutput)

DescribeCacheSubnetGroupsRequest generates a "aws/request.Request" representing the client's request for the DescribeCacheSubnetGroups operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DescribeCacheSubnetGroups for more information on using the DescribeCacheSubnetGroups API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DescribeCacheSubnetGroupsRequest method. req, resp := client.DescribeCacheSubnetGroupsRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeCacheSubnetGroups

DescribeCacheSubnetGroupsWithContext

func (c *ElastiCache) DescribeCacheSubnetGroupsWithContext(ctx aws.Context, input *DescribeCacheSubnetGroupsInput, opts ...request.Option) (*DescribeCacheSubnetGroupsOutput, error)

DescribeCacheSubnetGroupsWithContext is the same as DescribeCacheSubnetGroups with the addition of the ability to pass a context and additional request options.

See DescribeCacheSubnetGroups for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DescribeEngineDefaultParameters

func (c *ElastiCache) DescribeEngineDefaultParameters(input *DescribeEngineDefaultParametersInput) (*DescribeEngineDefaultParametersOutput, error)

DescribeEngineDefaultParameters API operation for Amazon ElastiCache.

Returns the default engine and system parameter information for the specified cache engine.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon ElastiCache's API operation DescribeEngineDefaultParameters for usage and error information.

Returned Error Codes:

  • ErrCodeInvalidParameterValueException "InvalidParameterValue" The value for a parameter is invalid.

  • ErrCodeInvalidParameterCombinationException "InvalidParameterCombination" Two or more incompatible parameters were specified.

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeEngineDefaultParameters

Example

ElastiCache DescribeEngineDefaultParameters shared00

DescribeEngineDefaultParameters

Returns the default engine and system parameter information for the specified cache engine.

{ svc := elasticache.New(session.New()) input := &elasticache.DescribeEngineDefaultParametersInput{ CacheParameterGroupFamily: aws.String("redis2.8"), MaxRecords: aws.Int64(25), } result, err := svc.DescribeEngineDefaultParameters(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elasticache.ErrCodeInvalidParameterValueException: fmt.Println(elasticache.ErrCodeInvalidParameterValueException, aerr.Error()) case elasticache.ErrCodeInvalidParameterCombinationException: fmt.Println(elasticache.ErrCodeInvalidParameterCombinationException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

DescribeEngineDefaultParametersPages

func (c *ElastiCache) DescribeEngineDefaultParametersPages(input *DescribeEngineDefaultParametersInput, fn func(*DescribeEngineDefaultParametersOutput, bool) bool) error

DescribeEngineDefaultParametersPages iterates over the pages of a DescribeEngineDefaultParameters operation, calling the "fn" function with the response data for each page. To stop iterating, return false from the fn function.

See DescribeEngineDefaultParameters method for more information on how to use this operation.

Note: This operation can generate multiple requests to a service.

// Example iterating over at most 3 pages of a DescribeEngineDefaultParameters operation. pageNum := 0 err := client.DescribeEngineDefaultParametersPages(params, func(page *DescribeEngineDefaultParametersOutput, lastPage bool) bool { pageNum++ fmt.Println(page) return pageNum <= 3 })

See Also

For more information about using this API, see AWS API Documentation.

DescribeEngineDefaultParametersPagesWithContext

func (c *ElastiCache) DescribeEngineDefaultParametersPagesWithContext(ctx aws.Context, input *DescribeEngineDefaultParametersInput, fn func(*DescribeEngineDefaultParametersOutput, bool) bool, opts ...request.Option) error

DescribeEngineDefaultParametersPagesWithContext same as DescribeEngineDefaultParametersPages except it takes a Context and allows setting request options on the pages.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DescribeEngineDefaultParametersRequest

func (c *ElastiCache) DescribeEngineDefaultParametersRequest(input *DescribeEngineDefaultParametersInput) (req *request.Request, output *DescribeEngineDefaultParametersOutput)

DescribeEngineDefaultParametersRequest generates a "aws/request.Request" representing the client's request for the DescribeEngineDefaultParameters operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DescribeEngineDefaultParameters for more information on using the DescribeEngineDefaultParameters API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DescribeEngineDefaultParametersRequest method. req, resp := client.DescribeEngineDefaultParametersRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeEngineDefaultParameters

DescribeEngineDefaultParametersWithContext

func (c *ElastiCache) DescribeEngineDefaultParametersWithContext(ctx aws.Context, input *DescribeEngineDefaultParametersInput, opts ...request.Option) (*DescribeEngineDefaultParametersOutput, error)

DescribeEngineDefaultParametersWithContext is the same as DescribeEngineDefaultParameters with the addition of the ability to pass a context and additional request options.

See DescribeEngineDefaultParameters for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DescribeEvents

func (c *ElastiCache) DescribeEvents(input *DescribeEventsInput) (*DescribeEventsOutput, error)

DescribeEvents API operation for Amazon ElastiCache.

Returns events related to clusters, cache security groups, and cache parameter groups. You can obtain events specific to a particular cluster, cache security group, or cache parameter group by providing the name as a parameter.

By default, only the events occurring within the last hour are returned; however, you can retrieve up to 14 days' worth of events if necessary.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon ElastiCache's API operation DescribeEvents for usage and error information.

Returned Error Codes:

  • ErrCodeInvalidParameterValueException "InvalidParameterValue" The value for a parameter is invalid.

  • ErrCodeInvalidParameterCombinationException "InvalidParameterCombination" Two or more incompatible parameters were specified.

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeEvents

Examples

ElastiCache DescribeEvents shared00

DescribeEvents

Describes all the cache-cluster events for the past 120 minutes.

{ svc := elasticache.New(session.New()) input := &elasticache.DescribeEventsInput{ Duration: aws.Int64(360), SourceType: aws.String("cache-cluster"), } result, err := svc.DescribeEvents(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elasticache.ErrCodeInvalidParameterValueException: fmt.Println(elasticache.ErrCodeInvalidParameterValueException, aerr.Error()) case elasticache.ErrCodeInvalidParameterCombinationException: fmt.Println(elasticache.ErrCodeInvalidParameterCombinationException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }
ElastiCache DescribeEvents shared01

DescribeEvents

Describes all the replication-group events from 3:00P to 5:00P on November 11, 2016.

{ svc := elasticache.New(session.New()) input := &elasticache.DescribeEventsInput{ StartTime: parseTime("2006-01-02T15:04:05Z", "2016-12-22T15:00:00.000Z"), } result, err := svc.DescribeEvents(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elasticache.ErrCodeInvalidParameterValueException: fmt.Println(elasticache.ErrCodeInvalidParameterValueException, aerr.Error()) case elasticache.ErrCodeInvalidParameterCombinationException: fmt.Println(elasticache.ErrCodeInvalidParameterCombinationException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

DescribeEventsPages

func (c *ElastiCache) DescribeEventsPages(input *DescribeEventsInput, fn func(*DescribeEventsOutput, bool) bool) error

DescribeEventsPages iterates over the pages of a DescribeEvents operation, calling the "fn" function with the response data for each page. To stop iterating, return false from the fn function.

See DescribeEvents method for more information on how to use this operation.

Note: This operation can generate multiple requests to a service.

// Example iterating over at most 3 pages of a DescribeEvents operation. pageNum := 0 err := client.DescribeEventsPages(params, func(page *DescribeEventsOutput, lastPage bool) bool { pageNum++ fmt.Println(page) return pageNum <= 3 })

See Also

For more information about using this API, see AWS API Documentation.

DescribeEventsPagesWithContext

func (c *ElastiCache) DescribeEventsPagesWithContext(ctx aws.Context, input *DescribeEventsInput, fn func(*DescribeEventsOutput, bool) bool, opts ...request.Option) error

DescribeEventsPagesWithContext same as DescribeEventsPages except it takes a Context and allows setting request options on the pages.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DescribeEventsRequest

func (c *ElastiCache) DescribeEventsRequest(input *DescribeEventsInput) (req *request.Request, output *DescribeEventsOutput)

DescribeEventsRequest generates a "aws/request.Request" representing the client's request for the DescribeEvents operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DescribeEvents for more information on using the DescribeEvents API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DescribeEventsRequest method. req, resp := client.DescribeEventsRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeEvents

DescribeEventsWithContext

func (c *ElastiCache) DescribeEventsWithContext(ctx aws.Context, input *DescribeEventsInput, opts ...request.Option) (*DescribeEventsOutput, error)

DescribeEventsWithContext is the same as DescribeEvents with the addition of the ability to pass a context and additional request options.

See DescribeEvents for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DescribeReplicationGroups

func (c *ElastiCache) DescribeReplicationGroups(input *DescribeReplicationGroupsInput) (*DescribeReplicationGroupsOutput, error)

DescribeReplicationGroups API operation for Amazon ElastiCache.

Returns information about a particular replication group. If no identifier is specified, DescribeReplicationGroups returns information about all replication groups.

This operation is valid for Redis only.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon ElastiCache's API operation DescribeReplicationGroups for usage and error information.

Returned Error Codes:

  • ErrCodeReplicationGroupNotFoundFault "ReplicationGroupNotFoundFault" The specified replication group does not exist.

  • ErrCodeInvalidParameterValueException "InvalidParameterValue" The value for a parameter is invalid.

  • ErrCodeInvalidParameterCombinationException "InvalidParameterCombination" Two or more incompatible parameters were specified.

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeReplicationGroups

Example

ElastiCache DescribeReplicationGroups shared00

DescribeReplicationGroups

Returns information about the replication group myreplgroup.

{ svc := elasticache.New(session.New()) input := &elasticache.DescribeReplicationGroupsInput{} result, err := svc.DescribeReplicationGroups(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elasticache.ErrCodeReplicationGroupNotFoundFault: fmt.Println(elasticache.ErrCodeReplicationGroupNotFoundFault, aerr.Error()) case elasticache.ErrCodeInvalidParameterValueException: fmt.Println(elasticache.ErrCodeInvalidParameterValueException, aerr.Error()) case elasticache.ErrCodeInvalidParameterCombinationException: fmt.Println(elasticache.ErrCodeInvalidParameterCombinationException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

DescribeReplicationGroupsPages

func (c *ElastiCache) DescribeReplicationGroupsPages(input *DescribeReplicationGroupsInput, fn func(*DescribeReplicationGroupsOutput, bool) bool) error

DescribeReplicationGroupsPages iterates over the pages of a DescribeReplicationGroups operation, calling the "fn" function with the response data for each page. To stop iterating, return false from the fn function.

See DescribeReplicationGroups method for more information on how to use this operation.

Note: This operation can generate multiple requests to a service.

// Example iterating over at most 3 pages of a DescribeReplicationGroups operation. pageNum := 0 err := client.DescribeReplicationGroupsPages(params, func(page *DescribeReplicationGroupsOutput, lastPage bool) bool { pageNum++ fmt.Println(page) return pageNum <= 3 })

See Also

For more information about using this API, see AWS API Documentation.

DescribeReplicationGroupsPagesWithContext

func (c *ElastiCache) DescribeReplicationGroupsPagesWithContext(ctx aws.Context, input *DescribeReplicationGroupsInput, fn func(*DescribeReplicationGroupsOutput, bool) bool, opts ...request.Option) error

DescribeReplicationGroupsPagesWithContext same as DescribeReplicationGroupsPages except it takes a Context and allows setting request options on the pages.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DescribeReplicationGroupsRequest

func (c *ElastiCache) DescribeReplicationGroupsRequest(input *DescribeReplicationGroupsInput) (req *request.Request, output *DescribeReplicationGroupsOutput)

DescribeReplicationGroupsRequest generates a "aws/request.Request" representing the client's request for the DescribeReplicationGroups operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DescribeReplicationGroups for more information on using the DescribeReplicationGroups API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DescribeReplicationGroupsRequest method. req, resp := client.DescribeReplicationGroupsRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeReplicationGroups

DescribeReplicationGroupsWithContext

func (c *ElastiCache) DescribeReplicationGroupsWithContext(ctx aws.Context, input *DescribeReplicationGroupsInput, opts ...request.Option) (*DescribeReplicationGroupsOutput, error)

DescribeReplicationGroupsWithContext is the same as DescribeReplicationGroups with the addition of the ability to pass a context and additional request options.

See DescribeReplicationGroups for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DescribeReservedCacheNodes

func (c *ElastiCache) DescribeReservedCacheNodes(input *DescribeReservedCacheNodesInput) (*DescribeReservedCacheNodesOutput, error)

DescribeReservedCacheNodes API operation for Amazon ElastiCache.

Returns information about reserved cache nodes for this account, or about a specified reserved cache node.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon ElastiCache's API operation DescribeReservedCacheNodes for usage and error information.

Returned Error Codes:

  • ErrCodeReservedCacheNodeNotFoundFault "ReservedCacheNodeNotFound" The requested reserved cache node was not found.

  • ErrCodeInvalidParameterValueException "InvalidParameterValue" The value for a parameter is invalid.

  • ErrCodeInvalidParameterCombinationException "InvalidParameterCombination" Two or more incompatible parameters were specified.

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeReservedCacheNodes

Example

ElastiCache DescribeReservedCacheNodes shared00

DescribeReservedCacheNodes

Returns information about reserved cache nodes for this account, or about a specified reserved cache node. If the account has no reserved cache nodes, the operation returns an empty list, as shown here.

{ svc := elasticache.New(session.New()) input := &elasticache.DescribeReservedCacheNodesInput{ MaxRecords: aws.Int64(25), } result, err := svc.DescribeReservedCacheNodes(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elasticache.ErrCodeReservedCacheNodeNotFoundFault: fmt.Println(elasticache.ErrCodeReservedCacheNodeNotFoundFault, aerr.Error()) case elasticache.ErrCodeInvalidParameterValueException: fmt.Println(elasticache.ErrCodeInvalidParameterValueException, aerr.Error()) case elasticache.ErrCodeInvalidParameterCombinationException: fmt.Println(elasticache.ErrCodeInvalidParameterCombinationException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

DescribeReservedCacheNodesOfferings

func (c *ElastiCache) DescribeReservedCacheNodesOfferings(input *DescribeReservedCacheNodesOfferingsInput) (*DescribeReservedCacheNodesOfferingsOutput, error)

DescribeReservedCacheNodesOfferings API operation for Amazon ElastiCache.

Lists available reserved cache node offerings.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon ElastiCache's API operation DescribeReservedCacheNodesOfferings for usage and error information.

Returned Error Codes:

  • ErrCodeReservedCacheNodesOfferingNotFoundFault "ReservedCacheNodesOfferingNotFound" The requested cache node offering does not exist.

  • ErrCodeInvalidParameterValueException "InvalidParameterValue" The value for a parameter is invalid.

  • ErrCodeInvalidParameterCombinationException "InvalidParameterCombination" Two or more incompatible parameters were specified.

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeReservedCacheNodesOfferings

Examples

ElastiCache DescribeReservedCacheNodesOfferings shared00

DescribeReseredCacheNodeOfferings

Lists available reserved cache node offerings.

{ svc := elasticache.New(session.New()) input := &elasticache.DescribeReservedCacheNodesOfferingsInput{ MaxRecords: aws.Int64(20), } result, err := svc.DescribeReservedCacheNodesOfferings(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elasticache.ErrCodeReservedCacheNodesOfferingNotFoundFault: fmt.Println(elasticache.ErrCodeReservedCacheNodesOfferingNotFoundFault, aerr.Error()) case elasticache.ErrCodeInvalidParameterValueException: fmt.Println(elasticache.ErrCodeInvalidParameterValueException, aerr.Error()) case elasticache.ErrCodeInvalidParameterCombinationException: fmt.Println(elasticache.ErrCodeInvalidParameterCombinationException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }
ElastiCache DescribeReservedCacheNodesOfferings shared01

DescribeReseredCacheNodeOfferings

Lists available reserved cache node offerings for cache.r3.large nodes with a 3 year commitment.

{ svc := elasticache.New(session.New()) input := &elasticache.DescribeReservedCacheNodesOfferingsInput{ CacheNodeType: aws.String("cache.r3.large"), Duration: aws.String("3"), MaxRecords: aws.Int64(25), OfferingType: aws.String("Light Utilization"), ReservedCacheNodesOfferingId: aws.String(""), } result, err := svc.DescribeReservedCacheNodesOfferings(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elasticache.ErrCodeReservedCacheNodesOfferingNotFoundFault: fmt.Println(elasticache.ErrCodeReservedCacheNodesOfferingNotFoundFault, aerr.Error()) case elasticache.ErrCodeInvalidParameterValueException: fmt.Println(elasticache.ErrCodeInvalidParameterValueException, aerr.Error()) case elasticache.ErrCodeInvalidParameterCombinationException: fmt.Println(elasticache.ErrCodeInvalidParameterCombinationException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }
ElastiCache DescribeReservedCacheNodesOfferings shared02

DescribeReseredCacheNodeOfferings

Lists available reserved cache node offerings.

{ svc := elasticache.New(session.New()) input := &elasticache.DescribeReservedCacheNodesOfferingsInput{ CacheNodeType: aws.String(""), Duration: aws.String(""), Marker: aws.String(""), MaxRecords: aws.Int64(25), OfferingType: aws.String(""), ProductDescription: aws.String(""), ReservedCacheNodesOfferingId: aws.String("438012d3-4052-4cc7-b2e3-8d3372e0e706"), } result, err := svc.DescribeReservedCacheNodesOfferings(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elasticache.ErrCodeReservedCacheNodesOfferingNotFoundFault: fmt.Println(elasticache.ErrCodeReservedCacheNodesOfferingNotFoundFault, aerr.Error()) case elasticache.ErrCodeInvalidParameterValueException: fmt.Println(elasticache.ErrCodeInvalidParameterValueException, aerr.Error()) case elasticache.ErrCodeInvalidParameterCombinationException: fmt.Println(elasticache.ErrCodeInvalidParameterCombinationException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

DescribeReservedCacheNodesOfferingsPages

func (c *ElastiCache) DescribeReservedCacheNodesOfferingsPages(input *DescribeReservedCacheNodesOfferingsInput, fn func(*DescribeReservedCacheNodesOfferingsOutput, bool) bool) error

DescribeReservedCacheNodesOfferingsPages iterates over the pages of a DescribeReservedCacheNodesOfferings operation, calling the "fn" function with the response data for each page. To stop iterating, return false from the fn function.

See DescribeReservedCacheNodesOfferings method for more information on how to use this operation.

Note: This operation can generate multiple requests to a service.

// Example iterating over at most 3 pages of a DescribeReservedCacheNodesOfferings operation. pageNum := 0 err := client.DescribeReservedCacheNodesOfferingsPages(params, func(page *DescribeReservedCacheNodesOfferingsOutput, lastPage bool) bool { pageNum++ fmt.Println(page) return pageNum <= 3 })

See Also

For more information about using this API, see AWS API Documentation.

DescribeReservedCacheNodesOfferingsPagesWithContext

func (c *ElastiCache) DescribeReservedCacheNodesOfferingsPagesWithContext(ctx aws.Context, input *DescribeReservedCacheNodesOfferingsInput, fn func(*DescribeReservedCacheNodesOfferingsOutput, bool) bool, opts ...request.Option) error

DescribeReservedCacheNodesOfferingsPagesWithContext same as DescribeReservedCacheNodesOfferingsPages except it takes a Context and allows setting request options on the pages.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DescribeReservedCacheNodesOfferingsRequest

func (c *ElastiCache) DescribeReservedCacheNodesOfferingsRequest(input *DescribeReservedCacheNodesOfferingsInput) (req *request.Request, output *DescribeReservedCacheNodesOfferingsOutput)

DescribeReservedCacheNodesOfferingsRequest generates a "aws/request.Request" representing the client's request for the DescribeReservedCacheNodesOfferings operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DescribeReservedCacheNodesOfferings for more information on using the DescribeReservedCacheNodesOfferings API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DescribeReservedCacheNodesOfferingsRequest method. req, resp := client.DescribeReservedCacheNodesOfferingsRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeReservedCacheNodesOfferings

DescribeReservedCacheNodesOfferingsWithContext

func (c *ElastiCache) DescribeReservedCacheNodesOfferingsWithContext(ctx aws.Context, input *DescribeReservedCacheNodesOfferingsInput, opts ...request.Option) (*DescribeReservedCacheNodesOfferingsOutput, error)

DescribeReservedCacheNodesOfferingsWithContext is the same as DescribeReservedCacheNodesOfferings with the addition of the ability to pass a context and additional request options.

See DescribeReservedCacheNodesOfferings for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DescribeReservedCacheNodesPages

func (c *ElastiCache) DescribeReservedCacheNodesPages(input *DescribeReservedCacheNodesInput, fn func(*DescribeReservedCacheNodesOutput, bool) bool) error

DescribeReservedCacheNodesPages iterates over the pages of a DescribeReservedCacheNodes operation, calling the "fn" function with the response data for each page. To stop iterating, return false from the fn function.

See DescribeReservedCacheNodes method for more information on how to use this operation.

Note: This operation can generate multiple requests to a service.

// Example iterating over at most 3 pages of a DescribeReservedCacheNodes operation. pageNum := 0 err := client.DescribeReservedCacheNodesPages(params, func(page *DescribeReservedCacheNodesOutput, lastPage bool) bool { pageNum++ fmt.Println(page) return pageNum <= 3 })

See Also

For more information about using this API, see AWS API Documentation.

DescribeReservedCacheNodesPagesWithContext

func (c *ElastiCache) DescribeReservedCacheNodesPagesWithContext(ctx aws.Context, input *DescribeReservedCacheNodesInput, fn func(*DescribeReservedCacheNodesOutput, bool) bool, opts ...request.Option) error

DescribeReservedCacheNodesPagesWithContext same as DescribeReservedCacheNodesPages except it takes a Context and allows setting request options on the pages.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DescribeReservedCacheNodesRequest

func (c *ElastiCache) DescribeReservedCacheNodesRequest(input *DescribeReservedCacheNodesInput) (req *request.Request, output *DescribeReservedCacheNodesOutput)

DescribeReservedCacheNodesRequest generates a "aws/request.Request" representing the client's request for the DescribeReservedCacheNodes operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DescribeReservedCacheNodes for more information on using the DescribeReservedCacheNodes API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DescribeReservedCacheNodesRequest method. req, resp := client.DescribeReservedCacheNodesRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeReservedCacheNodes

DescribeReservedCacheNodesWithContext

func (c *ElastiCache) DescribeReservedCacheNodesWithContext(ctx aws.Context, input *DescribeReservedCacheNodesInput, opts ...request.Option) (*DescribeReservedCacheNodesOutput, error)

DescribeReservedCacheNodesWithContext is the same as DescribeReservedCacheNodes with the addition of the ability to pass a context and additional request options.

See DescribeReservedCacheNodes for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DescribeSnapshots

func (c *ElastiCache) DescribeSnapshots(input *DescribeSnapshotsInput) (*DescribeSnapshotsOutput, error)

DescribeSnapshots API operation for Amazon ElastiCache.

Returns information about cluster or replication group snapshots. By default, DescribeSnapshots lists all of your snapshots; it can optionally describe a single snapshot, or just the snapshots associated with a particular cache cluster.

This operation is valid for Redis only.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon ElastiCache's API operation DescribeSnapshots for usage and error information.

Returned Error Codes:

  • ErrCodeCacheClusterNotFoundFault "CacheClusterNotFound" The requested cluster ID does not refer to an existing cluster.

  • ErrCodeSnapshotNotFoundFault "SnapshotNotFoundFault" The requested snapshot name does not refer to an existing snapshot.

  • ErrCodeInvalidParameterValueException "InvalidParameterValue" The value for a parameter is invalid.

  • ErrCodeInvalidParameterCombinationException "InvalidParameterCombination" Two or more incompatible parameters were specified.

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeSnapshots

Example

ElastiCache DescribeSnapshots shared00

DescribeSnapshots

Returns information about the snapshot mysnapshot. By default.

{ svc := elasticache.New(session.New()) input := &elasticache.DescribeSnapshotsInput{ SnapshotName: aws.String("snapshot-20161212"), } result, err := svc.DescribeSnapshots(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elasticache.ErrCodeCacheClusterNotFoundFault: fmt.Println(elasticache.ErrCodeCacheClusterNotFoundFault, aerr.Error()) case elasticache.ErrCodeSnapshotNotFoundFault: fmt.Println(elasticache.ErrCodeSnapshotNotFoundFault, aerr.Error()) case elasticache.ErrCodeInvalidParameterValueException: fmt.Println(elasticache.ErrCodeInvalidParameterValueException, aerr.Error()) case elasticache.ErrCodeInvalidParameterCombinationException: fmt.Println(elasticache.ErrCodeInvalidParameterCombinationException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

DescribeSnapshotsPages

func (c *ElastiCache) DescribeSnapshotsPages(input *DescribeSnapshotsInput, fn func(*DescribeSnapshotsOutput, bool) bool) error

DescribeSnapshotsPages iterates over the pages of a DescribeSnapshots operation, calling the "fn" function with the response data for each page. To stop iterating, return false from the fn function.

See DescribeSnapshots method for more information on how to use this operation.

Note: This operation can generate multiple requests to a service.

// Example iterating over at most 3 pages of a DescribeSnapshots operation. pageNum := 0 err := client.DescribeSnapshotsPages(params, func(page *DescribeSnapshotsOutput, lastPage bool) bool { pageNum++ fmt.Println(page) return pageNum <= 3 })

See Also

For more information about using this API, see AWS API Documentation.

DescribeSnapshotsPagesWithContext

func (c *ElastiCache) DescribeSnapshotsPagesWithContext(ctx aws.Context, input *DescribeSnapshotsInput, fn func(*DescribeSnapshotsOutput, bool) bool, opts ...request.Option) error

DescribeSnapshotsPagesWithContext same as DescribeSnapshotsPages except it takes a Context and allows setting request options on the pages.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DescribeSnapshotsRequest

func (c *ElastiCache) DescribeSnapshotsRequest(input *DescribeSnapshotsInput) (req *request.Request, output *DescribeSnapshotsOutput)

DescribeSnapshotsRequest generates a "aws/request.Request" representing the client's request for the DescribeSnapshots operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DescribeSnapshots for more information on using the DescribeSnapshots API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DescribeSnapshotsRequest method. req, resp := client.DescribeSnapshotsRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/DescribeSnapshots

DescribeSnapshotsWithContext

func (c *ElastiCache) DescribeSnapshotsWithContext(ctx aws.Context, input *DescribeSnapshotsInput, opts ...request.Option) (*DescribeSnapshotsOutput, error)

DescribeSnapshotsWithContext is the same as DescribeSnapshots with the addition of the ability to pass a context and additional request options.

See DescribeSnapshots for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

IncreaseReplicaCount

func (c *ElastiCache) IncreaseReplicaCount(input *IncreaseReplicaCountInput) (*IncreaseReplicaCountOutput, error)

IncreaseReplicaCount API operation for Amazon ElastiCache.

Dynamically increases the number of replics in a Redis (cluster mode disabled) replication group or the number of replica nodes in one or more node groups (shards) of a Redis (cluster mode enabled) replication group. This operation is performed with no cluster down time.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon ElastiCache's API operation IncreaseReplicaCount for usage and error information.

Returned Error Codes:

  • ErrCodeReplicationGroupNotFoundFault "ReplicationGroupNotFoundFault" The specified replication group does not exist.

  • ErrCodeInvalidReplicationGroupStateFault "InvalidReplicationGroupState" The requested replication group is not in the available state.

  • ErrCodeInvalidCacheClusterStateFault "InvalidCacheClusterState" The requested cluster is not in the available state.

  • ErrCodeInvalidVPCNetworkStateFault "InvalidVPCNetworkStateFault" The VPC network is in an invalid state.

  • ErrCodeInsufficientCacheClusterCapacityFault "InsufficientCacheClusterCapacity" The requested cache node type is not available in the specified Availability Zone.

  • ErrCodeClusterQuotaForCustomerExceededFault "ClusterQuotaForCustomerExceeded" The request cannot be processed because it would exceed the allowed number of clusters per customer.

  • ErrCodeNodeGroupsPerReplicationGroupQuotaExceededFault "NodeGroupsPerReplicationGroupQuotaExceeded" The request cannot be processed because it would exceed the maximum allowed number of node groups (shards) in a single replication group. The default maximum is 15

  • ErrCodeNodeQuotaForCustomerExceededFault "NodeQuotaForCustomerExceeded" The request cannot be processed because it would exceed the allowed number of cache nodes per customer.

  • ErrCodeNoOperationFault "NoOperationFault" The operation was not performed because no changes were required.

  • ErrCodeInvalidParameterValueException "InvalidParameterValue" The value for a parameter is invalid.

  • ErrCodeInvalidParameterCombinationException "InvalidParameterCombination" Two or more incompatible parameters were specified.

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/IncreaseReplicaCount

IncreaseReplicaCountRequest

func (c *ElastiCache) IncreaseReplicaCountRequest(input *IncreaseReplicaCountInput) (req *request.Request, output *IncreaseReplicaCountOutput)

IncreaseReplicaCountRequest generates a "aws/request.Request" representing the client's request for the IncreaseReplicaCount operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See IncreaseReplicaCount for more information on using the IncreaseReplicaCount API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the IncreaseReplicaCountRequest method. req, resp := client.IncreaseReplicaCountRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/IncreaseReplicaCount

IncreaseReplicaCountWithContext

func (c *ElastiCache) IncreaseReplicaCountWithContext(ctx aws.Context, input *IncreaseReplicaCountInput, opts ...request.Option) (*IncreaseReplicaCountOutput, error)

IncreaseReplicaCountWithContext is the same as IncreaseReplicaCount with the addition of the ability to pass a context and additional request options.

See IncreaseReplicaCount for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

ListAllowedNodeTypeModifications

func (c *ElastiCache) ListAllowedNodeTypeModifications(input *ListAllowedNodeTypeModificationsInput) (*ListAllowedNodeTypeModificationsOutput, error)

ListAllowedNodeTypeModifications API operation for Amazon ElastiCache.

Lists all available node types that you can scale your Redis cluster's or replication group's current node type up to.

When you use the ModifyCacheCluster or ModifyReplicationGroup operations to scale up your cluster or replication group, the value of the CacheNodeType parameter must be one of the node types returned by this operation.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon ElastiCache's API operation ListAllowedNodeTypeModifications for usage and error information.

Returned Error Codes:

  • ErrCodeCacheClusterNotFoundFault "CacheClusterNotFound" The requested cluster ID does not refer to an existing cluster.

  • ErrCodeReplicationGroupNotFoundFault "ReplicationGroupNotFoundFault" The specified replication group does not exist.

  • ErrCodeInvalidParameterCombinationException "InvalidParameterCombination" Two or more incompatible parameters were specified.

  • ErrCodeInvalidParameterValueException "InvalidParameterValue" The value for a parameter is invalid.

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/ListAllowedNodeTypeModifications

Examples

ElastiCache ListAllowedNodeTypeModifications shared00

ListAllowedNodeTypeModifications

Lists all available node types that you can scale your Redis cluster's or replication group's current node type up to.

{ svc := elasticache.New(session.New()) input := &elasticache.ListAllowedNodeTypeModificationsInput{ ReplicationGroupId: aws.String("myreplgroup"), } result, err := svc.ListAllowedNodeTypeModifications(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elasticache.ErrCodeCacheClusterNotFoundFault: fmt.Println(elasticache.ErrCodeCacheClusterNotFoundFault, aerr.Error()) case elasticache.ErrCodeReplicationGroupNotFoundFault: fmt.Println(elasticache.ErrCodeReplicationGroupNotFoundFault, aerr.Error()) case elasticache.ErrCodeInvalidParameterCombinationException: fmt.Println(elasticache.ErrCodeInvalidParameterCombinationException, aerr.Error()) case elasticache.ErrCodeInvalidParameterValueException: fmt.Println(elasticache.ErrCodeInvalidParameterValueException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }
ElastiCache ListAllowedNodeTypeModifications shared01

ListAllowedNodeTypeModifications

Lists all available node types that you can scale your Redis cluster's or replication group's current node type up to.

{ svc := elasticache.New(session.New()) input := &elasticache.ListAllowedNodeTypeModificationsInput{ CacheClusterId: aws.String("mycluster"), } result, err := svc.ListAllowedNodeTypeModifications(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elasticache.ErrCodeCacheClusterNotFoundFault: fmt.Println(elasticache.ErrCodeCacheClusterNotFoundFault, aerr.Error()) case elasticache.ErrCodeReplicationGroupNotFoundFault: fmt.Println(elasticache.ErrCodeReplicationGroupNotFoundFault, aerr.Error()) case elasticache.ErrCodeInvalidParameterCombinationException: fmt.Println(elasticache.ErrCodeInvalidParameterCombinationException, aerr.Error()) case elasticache.ErrCodeInvalidParameterValueException: fmt.Println(elasticache.ErrCodeInvalidParameterValueException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

ListAllowedNodeTypeModificationsRequest

func (c *ElastiCache) ListAllowedNodeTypeModificationsRequest(input *ListAllowedNodeTypeModificationsInput) (req *request.Request, output *ListAllowedNodeTypeModificationsOutput)

ListAllowedNodeTypeModificationsRequest generates a "aws/request.Request" representing the client's request for the ListAllowedNodeTypeModifications operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See ListAllowedNodeTypeModifications for more information on using the ListAllowedNodeTypeModifications API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the ListAllowedNodeTypeModificationsRequest method. req, resp := client.ListAllowedNodeTypeModificationsRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/ListAllowedNodeTypeModifications

ListAllowedNodeTypeModificationsWithContext

func (c *ElastiCache) ListAllowedNodeTypeModificationsWithContext(ctx aws.Context, input *ListAllowedNodeTypeModificationsInput, opts ...request.Option) (*ListAllowedNodeTypeModificationsOutput, error)

ListAllowedNodeTypeModificationsWithContext is the same as ListAllowedNodeTypeModifications with the addition of the ability to pass a context and additional request options.

See ListAllowedNodeTypeModifications for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

ListTagsForResource

func (c *ElastiCache) ListTagsForResource(input *ListTagsForResourceInput) (*TagListMessage, error)

ListTagsForResource API operation for Amazon ElastiCache.

Lists all cost allocation tags currently on the named resource. A cost allocation tag is a key-value pair where the key is case-sensitive and the value is optional. You can use cost allocation tags to categorize and track your AWS costs.

If the cluster is not in the available state, ListTagsForResource returns an error.

You can have a maximum of 50 cost allocation tags on an ElastiCache resource. For more information, see Monitoring Costs with Tags (https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/Tagging.html).

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon ElastiCache's API operation ListTagsForResource for usage and error information.

Returned Error Codes:

  • ErrCodeCacheClusterNotFoundFault "CacheClusterNotFound" The requested cluster ID does not refer to an existing cluster.

  • ErrCodeSnapshotNotFoundFault "SnapshotNotFoundFault" The requested snapshot name does not refer to an existing snapshot.

  • ErrCodeInvalidARNFault "InvalidARN" The requested Amazon Resource Name (ARN) does not refer to an existing resource.

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/ListTagsForResource

Example

ElastiCache ListTagsForResource shared00

ListTagsForResource

Lists all cost allocation tags currently on the named resource. A cost allocation tag is a key-value pair where the key is case-sensitive and the value is optional. You can use cost allocation tags to categorize and track your AWS costs.

{ svc := elasticache.New(session.New()) input := &elasticache.ListTagsForResourceInput{ ResourceName: aws.String("arn:aws:elasticache:us-west-2:<my-account-id>:cluster:mycluster"), } result, err := svc.ListTagsForResource(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elasticache.ErrCodeCacheClusterNotFoundFault: fmt.Println(elasticache.ErrCodeCacheClusterNotFoundFault, aerr.Error()) case elasticache.ErrCodeSnapshotNotFoundFault: fmt.Println(elasticache.ErrCodeSnapshotNotFoundFault, aerr.Error()) case elasticache.ErrCodeInvalidARNFault: fmt.Println(elasticache.ErrCodeInvalidARNFault, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

ListTagsForResourceRequest

func (c *ElastiCache) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *TagListMessage)

ListTagsForResourceRequest generates a "aws/request.Request" representing the client's request for the ListTagsForResource operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See ListTagsForResource for more information on using the ListTagsForResource API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the ListTagsForResourceRequest method. req, resp := client.ListTagsForResourceRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/ListTagsForResource

ListTagsForResourceWithContext

func (c *ElastiCache) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*TagListMessage, error)

ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of the ability to pass a context and additional request options.

See ListTagsForResource for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

ModifyCacheCluster

func (c *ElastiCache) ModifyCacheCluster(input *ModifyCacheClusterInput) (*ModifyCacheClusterOutput, error)

ModifyCacheCluster API operation for Amazon ElastiCache.

Modifies the settings for a cluster. You can use this operation to change one or more cluster configuration parameters by specifying the parameters and the new values.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon ElastiCache's API operation ModifyCacheCluster for usage and error information.

Returned Error Codes:

  • ErrCodeInvalidCacheClusterStateFault "InvalidCacheClusterState" The requested cluster is not in the available state.

  • ErrCodeInvalidCacheSecurityGroupStateFault "InvalidCacheSecurityGroupState" The current state of the cache security group does not allow deletion.

  • ErrCodeInsufficientCacheClusterCapacityFault "InsufficientCacheClusterCapacity" The requested cache node type is not available in the specified Availability Zone.

  • ErrCodeCacheClusterNotFoundFault "CacheClusterNotFound" The requested cluster ID does not refer to an existing cluster.

  • ErrCodeNodeQuotaForClusterExceededFault "NodeQuotaForClusterExceeded" The request cannot be processed because it would exceed the allowed number of cache nodes in a single cluster.

  • ErrCodeNodeQuotaForCustomerExceededFault "NodeQuotaForCustomerExceeded" The request cannot be processed because it would exceed the allowed number of cache nodes per customer.

  • ErrCodeCacheSecurityGroupNotFoundFault "CacheSecurityGroupNotFound" The requested cache security group name does not refer to an existing cache security group.

  • ErrCodeCacheParameterGroupNotFoundFault "CacheParameterGroupNotFound" The requested cache parameter group name does not refer to an existing cache parameter group.

  • ErrCodeInvalidVPCNetworkStateFault "InvalidVPCNetworkStateFault" The VPC network is in an invalid state.

  • ErrCodeInvalidParameterValueException "InvalidParameterValue" The value for a parameter is invalid.

  • ErrCodeInvalidParameterCombinationException "InvalidParameterCombination" Two or more incompatible parameters were specified.

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/ModifyCacheCluster

Example

ElastiCache ModifyCacheCluster shared00

ModifyCacheCluster

Copies a snapshot to a specified name.

{ svc := elasticache.New(session.New()) input := &elasticache.ModifyCacheClusterInput{ ApplyImmediately: aws.Bool(true), CacheClusterId: aws.String("redis-cluster"), SnapshotRetentionLimit: aws.Int64(14), } result, err := svc.ModifyCacheCluster(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elasticache.ErrCodeInvalidCacheClusterStateFault: fmt.Println(elasticache.ErrCodeInvalidCacheClusterStateFault, aerr.Error()) case elasticache.ErrCodeInvalidCacheSecurityGroupStateFault: fmt.Println(elasticache.ErrCodeInvalidCacheSecurityGroupStateFault, aerr.Error()) case elasticache.ErrCodeInsufficientCacheClusterCapacityFault: fmt.Println(elasticache.ErrCodeInsufficientCacheClusterCapacityFault, aerr.Error()) case elasticache.ErrCodeCacheClusterNotFoundFault: fmt.Println(elasticache.ErrCodeCacheClusterNotFoundFault, aerr.Error()) case elasticache.ErrCodeNodeQuotaForClusterExceededFault: fmt.Println(elasticache.ErrCodeNodeQuotaForClusterExceededFault, aerr.Error()) case elasticache.ErrCodeNodeQuotaForCustomerExceededFault: fmt.Println(elasticache.ErrCodeNodeQuotaForCustomerExceededFault, aerr.Error()) case elasticache.ErrCodeCacheSecurityGroupNotFoundFault: fmt.Println(elasticache.ErrCodeCacheSecurityGroupNotFoundFault, aerr.Error()) case elasticache.ErrCodeCacheParameterGroupNotFoundFault: fmt.Println(elasticache.ErrCodeCacheParameterGroupNotFoundFault, aerr.Error()) case elasticache.ErrCodeInvalidVPCNetworkStateFault: fmt.Println(elasticache.ErrCodeInvalidVPCNetworkStateFault, aerr.Error()) case elasticache.ErrCodeInvalidParameterValueException: fmt.Println(elasticache.ErrCodeInvalidParameterValueException, aerr.Error()) case elasticache.ErrCodeInvalidParameterCombinationException: fmt.Println(elasticache.ErrCodeInvalidParameterCombinationException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

ModifyCacheClusterRequest

func (c *ElastiCache) ModifyCacheClusterRequest(input *ModifyCacheClusterInput) (req *request.Request, output *ModifyCacheClusterOutput)

ModifyCacheClusterRequest generates a "aws/request.Request" representing the client's request for the ModifyCacheCluster operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See ModifyCacheCluster for more information on using the ModifyCacheCluster API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the ModifyCacheClusterRequest method. req, resp := client.ModifyCacheClusterRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/ModifyCacheCluster

ModifyCacheClusterWithContext

func (c *ElastiCache) ModifyCacheClusterWithContext(ctx aws.Context, input *ModifyCacheClusterInput, opts ...request.Option) (*ModifyCacheClusterOutput, error)

ModifyCacheClusterWithContext is the same as ModifyCacheCluster with the addition of the ability to pass a context and additional request options.

See ModifyCacheCluster for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

ModifyCacheParameterGroup

func (c *ElastiCache) ModifyCacheParameterGroup(input *ModifyCacheParameterGroupInput) (*CacheParameterGroupNameMessage, error)

ModifyCacheParameterGroup API operation for Amazon ElastiCache.

Modifies the parameters of a cache parameter group. You can modify up to 20 parameters in a single request by submitting a list parameter name and value pairs.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon ElastiCache's API operation ModifyCacheParameterGroup for usage and error information.

Returned Error Codes:

  • ErrCodeCacheParameterGroupNotFoundFault "CacheParameterGroupNotFound" The requested cache parameter group name does not refer to an existing cache parameter group.

  • ErrCodeInvalidCacheParameterGroupStateFault "InvalidCacheParameterGroupState" The current state of the cache parameter group does not allow the requested operation to occur.

  • ErrCodeInvalidParameterValueException "InvalidParameterValue" The value for a parameter is invalid.

  • ErrCodeInvalidParameterCombinationException "InvalidParameterCombination" Two or more incompatible parameters were specified.

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/ModifyCacheParameterGroup

Example

ElastiCache ModifyCacheParameterGroup shared00

ModifyCacheParameterGroup

Modifies one or more parameter values in the specified parameter group. You cannot modify any default parameter group.

{ svc := elasticache.New(session.New()) input := &elasticache.ModifyCacheParameterGroupInput{ CacheParameterGroupName: aws.String("custom-mem1-4"), ParameterNameValues: []*elasticache.ParameterNameValue{ { ParameterName: aws.String("binding_protocol"), ParameterValue: aws.String("ascii"), }, { ParameterName: aws.String("chunk_size"), ParameterValue: aws.String("96"), }, }, } result, err := svc.ModifyCacheParameterGroup(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elasticache.ErrCodeCacheParameterGroupNotFoundFault: fmt.Println(elasticache.ErrCodeCacheParameterGroupNotFoundFault, aerr.Error()) case elasticache.ErrCodeInvalidCacheParameterGroupStateFault: fmt.Println(elasticache.ErrCodeInvalidCacheParameterGroupStateFault, aerr.Error()) case elasticache.ErrCodeInvalidParameterValueException: fmt.Println(elasticache.ErrCodeInvalidParameterValueException, aerr.Error()) case elasticache.ErrCodeInvalidParameterCombinationException: fmt.Println(elasticache.ErrCodeInvalidParameterCombinationException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

ModifyCacheParameterGroupRequest

func (c *ElastiCache) ModifyCacheParameterGroupRequest(input *ModifyCacheParameterGroupInput) (req *request.Request, output *CacheParameterGroupNameMessage)

ModifyCacheParameterGroupRequest generates a "aws/request.Request" representing the client's request for the ModifyCacheParameterGroup operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See ModifyCacheParameterGroup for more information on using the ModifyCacheParameterGroup API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the ModifyCacheParameterGroupRequest method. req, resp := client.ModifyCacheParameterGroupRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/ModifyCacheParameterGroup

ModifyCacheParameterGroupWithContext

func (c *ElastiCache) ModifyCacheParameterGroupWithContext(ctx aws.Context, input *ModifyCacheParameterGroupInput, opts ...request.Option) (*CacheParameterGroupNameMessage, error)

ModifyCacheParameterGroupWithContext is the same as ModifyCacheParameterGroup with the addition of the ability to pass a context and additional request options.

See ModifyCacheParameterGroup for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

ModifyCacheSubnetGroup

func (c *ElastiCache) ModifyCacheSubnetGroup(input *ModifyCacheSubnetGroupInput) (*ModifyCacheSubnetGroupOutput, error)

ModifyCacheSubnetGroup API operation for Amazon ElastiCache.

Modifies an existing cache subnet group.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon ElastiCache's API operation ModifyCacheSubnetGroup for usage and error information.

Returned Error Codes:

  • ErrCodeCacheSubnetGroupNotFoundFault "CacheSubnetGroupNotFoundFault" The requested cache subnet group name does not refer to an existing cache subnet group.

  • ErrCodeCacheSubnetQuotaExceededFault "CacheSubnetQuotaExceededFault" The request cannot be processed because it would exceed the allowed number of subnets in a cache subnet group.

  • ErrCodeSubnetInUse "SubnetInUse" The requested subnet is being used by another cache subnet group.

  • ErrCodeInvalidSubnet "InvalidSubnet" An invalid subnet identifier was specified.

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/ModifyCacheSubnetGroup

Example

ElastiCache ModifyCacheSubnetGroup shared00

ModifyCacheSubnetGroup

Modifies an existing ElastiCache subnet group.

{ svc := elasticache.New(session.New()) input := &elasticache.ModifyCacheSubnetGroupInput{ CacheSubnetGroupName: aws.String("my-sn-grp"), SubnetIds: []*string{ aws.String("subnet-bcde2345"), }, } result, err := svc.ModifyCacheSubnetGroup(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elasticache.ErrCodeCacheSubnetGroupNotFoundFault: fmt.Println(elasticache.ErrCodeCacheSubnetGroupNotFoundFault, aerr.Error()) case elasticache.ErrCodeCacheSubnetQuotaExceededFault: fmt.Println(elasticache.ErrCodeCacheSubnetQuotaExceededFault, aerr.Error()) case elasticache.ErrCodeSubnetInUse: fmt.Println(elasticache.ErrCodeSubnetInUse, aerr.Error()) case elasticache.ErrCodeInvalidSubnet: fmt.Println(elasticache.ErrCodeInvalidSubnet, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

ModifyCacheSubnetGroupRequest

func (c *ElastiCache) ModifyCacheSubnetGroupRequest(input *ModifyCacheSubnetGroupInput) (req *request.Request, output *ModifyCacheSubnetGroupOutput)

ModifyCacheSubnetGroupRequest generates a "aws/request.Request" representing the client's request for the ModifyCacheSubnetGroup operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See ModifyCacheSubnetGroup for more information on using the ModifyCacheSubnetGroup API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the ModifyCacheSubnetGroupRequest method. req, resp := client.ModifyCacheSubnetGroupRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/ModifyCacheSubnetGroup

ModifyCacheSubnetGroupWithContext

func (c *ElastiCache) ModifyCacheSubnetGroupWithContext(ctx aws.Context, input *ModifyCacheSubnetGroupInput, opts ...request.Option) (*ModifyCacheSubnetGroupOutput, error)

ModifyCacheSubnetGroupWithContext is the same as ModifyCacheSubnetGroup with the addition of the ability to pass a context and additional request options.

See ModifyCacheSubnetGroup for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

ModifyReplicationGroup

func (c *ElastiCache) ModifyReplicationGroup(input *ModifyReplicationGroupInput) (*ModifyReplicationGroupOutput, error)

ModifyReplicationGroup API operation for Amazon ElastiCache.

Modifies the settings for a replication group.

For Redis (cluster mode enabled) clusters, this operation cannot be used to change a cluster's node type or engine version. For more information, see:

  • Scaling for Amazon ElastiCache for Redis—Redis (cluster mode enabled)

(http://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/scaling-redis-cluster-mode-enabled.html) in the ElastiCache User Guide

This operation is valid for Redis only.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon ElastiCache's API operation ModifyReplicationGroup for usage and error information.

Returned Error Codes:

  • ErrCodeReplicationGroupNotFoundFault "ReplicationGroupNotFoundFault" The specified replication group does not exist.

  • ErrCodeInvalidReplicationGroupStateFault "InvalidReplicationGroupState" The requested replication group is not in the available state.

  • ErrCodeInvalidCacheClusterStateFault "InvalidCacheClusterState" The requested cluster is not in the available state.

  • ErrCodeInvalidCacheSecurityGroupStateFault "InvalidCacheSecurityGroupState" The current state of the cache security group does not allow deletion.

  • ErrCodeInsufficientCacheClusterCapacityFault "InsufficientCacheClusterCapacity" The requested cache node type is not available in the specified Availability Zone.

  • ErrCodeCacheClusterNotFoundFault "CacheClusterNotFound" The requested cluster ID does not refer to an existing cluster.

  • ErrCodeNodeQuotaForClusterExceededFault "NodeQuotaForClusterExceeded" The request cannot be processed because it would exceed the allowed number of cache nodes in a single cluster.

  • ErrCodeNodeQuotaForCustomerExceededFault "NodeQuotaForCustomerExceeded" The request cannot be processed because it would exceed the allowed number of cache nodes per customer.

  • ErrCodeCacheSecurityGroupNotFoundFault "CacheSecurityGroupNotFound" The requested cache security group name does not refer to an existing cache security group.

  • ErrCodeCacheParameterGroupNotFoundFault "CacheParameterGroupNotFound" The requested cache parameter group name does not refer to an existing cache parameter group.

  • ErrCodeInvalidVPCNetworkStateFault "InvalidVPCNetworkStateFault" The VPC network is in an invalid state.

  • ErrCodeInvalidParameterValueException "InvalidParameterValue" The value for a parameter is invalid.

  • ErrCodeInvalidParameterCombinationException "InvalidParameterCombination" Two or more incompatible parameters were specified.

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/ModifyReplicationGroup

Example

ElastiCache ModifyReplicationGroup shared00
{ svc := elasticache.New(session.New()) input := &elasticache.ModifyReplicationGroupInput{ ApplyImmediately: aws.Bool(true), ReplicationGroupDescription: aws.String("Modified replication group"), ReplicationGroupId: aws.String("my-redis-rg"), SnapshotRetentionLimit: aws.Int64(30), SnapshottingClusterId: aws.String("my-redis-rg-001"), } result, err := svc.ModifyReplicationGroup(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elasticache.ErrCodeReplicationGroupNotFoundFault: fmt.Println(elasticache.ErrCodeReplicationGroupNotFoundFault, aerr.Error()) case elasticache.ErrCodeInvalidReplicationGroupStateFault: fmt.Println(elasticache.ErrCodeInvalidReplicationGroupStateFault, aerr.Error()) case elasticache.ErrCodeInvalidCacheClusterStateFault: fmt.Println(elasticache.ErrCodeInvalidCacheClusterStateFault, aerr.Error()) case elasticache.ErrCodeInvalidCacheSecurityGroupStateFault: fmt.Println(elasticache.ErrCodeInvalidCacheSecurityGroupStateFault, aerr.Error()) case elasticache.ErrCodeInsufficientCacheClusterCapacityFault: fmt.Println(elasticache.ErrCodeInsufficientCacheClusterCapacityFault, aerr.Error()) case elasticache.ErrCodeCacheClusterNotFoundFault: fmt.Println(elasticache.ErrCodeCacheClusterNotFoundFault, aerr.Error()) case elasticache.ErrCodeNodeQuotaForClusterExceededFault: fmt.Println(elasticache.ErrCodeNodeQuotaForClusterExceededFault, aerr.Error()) case elasticache.ErrCodeNodeQuotaForCustomerExceededFault: fmt.Println(elasticache.ErrCodeNodeQuotaForCustomerExceededFault, aerr.Error()) case elasticache.ErrCodeCacheSecurityGroupNotFoundFault: fmt.Println(elasticache.ErrCodeCacheSecurityGroupNotFoundFault, aerr.Error()) case elasticache.ErrCodeCacheParameterGroupNotFoundFault: fmt.Println(elasticache.ErrCodeCacheParameterGroupNotFoundFault, aerr.Error()) case elasticache.ErrCodeInvalidVPCNetworkStateFault: fmt.Println(elasticache.ErrCodeInvalidVPCNetworkStateFault, aerr.Error()) case elasticache.ErrCodeInvalidParameterValueException: fmt.Println(elasticache.ErrCodeInvalidParameterValueException, aerr.Error()) case elasticache.ErrCodeInvalidParameterCombinationException: fmt.Println(elasticache.ErrCodeInvalidParameterCombinationException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

ModifyReplicationGroupRequest

func (c *ElastiCache) ModifyReplicationGroupRequest(input *ModifyReplicationGroupInput) (req *request.Request, output *ModifyReplicationGroupOutput)

ModifyReplicationGroupRequest generates a "aws/request.Request" representing the client's request for the ModifyReplicationGroup operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See ModifyReplicationGroup for more information on using the ModifyReplicationGroup API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the ModifyReplicationGroupRequest method. req, resp := client.ModifyReplicationGroupRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/ModifyReplicationGroup

ModifyReplicationGroupShardConfiguration

func (c *ElastiCache) ModifyReplicationGroupShardConfiguration(input *ModifyReplicationGroupShardConfigurationInput) (*ModifyReplicationGroupShardConfigurationOutput, error)

ModifyReplicationGroupShardConfiguration API operation for Amazon ElastiCache.

Modifies a replication group's shards (node groups) by allowing you to add shards, remove shards, or rebalance the keyspaces among exisiting shards.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon ElastiCache's API operation ModifyReplicationGroupShardConfiguration for usage and error information.

Returned Error Codes:

  • ErrCodeReplicationGroupNotFoundFault "ReplicationGroupNotFoundFault" The specified replication group does not exist.

  • ErrCodeInvalidReplicationGroupStateFault "InvalidReplicationGroupState" The requested replication group is not in the available state.

  • ErrCodeInvalidCacheClusterStateFault "InvalidCacheClusterState" The requested cluster is not in the available state.

  • ErrCodeInvalidVPCNetworkStateFault "InvalidVPCNetworkStateFault" The VPC network is in an invalid state.

  • ErrCodeInsufficientCacheClusterCapacityFault "InsufficientCacheClusterCapacity" The requested cache node type is not available in the specified Availability Zone.

  • ErrCodeNodeGroupsPerReplicationGroupQuotaExceededFault "NodeGroupsPerReplicationGroupQuotaExceeded" The request cannot be processed because it would exceed the maximum allowed number of node groups (shards) in a single replication group. The default maximum is 15

  • ErrCodeNodeQuotaForCustomerExceededFault "NodeQuotaForCustomerExceeded" The request cannot be processed because it would exceed the allowed number of cache nodes per customer.

  • ErrCodeInvalidParameterValueException "InvalidParameterValue" The value for a parameter is invalid.

  • ErrCodeInvalidParameterCombinationException "InvalidParameterCombination" Two or more incompatible parameters were specified.

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/ModifyReplicationGroupShardConfiguration

ModifyReplicationGroupShardConfigurationRequest

func (c *ElastiCache) ModifyReplicationGroupShardConfigurationRequest(input *ModifyReplicationGroupShardConfigurationInput) (req *request.Request, output *ModifyReplicationGroupShardConfigurationOutput)

ModifyReplicationGroupShardConfigurationRequest generates a "aws/request.Request" representing the client's request for the ModifyReplicationGroupShardConfiguration operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See ModifyReplicationGroupShardConfiguration for more information on using the ModifyReplicationGroupShardConfiguration API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the ModifyReplicationGroupShardConfigurationRequest method. req, resp := client.ModifyReplicationGroupShardConfigurationRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/ModifyReplicationGroupShardConfiguration

ModifyReplicationGroupShardConfigurationWithContext

func (c *ElastiCache) ModifyReplicationGroupShardConfigurationWithContext(ctx aws.Context, input *ModifyReplicationGroupShardConfigurationInput, opts ...request.Option) (*ModifyReplicationGroupShardConfigurationOutput, error)

ModifyReplicationGroupShardConfigurationWithContext is the same as ModifyReplicationGroupShardConfiguration with the addition of the ability to pass a context and additional request options.

See ModifyReplicationGroupShardConfiguration for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

ModifyReplicationGroupWithContext

func (c *ElastiCache) ModifyReplicationGroupWithContext(ctx aws.Context, input *ModifyReplicationGroupInput, opts ...request.Option) (*ModifyReplicationGroupOutput, error)

ModifyReplicationGroupWithContext is the same as ModifyReplicationGroup with the addition of the ability to pass a context and additional request options.

See ModifyReplicationGroup for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

PurchaseReservedCacheNodesOffering

func (c *ElastiCache) PurchaseReservedCacheNodesOffering(input *PurchaseReservedCacheNodesOfferingInput) (*PurchaseReservedCacheNodesOfferingOutput, error)

PurchaseReservedCacheNodesOffering API operation for Amazon ElastiCache.

Allows you to purchase a reserved cache node offering.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon ElastiCache's API operation PurchaseReservedCacheNodesOffering for usage and error information.

Returned Error Codes:

  • ErrCodeReservedCacheNodesOfferingNotFoundFault "ReservedCacheNodesOfferingNotFound" The requested cache node offering does not exist.

  • ErrCodeReservedCacheNodeAlreadyExistsFault "ReservedCacheNodeAlreadyExists" You already have a reservation with the given identifier.

  • ErrCodeReservedCacheNodeQuotaExceededFault "ReservedCacheNodeQuotaExceeded" The request cannot be processed because it would exceed the user's cache node quota.

  • ErrCodeInvalidParameterValueException "InvalidParameterValue" The value for a parameter is invalid.

  • ErrCodeInvalidParameterCombinationException "InvalidParameterCombination" Two or more incompatible parameters were specified.

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/PurchaseReservedCacheNodesOffering

Example

ElastiCache PurchaseReservedCacheNodesOffering shared00

PurchaseReservedCacheNodesOfferings

Allows you to purchase a reserved cache node offering.

{ svc := elasticache.New(session.New()) input := &elasticache.PurchaseReservedCacheNodesOfferingInput{ ReservedCacheNodesOfferingId: aws.String("1ef01f5b-94ff-433f-a530-61a56bfc8e7a"), } result, err := svc.PurchaseReservedCacheNodesOffering(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elasticache.ErrCodeReservedCacheNodesOfferingNotFoundFault: fmt.Println(elasticache.ErrCodeReservedCacheNodesOfferingNotFoundFault, aerr.Error()) case elasticache.ErrCodeReservedCacheNodeAlreadyExistsFault: fmt.Println(elasticache.ErrCodeReservedCacheNodeAlreadyExistsFault, aerr.Error()) case elasticache.ErrCodeReservedCacheNodeQuotaExceededFault: fmt.Println(elasticache.ErrCodeReservedCacheNodeQuotaExceededFault, aerr.Error()) case elasticache.ErrCodeInvalidParameterValueException: fmt.Println(elasticache.ErrCodeInvalidParameterValueException, aerr.Error()) case elasticache.ErrCodeInvalidParameterCombinationException: fmt.Println(elasticache.ErrCodeInvalidParameterCombinationException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

PurchaseReservedCacheNodesOfferingRequest

func (c *ElastiCache) PurchaseReservedCacheNodesOfferingRequest(input *PurchaseReservedCacheNodesOfferingInput) (req *request.Request, output *PurchaseReservedCacheNodesOfferingOutput)

PurchaseReservedCacheNodesOfferingRequest generates a "aws/request.Request" representing the client's request for the PurchaseReservedCacheNodesOffering operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See PurchaseReservedCacheNodesOffering for more information on using the PurchaseReservedCacheNodesOffering API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the PurchaseReservedCacheNodesOfferingRequest method. req, resp := client.PurchaseReservedCacheNodesOfferingRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/PurchaseReservedCacheNodesOffering

PurchaseReservedCacheNodesOfferingWithContext

func (c *ElastiCache) PurchaseReservedCacheNodesOfferingWithContext(ctx aws.Context, input *PurchaseReservedCacheNodesOfferingInput, opts ...request.Option) (*PurchaseReservedCacheNodesOfferingOutput, error)

PurchaseReservedCacheNodesOfferingWithContext is the same as PurchaseReservedCacheNodesOffering with the addition of the ability to pass a context and additional request options.

See PurchaseReservedCacheNodesOffering for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

RebootCacheCluster

func (c *ElastiCache) RebootCacheCluster(input *RebootCacheClusterInput) (*RebootCacheClusterOutput, error)

RebootCacheCluster API operation for Amazon ElastiCache.

Reboots some, or all, of the cache nodes within a provisioned cluster. This operation applies any modified cache parameter groups to the cluster. The reboot operation takes place as soon as possible, and results in a momentary outage to the cluster. During the reboot, the cluster status is set to REBOOTING.

The reboot causes the contents of the cache (for each cache node being rebooted) to be lost.

When the reboot is complete, a cluster event is created.

Rebooting a cluster is currently supported on Memcached and Redis (cluster mode disabled) clusters. Rebooting is not supported on Redis (cluster mode enabled) clusters.

If you make changes to parameters that require a Redis (cluster mode enabled) cluster reboot for the changes to be applied, see Rebooting a Cluster (https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/Clusters.Rebooting.html) for an alternate process.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon ElastiCache's API operation RebootCacheCluster for usage and error information.

Returned Error Codes:

  • ErrCodeInvalidCacheClusterStateFault "InvalidCacheClusterState" The requested cluster is not in the available state.

  • ErrCodeCacheClusterNotFoundFault "CacheClusterNotFound" The requested cluster ID does not refer to an existing cluster.

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/RebootCacheCluster

Example

ElastiCache RebootCacheCluster shared00

RebootCacheCluster

Reboots the specified nodes in the names cluster.

{ svc := elasticache.New(session.New()) input := &elasticache.RebootCacheClusterInput{ CacheClusterId: aws.String("custom-mem1-4 "), CacheNodeIdsToReboot: []*string{ aws.String("0001"), aws.String("0002"), }, } result, err := svc.RebootCacheCluster(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elasticache.ErrCodeInvalidCacheClusterStateFault: fmt.Println(elasticache.ErrCodeInvalidCacheClusterStateFault, aerr.Error()) case elasticache.ErrCodeCacheClusterNotFoundFault: fmt.Println(elasticache.ErrCodeCacheClusterNotFoundFault, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

RebootCacheClusterRequest

func (c *ElastiCache) RebootCacheClusterRequest(input *RebootCacheClusterInput) (req *request.Request, output *RebootCacheClusterOutput)

RebootCacheClusterRequest generates a "aws/request.Request" representing the client's request for the RebootCacheCluster operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See RebootCacheCluster for more information on using the RebootCacheCluster API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the RebootCacheClusterRequest method. req, resp := client.RebootCacheClusterRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/RebootCacheCluster

RebootCacheClusterWithContext

func (c *ElastiCache) RebootCacheClusterWithContext(ctx aws.Context, input *RebootCacheClusterInput, opts ...request.Option) (*RebootCacheClusterOutput, error)

RebootCacheClusterWithContext is the same as RebootCacheCluster with the addition of the ability to pass a context and additional request options.

See RebootCacheCluster for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

RemoveTagsFromResource

func (c *ElastiCache) RemoveTagsFromResource(input *RemoveTagsFromResourceInput) (*TagListMessage, error)

RemoveTagsFromResource API operation for Amazon ElastiCache.

Removes the tags identified by the TagKeys list from the named resource.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon ElastiCache's API operation RemoveTagsFromResource for usage and error information.

Returned Error Codes:

  • ErrCodeCacheClusterNotFoundFault "CacheClusterNotFound" The requested cluster ID does not refer to an existing cluster.

  • ErrCodeSnapshotNotFoundFault "SnapshotNotFoundFault" The requested snapshot name does not refer to an existing snapshot.

  • ErrCodeInvalidARNFault "InvalidARN" The requested Amazon Resource Name (ARN) does not refer to an existing resource.

  • ErrCodeTagNotFoundFault "TagNotFound" The requested tag was not found on this resource.

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/RemoveTagsFromResource

Example

ElastiCache RemoveTagsFromResource shared00

RemoveTagsFromResource

Removes tags identified by a list of tag keys from the list of tags on the specified resource.

{ svc := elasticache.New(session.New()) input := &elasticache.RemoveTagsFromResourceInput{ ResourceName: aws.String("arn:aws:elasticache:us-east-1:1234567890:cluster:my-mem-cluster"), TagKeys: []*string{ aws.String("A"), aws.String("C"), aws.String("E"), }, } result, err := svc.RemoveTagsFromResource(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elasticache.ErrCodeCacheClusterNotFoundFault: fmt.Println(elasticache.ErrCodeCacheClusterNotFoundFault, aerr.Error()) case elasticache.ErrCodeSnapshotNotFoundFault: fmt.Println(elasticache.ErrCodeSnapshotNotFoundFault, aerr.Error()) case elasticache.ErrCodeInvalidARNFault: fmt.Println(elasticache.ErrCodeInvalidARNFault, aerr.Error()) case elasticache.ErrCodeTagNotFoundFault: fmt.Println(elasticache.ErrCodeTagNotFoundFault, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

RemoveTagsFromResourceRequest

func (c *ElastiCache) RemoveTagsFromResourceRequest(input *RemoveTagsFromResourceInput) (req *request.Request, output *TagListMessage)

RemoveTagsFromResourceRequest generates a "aws/request.Request" representing the client's request for the RemoveTagsFromResource operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See RemoveTagsFromResource for more information on using the RemoveTagsFromResource API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the RemoveTagsFromResourceRequest method. req, resp := client.RemoveTagsFromResourceRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/RemoveTagsFromResource

RemoveTagsFromResourceWithContext

func (c *ElastiCache) RemoveTagsFromResourceWithContext(ctx aws.Context, input *RemoveTagsFromResourceInput, opts ...request.Option) (*TagListMessage, error)

RemoveTagsFromResourceWithContext is the same as RemoveTagsFromResource with the addition of the ability to pass a context and additional request options.

See RemoveTagsFromResource for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

ResetCacheParameterGroup

func (c *ElastiCache) ResetCacheParameterGroup(input *ResetCacheParameterGroupInput) (*CacheParameterGroupNameMessage, error)

ResetCacheParameterGroup API operation for Amazon ElastiCache.

Modifies the parameters of a cache parameter group to the engine or system default value. You can reset specific parameters by submitting a list of parameter names. To reset the entire cache parameter group, specify the ResetAllParameters and CacheParameterGroupName parameters.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon ElastiCache's API operation ResetCacheParameterGroup for usage and error information.

Returned Error Codes:

  • ErrCodeInvalidCacheParameterGroupStateFault "InvalidCacheParameterGroupState" The current state of the cache parameter group does not allow the requested operation to occur.

  • ErrCodeCacheParameterGroupNotFoundFault "CacheParameterGroupNotFound" The requested cache parameter group name does not refer to an existing cache parameter group.

  • ErrCodeInvalidParameterValueException "InvalidParameterValue" The value for a parameter is invalid.

  • ErrCodeInvalidParameterCombinationException "InvalidParameterCombination" Two or more incompatible parameters were specified.

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/ResetCacheParameterGroup

Example

ElastiCache ResetCacheParameterGroup shared00

ResetCacheParameterGroup

Modifies the parameters of a cache parameter group to the engine or system default value.

{ svc := elasticache.New(session.New()) input := &elasticache.ResetCacheParameterGroupInput{ CacheParameterGroupName: aws.String("custom-mem1-4"), ResetAllParameters: aws.Bool(true), } result, err := svc.ResetCacheParameterGroup(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elasticache.ErrCodeInvalidCacheParameterGroupStateFault: fmt.Println(elasticache.ErrCodeInvalidCacheParameterGroupStateFault, aerr.Error()) case elasticache.ErrCodeCacheParameterGroupNotFoundFault: fmt.Println(elasticache.ErrCodeCacheParameterGroupNotFoundFault, aerr.Error()) case elasticache.ErrCodeInvalidParameterValueException: fmt.Println(elasticache.ErrCodeInvalidParameterValueException, aerr.Error()) case elasticache.ErrCodeInvalidParameterCombinationException: fmt.Println(elasticache.ErrCodeInvalidParameterCombinationException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

ResetCacheParameterGroupRequest

func (c *ElastiCache) ResetCacheParameterGroupRequest(input *ResetCacheParameterGroupInput) (req *request.Request, output *CacheParameterGroupNameMessage)

ResetCacheParameterGroupRequest generates a "aws/request.Request" representing the client's request for the ResetCacheParameterGroup operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See ResetCacheParameterGroup for more information on using the ResetCacheParameterGroup API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the ResetCacheParameterGroupRequest method. req, resp := client.ResetCacheParameterGroupRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/ResetCacheParameterGroup

ResetCacheParameterGroupWithContext

func (c *ElastiCache) ResetCacheParameterGroupWithContext(ctx aws.Context, input *ResetCacheParameterGroupInput, opts ...request.Option) (*CacheParameterGroupNameMessage, error)

ResetCacheParameterGroupWithContext is the same as ResetCacheParameterGroup with the addition of the ability to pass a context and additional request options.

See ResetCacheParameterGroup for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

RevokeCacheSecurityGroupIngress

func (c *ElastiCache) RevokeCacheSecurityGroupIngress(input *RevokeCacheSecurityGroupIngressInput) (*RevokeCacheSecurityGroupIngressOutput, error)

RevokeCacheSecurityGroupIngress API operation for Amazon ElastiCache.

Revokes ingress from a cache security group. Use this operation to disallow access from an Amazon EC2 security group that had been previously authorized.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon ElastiCache's API operation RevokeCacheSecurityGroupIngress for usage and error information.

Returned Error Codes:

  • ErrCodeCacheSecurityGroupNotFoundFault "CacheSecurityGroupNotFound" The requested cache security group name does not refer to an existing cache security group.

  • ErrCodeAuthorizationNotFoundFault "AuthorizationNotFound" The specified Amazon EC2 security group is not authorized for the specified cache security group.

  • ErrCodeInvalidCacheSecurityGroupStateFault "InvalidCacheSecurityGroupState" The current state of the cache security group does not allow deletion.

  • ErrCodeInvalidParameterValueException "InvalidParameterValue" The value for a parameter is invalid.

  • ErrCodeInvalidParameterCombinationException "InvalidParameterCombination" Two or more incompatible parameters were specified.

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/RevokeCacheSecurityGroupIngress

Example

ElastiCache RevokeCacheSecurityGroupIngress shared00

DescribeCacheSecurityGroups

Returns a list of cache security group descriptions. If a cache security group name is specified, the list contains only the description of that group.

{ svc := elasticache.New(session.New()) input := &elasticache.RevokeCacheSecurityGroupIngressInput{ CacheSecurityGroupName: aws.String("my-sec-grp"), EC2SecurityGroupName: aws.String("my-ec2-sec-grp"), EC2SecurityGroupOwnerId: aws.String("1234567890"), } result, err := svc.RevokeCacheSecurityGroupIngress(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elasticache.ErrCodeCacheSecurityGroupNotFoundFault: fmt.Println(elasticache.ErrCodeCacheSecurityGroupNotFoundFault, aerr.Error()) case elasticache.ErrCodeAuthorizationNotFoundFault: fmt.Println(elasticache.ErrCodeAuthorizationNotFoundFault, aerr.Error()) case elasticache.ErrCodeInvalidCacheSecurityGroupStateFault: fmt.Println(elasticache.ErrCodeInvalidCacheSecurityGroupStateFault, aerr.Error()) case elasticache.ErrCodeInvalidParameterValueException: fmt.Println(elasticache.ErrCodeInvalidParameterValueException, aerr.Error()) case elasticache.ErrCodeInvalidParameterCombinationException: fmt.Println(elasticache.ErrCodeInvalidParameterCombinationException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

RevokeCacheSecurityGroupIngressRequest

func (c *ElastiCache) RevokeCacheSecurityGroupIngressRequest(input *RevokeCacheSecurityGroupIngressInput) (req *request.Request, output *RevokeCacheSecurityGroupIngressOutput)

RevokeCacheSecurityGroupIngressRequest generates a "aws/request.Request" representing the client's request for the RevokeCacheSecurityGroupIngress operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See RevokeCacheSecurityGroupIngress for more information on using the RevokeCacheSecurityGroupIngress API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the RevokeCacheSecurityGroupIngressRequest method. req, resp := client.RevokeCacheSecurityGroupIngressRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/RevokeCacheSecurityGroupIngress

RevokeCacheSecurityGroupIngressWithContext

func (c *ElastiCache) RevokeCacheSecurityGroupIngressWithContext(ctx aws.Context, input *RevokeCacheSecurityGroupIngressInput, opts ...request.Option) (*RevokeCacheSecurityGroupIngressOutput, error)

RevokeCacheSecurityGroupIngressWithContext is the same as RevokeCacheSecurityGroupIngress with the addition of the ability to pass a context and additional request options.

See RevokeCacheSecurityGroupIngress for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

TestFailover

func (c *ElastiCache) TestFailover(input *TestFailoverInput) (*TestFailoverOutput, error)

TestFailover API operation for Amazon ElastiCache.

Represents the input of a TestFailover operation which test automatic failover on a specified node group (called shard in the console) in a replication group (called cluster in the console).

Note the following

  • A customer can use this operation to test automatic failover on up to 5 shards (called node groups in the ElastiCache API and AWS CLI) in any rolling 24-hour period.

  • If calling this operation on shards in different clusters (called replication groups in the API and CLI), the calls can be made concurrently.

  • If calling this operation multiple times on different shards in the same Redis (cluster mode enabled) replication group, the first node replacement must complete before a subsequent call can be made.

  • To determine whether the node replacement is complete you can check Events using the Amazon ElastiCache console, the AWS CLI, or the ElastiCache API. Look for the following automatic failover related events, listed here in order of occurrance:

Replication group message: Test Failover API called for node group <node-group-id>

Cache cluster message: Failover from master node <primary-node-id> to replica

node <node-id> completed

Replication group message: Failover from master node <primary-node-id> to

replica node <node-id> completed

Cache cluster message: Recovering cache nodes <node-id>

Cache cluster message: Finished recovery for cache nodes <node-id>

For more information see:

Viewing ElastiCache Events (https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/ECEvents.Viewing.html)

in the ElastiCache User Guide

DescribeEvents (https://docs.aws.amazon.com/AmazonElastiCache/latest/APIReference/API_DescribeEvents.html)

in the ElastiCache API Reference

Also see, Testing Multi-AZ with Automatic Failover (https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/AutoFailover.html#auto-failover-test) in the ElastiCache User Guide.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon ElastiCache's API operation TestFailover for usage and error information.

Returned Error Codes:

  • ErrCodeAPICallRateForCustomerExceededFault "APICallRateForCustomerExceeded" The customer has exceeded the allowed rate of API calls.

  • ErrCodeInvalidCacheClusterStateFault "InvalidCacheClusterState" The requested cluster is not in the available state.

  • ErrCodeInvalidReplicationGroupStateFault "InvalidReplicationGroupState" The requested replication group is not in the available state.

  • ErrCodeNodeGroupNotFoundFault "NodeGroupNotFoundFault" The node group specified by the NodeGroupId parameter could not be found. Please verify that the node group exists and that you spelled the NodeGroupId value correctly.

  • ErrCodeReplicationGroupNotFoundFault "ReplicationGroupNotFoundFault" The specified replication group does not exist.

  • ErrCodeTestFailoverNotAvailableFault "TestFailoverNotAvailableFault" The TestFailover action is not available.

  • ErrCodeInvalidParameterValueException "InvalidParameterValue" The value for a parameter is invalid.

  • ErrCodeInvalidParameterCombinationException "InvalidParameterCombination" Two or more incompatible parameters were specified.

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/TestFailover

TestFailoverRequest

func (c *ElastiCache) TestFailoverRequest(input *TestFailoverInput) (req *request.Request, output *TestFailoverOutput)

TestFailoverRequest generates a "aws/request.Request" representing the client's request for the TestFailover operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See TestFailover for more information on using the TestFailover API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the TestFailoverRequest method. req, resp := client.TestFailoverRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/TestFailover

TestFailoverWithContext

func (c *ElastiCache) TestFailoverWithContext(ctx aws.Context, input *TestFailoverInput, opts ...request.Option) (*TestFailoverOutput, error)

TestFailoverWithContext is the same as TestFailover with the addition of the ability to pass a context and additional request options.

See TestFailover for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

WaitUntilCacheClusterAvailable

func (c *ElastiCache) WaitUntilCacheClusterAvailable(input *DescribeCacheClustersInput) error

WaitUntilCacheClusterAvailable uses the Amazon ElastiCache API operation DescribeCacheClusters to wait for a condition to be met before returning. If the condition is not met within the max attempt window, an error will be returned.

WaitUntilCacheClusterAvailableWithContext

func (c *ElastiCache) WaitUntilCacheClusterAvailableWithContext(ctx aws.Context, input *DescribeCacheClustersInput, opts ...request.WaiterOption) error

WaitUntilCacheClusterAvailableWithContext is an extended version of WaitUntilCacheClusterAvailable. With the support for passing in a context and options to configure the Waiter and the underlying request options.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

WaitUntilCacheClusterDeleted

func (c *ElastiCache) WaitUntilCacheClusterDeleted(input *DescribeCacheClustersInput) error

WaitUntilCacheClusterDeleted uses the Amazon ElastiCache API operation DescribeCacheClusters to wait for a condition to be met before returning. If the condition is not met within the max attempt window, an error will be returned.

WaitUntilCacheClusterDeletedWithContext

func (c *ElastiCache) WaitUntilCacheClusterDeletedWithContext(ctx aws.Context, input *DescribeCacheClustersInput, opts ...request.WaiterOption) error

WaitUntilCacheClusterDeletedWithContext is an extended version of WaitUntilCacheClusterDeleted. With the support for passing in a context and options to configure the Waiter and the underlying request options.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

WaitUntilReplicationGroupAvailable

func (c *ElastiCache) WaitUntilReplicationGroupAvailable(input *DescribeReplicationGroupsInput) error

WaitUntilReplicationGroupAvailable uses the Amazon ElastiCache API operation DescribeReplicationGroups to wait for a condition to be met before returning. If the condition is not met within the max attempt window, an error will be returned.

WaitUntilReplicationGroupAvailableWithContext

func (c *ElastiCache) WaitUntilReplicationGroupAvailableWithContext(ctx aws.Context, input *DescribeReplicationGroupsInput, opts ...request.WaiterOption) error

WaitUntilReplicationGroupAvailableWithContext is an extended version of WaitUntilReplicationGroupAvailable. With the support for passing in a context and options to configure the Waiter and the underlying request options.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

WaitUntilReplicationGroupDeleted

func (c *ElastiCache) WaitUntilReplicationGroupDeleted(input *DescribeReplicationGroupsInput) error

WaitUntilReplicationGroupDeleted uses the Amazon ElastiCache API operation DescribeReplicationGroups to wait for a condition to be met before returning. If the condition is not met within the max attempt window, an error will be returned.

WaitUntilReplicationGroupDeletedWithContext

func (c *ElastiCache) WaitUntilReplicationGroupDeletedWithContext(ctx aws.Context, input *DescribeReplicationGroupsInput, opts ...request.WaiterOption) error

WaitUntilReplicationGroupDeletedWithContext is an extended version of WaitUntilReplicationGroupDeleted. With the support for passing in a context and options to configure the Waiter and the underlying request options.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

On this page: