Featured resource
2026 Tech Forecast
2026 Tech Forecast

Stay ahead of what’s next in tech with predictions from 1,500+ business leaders, insiders, and Pluralsight Authors.

Get these insights
  • Lab
    • Libraries: If you want this lab, consider one of these libraries.
    • Cloud
    • Security
Google Cloud Platform icon
Labs

Using EC2 Roles and Instance Profiles in AWS

If you are still hardcoding AWS access keys in your EC2 applications, there's a **better** way—and it takes less than 30 minutes to master. This hands-on lab shows you how to use EC2 instance profiles to grant your servers secure access to AWS services like S3 without ever touching static credentials.

Google Cloud Platform icon
Lab platform
Lab Info
Level
Intermediate
Last updated
Dec 14, 2025
Duration
30m

Contact sales

By clicking submit, you agree to our Privacy Policy and Terms of Use, and consent to receive marketing emails from Pluralsight.
Table of Contents
  1. Challenge

    Upload a File to the Amazon S3 bucket and Copy the Bucket ARN

    Choose any file you have locally, or you can optionally download the lab diagram locally, and upload it to the provided Amazon S3 bucket in you AWS account. Be sure to also copy the S3 bucket ARN for later on.

  2. Challenge

    Connect to the Old EC2 and Locate the Hardcoded Credentials

    Leverage Session Manager to connect to the Old Server Amazon EC2 instance and locate the hardcoded set of AWS secret access key credentials for ssm-user. There should be an access key pair, as well as a configuration for output and Region.

  3. Challenge

    Create the Managed Permissions Policy

    Create a new permission policy with the following information:

    • Name: allow-ec2-to-app-bucket
    • Permissions: List buckets and get objects from the S3 bucket that was created for you (Should be named like c6e0-account_id-app-bucket)
  4. Challenge

    Create the IAM Role and Attach Permissions

    Create a brand-new IAM role with the following information:

    • Name: ec2-to-s3-role
    • Description: Whatever you want!
    • Trusted entity type: Amazon EC2
    • Permissions: Attach the allow-ec2-to-app-bucket policy you created, and attach the AmazonSSMManagedInstanceCore AWS managed policy
  5. Challenge

    Attach the IAM Role to the New EC2 Instance

    Take the newly created ec2-to-s3-role IAM role and attach it to your New Server EC2 instance.

  6. Challenge

    Get the File From Amazon S3 on the New EC2 Instance

    Connect to the New Sever Amazon EC2 instance via session manager. Use the AWS CLI to get the recently uploaded file from your Amazon S3 bucket and save it to the /tmp directory.

About the author

Pluralsight Skills gives leaders confidence they have the skills needed to execute technology strategy. Technology teams can benchmark expertise across roles, speed up release cycles and build reliable, secure products. By leveraging our expert content, skill assessments and one-of-a-kind analytics, keep up with the pace of change, put the right people on the right projects and boost productivity. It's the most effective path to developing tech skills at scale.

Real skill practice before real-world application

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Learn by doing

Engage hands-on with the tools and technologies you’re learning. You pick the skill, we provide the credentials and environment.

Follow your guide

All labs have detailed instructions and objectives, guiding you through the learning process and ensuring you understand every step.

Turn time into mastery

On average, you retain 75% more of your learning if you take time to practice. Hands-on labs set you up for success to make those skills stick.

Get started with Pluralsight