Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A Lambda function’s access to Amazon S3 comes from its IAM execution role. If that role allows broad S3 actions on broad resources, the function may be able to do far more than its code needs. That does not, by itself, make an S3 bucket public; role permissions and bucket-level access are separate controls.

To reduce risk, find the function’s execution role, compare its policies with the S3 operations and resources the workload actually needs, and narrow the permissions. Then check bucket policies and other S3 controls separately if your concern is public or cross-account access.

Why does my Lambda have admin access to S3?

Lambda runs your function using an execution role. AWS grants the function temporary credentials for that role, and the role’s permissions determine which AWS resources the function can access. The function itself does not have a separate S3 identity.

If the role’s identity policies grant wide-ranging S3 actions against many buckets or objects, the function can inherit that reach—even if its current code uses only a small part of it. The actual access depends on the policies and applicable controls; the title does not establish that any particular account, function, or role has been inspected.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

A broad role policy also does not automatically make a bucket public. A role policy governs what an identity such as the Lambda function can do. Public or shared access is a separate question involving bucket policies, ACLs, and access-point policies. AWS explains execution-role permissions in its Lambda execution role guidance.

How do I limit an AWS Lambda function to one S3 bucket?

  1. Find the role. In the AWS Lambda console, open Functions, choose the function, and open Configuration > Permissions. Follow the execution-role link to IAM.
  2. Review the role’s policies. Check both policies attached directly to the role and any relevant permissions boundaries or other controls. Look for S3 actions granted broadly, especially policies whose resource scope includes a wildcard rather than the specific bucket or object locations the function needs.
  3. Map the workload. Identify the S3 operations the code performs—such as reading, writing, listing, or deleting—and which bucket and object paths those operations require. Include scheduled and infrequent flows, not just the function’s most common run.
  4. Narrow actions and resources. Replace unnecessary broad S3 permissions with the smallest set of actions and bucket or object resources that support the workload. Keep any required CloudWatch logging permissions; AWS’s basic Lambda execution-role guidance includes permissions for writing logs.
  5. Review the result. Use IAM policy validation and Access Analyzer findings as aids, then exercise the function’s expected flows and check for failures. AWS’s policy validation guidance cautions that wildcards and overly broad permissions can expand access beyond intent.

There is no universal S3 policy snippet for every Lambda: the right actions and resources depend on what the code does. A function that only reads objects should not retain write or delete permissions merely because they were convenient during development. Conversely, narrowing permissions without accounting for an occasional workflow can break a legitimate job.

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

How can I tell which S3 permissions the function actually needs?

Start with the code and workload requirements, then use observed activity as supporting evidence. IAM Access Analyzer can use CloudTrail activity over a selected date range to generate a policy template based on permissions used. AWS recommends it as a way to help identify required execution-role permissions in its Lambda execution role documentation; the generated template should be reviewed, not treated as a complete guarantee.

Observed activity can miss rarely used paths. In its role-permission recommendations, AWS uses the last 30 days of activity. A permission needed only for a quarterly job could therefore appear unused. Check schedules, recovery procedures, and business requirements against the observation window before removing a permission. See AWS’s IAM Access Analyzer guidance on unused access.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

Consider the difference between evidence sources when refining the policy:

  • Code and workload requirements identify intended operations and resources, including flows that may not have run recently.
  • Observed CloudTrail activity can show permissions used during the selected period, but does not prove that unobserved permissions are unnecessary.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

How do I check whether an S3 bucket is public or shared?

Inspect bucket-level access controls separately from the Lambda role. AWS IAM Access Analyzer for S3 can review bucket policies, ACLs, and access-point policies for public or shared access. This helps answer whether a bucket is exposed beyond the intended accounts or users; it does not replace reviewing what the Lambda execution role itself is allowed to do. See AWS’s S3 Access Analyzer documentation.

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft

If an analyzer finding shows unintended access, identify which policy or control permits it, change that policy, and rescan to confirm the finding is addressed. AWS describes findings as a guide to remediation in its IAM Access Analyzer overview.

Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.

What should I verify after changing the role policy?

  • The function completes its intended reads, writes, and other required S3 operations.
  • Scheduled or infrequent jobs still work, including tasks outside a recent activity window.
  • Unneeded broad actions and resource scopes have been removed without removing essential logging permissions.
  • Relevant Access Analyzer findings have been reviewed, and unintended access has been corrected at the policy responsible.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.