Questions tagged with S3 Object Lock

Content language: English

Sort by most recent

Browse through the questions and answers listed below or filter and sort to narrow down your results.

S3 Get object not working properly in Unity

I am using AWS SDK .NET for Unity to download zip files from S3. I implemented the get method just as this tutorial for .NET https://docs.aws.amazon.com/AmazonS3/latest/userguide/download-objects.html But when I call the method with ReadObjectDataAsync().Wait(); Unity stops and crashes, like is in an infinite loop. This is my code, has a different name but is practically the same: /// <summary> /// Start is called before the first frame update /// </summary> void Start() { customSongsManager = gameObject.GetComponent<CustomSongsManager>(); GetZip(S3SampleFile).Wait(); } /// <summary> /// Get Object from S3 Bucket /// </summary> public async Task GetZip(string pFile) { string folder = "Assets/Audio/Custom/"; try { GetObjectRequest request = new GetObjectRequest { BucketName = S3Bucket, Key = pFile }; using (GetObjectResponse response = await S3Client.GetObjectAsync(request)) using (Stream responseStream = response.ResponseStream) { string title = response.Metadata["x-amz-meta-title"]; // Assume you have "title" as medata added to the object. string contentType = response.Headers["Content-Type"]; Debug.Log("Object metadata, Title: " + title); Debug.Log("Content type: " + contentType); if (responseStream != null) { using (BinaryReader bReader = new BinaryReader(response.ResponseStream)) { byte[] buffer = bReader.ReadBytes((int)response.ResponseStream.Length); File.WriteAllBytes(folder + S3SampleFile, buffer); Debug.Log("Writed all bytes"); StartCoroutine(customSongsManager.ReadDownloadedSong(folder + S3SampleFile)); } } } } catch (AmazonS3Exception e) { // If bucket or object does not exist Debug.Log("Error encountered ***. Message:"+ e.Message + " when reading object"); } catch (Exception e) { Debug.Log("Unknown encountered on server. Message:"+ e.Message + " when reading object"); } } The game crashes in this line: using (GetObjectResponse response = await S3Client.GetObjectAsync(request))
2
answers
0
votes
49
views
asked 6 months ago

Expired s3 Backup Recovery Point

I configured AWS Backup in CDK to enable continuous backups for s3 buckets with this configuration : - backup rule : with `enableContinuousBackup: true` and `deleteAfter 35 days` - backup selection : with `resources` array having the ARN of the bucket directly set and roles setup following the docs of aws : https://docs.aws.amazon.com/aws-backup/latest/devguide/s3-backups.html Later I deleted the stack in CDK and ,as expected, all the resources were deleted except for the vault that was orphaned. The problem happens when trying to delete the recovery points inside the vault, I get back the status as `Expired` with a message `Insufficient permission to delete recovery point`. - I am logged in as a user with AdministratorAccess - I changed the access policy of the vault to allow anyone to delete the vault / recovery point - even when logged as the root of the account, I still get the same message. --- - For reference, this is aws managed policy attached to my user : `AdministratorAccess` , it Allows (325 of 325 services) including AWS Backup obviously. - Here's the vault access policy that I set : ``` { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "AWS": "*" }, "Action": [ "backup:DeleteBackupVault", "backup:DeleteBackupVaultAccessPolicy", "backup:DeleteRecoveryPoint", "backup:StartCopyJob", "backup:StartRestoreJob", "backup:UpdateRecoveryPointLifecycle" ], "Resource": "*" } ] } ``` Any ideas what I'm missing here ? **Update ** : - A full week after creating the backup recovery point, and still unable to delete it. - I tried deleting it from the AWS CLI but no luck. - I tried suspending the versioning for the bucket in question and tried, but no luck too.
0
answers
2
votes
133
views
Anis
asked 7 months ago