Skip to content
This repository was archived by the owner on Aug 7, 2025. It is now read-only.

Commit a6748ea

Browse files
Refine EC2 docs
1 parent 44cde48 commit a6748ea

File tree

1 file changed

+21
-19
lines changed

1 file changed

+21
-19
lines changed

content/en/user-guide/aws/ec2/index.md

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ Any execution of this data is recorded in the `/var/log/cloud-init-output.log` f
196196

197197
You can also set up an SSH connection to the locally emulated EC2 instance using the instance IP address.
198198

199-
This section assumes that you have created or imported an SSH key pair named `my-key` (see [instructions above]({{< relref "#create-a-key-pair" >}})).
199+
This section assumes that you have created or imported an SSH key pair named `my-key`.
200200
When running the EC2 instance, make sure to pass the `--key-name` parameter to the command:
201201

202202
{{< command >}}
@@ -211,7 +211,7 @@ $ ssh -p 12862 -i key.pem root@127.0.0.1
211211
{{< /command >}}
212212

213213
{{< callout "tip" >}}
214-
If the `ssh` command throws an error like "Identity file not accessible" or "bad permissions", then please make sure that the key file has a restrictive `0400` permission as illustrated [here]({{< relref "ec2#create-a-key-pair" >}}).
214+
If the `ssh` command throws an error like "Identity file not accessible" or "bad permissions", make sure that the key file has a restrictive `0400` permission as illustrated above.
215215
{{< /callout >}}
216216

217217
## VM Managers
@@ -251,8 +251,8 @@ While the records of resources will be persisted, the instances or AMIs themselv
251251

252252
### AMIs
253253

254-
LocalStack utilizes a specific naming scheme to recognize and manage associated containers and images.
255254
Docker base images which are tagged with the scheme `localstack-ec2/<AmiName>:<AmiId>` are recognized as Amazon Machine Images (AMIs).
255+
These can be used to launch EC2 instances which are in fact Docker containers.
256256

257257
You can mark any Docker base image as AMI using the below command:
258258

@@ -267,28 +267,27 @@ At startup, LocalStack downloads the following AMIs that can be used to launch D
267267
- Amazon Linux 2023 `ami-024f768332f0`
268268

269269
{{< callout "note" >}}
270-
The auto download of Docker images to be used as AMIs can be disabled using the `EC2_DOWNLOAD_DEFAULT_IMAGES=0` configuration variable.
270+
The auto download of Docker images for default AMIs can be disabled using the `EC2_DOWNLOAD_DEFAULT_IMAGES=0` configuration variable.
271271
{{< /callout >}}
272272

273273
All LocalStack-managed Docker AMIs bear the resource tag `ec2_vm_manager:docker`.
274-
These AMIs can be listed using:
274+
These can be listed using:
275275

276276
{{< command >}}
277277
$ awslocal ec2 describe-images --filters Name=tag:ec2_vm_manager,Values=docker
278278
{{< /command >}}
279279

280280
{{< callout "note" >}}
281-
If an AMI does have the `ec2_vm_manager:docker` tag, it means that it is mocked.
281+
If an AMI does not have the `ec2_vm_manager:docker` tag, it means that it is mocked.
282282
Attempting to launch Dockerized instances using these AMIs will result in an `InvalidAMIID.NotFound` error.
283283
See [Mock VM manager](#mock-vm-manager).
284284
{{< /callout >}}
285285

286-
AWS does not provide an API to download AMIs.
287-
This prevents the use stock AWS AMIs on LocalStack.
288-
However, in certain cases it may be possible to tweak your AMI build process to target Docker images.
286+
AWS does not provide an API to download AMIs which prevents the use of real AWS AMIs on LocalStack.
287+
However, in certain cases it may be possible to tweak your workflow to make it work with Localstack.
289288

290-
For example, suppose you use [Packer](https://packer.io/) to customise the Amazon Linux AMI on AWS.
291-
You can instead make Packer use the [Docker builder](https://developer.hashicorp.com/packer/integrations/hashicorp/docker/latest/components/builder/docker) instead of the Amazon builder and add the customisations on top of the Amazon Linux [Docker base image](https://hub.docker.com/_/amazonlinux/).
289+
For example, you can use [Packer](https://packer.io/) to customise the Amazon Linux AMI on AWS.
290+
Packer can be made to use the [Docker builder](https://developer.hashicorp.com/packer/integrations/hashicorp/docker/latest/components/builder/docker) instead of the Amazon builder and add the customisations on top of the Amazon Linux [Docker base image](https://hub.docker.com/_/amazonlinux/).
292291
The final image then can be used by LocalStack EC2 as illustrated above.
293292

294293
### Instances
@@ -321,26 +320,27 @@ These addresses are also printed in the logs while the instance is being initial
321320
When instances are launched, LocalStack attempts to start SSH server `/usr/sbin/sshd` in the Docker base image.
322321
If not found, it installs and starts the [Dropbear](https://github.com/mkj/dropbear) SSH server.
323322

324-
To be able to access the instance at additional ports from the host system, you can modify the default security group and incorporate the needed ingress ports.
323+
To be able to access the instance at additional ports from the host system, you can modify the default security group and include the required ingress ports.
325324

326325
{{< callout "note" >}}
327326
Security group ingress rules are applied only during the creation of the Dockerized instance.
328327
Modifying a security group will not open any ports for a running instance.
329328
{{< /callout >}}
330329

331330
The system supports up to 32 ingress ports.
332-
This constraint is in place to prevent the host from exhausting available ports.
331+
This constraint is in place to prevent exhausting free ports on the host.
333332

334333
{{< command >}}
335334
$ awslocal ec2 authorize-security-group-ingress \
336335
--group-id default \
337336
--protocol tcp \
338337
--port 8080
339-
$ awslocal ec2 describe-security-groups \
340-
--group-names default
338+
{{< /command >}}
339+
{{< command >}}
340+
$ awslocal ec2 describe-security-groups --group-names default
341341
{{< /command >}}
342342

343-
The port mapping details are provided in the logs during the instance initialization process.
343+
The port mapping details are provided in the logs when the instance starts up.
344344

345345
```bash
346346
2022-12-20T19:43:44.544 INFO Instance i-1d6327abf04e31be6 port mappings (container -> host): {'8080/tcp': 51747, '22/tcp': 55705}
@@ -507,9 +507,7 @@ Underlying virtual machines and volumes are not persisted, only their mock respr
507507
### AMIs
508508

509509
All qcow2 images with cloud-init support can be used as AMIs.
510-
511-
LocalStack does not come preloaded with any AMIs.
512-
You can find the download links for images of popular OSs below:
510+
You can find the download links for images of popular OSs below.
513511

514512
{{< tabpane text=true >}}
515513

@@ -545,6 +543,8 @@ An evaluation version of Windows Server 2012 R2 is provided by [Cloudbase Soluti
545543

546544
{{< /tabpane >}}
547545

546+
LocalStack does not come preloaded with any AMIs.
547+
548548
Compatible qcow2 images must be placed at the default Libvirt storage pool at `/var/lib/libvirt/images` on the host machine.
549549
Images must be named with the prefix `ami-` followed by at least 8 hexadecimal characters without an extension, e.g. `ami-1234abcd`.
550550
You may need run the following command to make sure the image is registered with Libvirt:
@@ -554,6 +554,8 @@ $ virsh pool-refresh default
554554
<disable-copy>
555555
Pool default refreshed
556556
</disable-copy>
557+
{{< /command >}}
558+
{{< command >}}
557559
$ virsh vol-list --pool default
558560
<disable-copy>
559561
Name Path

0 commit comments

Comments
 (0)