VishaalY/solutions-architect-hf-dataset huggingface dataset:
Question: How do I resolve the error that I receive in AWS CodeDeploy when my deployment times out while waiting for a status callback?

My AWS CodeDeploy deployment times out and returns the following error: "The deployment timed out while waiting for a status callback. CodeDeploy expects a status callback within one hour after a deployment hook is invoked."Short descriptionThis issue can occur when you use CodeDeploy to deploy an Amazon Elastic Container Service (Amazon ECS) service with a validation test.If the test doesn't return a Succeeded or Failed response within 60 minutes after a lifecycle event hook is invoked, then CodeDeploy returns the following error:"The deployment timed out while waiting for a status callback. CodeDeploy expects a status callback within one hour after a deployment hook is invoked."Note: The default timeout limit for a lifecycle hook AWS Lambda function's status callback is 60 minutes.To resolve the error, verify that the lifecycle hook Lambda function has the required method and AWS Identity and Access Management (IAM) permissions.

ResolutionConfirm the cause of the error by reviewing your CloudWatch LogsFor instructions, see How do I retrieve log data from Amazon CloudWatch Logs?Verify that the lifecycle hook Lambda function has the required IAM permissionsMake sure that the lifecycle hook Lambda function has an execution role that includes the following permission: PutLifecycleEventHookExecutionStatus.Note: The PutLifecycleEventHookExecutionStatus permission isn't included by default in the AWS managed CodeDeployFullAccess IAM policy.See the following example of a PutLifecycleEventHookExecutionStatus permissions statement:{  "Version": "2012-10-17",  "Statement": [    {      "Sid": "VisualEditor0",      "Effect": "Allow",      "Action": "codedeploy:PutLifecycleEventHookExecutionStatus",      "Resource": "*"    }  ]}Verify that the lifecycle hook Lambda function includes the required method to return a status response to CodeDeployMake sure that the lifecycle hook Lambda function includes the putLifecycleEventHookExecutionStatus method.For more information, see Step 3: Create a lifecycle hook Lambda function in the CodeDeploy User Guide.See the following example of a putLifecycleEventHookExecutionStatus method for a lifecycle hook Lambda function:codedeploy.putLifecycleEventHookExecutionStatus(params, function(err, data) {     if (err) {          // Validation failed.          console.log('AfterAllowTestTraffic validation tests failed');          console.log(err, err.stack);          callback("CodeDeploy Status update failed");     } else {          // Validation succeeded.          console.log("AfterAllowTestTraffic validation tests succeeded");callback(null, "AfterAllowTestTraffic validation tests succeeded");         }
Question: How can I allow only certain file types to be uploaded to my Amazon S3 bucket?

I want only certain file types to be stored on my Amazon Simple Storage Service (Amazon S3) bucket. How can I limit uploads so that my bucket accepts only those file types?ResolutionAdd statements to your bucket policy that do the following:Allow the s3:PutObject action only for objects that have the extension of the file type that you want.Explicitly deny the s3:PutObject action for objects that don't have the extension of the file type that you want.Note: This explicit deny statement applies the file-type requirement to users with full access to your Amazon S3 resources.For example, the following bucket policy allows the s3:PutObject action to exampleuser only for objects with .jpg, .png, or .gif file extensions:Warning: This example bucket policy includes an explicit deny statement. If a user doesn't meet the specified conditions, even the user who enters the bucket policy can get denied access to the bucket. Therefore, you must carefully review the bucket policy before saving it. If you've accidentally locked the bucket, then see I accidentally denied everyone access to my Amazon S3 bucket. How do I regain access?{  "Version": "2012-10-17",  "Id": "Policy1464968545158",  "Statement": [    {      "Sid": "Stmt1464968483619",      "Effect": "Allow",      "Principal": {        "AWS": "arn:aws:iam::111111111111:user/exampleuser"      },      "Action": "s3:PutObject",      "Resource": [        "arn:aws:s3:::DOC-EXAMPLE-BUCKET/*.jpg",        "arn:aws:s3:::DOC-EXAMPLE-BUCKET/*.png",        "arn:aws:s3:::DOC-EXAMPLE-BUCKET/*.gif"      ]    },    {      "Sid": "Stmt1464968483619",      "Effect": "Deny",      "Principal": "*",      "Action": "s3:PutObject",      "NotResource": [        "arn:aws:s3:::DOC-EXAMPLE-BUCKET/*.jpg",        "arn:aws:s3:::DOC-EXAMPLE-BUCKET/*.png",        "arn:aws:s3:::DOC-EXAMPLE-BUCKET/*.gif"      ]    }  ]}Note:For the first Principal value, list the Amazon Resource Names (ARNs) of the users that you want to grant upload permissions to.For the Resource and NotResource values, make sure to replace DOC-EXAMPLE-BUCKET with the name of your bucket.When you specify resources in the bucket policy, the bucket policy evaluation is case-sensitive. A bucket policy that denies s3:PutObject actions for NotResource "arn:aws:s3:::DOC-EXAMPLE-BUCKET/*.jpg" will allow you to upload "my_image.jpg". However, if you try to upload "my_image.JPG", Amazon S3 will return an Access Denied error.