Courseiva
TechnologyhardMultiple ChoiceObjective-mapped

IAM Role for S3 Backup – Snapshot Permissions Denied

Exhibit

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": "s3:PutObject",
      "Resource": "arn:aws:s3:::my-sap-backup/*"
    },
    {
      "Effect": "Allow",
      "Action": [
        "ec2:DescribeInstances",
        "ec2:CreateSnapshot"
      ],
      "Resource": "*"
    }
  ]
}

An SAP administrator uses an IAM role attached to an EC2 instance to perform backups. The backup script fails when trying to write to an S3 bucket and create EBS snapshots. What is the most likely cause?

Quick Answer

The answer is that the IAM role lacks the `s3:ListBucket` permission and the `ec2:CreateSnapshot` action is not properly scoped to the volume ARN. The backup script fails because, even if `s3:PutObject` is allowed, the process must first list the bucket contents to verify or stage the backup, and `s3:ListBucket` is a separate required action. Additionally, `ec2:CreateSnapshot` demands a specific resource ARN for the source volume, not a wildcard `*`, so the policy’s broad resource scope causes a permissions denied error. On the AWS Certified SAP on AWS Specialty PAS-C01 exam, this scenario tests your understanding of least-privilege IAM policy design for backup workflows, often trapping candidates who assume `PutObject` alone is sufficient. A common memory tip is “List before Put, ARN before star”—always check for `s3:ListBucket` when writing to S3, and ensure `ec2:CreateSnapshot` references the exact volume ARN.

⚠ Common exam trap

Candidates often focus on missing S3 or EC2 permissions but overlook the prerequisite trust policy. If the instance cannot assume the role, no permissions are applied.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

The trust policy does not include the EC2 service principal.

The most likely cause is that the trust policy of the IAM role does not include the EC2 service principal (ec2.amazonaws.com). Without this, the EC2 instance cannot assume the role, causing all AWS API calls from the backup script to fail, including writing to S3 and creating EBS snapshots. Options A and C only affect specific actions, and D incorrectly includes s3:ListBucket as a requirement.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • The S3 bucket policy denies all writes from this role.

    Why it's wrong here

    Incorrect. While a bucket policy denying writes would cause S3 failures, it does not affect EBS snapshots, so it cannot explain both failures.

  • The trust policy does not include the EC2 service principal.

    Why this is correct

    Correct. Without the EC2 service principal in the trust policy, the instance cannot assume the role, causing all API calls to fail.

  • The role does not have permission to create snapshots due to an explicit deny.

    Why it's wrong here

    Incorrect. An explicit deny for ec2:CreateSnapshot would only affect snapshots, not S3 writes.

  • The policy lacks 's3:ListBucket' and 'ec2:CreateSnapshot' requires volume ARN.

    Why it's wrong here

    Incorrect. s3:ListBucket is not required for writing objects; only s3:PutObject is needed. The volume ARN requirement for ec2:CreateSnapshot can be satisfied with a wildcard.

Quick reference

AWS S3 Storage Class Comparison

Storage ClassMin DurationRetrievalUse Case
S3 StandardNoneImmediateFrequently accessed data
S3 Standard-IA30 daysImmediateInfrequent access, rapid retrieval
S3 One Zone-IA30 daysImmediateNon-critical infrequent data
S3 Intelligent-TieringNoneImmediate–hoursUnknown or changing access patterns
S3 Glacier Instant90 daysMillisecondsArchive with instant retrieval
S3 Glacier Flexible90 daysMinutes–hoursArchive, flexible retrieval
S3 Glacier Deep Archive180 daysHoursLong-term compliance archive

About these practice questions

One of 1,616 original PAS-C01 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Same concept, more angles

2 more ways this is tested on PAS-C01

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. An SAP administrator has created the following IAM policy and attached it to an IAM role used by an EC2 instance running SAP HANA: { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": "s3:ListBucket", "Resource": "arn:aws:s3:::sap-backup-bucket/*" }, { "Effect": "Allow", "Action": "s3:GetObject", "Resource": "arn:aws:s3:::sap-backup-bucket/*" } ] } The instance needs to download backup files from the S3 bucket 'sap-backup-bucket' and then stop itself after the backup is complete. However, the backup script fails with an access denied error when trying to list the bucket. What is the most likely cause?

hard
  • A.The S3 bucket is encrypted and the policy does not allow kms:Decrypt [wrong]
  • B.The policy does not allow the s3:ListBucket action on the bucket ARN [CORRECT]
  • C.The policy does not include the ec2:StopInstances permission [wrong]
  • D.The instance does not have an internet gateway to reach S3 [wrong]

Why B: The IAM policy must grant the s3:ListBucket permission on the bucket ARN itself (arn:aws:s3:::sap-backup-bucket) to allow listing objects. The policy includes s3:ListBucket but only on the object ARN (arn:aws:s3:::sap-backup-bucket/*), not on the bucket ARN. This causes the 'ListObjects' API call to fail with an access denied error when the script attempts to list the bucket contents. The s3:GetObject permission on the object ARN is correctly specified for downloading files, but without s3:ListBucket on the bucket ARN, the list operation is denied.

Variation 2. An SAP administrator has created the IAM policy shown in the exhibit and attached it to an IAM role used by an EC2 instance running SAP HANA. The instance needs to download backup files from the S3 bucket 'sap-backup-bucket' and then stop itself after the backup is complete. However, the backup script fails with an access denied error when trying to list the bucket. What is the most likely cause? (Note: This question is reused from above but with correct exhibit now. I need to change the exhibit to have a mistake. Let me fix: remove the bucket ARN from the Resource list for S3 actions, so only the object ARN is present. That will cause the list operation to fail.)

medium
  • A.The S3 bucket is encrypted and the policy does not allow kms:Decrypt
  • B.The instance does not have an internet gateway to reach S3
  • C.The policy does not include the ec2:StopInstances permission
  • D.The policy does not allow the s3:ListBucket action on the bucket ARN
JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This PAS-C01 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the PAS-C01 exam.