From 0373c8b9259eb98d08c7a6eb75d217bad84bdc2a Mon Sep 17 00:00:00 2001 From: Brian Rinaldi Date: Wed, 18 Jun 2025 16:22:49 -0400 Subject: [PATCH 1/7] App frameworks section done Added the ability to add line numbers --- ec.config.mjs | 9 + package-lock.json | 16 +- package.json | 1 + .../integrations/app-frameworks/quarkus.md | 172 +++++++++++++++++- ...-framework.mdx => serverless-framework.md} | 0 .../app-frameworks/spring-cloud-function.mdx | 48 ++--- 6 files changed, 204 insertions(+), 42 deletions(-) create mode 100644 ec.config.mjs rename src/content/docs/aws/integrations/app-frameworks/{serverless-framework.mdx => serverless-framework.md} (100%) diff --git a/ec.config.mjs b/ec.config.mjs new file mode 100644 index 00000000..c5224efe --- /dev/null +++ b/ec.config.mjs @@ -0,0 +1,9 @@ +import { pluginLineNumbers } from '@expressive-code/plugin-line-numbers'; + +/** @type {import('@astrojs/starlight/expressive-code').StarlightExpressiveCodeOptions} */ +export default { + plugins: [pluginLineNumbers()], + defaultProps: { + showLineNumbers: false, + }, +}; diff --git a/package-lock.json b/package-lock.json index d55d22ec..01dcfa66 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,6 +13,7 @@ "@astrojs/starlight": "^0.34.0", "@astrojs/starlight-markdoc": "^0.4.0", "@astrojs/starlight-tailwind": "^4.0.1", + "@expressive-code/plugin-line-numbers": "^0.41.2", "@lorenzo_lewis/starlight-utils": "^0.3.2", "@tailwindcss/vite": "^4.1.6", "@tanstack/react-table": "^8.21.3", @@ -977,9 +978,9 @@ } }, "node_modules/@expressive-code/core": { - "version": "0.41.1", - "resolved": "https://registry.npmjs.org/@expressive-code/core/-/core-0.41.1.tgz", - "integrity": "sha512-mG2IrN4t/NGPmEeeswmttsW7W7c96sz3ASjo1psQnOqU5QWAF61HpnBu3lPxHI8iQJyZI8wfAroo9FFpwlkvAQ==", + "version": "0.41.2", + "resolved": "https://registry.npmjs.org/@expressive-code/core/-/core-0.41.2.tgz", + "integrity": "sha512-AJW5Tp9czbLqKMzwudL9Rv4js9afXBxkSGLmCNPq1iRgAYcx9NkTPJiSNCesjKRWoVC328AdSu6fqrD22zDgDg==", "license": "MIT", "dependencies": { "@ctrl/tinycolor": "^4.0.4", @@ -1002,6 +1003,15 @@ "@expressive-code/core": "^0.41.1" } }, + "node_modules/@expressive-code/plugin-line-numbers": { + "version": "0.41.2", + "resolved": "https://registry.npmjs.org/@expressive-code/plugin-line-numbers/-/plugin-line-numbers-0.41.2.tgz", + "integrity": "sha512-xdRoScuFWQbYEpWTh6G7kJ0VK46kcUPHPMjRo3CG2ynZ1rqiJCC9FnZQQWQ7U8aGd/n7EnU3vJBkBeVqhZyEWg==", + "license": "MIT", + "dependencies": { + "@expressive-code/core": "^0.41.2" + } + }, "node_modules/@expressive-code/plugin-shiki": { "version": "0.41.1", "resolved": "https://registry.npmjs.org/@expressive-code/plugin-shiki/-/plugin-shiki-0.41.1.tgz", diff --git a/package.json b/package.json index c89da584..fbd91067 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "@astrojs/starlight": "^0.34.0", "@astrojs/starlight-markdoc": "^0.4.0", "@astrojs/starlight-tailwind": "^4.0.1", + "@expressive-code/plugin-line-numbers": "^0.41.2", "@lorenzo_lewis/starlight-utils": "^0.3.2", "@tailwindcss/vite": "^4.1.6", "@tanstack/react-table": "^8.21.3", diff --git a/src/content/docs/aws/integrations/app-frameworks/quarkus.md b/src/content/docs/aws/integrations/app-frameworks/quarkus.md index b025219e..e69f3a2a 100644 --- a/src/content/docs/aws/integrations/app-frameworks/quarkus.md +++ b/src/content/docs/aws/integrations/app-frameworks/quarkus.md @@ -1,9 +1,177 @@ --- title: Quarkus -description: This is a dummy description +description: Use the Quarkus framework with LocalStack template: doc sidebar: order: 3 --- -Nada \ No newline at end of file +## Introduction + +Quarkus is a Java framework optimized for cloud, serverless, and containerized environments. +Quarkus leverages a Kubernetes Native Java stack tailored for GraalVM & OpenJDK HotSpot, which further builds on various Java libraries and standards. + +Localstack is supported by Quarkus as a Dev service for Amazon Services. +Quarkus Amazon Services automatically starts a LocalStack container in development mode and when running tests, and the extension client is configured automatically. + +## Getting started + +In this guide, we will demonstrate how you can create a service client for creating and managing Lambdas on LocalStack. +The Lambda extension is based on [AWS Java SDK 2.x](https://docs.aws.amazon.com/sdk-for-java/v2/developer-guide/welcome.html). + +### Prerequisites + +- [LocalStack](/aws/getting-started/installation/) installed and running +- [JDK 17+](https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html) with `JAVA_HOME` configured properly +- [Maven 3.8.1+](https://maven.apache.org/download.cgi) +- [Docker](https://docs.docker.com/get-docker/) + +### Create a Maven project + +Create a new project with the following command: + +```bash +mvn io.quarkus.platform:quarkus-maven-plugin:3.6.3:create \ + -DprojectGroupId=org.acme \ + -DprojectArtifactId=amazon-lambda-quickstart \ + -DclassName="org.acme.lambda.QuarkusLambdaSyncResource" \ + -Dpath="/sync" \ + -Dextensions="resteasy-reactive-jackson,amazon-lambda" +cd amazon-lambda-quickstart +``` + +The above command generates a Maven project structure with imports for RESTEasy Reactive/JAX-RS and Amazon Lambda Client extensions. + +### Configure Lambda Client + +Both Lambda clients (sync and async) can be configured through the `application.properties` file, which should be located in the `src/main/resources` directory. +Additionally, ensure that a suitable implementation of the sync client is added to the `classpath`. +By default, the extension employs the URL connection HTTP client, so it's necessary to include a URL connection client dependency in the `pom.xml` file: + +```xml + + software.amazon.awssdk + url-connection-client + +``` + +If you want to use Apache HTTP client instead, configure it as follows in `application.properties`: + +```xml +quarkus.lambda.sync-client.type=apache +``` + +Add the following dependencies to the `pom.xml` file: + +```xml + + software.amazon.awssdk + apache-client + +```` + +To configure LocalStack, add the following properties to the `application.properties` file: + +```bash +quarkus.lambda.endpoint-override=http://localhost:4566 + +quarkus.lambda.aws.region=us-east-1 +quarkus.lambda.aws.credentials.type=static +quarkus.lambda.aws.credentials.static-provider.access-key-id=test-key +quarkus.lambda.aws.credentials.static-provider.secret-access-key=test-secret +``` + +### Package the application + +You can package the application with the following command: + +```bash +$ ./mvnw clean package +``` + +You can further run the application in dev mode with the following command: + +```bash +$ java -Dparameters.path=/quarkus/is/awesome/ -jar target/quarkus-app/quarkus-run.jar +``` + +:::tip +With GraalVM installed, you can also create a native executable binary using the following command: + +```bash +$ ./mvnw clean package -Dnative. +``` +::: + +:::note +Dev Services for Amazon Services is automatically enabled for each extension added to the `pom.xml`, except in the following scenarios: + +- When `quarkus.devservices.enabled` is set to false. +- When `devservices.enabled` is set to false per extension (e.g., `quarkus.s3.devservices.enabled=false`). +- When the `endpoint-override` is configured (e.g., `quarkus.s3.endpoint-override=http://localhost:4566`). +::: + +## Supported extensions + +- [Lambda](https://docs.quarkiverse.io/quarkus-amazon-services/dev/amazon-lambda.html) +- [S3](https://docs.quarkiverse.io/quarkus-amazon-services/dev/amazon-s3.html) +- [SSM](https://docs.quarkiverse.io/quarkus-amazon-services/dev/amazon-ssm.html) +- [SQS](https://docs.quarkiverse.io/quarkus-amazon-services/dev/amazon-sqs.html) +- [SNS](https://docs.quarkiverse.io/quarkus-amazon-services/dev/amazon-sns.html) +- [SES](https://docs.quarkiverse.io/quarkus-amazon-services/dev/amazon-ses.html) +- [Secrets Manager](https://docs.quarkiverse.io/quarkus-amazon-services/dev/amazon-secretsmanager.html) +- [KMS](https://docs.quarkiverse.io/quarkus-amazon-services/dev/amazon-kms.html) +- [IAM](https://docs.quarkiverse.io/quarkus-amazon-services/dev/amazon-iam.html) + +## Configuration + +The following configuration properties are fixed at build time. +All the other configuration properties can be overridden at runtime. + +| Property | Type | Default | +|----------------------------------------------------------|------------------------|--------------------------------------| +| `quarkus.aws.devservices.localstack.image-name` | string | `localstack/localstack:3.0.1` | +| `quarkus.aws.devservices.localstack.init-scripts-folder` | string | | +| `quarkus.aws.devservices.localstack.init-scripts-classpath`| string | | +| `quarkus.aws.devservices.localstack.init-completion-msg` | string | | +| `quarkus.aws.devservices.localstack.container-properties` | `Map` | | +| `quarkus.aws.devservices.localstack.additional-services."additional-services".enabled` | boolean | | +| `quarkus.aws.devservices.localstack.additional-services."additional-services".shared` | boolean | `false` | +| `quarkus.aws.devservices.localstack.additional-services."additional-services".service-name` | string | `localstack` | +| `quarkus.aws.devservices.localstack.additional-services."additional-services".container-properties` | `Map` | | + +{{< callout >}} +- If `quarkus.aws.devservices.localstack.additional-services."additional-services".enabled` is set to `true` and the endpoint-override is not configured, LocalStack will be started and utilized instead of the provided configuration. + For all services excluding Cognito, LocalStack will function as the core cloud emulator. + In the case of Cognito, the emulation/mocking will be done by Moto. +- The `quarkus.aws.devservices.localstack.additional-services."additional-services".shared` indicates whether the LocalStack container managed by Dev Services is shared. + In shared mode, Quarkus utilizes label-based service discovery, specifically the `quarkus-dev-service-localstack` label, to identify running containers. + If a matching container is found, it is used. + Otherwise, Dev Services initiates a new container. + It's important to note that sharing is not supported for the Cognito extension. +- In `quarkus.aws.devservices.localstack.additional-services."additional-services".service-name`, the value of the `quarkus-dev-service-localstack` label is attached to the initiated container. + In dev mode, when the shared flag is true, Dev Services checks for a container with the `quarkus-dev-service-localstack` label set to the configured value before starting a new one. + If found, it utilizes the existing container. + Otherwise, it creates a new container with the `quarkus-dev-service-localstack` label set to the specified value. + In test mode, Dev Services groups services with the same service-name value into a single container instance. + This property is useful when there's a requirement for multiple shared LocalStack instances. +{{< /callout >}} + +### Specific configuration + +Dev Services can support specific configurations passed to the LocalStack container. +These configurations can be globally applied to all containers or specified individually per service. + +```bash +quarkus.aws.devservices.localstack.image-name=localstack/localstack:3.0.3 +quarkus.dynamodb.devservices.container-properties.DYNAMODB_HEAP_SIZE=1G +``` + +### Additional services + +To start additional services for which a Quarkus extension does not exist or is not imported in the project, use the `additional-services` property: + +```bash +quarkus.aws.devservices.localstack.additional-services."kinesis".enabled=true +quarkus.aws.devservices.localstack.additional-services."redshift".enabled=true +``` \ No newline at end of file diff --git a/src/content/docs/aws/integrations/app-frameworks/serverless-framework.mdx b/src/content/docs/aws/integrations/app-frameworks/serverless-framework.md similarity index 100% rename from src/content/docs/aws/integrations/app-frameworks/serverless-framework.mdx rename to src/content/docs/aws/integrations/app-frameworks/serverless-framework.md diff --git a/src/content/docs/aws/integrations/app-frameworks/spring-cloud-function.mdx b/src/content/docs/aws/integrations/app-frameworks/spring-cloud-function.mdx index 02116709..7f22525c 100644 --- a/src/content/docs/aws/integrations/app-frameworks/spring-cloud-function.mdx +++ b/src/content/docs/aws/integrations/app-frameworks/spring-cloud-function.mdx @@ -13,7 +13,6 @@ In this guide, you will learn how to use LocalStack to test your serverless applications powered by Spring Cloud Function framework. :::note - Some features and services described in this document may not work properly on aarch64, including Apple's M1 silicon. ::: @@ -119,8 +118,7 @@ To that end, we use the "Shadow Jar" plugin. Here's our final `build.gradle`: -{/* {{< highlight gradle "linenos=table" >}} */} {/* mdx-disabled */} {/* TODO: packing this into a bash block for now */} -```gradle +```groovy showLineNumbers=true plugins { id "java" id "org.jetbrains.kotlin.jvm" version '1.5.31' @@ -198,7 +196,6 @@ shadowJar { assemble.dependsOn shadowJar ``` -{/* {{< / highlight >}} */} {/* mdx-disabled */} Please note that we will be using `org.localstack.sampleproject` as a working namespace, and `org.localstack.sampleproject.Application` as an @@ -258,9 +255,7 @@ org.springframework.cloud.function.adapter.aws.FunctionInvoker::handleRequest Now our application needs an entry-class, the one we referenced earlier. Let's add it under `src/main/kotlin/org/localstack/sampleproject/Application.kt`. -{/* {{< highlight kotlin "linenos=table" >}} */} {/* mdx-disabled */} -{/* TODO: packing this into a java block for now */} -```java +```kotlin showLineNumbers package org.localstack.sampleproject import org.springframework.boot.autoconfigure.SpringBootApplication @@ -272,7 +267,6 @@ fun main(args: Array) { // Do nothing unless you use a custom runtime } ``` -{/*{{< / highlight >}}*/} ### Configure Jackson @@ -281,9 +275,8 @@ The easiest way to get started with JSON is to use the Jackson library. Let's configure it by creating a new configuration class `JacksonConfiguration.kt` under `src/main/kotlin/org/localstack/sampleproject/config`: -{/*{{< highlight kotlin "linenos=table" >}}*/} -```java +```kotlin package org.localstack.sampleproject.config import com.fasterxml.jackson.annotation.JsonInclude @@ -315,7 +308,6 @@ class JacksonConfiguration { } } ``` -{/*{{< / highlight >}}*/} In applications where you need support for multiple formats or a format different from JSON (for example, SOAP/XML applications) simply use multiple @@ -329,7 +321,7 @@ Let's create a small logging utility to simplify interactions with the logger {/*{{< highlight kotlin "linenos=table" >}}*/} {/* TODO: packing this into a java block for now */} -```java +```kotlin package org.localstack.sampleproject.util import org.apache.logging.log4j.LogManager @@ -354,9 +346,7 @@ Your application may even support multiple protocols with different request/resp Let's define utility functions to to build API gateway responses: -{/*{{< highlight kotlin "linenos=table" >}}*/} -{/* TODO: packing this into a java block for now */} -```java +```kotlin showLineNumbers package org.localstack.sampleproject.util import org.springframework.messaging.Message @@ -379,13 +369,10 @@ fun buildJsonResponse(data: T, code: Int = 200): Message { fun buildJsonErrorResponse(message: String, code: Int = 500) = buildJsonResponse(ResponseError(message), code) ``` -{/*{{< / highlight >}}*/} And now a utility function to process API Gateway requests: -{/*{{< highlight kotlin "linenos=table" >}}*/} -{/* TODO: packing this into a java block for now */} -```java +```kotlin showLineNumbers package org.localstack.sampleproject.util import com.amazonaws.services.lambda.runtime.events.APIGatewayProxyRequestEvent @@ -410,7 +397,6 @@ fun apiGatewayFunction( } } ``` -{/*{{< / highlight >}}*/} ### Creating a sample Model / DTO @@ -418,9 +404,7 @@ To transfer data from requests into something more meaningful than JSON strings (and back) you will be using a lot of Models and Data Transfer Objects (DTOs). It's time to define our first one. -{/*{{< highlight kotlin "linenos=table" >}}*/} -{/* TODO: packing this into a java block for now */} -```java +```kotlin showLineNumbers package org.localstack.sampleproject.model import com.fasterxml.jackson.annotation.JsonIgnore @@ -433,16 +417,13 @@ data class SampleModel( val jsonIgnoredProperty: String? = null, ) ``` -{/*{{< / highlight >}}*/} ### Creating Rest API endpoints Let's add our first endpoints to simulate CRUD operations on previously defined `SampleModel`: -{/*{{< highlight kotlin "linenos=table" >}}*/} -{/* TODO: packing this into a java block for now */} -```java +```kotlin showLineNumbers package org.localstack.sampleproject.api import com.fasterxml.jackson.databind.ObjectMapper @@ -485,7 +466,6 @@ class SampleApi(private val objectMapper: ObjectMapper) { } ``` -{/*{{< / highlight >}}*/} Note how we used Spring's dependency injection to inject `ObjectMapper` Bean we configured earlier. @@ -496,9 +476,7 @@ We know Java's cold start is always a pain. To minimize this pain, we will try to define a pre-warming endpoint within the Rest API. By invoking this function every 5-10 mins we can make sure Rest API lambda is always kept in a pre-warmed state. -{/*{{< highlight kotlin "linenos=table" >}}*/} -{/* TODO: packing this into a java block for now */} -```java +```kotlin showLineNumbers package org.localstack.sampleproject.api import com.fasterxml.jackson.databind.ObjectMapper @@ -518,7 +496,6 @@ class ScheduleApi(private val objectMapper: ObjectMapper) { } ``` -{/*{{< / highlight >}}*/} Now you can add a scheduled event to the Rest API lambda function with the following synthetic payload (to simulate API gateway request). This way, you can define any other scheduled events, but we recommend using pure lambda functions. @@ -541,9 +518,7 @@ We can still define pure lambda functions, DynamoDB stream handlers, and so on. Below you can find a little example of few lambda functions grouped in `LambdaApi` class. -{/*{{< highlight kotlin "linenos=table" >}}*/} -{/* TODO: packing this into a java block for now */} -```java +```kotlin showLineNumbers package org.localstack.sampleproject.api import com.amazonaws.services.lambda.runtime.events.DynamodbEvent @@ -584,7 +559,6 @@ class LambdaApi : SpringBootStreamHandler() { } ``` -{/*{{< / highlight >}}*/} As you can see from the example above, we are using `SpringBootStreamHandler` class as a base that takes care of the application bootstrapping process and @@ -732,7 +706,7 @@ class ApplicationStack(parent: Construct, name: String) : Stack(parent, name) { ``` -``` +```hcl variable "STAGE" { type = string default = "local" From c14f20d4ce971a9bad259fb52e8fdf15a2964d2e Mon Sep 17 00:00:00 2001 From: Brian Rinaldi Date: Wed, 18 Jun 2025 16:38:46 -0400 Subject: [PATCH 2/7] aws native tools done --- .../{aws-cdk.mdx => aws-cdk.md} | 0 .../aws-native-tools/aws-chalice.mdx | 26 +++++++++---------- .../{aws-cli.mdx => aws-cli.md} | 0 .../{aws-sam.mdx => aws-sam.md} | 0 4 files changed, 12 insertions(+), 14 deletions(-) rename src/content/docs/aws/integrations/aws-native-tools/{aws-cdk.mdx => aws-cdk.md} (100%) rename src/content/docs/aws/integrations/aws-native-tools/{aws-cli.mdx => aws-cli.md} (100%) rename src/content/docs/aws/integrations/aws-native-tools/{aws-sam.mdx => aws-sam.md} (100%) diff --git a/src/content/docs/aws/integrations/aws-native-tools/aws-cdk.mdx b/src/content/docs/aws/integrations/aws-native-tools/aws-cdk.md similarity index 100% rename from src/content/docs/aws/integrations/aws-native-tools/aws-cdk.mdx rename to src/content/docs/aws/integrations/aws-native-tools/aws-cdk.md diff --git a/src/content/docs/aws/integrations/aws-native-tools/aws-chalice.mdx b/src/content/docs/aws/integrations/aws-native-tools/aws-chalice.mdx index b45216f2..303e3064 100644 --- a/src/content/docs/aws/integrations/aws-native-tools/aws-chalice.mdx +++ b/src/content/docs/aws/integrations/aws-native-tools/aws-chalice.mdx @@ -6,6 +6,8 @@ sidebar: order: 4 --- +import { FileTree } from '@astrojs/starlight/components'; + [AWS Chalice](https://aws.github.io/chalice/) is a serverless micro framework used to develop and deploy your serverless applications on AWS resources. Chalice provides integrated functionality with most of the AWS Toolings like S3 Storage, Simple Queue Service, API Gateway and more. It offers a handy CLI interface that allows you to easily create, develop & deploy your serverless applications. @@ -61,20 +63,16 @@ Your project has been generated in ./localstack-test Let's take a look inside the project structure: -```sh -tree -. -├── app.py -├── chalicelib -│ └── __init__.py -├── requirements-dev.txt -├── requirements.txt -└── tests - ├── __init__.py - └── test_app.py - -2 directories, 6 files -``` + +- app.py +- chalicelib + - \_\_init\_\_.py +- requirements-dev.txt +- requirements.txt +- tests + - \_\_init\_\_.py + - test_app.py + The `app.py` is our main API file. It has only one Route that would assign the URL of the application to the function. diff --git a/src/content/docs/aws/integrations/aws-native-tools/aws-cli.mdx b/src/content/docs/aws/integrations/aws-native-tools/aws-cli.md similarity index 100% rename from src/content/docs/aws/integrations/aws-native-tools/aws-cli.mdx rename to src/content/docs/aws/integrations/aws-native-tools/aws-cli.md diff --git a/src/content/docs/aws/integrations/aws-native-tools/aws-sam.mdx b/src/content/docs/aws/integrations/aws-native-tools/aws-sam.md similarity index 100% rename from src/content/docs/aws/integrations/aws-native-tools/aws-sam.mdx rename to src/content/docs/aws/integrations/aws-native-tools/aws-sam.md From 737de8045a506d320fc47106cd642d3de4043179 Mon Sep 17 00:00:00 2001 From: Brian Rinaldi Date: Wed, 18 Jun 2025 16:44:50 -0400 Subject: [PATCH 3/7] AWS SDKs folder done --- .../integrations/aws-sdks/{cpp.mdx => cpp.md} | 0 .../docs/aws/integrations/aws-sdks/java.mdx | 21 ++++++------------- .../aws/integrations/aws-sdks/javascript.mdx | 1 - .../integrations/aws-sdks/{net.mdx => net.md} | 0 .../integrations/aws-sdks/{php.mdx => php.md} | 0 .../{python-boto3.mdx => python-boto3.md} | 0 .../aws-sdks/{ruby.mdx => ruby.md} | 2 +- 7 files changed, 7 insertions(+), 17 deletions(-) rename src/content/docs/aws/integrations/aws-sdks/{cpp.mdx => cpp.md} (100%) rename src/content/docs/aws/integrations/aws-sdks/{net.mdx => net.md} (100%) rename src/content/docs/aws/integrations/aws-sdks/{php.mdx => php.md} (100%) rename src/content/docs/aws/integrations/aws-sdks/{python-boto3.mdx => python-boto3.md} (100%) rename src/content/docs/aws/integrations/aws-sdks/{ruby.mdx => ruby.md} (99%) diff --git a/src/content/docs/aws/integrations/aws-sdks/cpp.mdx b/src/content/docs/aws/integrations/aws-sdks/cpp.md similarity index 100% rename from src/content/docs/aws/integrations/aws-sdks/cpp.mdx rename to src/content/docs/aws/integrations/aws-sdks/cpp.md diff --git a/src/content/docs/aws/integrations/aws-sdks/java.mdx b/src/content/docs/aws/integrations/aws-sdks/java.mdx index d319beaf..65f48995 100644 --- a/src/content/docs/aws/integrations/aws-sdks/java.mdx +++ b/src/content/docs/aws/integrations/aws-sdks/java.mdx @@ -82,7 +82,6 @@ S3Client s3Client = S3Client.builder() ```java - // Existing bucket name. final String BUCKET_NAME = "records"; @@ -135,7 +134,6 @@ GetObjectRequest getObjectRequest = GetObjectRequest.builder() // Retrieving the object from the bucket. ResponseInputStream response = s3Client.getObject(getObjectRequest); - ``` @@ -143,21 +141,14 @@ ResponseInputStream response = s3Client.getObject(getObjectRe ### DynamoDB Service Another interesting case is interacting with the DynamoDB service. -Here we can see code snippets of -a DynamoDB client inserting an entity of type `Person` into a table with the same name. -Once the object is in -the database, we would like to retrieve it as well. -Just like the example before, the scripts to create the AWS services on LocalStack can be found under -the `src/main/resources` folder of each module in the repository. +Here we can see code snippets of a DynamoDB client inserting an entity of type `Person` into a table with the same name. +Once the object is in the database, we would like to retrieve it as well. +Just like the example before, the scripts to create the AWS services on LocalStack can be found under the `src/main/resources` folder of each module in the repository. Pay particular attention to the handling of the data model in the v2 example. -As part of improvements, some -boilerplate code can be abstracted with the help of specific annotations, which help label the Java bean, the -partition key and even specify converters for certain data types. -Unfortunately, the enhanced mapping in v2 does not support Date type, but a handwritten converter is enough to -cater to the application's needs. -The full list of supported converters can be found -[here](https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/enhanced/dynamodb/internal/converter/attribute/package-summary.html). +As part of improvements, some boilerplate code can be abstracted with the help of specific annotations, which help label the Java bean, the partition key and even specify converters for certain data types. +Unfortunately, the enhanced mapping in v2 does not support Date type, but a handwritten converter is enough to cater to the application's needs. +The full list of supported converters can be found [here](https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/enhanced/dynamodb/internal/converter/attribute/package-summary.html). #### Configuring the DynamoDB Client diff --git a/src/content/docs/aws/integrations/aws-sdks/javascript.mdx b/src/content/docs/aws/integrations/aws-sdks/javascript.mdx index d537cb1f..259eb8eb 100644 --- a/src/content/docs/aws/integrations/aws-sdks/javascript.mdx +++ b/src/content/docs/aws/integrations/aws-sdks/javascript.mdx @@ -116,7 +116,6 @@ s3.send(new ListBucketsCommand({})) :::note - In case of issues resolving S3 DNS record, we can fallback to `http://localhost:4566` in combination with the provider setting `forcePathStyle: true` (see the specific way of setting this parameter for each SDK above). The S3 service endpoint is slightly different from the other service endpoints, because AWS is deprecating path-style based access for hosting buckets. See [S3 documentation](user-guide/aws/s3) about endpoints. {/*TODO: fix link*/} diff --git a/src/content/docs/aws/integrations/aws-sdks/net.mdx b/src/content/docs/aws/integrations/aws-sdks/net.md similarity index 100% rename from src/content/docs/aws/integrations/aws-sdks/net.mdx rename to src/content/docs/aws/integrations/aws-sdks/net.md diff --git a/src/content/docs/aws/integrations/aws-sdks/php.mdx b/src/content/docs/aws/integrations/aws-sdks/php.md similarity index 100% rename from src/content/docs/aws/integrations/aws-sdks/php.mdx rename to src/content/docs/aws/integrations/aws-sdks/php.md diff --git a/src/content/docs/aws/integrations/aws-sdks/python-boto3.mdx b/src/content/docs/aws/integrations/aws-sdks/python-boto3.md similarity index 100% rename from src/content/docs/aws/integrations/aws-sdks/python-boto3.mdx rename to src/content/docs/aws/integrations/aws-sdks/python-boto3.md diff --git a/src/content/docs/aws/integrations/aws-sdks/ruby.mdx b/src/content/docs/aws/integrations/aws-sdks/ruby.md similarity index 99% rename from src/content/docs/aws/integrations/aws-sdks/ruby.mdx rename to src/content/docs/aws/integrations/aws-sdks/ruby.md index 5d0159a2..908f621b 100644 --- a/src/content/docs/aws/integrations/aws-sdks/ruby.mdx +++ b/src/content/docs/aws/integrations/aws-sdks/ruby.md @@ -14,7 +14,7 @@ The [AWS SDK for Ruby](https://aws.amazon.com/sdk-for-ruby/), like other AWS SDK Here is an example of how to create a S3 bucket with the AWS configuration endpoint set to LocalStack: -```ruby +```ruby showLineNumbers require "aws-sdk-s3" # Wraps Amazon S3 bucket actions. From 5e328ebe4af3bc975ed770ff95c11d9dc4d860a5 Mon Sep 17 00:00:00 2001 From: Brian Rinaldi Date: Wed, 18 Jun 2025 17:12:28 -0400 Subject: [PATCH 4/7] Containers folder done --- .../integrations/containers/devcontainers.mdx | 119 +++++++----------- .../aws/integrations/containers/eksctl.mdx | 4 +- .../containers/{gitpod.mdx => gitpod.md} | 0 .../integrations/containers/kubernetes.mdx | 95 +++++++++++++- .../{openshift.mdx => openshift.md} | 6 - .../containers/rancher-desktop.mdx | 1 - 6 files changed, 144 insertions(+), 81 deletions(-) rename src/content/docs/aws/integrations/containers/{gitpod.mdx => gitpod.md} (100%) rename src/content/docs/aws/integrations/containers/{openshift.mdx => openshift.md} (99%) diff --git a/src/content/docs/aws/integrations/containers/devcontainers.mdx b/src/content/docs/aws/integrations/containers/devcontainers.mdx index 5701713f..d27d763b 100644 --- a/src/content/docs/aws/integrations/containers/devcontainers.mdx +++ b/src/content/docs/aws/integrations/containers/devcontainers.mdx @@ -20,13 +20,12 @@ You can use the following two approaches to set up LocalStack with DevContainers ## LocalStack Templates LocalStack provides two different approaches for [Templates](https://github.com/localstack/devcontainer-template) which can be used via [supporting tools](https://containers.dev/supporting). -{/* TODO: transform this into a proper table, deal with the breaks */} -{/* + | **Type** | **Advantages** | **Disadvantages** | |------------------------------|----------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| **Docker-in-Docker** | • Strict separation from host Docker service
• Control LocalStack with LocalStack CLI
• All-in-one container | • Resources are limited as all resources spawned by LocalStack are encapsulated within the container
• LocalStack volume directory must exist beforehand
• Larger container size
• Cannot use existing images on host system | -| **Docker-outside-of-Docker** | • Easy addition of external services managed by Docker Compose
• DNS service for custom domains | • Host's Docker socket mounted into containers, raising security concerns
• Limited LocalStack CLI usage
• LocalStack volume directory must exist beforehand | -*/} +| **Docker-in-Docker** | • Strict separation from host Docker service
• Control LocalStack with LocalStack CLI
• All-in-one container | • Resources are limited as all resources spawned by LocalStack are encapsulated within the container
• LocalStack volume directory must exist beforehand
• Larger container size
• Cannot use existing images on host system | +| **Docker-outside-of-Docker** | • Easy addition of external services managed by Docker Compose
• DNS service for custom domains | • Host's Docker socket mounted into containers, raising security concerns
• Limited LocalStack CLI usage
• LocalStack volume directory must exist beforehand | + ### Docker-in-Docker * [Dev Container CLI](#dev-container-cli) @@ -92,7 +91,6 @@ done #### VSCode :::note - The DevContainer extension is currently reporting issues & bugs. Follow the [issue](https://github.com/microsoft/vscode-remote-release/issues/10180) for details. ::: @@ -101,64 +99,57 @@ To get started with LocalStack and DevContainers in VS Code, follow these steps: * Open VS Code with the DevContainers extension installed. * From the Command Palette, select **Dev Containers: Add Dev Container configuration file**. -

+ ![Add Dev Container configuration file](public/images/aws/01_add_devcontainer_conf.png) -

* Choose **Add configuration to workspace**; alternatively, select **Add configuration to user data folder** for general usage. -

+ ![Add configuration to workspace](public/images/aws/02_add_conf_workspace.png) -

* Select **Show All Definitions...** to view community templates. -

+ ![Show all Template definitions](public/images/aws/03_show_all_definitions.png) -

* Filter by typing "localstack" in the search bar and select the **LocalStack Docker-in-Docker** template. -

+ [Select official LocalStack Template (DinD)](public/images/aws/04a_select_template_dind.png) -

* Proceed through the configuration by selecting or entering values. Pressing **Enter** through the options will apply default settings, which include: -

+ * Select the image variant (only Debian-based images are supported). ![Image variant option](public/images/aws/05_option_1.png) * Select the log level. -

-![Log level option] (public/images/aws/06_option_2.png) -

+ + ![Log level option](public/images/aws/06_option_2.png) + * Select the LocalStack version. -

![LocalStack version option](public/images/aws/07_option_3.png) -

* Relative paths are acceptable for the volume path, but the specified mount folder must be created prior to building the container. -

-![Volume path option](public/images/aws/08_volume_option.png) -

-![Volume folder exists](public/images/aws/09_volume_folder.png) + + ![Volume path option](public/images/aws/08_volume_option.png) + + ![Volume folder exists](public/images/aws/09_volume_folder.png) * Select various tools and configuration options from the checklist. For local tools, either select the appropriate SDK or tool feature, or install it manually. The template and LocalStack CLI feature do not manage these installations. -

-![List of options (DinD)](public/images/aws/10a_options_list_dind.png) -* You can also add additional features. -

-![Additional Features](public/images/aws/11_additional_features.png) + ![List of options (DinD)](public/images/aws/10a_options_list_dind.png) + +* You can also add additional features. + + ![Additional Features](public/images/aws/11_additional_features.png) * This results in the following folder structure in your workspace. -

-![Generated folder structure (DinD)](public/images/aws/12a_folder_structure_dind.png) + ![Generated folder structure (DinD)](public/images/aws/12a_folder_structure_dind.png) #### Reference file The `devcontainer.json` will look similar to the following: -```json +```json showLineNumbers { "name": "LocalStack DinD setup", "image": "mcr.microsoft.com/devcontainers/base:bullseye", @@ -281,7 +272,6 @@ docker compose \ #### VSCode :::note - The DevContainer extension is currently reporting issues & bugs. Follow the [issue](https://github.com/microsoft/vscode-remote-release/issues/10180) for details. ::: @@ -290,70 +280,58 @@ To get started with LocalStack and DevContainers in VS Code, follow these steps: * Open VSCode with the DevContainers extension installed. * From the Command Palette, choose **Dev Containers: Add Dev Container configuration file**. -

-![Add Dev Container configuration file](public/images/aws/01_add_devcontainer_conf.png) -

+ + ![Add Dev Container configuration file](public/images/aws/01_add_devcontainer_conf.png) * Choose the **Add configuration to workspace** option; alternatively, select **Add configuration to user data folder** for general usage. -

-![Add configuration to workspace](public/images/aws/02_add_conf_workspace.png) -

+ + ![Add configuration to workspace](public/images/aws/02_add_conf_workspace.png) * Select **Show All Definitions...** to view community templates. -

-![Show all Template definitions](public/images/aws/03_show_all_definitions.png) -

+ + ![Show all Template definitions](public/images/aws/03_show_all_definitions.png) * Start typing "localstack" in the search bar to filter the official LocalStack templates and choose **LocalStack Docker-outside-of-Docker**. -

-![Select official LocalStack Template (DooD)](public/images/aws/04b_select_template_dood.png) -

+ ![Select official LocalStack Template (DooD)](public/images/aws/04b_select_template_dood.png) * Navigate through the configuration inputs by either selecting or typing in values. The defaults provided in the template are sufficient; navigating through the options by hitting Enter will result in a valid configuration. These options include: -

+ * The image variant (currently only Debian-based images are supported). -

-![Image variant option](public/images/aws/05_option_1.png) -

+ + ![Image variant option](public/images/aws/05_option_1.png) + * The log level. -

-![Log level option](public/images/aws/06_option_2.png) -

+ + ![Log level option](public/images/aws/06_option_2.png) + * The LocalStack version. -

-![LocalStack version option](public/images/aws/07_option_3.png) -

+ + ![LocalStack version option](public/images/aws/07_option_3.png) * Note that LocalStack's IP address must be within the defined CIDR range. The network CIDR defaults to `10.0.2.0/24`, with the container IP set to `10.0.2.20`. -

* For the volume path, relative paths are accepted, but you must create the specified mount's folder before successfully building the container. The default is `./.volume`. -

-![Volume path option](public/images/aws/08_volume_option.png) -

-![Volume folder exists](public/images/aws/09_volume_folder.png) -

+ + ![Volume path option](public/images/aws/08_volume_option.png) + + ![Volume folder exists](public/images/aws/09_volume_folder.png) * Select multiple tools and configuration options from the checklist. For local tools, you must select the appropriate SDK or tool feature, or install it manually. The template and the underlying LocalStack CLI Feature do not manage these installations. -

-![List of options (DooD)](public/images/aws/10b_options_list_dood.png) -

+ + ![List of options (DooD)](public/images/aws/10b_options_list_dood.png) * You can also add additional features. -

-![Additional Features](public/images/aws/11_additional_features.png) -

+ + ![Additional Features](public/images/aws/11_additional_features.png) * As a result, you will end up with the folder structure shown below. -

-![Folder structure (DooD)](public/images/aws/12b_folder_structure_dood.png) -

+ ![Folder structure (DooD)](public/images/aws/12b_folder_structure_dood.png) ###### Reference files @@ -471,7 +449,6 @@ That's it. By building your container the LocalStack CLI and any of the enabled local-tools (currently these are `awslocal`, `cdklocal`, `pulumilocal`, `samlocal` and `tflocal`) will be installed. :::note - The LocalStack Feature does not manage the installation of underlying tools (e.g., for awslocal, aws-cli is not installed). For more information on dependencies, please refer to the [Feature documentation](https://github.com/localstack/devcontainer-feature). ::: \ No newline at end of file diff --git a/src/content/docs/aws/integrations/containers/eksctl.mdx b/src/content/docs/aws/integrations/containers/eksctl.mdx index 9d03b4f4..965ae666 100644 --- a/src/content/docs/aws/integrations/containers/eksctl.mdx +++ b/src/content/docs/aws/integrations/containers/eksctl.mdx @@ -41,12 +41,12 @@ Run the following command to create a cluster: {/* TODO: change labels so they are formatted like **** in markdown */} - + ```bash eksctl create cluster --nodes 1 --profile localstack ``` - + ```bash export AWS_CLOUDFORMATION_ENDPOINT=http://localhost.localstack.cloud:4566 export AWS_EC2_ENDPOINT=http://localhost.localstack.cloud:4566 diff --git a/src/content/docs/aws/integrations/containers/gitpod.mdx b/src/content/docs/aws/integrations/containers/gitpod.md similarity index 100% rename from src/content/docs/aws/integrations/containers/gitpod.mdx rename to src/content/docs/aws/integrations/containers/gitpod.md diff --git a/src/content/docs/aws/integrations/containers/kubernetes.mdx b/src/content/docs/aws/integrations/containers/kubernetes.mdx index bf18dbdc..ec3d7d9d 100644 --- a/src/content/docs/aws/integrations/containers/kubernetes.mdx +++ b/src/content/docs/aws/integrations/containers/kubernetes.mdx @@ -97,4 +97,97 @@ helm install my-release localstack-charts/localstack -f pro-values.yaml ## Parameters -{/* {{< github-markdown repo="localstack/helm-charts" file="charts/localstack/README.md#parameters" lang="markdown" >}} */} {/* TODO: properly embedd this*/} \ No newline at end of file +The following table lists the configurable parameters of the Localstack chart and their default values. + +### Common parameters + +| Parameter | Description | Default | +|------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------| +| `nameOverride` | String to partially override common.names.fullname | `nil` | +| `fullnameOverride` | String to fully override common.names.fullname | `nil` | +| `extraDeploy` | Extra objects to deploy (value evaluated as a template) | `[]` | + +### Localstack common parameters + +| Parameter | Description | Default | +|------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------| +| `image.repository` | Localstack image name | `localstack/localstack` | +| `image.tag` | Localstack image tag | `latest` | +| `image.pullPolicy` | Localstack image pull policy | `IfNotPresent` | +| `image.pullSecrets` | Specify docker-registry secret names as an array | `[]` | +| `podLabels` | Additional pod labels for Localstack secondary pods | `{}` | +| `podAnnotations` | Additional pod annotations for Localstack secondary pods | `{}` | +| `podSecurityContext` | Enable security context for Localstack pods | `{}` | +| `extraDeploy` | Extra objects to deploy (value evaluated as a template) | `{}` | +| `extraAnnotations` | Add additional annotations to every resource (value evaluated as a template) | `{}` | +| `extraLabels` | Add additional labels to every resource (value evaluated as a template) | `{}` | +| `securityContext` | Localstack container securityContext | `{}` | + +### Localstack parameters + +| Parameter | Description | Default | +|------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------| +| `debug` | Specify if debug logs should be enabled | `false` | +| `kinesisErrorProbability` | Specify to randomly inject ProvisionedThroughputExceededException errors into Kinesis API responses | `nil` (Localstack Default) | +| `startServices` | Comma-separated list of AWS CLI service names which should be loaded right when starting LocalStack. If not set, each service is loaded and started on the first request for that service. | `nil` (Localstack Default) | +| `lambdaExecutor` | Specify Method to use for executing Lambda functions (partially supported) | `docker` | +| `extraEnvVars` | Extra environment variables to be set on Localstack primary containers | `nil` (Localstack Default) | +| `enableStartupScripts` | Mount `/etc/localstack/init/ready.d` to run startup scripts with `{{ template "localstack.fullname" . }}-init-scripts-config` configMap | `false` | +| `startupScriptContent` | Startup script content when `enableStartupScripts` is `true`. Note: You will need to add a shebang as your first line such as `#!/bin/sh` in order to ensure the startup script is not malformed. | `nil` (Localstack Default) | + +### Deployment parameters + +| Parameter | Description | Default | +|------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------| +| `replicaCount` | Number of Localstack pods | `1` | +| `updateStrategy.type` | Update strategy type | `RollingUpdate` | +| `nodeSelector` | Node labels for pod assignment | `{}` | +| `tolerations` | Tolerations for pod assignment | `[]` | +| `affinity` | Affinity for pod assignment | `{}` | +| `resources.limits` | The resources limits for Localstack containers | `{}` | +| `resources.requests` | The requested resources for Localstack containers | `{}` | +| `livenessProbe` | Liveness probe configuration for Localstack containers | Same with [Kubernetes defaults][k8s-probe] | +| `readinessProbe` | Readiness probe configuration for Localstack containers | Same with [Kubernetes defaults][k8s-probe] | +| `mountDind.enabled` | Specify the mount of Docker daemon into Pod to enable some AWS services that got runtime dependencies such as Lambdas on GoLang | `false` | +| `mountDind.forceTLS` | Specify TLS enforcement on Docker daemon communications | `true` | +| `mountDind.image` | Specify DinD image tag | `docker:20.10-dind` | +| `volumes` | Extra volumes to mount | `[]` | +| `volumeMounts` | Extra volumes to mount | `[]` | + +[k8s-probe]: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#configure-probes + +### RBAC parameters + +| Parameter | Description | Default | +|------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------| +| `serviceAccount.create` | Enable the creation of a ServiceAccount for Localstack pods | `true` | +| `serviceAccount.name` | Name of the created ServiceAccount | Generated using the `common.names.fullname` template | +| `serviceAccount.annotations` | Annotations for Localstack Service Account | `{}` | + +### Exposure parameters + +| Parameter | Description | Default | +|------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------| +| `service.type` | Kubernetes Service type | `NodePort` | +| `service.edgeService.targetPort` | Port number for Localstack edge service | `4566` | +| `service.externalServicePorts.start` | Start of the external service port range (included). service | `4510` | +| `service.externalServicePorts.end` | End of the external service port range (excluded). service | `4560` | +| `service.loadBalancerIP` | loadBalancerIP if Localstack service type is `LoadBalancer` | `nil` | +| `service.dnsService` | Expose the Service and Deployment's DNS port for TCP and UDP DNS traffic | `""` | +| `service.clusterIP` | Set a static clusterIP for the service. Useful for DNS delegation to the Localstack Service | `""` | +| `ingress.enabled` | Enable the use of the ingress controller to access Localstack service | `false` | +| `ingress.annotations` | Annotations for the Localstack Ingress | `{}` | +| `ingress.hosts[0].host` | Hostname to your Localstack Ingress | `nil` | +| `ingress.hosts[0].paths` | Path within the url structure | `[]` | +| `ingress.tls` | Existing TLS certificates for ingress | `[]` | + +### Persistence Parameters + +| Name | Description | Value | +|------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------| +| `persistence.enabled` | Enable persistence using Persistent Volume Claims | `false` | +| `persistence.storageClass` | Persistent Volume storage class | `""` | +| `persistence.accessModes` | Persistent Volume access modes | `[]` | +| `persistence.size` | Persistent Volume size | `8Gi` | +| `persistence.dataSource` | Custom PVC data source | `{}` | +| `persistence.existingClaim` | The name of an existing PVC to use for persistence | `""` | \ No newline at end of file diff --git a/src/content/docs/aws/integrations/containers/openshift.mdx b/src/content/docs/aws/integrations/containers/openshift.md similarity index 99% rename from src/content/docs/aws/integrations/containers/openshift.mdx rename to src/content/docs/aws/integrations/containers/openshift.md index 3ddad525..d5c2826a 100644 --- a/src/content/docs/aws/integrations/containers/openshift.mdx +++ b/src/content/docs/aws/integrations/containers/openshift.md @@ -16,14 +16,12 @@ This guide demonstrates how you can deploy LocalStack on OpenShift using Devfile You can use the deployed LocalStack container to create AWS resources that you can use for local development and testing purposes. :::danger - Creating shared/hosted LocalStack instances may have some licensing implications. For example, a valid license might be necessary for each user who interacts with the instance. If you have any questions or uncertainties regarding the licensing implications, we encourage you to [contact us](https://localstack.cloud/contact) for further details. ::: :::note - LocalStack on OpenShift can be used in conjunction with the [LocalStack Community image](https://hub.docker.com/r/localstack/localstack). However, specific features such as execution of Lambda functions as OpenShift pods and other container workloads is only available in the [LocalStack Pro image](https://hub.docker.com/r/localstack/localstack-pro). ::: @@ -42,7 +40,6 @@ You can deploy LocalStack via the **Developer** perspective in the OpenShift Web Navigate to the **+Add** view to deploy LocalStack using a Devfile. ![OpenShift Developer perspective](/images/aws/openshift-developer-view.png) -

To deploy LocalStack on OpenShift, click on **Import from Git** in the **Git Repository** tile. In the Git section, enter the following Git repository URL to import the Devfile and Helm charts which contains the configuration for LocalStack: [**https://github.com/localstack/localstack-dev-spaces**](https://github.com/localstack/localstack-dev-spaces). @@ -59,7 +56,6 @@ Click on **Create** to deploy LocalStack on OpenShift. You can see the build status of the LocalStack deployment in the **Topology** view. ![OpenShift Topology view](/images/aws/openshift-topology-view.png) -

After successful deployment, you can see the **localstack-dev-spaces** pod in the **Topology** view. Click on the pod to view the details. @@ -71,7 +67,6 @@ You will be able to see the following details: - Exposed routes for your deployed pods on the cluster. ![LocalStack Dev Spaces Deployment](/images/aws/localstack-dev-spaces.png) -

### Creating AWS resources on OpenShift @@ -91,7 +86,6 @@ In the above commands, replace `` with the route URL of th The `AWS_ENDPOINT_URL` environment variable is used to specify the endpoint URL of the LocalStack container. :::note - By default, the endpoint URL for `awslocal` is `http://localhost:4566`. Since we are running LocalStack on OpenShift, we need to specify the route URL of the LocalStack container. You can swap `awslocal` with the AWS CLI, by specifying the additional `--endpoint-url` parameter. diff --git a/src/content/docs/aws/integrations/containers/rancher-desktop.mdx b/src/content/docs/aws/integrations/containers/rancher-desktop.mdx index 64f65324..f32baf17 100644 --- a/src/content/docs/aws/integrations/containers/rancher-desktop.mdx +++ b/src/content/docs/aws/integrations/containers/rancher-desktop.mdx @@ -34,7 +34,6 @@ These setups enable LocalStack to run smoothly with Rancher Desktop across vario ### Linux/macOS -{/*TODO: this was an "alert" before, change container accordingly (or remove this TODO)*/} :::note ### Recommended Settings for Rancher Desktop on macOS From 03107a8622ed02a1aeedd49114d38c3992830024 Mon Sep 17 00:00:00 2001 From: Brian Rinaldi Date: Thu, 19 Jun 2025 08:54:23 -0400 Subject: [PATCH 5/7] Continuous integration folder done --- .../continuous-integration/{bitbucket.mdx => bitbucket.md} | 0 .../continuous-integration/{circleci.mdx => circleci.md} | 0 .../continuous-integration/{codebuild.mdx => codebuild.md} | 1 - .../{github-actions.mdx => github-actions.md} | 0 .../continuous-integration/{gitlab-ci.mdx => gitlab-ci.md} | 6 ++---- .../continuous-integration/{index.mdx => index.md} | 0 .../continuous-integration/{travis-ci.mdx => travis-ci.md} | 0 7 files changed, 2 insertions(+), 5 deletions(-) rename src/content/docs/aws/integrations/continuous-integration/{bitbucket.mdx => bitbucket.md} (100%) rename src/content/docs/aws/integrations/continuous-integration/{circleci.mdx => circleci.md} (100%) rename src/content/docs/aws/integrations/continuous-integration/{codebuild.mdx => codebuild.md} (98%) rename src/content/docs/aws/integrations/continuous-integration/{github-actions.mdx => github-actions.md} (100%) rename src/content/docs/aws/integrations/continuous-integration/{gitlab-ci.mdx => gitlab-ci.md} (98%) rename src/content/docs/aws/integrations/continuous-integration/{index.mdx => index.md} (100%) rename src/content/docs/aws/integrations/continuous-integration/{travis-ci.mdx => travis-ci.md} (100%) diff --git a/src/content/docs/aws/integrations/continuous-integration/bitbucket.mdx b/src/content/docs/aws/integrations/continuous-integration/bitbucket.md similarity index 100% rename from src/content/docs/aws/integrations/continuous-integration/bitbucket.mdx rename to src/content/docs/aws/integrations/continuous-integration/bitbucket.md diff --git a/src/content/docs/aws/integrations/continuous-integration/circleci.mdx b/src/content/docs/aws/integrations/continuous-integration/circleci.md similarity index 100% rename from src/content/docs/aws/integrations/continuous-integration/circleci.mdx rename to src/content/docs/aws/integrations/continuous-integration/circleci.md diff --git a/src/content/docs/aws/integrations/continuous-integration/codebuild.mdx b/src/content/docs/aws/integrations/continuous-integration/codebuild.md similarity index 98% rename from src/content/docs/aws/integrations/continuous-integration/codebuild.mdx rename to src/content/docs/aws/integrations/continuous-integration/codebuild.md index ff2f5c67..50237c2d 100644 --- a/src/content/docs/aws/integrations/continuous-integration/codebuild.mdx +++ b/src/content/docs/aws/integrations/continuous-integration/codebuild.md @@ -12,7 +12,6 @@ sidebar: CodeBuild allows you to define your build project, set the source code location, and handles the building and testing, while supporting various programming languages, build tools, and runtime environments. LocalStack supports CodeBuild out of the box and can be easily integrated into your pipeline to run your tests against a cloud emulator. -{/* TODO: this was an alert before, title=Requirement, change container or remove TODO */} :::note LocalStack depends on the Docker socket to emulate your infrastructure. To enable it, update your project by ticking **Environment > Additional Configuration > Privileged > Enable this flag if you want to build Docker Images or want your builds to get elevated privileges**. diff --git a/src/content/docs/aws/integrations/continuous-integration/github-actions.mdx b/src/content/docs/aws/integrations/continuous-integration/github-actions.md similarity index 100% rename from src/content/docs/aws/integrations/continuous-integration/github-actions.mdx rename to src/content/docs/aws/integrations/continuous-integration/github-actions.md diff --git a/src/content/docs/aws/integrations/continuous-integration/gitlab-ci.mdx b/src/content/docs/aws/integrations/continuous-integration/gitlab-ci.md similarity index 98% rename from src/content/docs/aws/integrations/continuous-integration/gitlab-ci.mdx rename to src/content/docs/aws/integrations/continuous-integration/gitlab-ci.md index b72f3a7d..84baa078 100644 --- a/src/content/docs/aws/integrations/continuous-integration/gitlab-ci.mdx +++ b/src/content/docs/aws/integrations/continuous-integration/gitlab-ci.md @@ -13,21 +13,19 @@ This page contains easily customisable snippets to show you how to manage LocalS ### Start up Localstack :::tip - While working with a Docker-in-Docker (`dind`) setup, the Docker runner requires `privileged` mode. You must always use `privileged = true` in your GitLab CI's `config.toml` file while setting up LocalStack in GitLab CI runners. For more information, see [GitLab CI Docker-in-Docker](https://docs.gitlab.com/ee/ci/docker/using_docker_build.html#use-docker-in-docker-executor) documentation. ::: -{/*TODO: transform this into a proper collapsable item*/} -{/* +
For LocalStack versions before 3.0.0 Under test>variables, add:
LOCALSTACK_HOSTNAME: localhost.localstack.cloud
HOSTNAME_EXTERNAL: localhost.localstack.cloud.
-*/} + #### Service ```yaml diff --git a/src/content/docs/aws/integrations/continuous-integration/index.mdx b/src/content/docs/aws/integrations/continuous-integration/index.md similarity index 100% rename from src/content/docs/aws/integrations/continuous-integration/index.mdx rename to src/content/docs/aws/integrations/continuous-integration/index.md diff --git a/src/content/docs/aws/integrations/continuous-integration/travis-ci.mdx b/src/content/docs/aws/integrations/continuous-integration/travis-ci.md similarity index 100% rename from src/content/docs/aws/integrations/continuous-integration/travis-ci.mdx rename to src/content/docs/aws/integrations/continuous-integration/travis-ci.md From 3e4e2bc40cfef11c4c1caee470a4b53ef6eab8ce Mon Sep 17 00:00:00 2001 From: Brian Rinaldi Date: Thu, 19 Jun 2025 09:56:42 -0400 Subject: [PATCH 6/7] IaC folder done --- ...cloud-custodian.mdx => cloud-custodian.md} | 0 .../{crossplane.mdx => crossplane.md} | 45 +++++++++++-------- .../{former2.mdx => former2.md} | 32 ++++++++----- .../infrastructure-as-code/pulumi.mdx | 31 ++++++------- .../infrastructure-as-code/terraform.mdx | 19 ++++---- 5 files changed, 70 insertions(+), 57 deletions(-) rename src/content/docs/aws/integrations/infrastructure-as-code/{cloud-custodian.mdx => cloud-custodian.md} (100%) rename src/content/docs/aws/integrations/infrastructure-as-code/{crossplane.mdx => crossplane.md} (91%) rename src/content/docs/aws/integrations/infrastructure-as-code/{former2.mdx => former2.md} (97%) diff --git a/src/content/docs/aws/integrations/infrastructure-as-code/cloud-custodian.mdx b/src/content/docs/aws/integrations/infrastructure-as-code/cloud-custodian.md similarity index 100% rename from src/content/docs/aws/integrations/infrastructure-as-code/cloud-custodian.mdx rename to src/content/docs/aws/integrations/infrastructure-as-code/cloud-custodian.md diff --git a/src/content/docs/aws/integrations/infrastructure-as-code/crossplane.mdx b/src/content/docs/aws/integrations/infrastructure-as-code/crossplane.md similarity index 91% rename from src/content/docs/aws/integrations/infrastructure-as-code/crossplane.mdx rename to src/content/docs/aws/integrations/infrastructure-as-code/crossplane.md index 7224e5fb..80dfc19f 100644 --- a/src/content/docs/aws/integrations/infrastructure-as-code/crossplane.mdx +++ b/src/content/docs/aws/integrations/infrastructure-as-code/crossplane.md @@ -39,19 +39,23 @@ The installation may take a few minutes. In parallel, we can install the `crossplane` command-line tool. ```bash curl -sL https://raw.githubusercontent.com/crossplane/crossplane/master/install.sh | bash -{/* ... */} {/* mdx-disabled */} sudo mv crossplane /usr/local/bin ``` To confirm that the installation was successful, we can run these commands, which should yield output similar to the following: ```bash crossplane version -{/* Client Version: v1.17.0 */} {/* mdx-disabled */} -Server Version: v1.17.0 +``` +```bash title="Output" +Client Version: v1.17.0 +Server Version: v1.17.0 +``` +```bash kubectl get crds | grep crossplane -{/* compositions.apiextensions.crossplane.io 2023-09-03T11:30:36Z */} {/* mdx-disabled */} +``` +```bash title="Output" +compositions.apiextensions.crossplane.io 2023-09-03T11:30:36Z configurations.pkg.crossplane.io 2023-09-03T11:30:36Z -... ``` ### Installing the Crossplane AWS Provider @@ -87,12 +91,13 @@ EOF After some time, the providers should get into healthy state, which can be confirmed via `kubectl get providers`: ```bash -{/* kubectl get providers */} {/* mdx-disabled */} +kubectl get providers +``` +```bash title="Output" NAME INSTALLED HEALTHY PACKAGE AGE upbound-provider-family-aws True True xpkg.upbound.io/upbound/provider-family-aws:v0.40.0 2m provider-aws-s3 True True xpkg.upbound.io/upbound/provider-aws-s3:v0.40.0 2m provider-aws-sqs True True xpkg.upbound.io/upbound/provider-aws-sqs:v0.40.0 2m - ``` Next, we install a secret to define the test credentials for the AWS provider: @@ -139,12 +144,10 @@ EOF ``` :::note - The endpoint `http://host.docker.internal:4566` in the listing above assumes that you are running Kubernetes in the local Docker engine, and that LocalStack is up and running and available on default port `4566`. ::: :::note - The Crossplane AWS provider currently requires us to specify the list of `services` for which the local `endpoint` is used as the target URL. Please make sure to extend this list accordingly if you're working with additional LocalStack services. ::: @@ -169,18 +172,20 @@ EOF If everything is wired up correctly, you should now see some activity in the LocalStack log outputs, where Crossplane starts deploying the S3 bucket against LocalStack. After some time, the bucket should be transitioning into `ready` state within Crossplane: ```bash -{/* kubectl get buckets */} {/* mdx-disabled */} +kubectl get buckets +``` +```bash NAME READY SYNCED EXTERNAL-NAME AGE crossplane-test-bucket True True crossplane-test-bucket 30s - ``` ... and the bucket it should also be visible when querying the local S3 buckets in LocalStack via [`awslocal`](https://github.com/localstack/awscli-local): ```bash -{/* awslocal s3 ls */} {/* mdx-disabled */} +awslocal s3 ls +``` +```bash title="Output" 2023-09-03 15:18:47 crossplane-test-bucket - ``` We can repeat the same exercise for creating a local SQS queue named `crossplane-test-queue`: @@ -199,22 +204,24 @@ EOF After some time, the queue should transition into `ready` state in Crossplane: ```bash -{/* kubectl get queues */} {/* mdx-disabled */} +kubectl get queues +``` +```bash title="Output" NAME READY SYNCED EXTERNAL-NAME AGE crossplane-test-queue True True http://host.docker.internal:4566/000000000000/crossplane-test-queue 40s - ``` -... -and the queue should be visible when listing the SQS queues in LocalStack: +...and the queue should be visible when listing the SQS queues in LocalStack: ```bash -{/* awslocal sqs list-queues */} {/* mdx-disabled */} +awslocal sqs list-queues +``` + +```bash title="Output" { "QueueUrls": [ "http://localhost:4566/000000000000/crossplane-test-queue" ] } - ``` ### Summary diff --git a/src/content/docs/aws/integrations/infrastructure-as-code/former2.mdx b/src/content/docs/aws/integrations/infrastructure-as-code/former2.md similarity index 97% rename from src/content/docs/aws/integrations/infrastructure-as-code/former2.mdx rename to src/content/docs/aws/integrations/infrastructure-as-code/former2.md index 013aeb2e..2a7771ae 100644 --- a/src/content/docs/aws/integrations/infrastructure-as-code/former2.mdx +++ b/src/content/docs/aws/integrations/infrastructure-as-code/former2.md @@ -66,33 +66,45 @@ You can verify that the resources were created successfully by running the follo ```bash localstack logs -{/* */} {/* mdx-disabled */} +``` + +```bash title="Output" 2023-10-14T15:31:08.852 INFO --- [ asgi_gw_0] localstack.request.aws : AWS s3.CreateBucket => 200 2023-10-14T15:31:09.356 INFO --- [ asgi_gw_0] localstack.request.aws : AWS sqs.CreateQueue => 200 2023-10-14T15:31:12.920 INFO --- [ asgi_gw_0] botocore.credentials : Found credentials in environment variables. 2023-10-14T15:31:13.332 INFO --- [ asgi_gw_0] localstack.utils.bootstrap : Execution of "require" took 2028.25ms 2023-10-14T15:31:13.712 INFO --- [ asgi_gw_0] localstack.request.aws : AWS dynamodb.CreateTable => 200 - +``` + +```bash awslocal s3 ls - +``` +```bash title="Output" 2023-10-14 21:01:08 my-bucket - +``` + +```bash awslocal sqs list-queues - +``` + +```bash title="Output" { "QueueUrls": [ "http://localhost:4566/000000000000/my-queue" ] } - +``` + +```bash awslocal dynamodb list-tables - +``` + +```bash title="Output" { "TableNames": [ "my-table" ] } - ``` ### Configure Former2 @@ -102,7 +114,6 @@ Open the [**Credentials**](https://former2.com/#section-setup-credentials) tab a For LocalStack, you can just configure the `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` environment variables as `test` and `test`, respectively. ![Enter test credentials on Former2 Dashboard](/images/aws/former2-credentials.png) -

Click on [**Continue to Parameters**](https://former2.com/#section-setup-parameters) and include your own CloudFormation stack parameters by adding them below. Click on [**Continue to Settings**](https://former2.com/#section-setup-settings) and navigate to **Custom Endpoints**. @@ -110,7 +121,6 @@ Toggle the **Use LocalStack Endpoint** switch to enable the LocalStack endpoint Click on [**Go to Dashboard**](https://former2.com/#section-dashboard) to complete the setup. ![LocalStack endpoint toggle on Former2 Dashboard](/images/aws/former2-localstack-endpoint.png) -

You can now click on **Scan Account** button on the top-right corner of the dashboard to scan your LocalStack instance for resources. Once the scan is complete, you can select the resources you want to generate IaC outputs for. @@ -120,12 +130,10 @@ Once the scan is complete, you can select the resources you want to generate IaC Navigate to [S3](https://former2.com/#section-storage-s3), [DynamoDB](https://former2.com/#section-database-dynamodb), and [SQS](https://former2.com/#section-applicationintegration-sqs) to verify that the resources you created earlier are listed. ![S3 Console on Former2 Dashboard](/images/aws/former2-s3.png) -

You can select the resources you want to generate IaC outputs for and click on **Add Selected**. Finally, you can click on **Generate** on the top-left corner of the dashboard to generate the IaC outputs. ![CloudFormation Output on Former2 Dashboard](/images/aws/former2-cloudformation-output.png) -

You can also choose to generate the IaC outputs in a different format by clicking on the various options available on the left-hand side of the dashboard. \ No newline at end of file diff --git a/src/content/docs/aws/integrations/infrastructure-as-code/pulumi.mdx b/src/content/docs/aws/integrations/infrastructure-as-code/pulumi.mdx index 63f8ffe1..d3836481 100644 --- a/src/content/docs/aws/integrations/infrastructure-as-code/pulumi.mdx +++ b/src/content/docs/aws/integrations/infrastructure-as-code/pulumi.mdx @@ -6,6 +6,8 @@ sidebar: order: 2 --- +import { FileTree } from "@astrojs/starlight/components"; + ## Introduction Pulumi's SDK for infrastructure-as-code allows you to create, deploy, and manage AWS containers, serverless functions, and other infrastructure using popular programming languages. @@ -22,7 +24,6 @@ This guide will show you how to set up local AWS resources using both the `pulum ## `pulumilocal` wrapper script :::note - `pulumi-local` currently does not support the `aws-native` package as it relies on the AWS Cloud Control API. For additional information, refer to the [GitHub issue](https://github.com/localstack/localstack/issues/11523). ::: @@ -43,7 +44,6 @@ export PULUMI_BACKEND_URL=file://`pwd`/myproj ``` :::note - For further options please consult the official documentation on available [environment variables](https://www.pulumi.com/docs/cli/environment-variables/) and [local backend](https://www.pulumi.com/docs/concepts/state/#local-filesystem). ::: @@ -59,10 +59,10 @@ You can now use the `pulumilocal` command to interact with your Pulumi project. ```bash pulumilocal --help -{/* */} {/* mdx-disabled */} +``` +```bash title="Output" Pulumi - Modern Infrastructure as Code ... - ``` ### Create a new Pulumi project @@ -75,7 +75,6 @@ pulumilocal new aws-typescript -y -s lsdev --cwd myproj ``` :::tip - The `--cwd` option is unnecessary if you're already in the project directory. ::: @@ -142,24 +141,22 @@ Installing dependencies... This will create the following directory structure. -```bash -tree -L 1 -. -├── index.ts -├── node_modules -├── package.json -├── package-lock.json -├── Pulumi.dev.yaml -├── Pulumi.yaml -└── tsconfig.json -``` + +- index.ts +- node_modules +- package.json +- package-lock.json +- Pulumi.dev.yaml +- Pulumi.yaml +- tsconfig.json + ### Configure the stack Modify your stack configuration in `Pulumi.dev.yaml` to include endpoints for AWS services pointing to `http://localhost:4566`. However, these endpoints may change depending on the AWS plugin version you are using. -```yaml +```yaml showLineNumbers config: aws:accessKey: test aws:s3UsePathStyle: "true" diff --git a/src/content/docs/aws/integrations/infrastructure-as-code/terraform.mdx b/src/content/docs/aws/integrations/infrastructure-as-code/terraform.mdx index a6018aec..7665fc95 100644 --- a/src/content/docs/aws/integrations/infrastructure-as-code/terraform.mdx +++ b/src/content/docs/aws/integrations/infrastructure-as-code/terraform.mdx @@ -51,10 +51,11 @@ After installation, you can use the `tflocal` command, which has the same interf ```bash tflocal --help -{/* */} {/* mdx-disabled */} +``` + +```bash title="Output" Usage: terraform [global options] [args] ... - ``` ### Deploy the Terraform configuration @@ -88,7 +89,6 @@ tflocal apply | `AWS_ACCESS_KEY_ID` | `test` (`accountId`: 000000000000) | AWS Access Key ID to use for multi-account setups | :::note - While using `CUSTOMIZE_ACCESS_KEY`, following cases are taking precedence over each other from top to bottom: 1. If the `AWS_ACCESS_KEY_ID` environment variable is set. 2. If `access_key` is configured in the Terraform AWS provider. @@ -144,9 +144,9 @@ Furthermore, it's necessary to configure the individual services to use LocalSta For S3, this configuration resembles the following snippet, where we've chosen to use the virtual hosted-style endpoint: ```hcl - endpoints { - s3 = "http://s3.localhost.localstack.cloud:4566" - } +endpoints { + s3 = "http://s3.localhost.localstack.cloud:4566" +} ``` :::note @@ -226,7 +226,6 @@ provider "aws" { ``` :::note - To heuristically detect whether your Terraform configuration should be deployed against LocalStack, you can use the following snippet: ```hcl @@ -414,6 +413,7 @@ Note: You can always add providers using 'cdktf provider add' later on ```python $ pipenv install cdktf-cdktf-provider-aws +``` ```javascript @@ -524,14 +524,15 @@ OpenTofu is an open-source fork of Terraform acting as a drop-in replacement for ```bash TF_CMD=tofu tflocal --help - +``` + +```bash title="Output" Usage: tofu [global options] [args] The available commands for execution are listed below. The primary workflow commands are given first, followed by less common or more advanced commands. ... - ``` ## Terragrunt From f8af7b0f07f1cde68b73ecf361d845bef505a2f9 Mon Sep 17 00:00:00 2001 From: Brian Rinaldi Date: Thu, 19 Jun 2025 15:25:39 -0400 Subject: [PATCH 7/7] remaining folders done --- .../docs/aws/integrations/app-frameworks/quarkus.md | 4 ++-- ...aged-kafka-cluster.mdx => selfmanaged-kafka-cluster.md} | 0 src/content/docs/aws/integrations/testing/hyperexecute.mdx | 7 ------- ...bdatest-hyperexecute.mdx => lambdatest-hyperexecute.md} | 2 -- .../docs/aws/integrations/testing/testcontainers.mdx | 7 ++++--- 5 files changed, 6 insertions(+), 14 deletions(-) rename src/content/docs/aws/integrations/messaging/{selfmanaged-kafka-cluster.mdx => selfmanaged-kafka-cluster.md} (100%) delete mode 100644 src/content/docs/aws/integrations/testing/hyperexecute.mdx rename src/content/docs/aws/integrations/testing/{lambdatest-hyperexecute.mdx => lambdatest-hyperexecute.md} (99%) diff --git a/src/content/docs/aws/integrations/app-frameworks/quarkus.md b/src/content/docs/aws/integrations/app-frameworks/quarkus.md index e69f3a2a..60ee3bb0 100644 --- a/src/content/docs/aws/integrations/app-frameworks/quarkus.md +++ b/src/content/docs/aws/integrations/app-frameworks/quarkus.md @@ -140,7 +140,7 @@ All the other configuration properties can be overridden at runtime. | `quarkus.aws.devservices.localstack.additional-services."additional-services".service-name` | string | `localstack` | | `quarkus.aws.devservices.localstack.additional-services."additional-services".container-properties` | `Map` | | -{{< callout >}} +:::note - If `quarkus.aws.devservices.localstack.additional-services."additional-services".enabled` is set to `true` and the endpoint-override is not configured, LocalStack will be started and utilized instead of the provided configuration. For all services excluding Cognito, LocalStack will function as the core cloud emulator. In the case of Cognito, the emulation/mocking will be done by Moto. @@ -155,7 +155,7 @@ All the other configuration properties can be overridden at runtime. Otherwise, it creates a new container with the `quarkus-dev-service-localstack` label set to the specified value. In test mode, Dev Services groups services with the same service-name value into a single container instance. This property is useful when there's a requirement for multiple shared LocalStack instances. -{{< /callout >}} +::: ### Specific configuration diff --git a/src/content/docs/aws/integrations/messaging/selfmanaged-kafka-cluster.mdx b/src/content/docs/aws/integrations/messaging/selfmanaged-kafka-cluster.md similarity index 100% rename from src/content/docs/aws/integrations/messaging/selfmanaged-kafka-cluster.mdx rename to src/content/docs/aws/integrations/messaging/selfmanaged-kafka-cluster.md diff --git a/src/content/docs/aws/integrations/testing/hyperexecute.mdx b/src/content/docs/aws/integrations/testing/hyperexecute.mdx deleted file mode 100644 index 3f4bb0b7..00000000 --- a/src/content/docs/aws/integrations/testing/hyperexecute.mdx +++ /dev/null @@ -1,7 +0,0 @@ ---- -title: This is a dummy title -description: This is a dummy description -template: doc -sidebar: - order: 3 ---- \ No newline at end of file diff --git a/src/content/docs/aws/integrations/testing/lambdatest-hyperexecute.mdx b/src/content/docs/aws/integrations/testing/lambdatest-hyperexecute.md similarity index 99% rename from src/content/docs/aws/integrations/testing/lambdatest-hyperexecute.mdx rename to src/content/docs/aws/integrations/testing/lambdatest-hyperexecute.md index 9f4ea473..b131ccff 100644 --- a/src/content/docs/aws/integrations/testing/lambdatest-hyperexecute.mdx +++ b/src/content/docs/aws/integrations/testing/lambdatest-hyperexecute.md @@ -11,7 +11,6 @@ It supports a wide range of testing frameworks and integrates seamlessly with CI You can use HyperExecute to run your LocalStack tests on your local machine or in the CI pipeline using a single configuration file. :::note - LambdaTest provides specialized runners for LocalStack. The default runners don't provide a Docker socket, which is required for LocalStack to work properly. If you want to use LocalStack with HyperExecute, you need to get in touch with the LambdaTest team to get access to the specialized runners. @@ -51,7 +50,6 @@ pre: The above minimal configuration file starts LocalStack and creates an S3 bucket, SQS queue, and SNS topic. :::note - To use the LocalStack Pro image, configure a LocalStack Auth Token by appending `LOCALSTACK_AUTH_TOKEN=${{ .secrets.LOCALSTACK_AUTH_TOKEN }}` to the `localstack start` command. Subsequently, you need to add your LocalStack Auth Token to your HyperExecute Portal as a secret. ::: diff --git a/src/content/docs/aws/integrations/testing/testcontainers.mdx b/src/content/docs/aws/integrations/testing/testcontainers.mdx index c8fffc15..eac26ef5 100644 --- a/src/content/docs/aws/integrations/testing/testcontainers.mdx +++ b/src/content/docs/aws/integrations/testing/testcontainers.mdx @@ -99,7 +99,7 @@ using var client = new AmazonS3Client(config); ``` -```go +```go showLineNumbers func s3Client(ctx context.Context, l *localstack.LocalStackContainer) (*s3.Client, error) { // the Testcontainers Docker provider is used to get the host of the Docker daemon provider, err := testcontainers.NewDockerProvider() @@ -150,8 +150,10 @@ S3Client s3 = S3Client.builder() .credentialsProvider(StaticCredentialsProvider.create(AwsBasicCredentials.create(localstack.getAccessKey(), localstack.getSecretKey()))) .region(Region.of(localstack.getRegion())) .build(); +``` -{{< tab header="NodeJS (typescript)" lang="typescript">}} + +```typescript const awsConfig = { endpoint: localstack.getConnectionUri(), credentials: { @@ -183,7 +185,6 @@ The Testcontainer can be created like this: public LocalStackContainer localstack = new LocalStackContainer(DockerImageName("localstack/localstack:2.0.0")) .withExposedPorts(4510, 4511, 4512, 4513, 4514) // the port can have any value between 4510-4559, but LS starts from 4510 .withEnv("LOCALSTACK_AUTH_TOKEN", auth_token); // add your Auth Token here - ``` To find the exposed port which you can use to connect to the instance: