Skip to content

Commit

Permalink
improve extensions index docs
Browse files Browse the repository at this point in the history
  • Loading branch information
HarshCasper committed Nov 5, 2023
1 parent 14f4473 commit d3a9e83
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 73 deletions.
20 changes: 12 additions & 8 deletions content/en/user-guide/extensions/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: "LocalStack Extensions"
linkTitle: "Extensions"
weight: 3
description: >
Use the power of LocalStack Extensions to customize and extend your local development experience.
Use LocalStack Extensions to customize and extend your local development experience.
cascade:
type: docs
slug: extensions
Expand All @@ -12,15 +12,19 @@ slug: extensions
{{< figure src="https://user-images.githubusercontent.com/3996682/184503940-c30bfcac-e049-4ee4-b905-207b340111d1.png" >}}

LocalStack Extensions allow developers to extend and customize LocalStack.
Extensions are a feature of our paid offering.
To install and use extensions, you need an active LocalStack license.
Extensions are a feature of our paid offering. LocalStack Extensions enable you to start custom services with LocalStack in the same container, while leveraging the existing features in the ecosystem.

Specific LocalStack Extensions are documented [here]({{< ref "user-guide/extensions/official-extensions" >}}) and
can be discovered on our [Extension Library](https://app.localstack.cloud/extensions/library).
Our blogpost about [LocalStack’s Cloudflare Extension](https://localstack.cloud/blog/2023-06-26-develop-your-cloudflare-workers-aws-apps-locally-with-localstack-miniflare/)
showcases LocalStack as a local cloud development platform beyond AWS emulation.
Developers can add new services, extend existing services, and even add custom functionality. The Extensions API allows developers to easily plug in their own custom logic and services into the LocalStack container.

You can use LocalStack Extensions to:

- Starting custom services together with LocalStack in the same container (see our [Cloudflare Workers Extension](https://localstack.cloud/blog/2023-06-26-develop-your-cloudflare-workers-aws-apps-locally-with-localstack-miniflare/)).
- Instrumenting AWS requests with additional information before they reach your Lambdas.
- Logging AWS API calls to custom data backends.

The officially supported [LocalStack Extensions]({{< ref "user-guide/extensions/official-extensions" >}}) can be discovered on our [Extension Library](https://app.localstack.cloud/extensions/library). To install and use extensions, you need an active LocalStack license.

{{<alert title="Note">}}
The feature and the API are currently experimental and may be subject to change.
Please report any issues or feature requests on our [GitHub repository](https://github.com/localstack/localstack-extensions).
Please report any issues or feature requests on [LocalStack Extension's GitHub repository](https://github.com/localstack/localstack-extensions).
{{</alert>}}
69 changes: 69 additions & 0 deletions content/en/user-guide/extensions/getting-started/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
---
title: "Getting started"
linkTitle: "Getting started"
weight: 3
description: >
Get started with LocalStack extensions by installing and using the official MailHog extension.
---

## Introduction

MailHog is an open source email testing tool for developers. It provides a simple SMTP server and web interface that allows developers to easily catch and inspect emails sent from their application during development. In this guide, you will install and use the [official MailHog extension for LocalStack](https://github.com/localstack/localstack-extensions/tree/main/mailhog) and send an email through SES, while inspecting it in MailHog.

## Prerequisites

- [LocalStack Account](https://app.localstack.cloud/)
- [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html)

## Installation

To get started, start your LocalStack instance with your `LOCALSTACK_API_KEY`. Access our [Extension Manager](https://app.localstack.cloud/inst/default/extensions/manage), and click the **Install** button for the MailHog extension.

{{< figure src="install-extensions.png" alt="Extensions Manager" title="Extensions Manager" width="800">}}

You'll receive a confirmation prompt indicating that LocalStack container will restart, after which the extension will become accessible. Check your LocalStack logs for MailHog extension output, where you should see relevant logging information:

```bash
2023-10-11T19:10:54.708 INFO --- [ MainThread] l.extensions.platform : loaded 1 extensions
2023-10-11T19:10:54.709 INFO --- [ MainThread] mailhog.extension : starting mailhog server
2023-10-11T19:10:54.709 INFO --- [ MainThread] mailhog.extension : configuring SMTP host to internal mailhog smtp: localhost:25
...
2023-10-11T19:10:55.023 INFO --- [ MainThread] mailhog.extension : serving mailhog extension on host: http://mailhog.localhost.localstack.cloud:4566
2023-10-11T19:10:55.023 INFO --- [ MainThread] mailhog.extension : serving mailhog extension on path: http://localhost:4566/mailhog/
```

## Usage

MailHog enables you to conduct end-to-end testing of applications that utilize SES (Simple Email Service) for sending emails. To test this, let's use the AWS CLI to send an email.

### Send an Email

You can use the [`VerifyEmailIdentity`](https://docs.aws.amazon.com/cli/latest/reference/ses/verify-email-identity.html) API to verify an email address with SES. This is a required step before you can send emails from SES. Run the following command to verify an email address:

{{< command >}}
$ aws --endpoint-url=http://localhost:4566 \
ses verify-email-identity --email-address [email protected]
{{< /command >}}

You can further send an email using the [`SendEmail`](https://docs.aws.amazon.com/cli/latest/reference/ses/send-email.html) API. Run the following command to send an email:

{{< command >}}
$ aws --endpoint-url=http://localhost:4566 \
ses send-email \
--from [email protected] \
--message 'Body={Text={Data="Hello from LocalStack to MailHog"}},Subject={Data=Test Email}' \
--destination 'ToAddresses=[email protected]'
{{< /command >}}

### Navigate to Extension UI

Navigate in your browser to the [MailHog UI in LocalStack](http://mailhog.localhost.localstack.cloud:4566/). You should see the email you sent in the MailHog UI.

{{< figure src="mailhog.png" alt="Mailhog UI" title="Mailhog UI" width="800">}}

## Next steps

- Explore our collection of official extensions, along with a growing ecosystem of third-party extensions, in our [Extensions Library](https://app.localstack.cloud/extensions/library).
- Learn about the various methods for extension management and automating their installation when using LocalStack in a CI environment. Get detailed insights from our [Managing Extensions]({{< ref "managing-extensions" >}}) guide.
- Want to create your own extensions? Dive into our guide on [Developing Extensions]({{< ref "developing-extensions" >}}) for step-by-step instructions.

65 changes: 0 additions & 65 deletions content/en/user-guide/extensions/quickstart/index.md

This file was deleted.

0 comments on commit d3a9e83

Please sign in to comment.