How to use AWS iOS SDK to delete an object?

How to use AWS iOS SDK to delete an object?

I'm trying to delete a public image (cannedACL property of the S3PutObjectRequest to upload the image was [S3CannedACL publicRead]) uploaded to an S3 bucket.
There is an S3DeleteObjectRequest class in the AWS SDK documentation, but there don't seem to be any properties or initialization methods for this class.
Based on sample code in other languages, it looks like there should be key or bucket property or an initialization method setting those properties, as there are in the iOS SDK's S3PutObjectRequest class, used to upload files to a bucket.
What's going on here? Is the SDK simply incomplete? Is there a way to delete an object with the iOS AWS SDK?

Solutions/Answers:

Answer 1:

Just going off the documentation you linked to, but does this not work?

[s3Client deleteObjectWithKey:@"objectKey" withBucket:@"my-bucket"];

Answer 2:

For the iOS SDK for S3 V2, this code came in handy

AWSS3 *s3 = [AWSS3 defaultS3];
                AWSS3DeleteObjectRequest *deleteRequest = [AWSS3DeleteObjectRequest new];
                deleteRequest.bucket = S3BucketName;
                deleteRequest.key = climb.imageKey;
                [[[s3 deleteObject:deleteRequest] continueWithBlock:^id(BFTask *task) {
                    if(task.error != nil){
                        if(task.error.code != AWSS3TransferManagerErrorCancelled && task.error.code != AWSS3TransferManagerErrorPaused){
                            NSLog(@"%s Error: [%@]",__PRETTY_FUNCTION__, task.error);
                        }
                    }else{
                        // Completed logic here
                    }
                    return nil;
                }] waitUntilFinished];

This is based heavily upon the unit tests that have been written for the library here: https://github.com/aws/aws-sdk-ios/blob/master/AWSS3Tests/AWSS3Tests.m

Answer 3:

Art Gillespie’s answer worked just fine for me as well.

However, I also discovered that you can achieve the same by setting the key and bucket attributes on the S3 delete object request:

S3DeleteObjectRequest *dor = [[S3DeleteObjectRequest alloc] init];
dor.key = AWS_OBJ_PATH;
dor.bucket = AWS_BUCKET;

[s3Client deleteObject:dor];

References

connect to redis server on AWS EC2

connect to redis server on AWS EC2

I am trying to connect to redis server running on EC2. I uncomment the bind line in redis conf file. 
>> netstat -nlpt | grep 6379
tcp        0      0 0.0.0.0:6379            0.0.0.0:*               LISTEN      -

but I still could not connect to it with the following command:
redis-cli -h ec2-xx-xx.us-west-1.compute.amazonaws.com -p 6379

Am i missing something here? I am able to connect the the ec2 box through ssh:
ssh -i ~/.ec2/ec2.pem ubuntu@ec2-xx-xx.us-west-1.compute.amazonaws.com

Thanks

Solutions/Answers:

Answer 1:

You need to set the security policy associated with the instance to allow for inbound traffic on port 6379.

References