AWS Certified CloudOps Engineer Associate SOA-C03 [2026]

Creating, Launching, and Managing Amazon Machine Images (AMIs)

Learn how to bootstrap an EC2 instance, create an AMI, launch instances from it, and clean up the associated snapshots.

AWS Certified CloudOps Engineer Associate SOA-C03 [2026]AWS Certified CloudOps Engineer Associate SOA-C03 [2026]Updated Sep 1, 2026
Study options
WatchComing later
ListenComing later
ReadAvailable
ReviewComing later

Study guide

Technical reference and lesson notes

Purpose of This Lesson

This hands-on lesson demonstrates the complete EC2 AMI workflow: prepare an instance with user data, verify the application, create an AMI, launch another instance from that image, and clean up the resulting resources. The workflow is especially relevant to AWS Certified CloudOps Engineer Associate scenario questions involving repeatable provisioning, instance configuration, snapshots, and resource lifecycle management.

Key Concepts

  • Amazon Machine Image (AMI): A reusable template containing the operating system and the instance configuration captured when the image is created.
  • EC2 user data: A first-launch bootstrap mechanism used here to install Apache and copy an index.html file from an Amazon S3 bucket.
  • Amazon EBS snapshot: The storage snapshot backing the AMI. The AMI and its snapshot are initially pending while creation completes.
  • IAM instance profile: The role attached to the initial EC2 instance so its user data can read from S3. The role uses an EC2 trust relationship and Amazon S3 read-only permissions.
  • AMI launch behavior: Instances launched from the completed AMI already contain the installed and configured Apache service, so they do not require the original instance profile or user data for this application.
  • AMI lifecycle: Creating an image does not eliminate the need to manage its underlying snapshot. Deregistering an AMI and deleting its associated snapshot are separate cleanup considerations.

EC2 AMI Creation and Launch Workflow

1. Prepare the S3 content

Create an Amazon S3 bucket and upload the course-provided index.html file. The page displays a confirmation that the Apache website is running on EC2. Record the bucket name because it is inserted into the EC2 user data script.

2. Launch and bootstrap the source instance

Launch an EC2 instance using an Amazon Linux 2023 AMI. Select a security group that allows HTTP traffic on port 80. Under the advanced details, attach an IAM role with:

  • A trust relationship for EC2.
  • Amazon S3 read-only permissions.

Paste the user data script into the instance configuration. The script bootstraps the instance by installing Apache and copying index.html from the S3 bucket.

The role is needed during this initial configuration because the instance must read the web page from S3. The security group is also essential: even a correctly configured Apache service cannot be reached from a browser if inbound HTTP traffic is not allowed.

3. Verify before creating the image

Wait until the instance is running and the user data process has completed. Test the public IP address in a browser and confirm that the Apache page is displayed. Creating an AMI before initialization completes can produce an image that does not contain the intended software or configuration.

4. Create the AMI

From the instance actions menu, choose the option to create an image and give it a meaningful name, such as my Apache server.

AWS can reboot the instance before taking the snapshot. A reboot helps provide a consistent image when applications or the operating system may be actively writing data. For this simple static Apache example, the lesson disables the reboot option because application consistency is not a concern in the demonstrated use case.

5. Wait for AMI and snapshot completion

AMI creation is asynchronous. The AMI initially appears as pending, and its backing EBS snapshot also appears as pending. The AMI becomes available after the snapshot completes. Do not attempt to rely on the image until its status is available.

6. Launch from the completed AMI

There are two equivalent console paths:

  • Launch an instance directly from the AMI.
  • Use the normal instance launch workflow, choose Browse more AMIs, open My AMIs, and select the created image.

When launching from this AMI, select the appropriate web-access security group. For the demonstrated application, no instance profile and no user data are required because Apache and the website configuration were already captured in the image.

7. Verify and clean up

After the new instance is running, open its public IP address and confirm that the website is available. When finished with the lab:

  1. Terminate the test instances.
  2. Deregister the AMI.
  3. Delete the associated EBS snapshot if it is no longer needed.

Deregistering the AMI and deleting the snapshot are separate lifecycle actions to verify during cleanup.

Exam- or Assessment-Relevant Takeaways

  • User data versus AMI: Use user data for first-launch installation and configuration. Create an AMI when the configured state should be reused for subsequent instances.
  • Role timing: The initial instance needs the EC2 instance profile because its bootstrap script reads from S3. A newly launched instance from the AMI does not need that role for this already-captured application state.
  • Snapshot dependency: An AMI is backed by a snapshot. The image remains pending until the snapshot is complete.
  • Reboot decision: Rebooting before image creation improves consistency for workloads with active writes. Skipping the reboot may be acceptable for the simple static Apache scenario shown, but it is not a universal best practice.
  • Verification matters: Confirm that user data completed and that the service is reachable before creating the AMI. Otherwise, the image may preserve an incomplete configuration.
  • Networking still applies: Launching from an AMI does not replace security-group requirements. The new instance still needs a security group permitting HTTP access on port 80.
  • Lifecycle management: Terminating instances does not automatically mean the AMI and its backing snapshot are no longer present. Clean up each resource deliberately when appropriate.

Tool / Feature Decision Guide

NeedAppropriate feature or actionReason
Install Apache and retrieve a file during first bootEC2 user data plus an IAM instance profileThe instance must run initialization logic and access S3 securely.
Reuse an already configured serverCreate an AMIThe installed service and configuration are captured for later launches.
Provide a repeatable source for new instancesLaunch from the completed AMINew instances start with the captured operating-system state.
Protect against inconsistent application state during captureReboot before creating the AMIThe snapshot can be taken while the application and operating system are not running.
Capture a simple static Apache test where active writes are not a concernConsider disabling the reboot optionThis is the specific lesson scenario; the choice depends on workload behavior.
Allow the browser to reach the web serviceUse a security group with inbound HTTP on port 80The application can be healthy while remaining inaccessible if network access is blocked.
Remove an obsolete image completelyDeregister the AMI and assess/delete its snapshotThe AMI and underlying snapshot require separate lifecycle attention.

Common Traps / Misconceptions

  • Assuming an AMI is instantly available: AMI creation can take several minutes and remains pending until the backing snapshot completes.
  • Thinking user data is required on every launch: User data was used to build the source instance. It is not needed for the demonstrated launches from the completed AMI.
  • Forgetting the S3 permission requirement: The bootstrap process cannot copy the file from S3 unless the instance role has suitable S3 read access.
  • Confusing IAM access with network access: The IAM role controls S3 permissions; the security group controls whether HTTP traffic can reach the instance.
  • Always disabling the reboot: Skipping a reboot is suitable for the simple static example, not automatically for applications with active writes or consistency requirements.
  • Assuming deregistering the AMI deletes everything: The associated snapshot may still need to be deleted separately if it is no longer required.
  • Creating the AMI before validation: If Apache installation or file retrieval has failed, the failure can be preserved in every instance launched from the image.

Real-World Engineer / Analyst Notes

  • Treat AMI creation as a release or golden-image step: install required software, apply relevant configuration and updates, validate behavior, then capture the image.
  • Use a meaningful AMI name so its intended workload and status are clear when multiple images exist.
  • Check both the service response and the image/snapshot status. A web page working on the source instance does not mean the AMI is already ready for use.
  • Keep the initial bootstrap role narrowly scoped to the required S3 read operation rather than treating the role as part of the permanent application configuration.
  • Before deleting a snapshot, confirm that no retained AMI or other operational process still depends on it. The lab deletes it only because the test resources are no longer needed.

Quick Reference Summary

  1. Upload index.html to S3 and record the bucket name.
  2. Launch Amazon Linux 2023 with HTTP port 80 allowed.
  3. Attach an EC2-trusted IAM role with S3 read-only access.
  4. Use user data to install Apache and copy the file from S3.
  5. Verify the page through the instance public IP.
  6. Create an AMI, choosing whether a reboot is needed for consistency.
  7. Wait for both the AMI and backing snapshot to become available.
  8. Launch a new instance from My AMIs using the web-access security group.
  9. Omit user data and the instance profile for this already-configured example.
  10. Verify the new instance, then terminate instances, deregister the AMI, and delete the snapshot if appropriate.

Flashcards

Q: Why is an IAM role attached to the initial EC2 instance in this workflow?

A: The user data script must read index.html from Amazon S3. The instance role supplies S3 read-only permissions through an EC2-trusted role.

Q: An instance is running, but browsing to its public IP does not show Apache. Which configuration areas should be checked first?

A: Confirm that user data completed and that the security group allows inbound HTTP on port 80. IAM permissions alone do not make the web service reachable.

Q: When should user data be used instead of creating an AMI?

A: Use user data when an instance should perform installation or configuration during first boot. Create an AMI when that completed state needs to be reused for future launches.

Q: What is the main operational reason to reboot an instance before creating an AMI?

A: Rebooting can help ensure the backing snapshot is captured while the operating system and applications are not actively running or writing data, improving consistency.

Q: Why might the reboot option be disabled for the lesson’s Apache example?

A: The example is a simple static website, so active application writes are not a concern. This is a scenario-specific tradeoff, not a rule that rebooting is always unnecessary.

Q: What must happen before a newly created AMI can reliably be used to launch the test server?

A: The AMI must change from pending to available, which occurs after its backing EBS snapshot completes.

Q: How can the created AMI be selected through the standard EC2 launch process?

A: Choose Browse more AMIs, open My AMIs, and select the image that was created from the configured instance.

Q: Why does the new instance launched from the AMI not need the original user data script in this exercise?

A: Apache and the website configuration were already installed and captured in the AMI, so repeating the bootstrap script is unnecessary.

Q: Why is the original instance profile not required when launching the configured AMI in this example?

A: The S3 copy operation has already occurred and the application is already present in the image. The new instance is not performing that S3 bootstrap step.

Q: What is the relationship between an AMI and its EBS snapshot during creation?

A: The snapshot backs the AMI. Both may show pending status initially, and the AMI becomes available after the snapshot is complete.

Q: What is the difference between a security group and an IAM instance profile in this workflow?

A: The security group controls network access such as HTTP on port 80. The IAM instance profile grants the instance permission to access AWS services such as S3.

Q: What cleanup actions are needed when the test image is no longer required?

A: Terminate the test instances, deregister the AMI, and delete its associated snapshot if it is no longer needed.

Q: What is the trap in creating an AMI immediately after launching the source instance?

A: User data may still be installing Apache or copying the web page. Capturing too early can create an incomplete image that reproduces the failure.

Practice Questions

Question 1

A CloudOps engineer launches an EC2 instance with user data that installs Apache and copies a web page from S3. The page is confirmed working, and the engineer wants future instances to start with the same software already installed. What should the engineer do next?

A. Attach the S3 read-only role to every future instance and rerun the user data script
B. Create an AMI from the validated instance
C. Delete the source instance and recreate it from the Amazon Linux base AMI
D. Create a security group without HTTP access

Correct answer: B. Create an AMI from the validated instance. The requirement is to reuse the completed configuration, which is the purpose of an AMI.

Question 2

An AMI has been created, but its status is still pending. The associated EBS snapshot is also pending. What is the best interpretation?

A. The AMI is usable, but the snapshot status is informational only
B. The AMI will become available after the backing snapshot completes
C. The IAM role is missing and must be attached to the AMI
D. The security group must be changed before the snapshot can complete

Correct answer: B. The AMI will become available after the backing snapshot completes. AMI creation depends on completion of the underlying snapshot.

Question 3

A new instance launched from the completed Apache AMI starts successfully, but the engineer cannot reach the web page from a browser. The Apache installation was present in the image. Which issue is most directly indicated by the scenario?

A. The AMI needs to be recreated with user data
B. The instance must have an S3 read-only role to serve a static local page
C. The instance’s security group may not allow inbound HTTP on port 80
D. The AMI cannot be used to launch more than one instance

Correct answer: C. The instance’s security group may not allow inbound HTTP on port 80. The AMI preserves the application, but network access still depends on the selected security group.

Question 4

An engineer is capturing an AMI of an application that may be actively writing data. Which choice best reflects the consistency decision demonstrated in the lesson?

A. Always disable reboot because AMIs never require a stopped operating system
B. Reboot before capture when application and operating-system consistency matters
C. Attach the S3 role before capture to guarantee snapshot consistency
D. Delete the backing snapshot immediately after creating the AMI

Correct answer: B. Reboot before capture when application and operating-system consistency matters. The lesson notes that a reboot can allow the snapshot to be taken when the application and operating system are not running.

Question 5

A lab is complete, and the engineer deregisters the AMI but still sees its EBS snapshot. What should the engineer do if the snapshot is no longer needed?

A. Leave it indefinitely because deregistering the AMI always deletes it later
B. Launch another instance from the snapshot before deleting it
C. Delete the associated snapshot after confirming it is no longer required
D. Reattach the original IAM role to the snapshot

Correct answer: C. Delete the associated snapshot after confirming it is no longer required. AMI deregistration and snapshot deletion are separate cleanup actions.

WordPress Metadata

Suggested Slug:
creating-launching-managing-amis-ec2

Meta Description:
Learn how to bootstrap an EC2 instance, create an AMI, launch instances from it, and clean up the associated snapshots.

Tags:
AWS, Amazon EC2, Amazon Machine Images, AMIs, EBS snapshots, Amazon S3, IAM roles, EC2 user data, CloudOps, AWS Certified CloudOps Engineer