Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Describe how to use Localstack to improve the development experience with AWS #6875

Merged
merged 13 commits into from
Nov 6, 2024
Merged
4 changes: 4 additions & 0 deletions menu/menu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1113,6 +1113,8 @@
Title: Native Integration
- Url: transports/sqs/operations-scripting
Title: Scripting
- Url: nservicebus/aws/local-development
Title: Local development
- Url: transports/sqs/troubleshooting
Title: Troubleshooting

Expand Down Expand Up @@ -1360,6 +1362,8 @@
Title: Outbox
- Url: persistence/dynamodb/transactions
Title: Transactions
- Url: nservicebus/aws/local-development
Title: Local development

- Name: ServiceInsight
Topics:
Expand Down
5 changes: 5 additions & 0 deletions nservicebus/aws/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: AWS local development
summary: Guidance on local development when using AWS
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although this won't be in the nav, so it would be hard to get here without manually altering the URL, I would imagine that any other article added to this section would not be about local development but more AWS stuff in general. Shouldn't this title/summary be more general as well?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like the need of this index page. I see two options:

  1. Delete this page and the aws folder. Move the nservicebus/aws/local-development.md under architecture/aws/local-development.md and keep the menu links as is pointing to the new location
  2. Delete this page and the aws folder. Move the nservicebus/aws/local-development.md under transports/sqs/local-development.md and keep the menu links as is pointing to the new location

Copy link
Member

@DavidBoike DavidBoike Nov 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer option 2. It's a greater affinity for SQS. If you're using Dynamo it should be because you're already using Dynamo and you're really past the point of developing a plan for these things.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DavidBoike@saratry and I thought the index page could look like a landing/summary page for supported AWS services. What do you think?

DavidBoike marked this conversation as resolved.
Show resolved Hide resolved
reviewed: 2024-10-29
---
DavidBoike marked this conversation as resolved.
Show resolved Hide resolved
36 changes: 36 additions & 0 deletions nservicebus/aws/local-development.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
title: AWS local development using LocalStack
summary: How to use LocalStack for your development needs when using Amazon SQS Transport and DynamoDB Persistence
reviewed: 2024-10-29
---

[LocalStack](https://www.localstack.cloud/) is a tool to develop and test your AWS applications locally, reducing development time and increasing productivity.

> [!NOTE]
> Refer to the [official LocalStack documentation](https://docs.localstack.cloud/getting-started/installation/) to learn how to install and run it locally.

To configure an NServiceBus endpoint to connect to LocalStack instead of AWS, the AWS endpoint URL must be set to the address of the LocalStack instance. The simplest way is by defining the `AWS_ENDPOINT_URL` environment variable and setting its value to the LocalStack URL:

```
AWS_ENDPOINT_URL=http://localhost.localstack.cloud:4566
```

Alternatively, configure the AWS SDK `ServiceURL` configuration property, like in the following example programmatically:


```csharp
var amazonSqsConfig = new AmazonSQSConfig();
amazonSqsConfig.ServiceURL = "http://localhost.localstack.cloud:4566";
var amazonSqsClient = new AmazonSQSClient(amazonSqsConfig);
```

mauroservienti marked this conversation as resolved.
Show resolved Hide resolved

> [!NOTE]
> Remember that, even if you are not connecting to AWS cloud services, it is still required to specify access credentials and region.
> From the LocalStack perspective they could be fake values, like the following:
>
> ```bash
> AWS_ACCESS_KEY_ID=demo
> AWS_SECRET_ACCESS_KEY=demo
> AWS_REGION=us-east-1
> ```
6 changes: 5 additions & 1 deletion servicecontrol/transports.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Transport configuration
summary: ServiceControl can be configured to use one of the supported message transports which are configured for each instance type
summary: ServiceControl can be configured to use one of the supported message transports which are configured for each instance type
reviewed: 2024-07-19
component: ServiceControl
---
Expand Down Expand Up @@ -99,6 +99,10 @@ The following ServiceControl connection string options are available:
* `S3KeyPrefix=<value>` - S3 key prefix [option](/transports/sqs/configuration-options.md#offload-large-messages-to-s3-key-prefix).
* `DoNotWrapOutgoingMessages=true` - Do not wrap outgoing messages [option](/transports/sqs/configuration-options.md#do-not-wrap-message-payload-in-a-transport-envelope).

> [!NOTE]
> When using SQS as a transport, for local development purposes it is possible to set up ServiceControl to connect to a LocalStack instance.
mauroservienti marked this conversation as resolved.
Show resolved Hide resolved
> Refer to the [documentation](/nservicebus/aws/local-development.md) about how to configure the environment to use LocalStack.

## MSMQ

To configure MSMQ as the transport, ensure the MSMQ service has been installed and configured as outlined in [MSMQ configuration](/transports/msmq/#msmq-configuration).
Expand Down