localstack-dagger-module
This module has been generated via dagger init and serves as a reference tobasic module structure as you get started with Dagger.
Two functions have been pre-created. You can modify, delete, or add to them,
as needed. They demonstrate usage of arguments and return types using simple
echo and grep commands. The functions can be called from the dagger CLI or
from one of the SDKs.
The first line in this comment block is a short description line and the
rest is a long description with more detail on the module's purpose or usage,
if appropriate. All modules should have a short description.
Installation
dagger install github.com/localstack/localstack-dagger-module@17d17db8d5ed1d8fd2e427b570b4cf9693149e85
Entrypoint
Return Type
LocalstackDaggerModule !
Example
dagger -m github.com/localstack/localstack-dagger-module@17d17db8d5ed1d8fd2e427b570b4cf9693149e85 call \
func (m *myModule) example() *dagger.LocalstackDaggerModule {
return dag.
LocalstackDaggerModule()
}
@function
def example() -> dagger.LocalstackDaggerModule:
return (
dag.localstack_dagger_module()
)
@func()
example(): LocalstackDaggerModule {
return dag
.localstackDaggerModule()
}
Types
LocalstackDaggerModule 🔗
ephemeral() 🔗
Manage ephemeral LocalStack instances in the cloud.
Args: auth_token: LocalStack auth token (required) operation: Operation to perform (create, list, delete, logs) name: Name of the ephemeral instance (required for create, delete, logs) lifetime: Lifetime of the instance in minutes (optional, default: 60) auto_load_pod: Auto load pod configuration (optional) extension_auto_install: Extension auto install configuration (optional)
Returns: Response from the API operation
Return Type
String !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
authToken | Secret ! | - | A reference to a secret value, which can be handled more safely than the value itself. |
operation | String ! | - | No description provided |
name | String | null | No description provided |
lifetime | Integer | null | No description provided |
autoLoadPod | String | null | No description provided |
extensionAutoInstall | String | null | No description provided |
Example
dagger -m github.com/localstack/localstack-dagger-module@17d17db8d5ed1d8fd2e427b570b4cf9693149e85 call \
ephemeral --auth-token env:MYSECRET --operation string
func (m *myModule) example(ctx context.Context, authToken *dagger.Secret, operation string) string {
return dag.
LocalstackDaggerModule().
Ephemeral(ctx, authToken, operation)
}
@function
async def example(auth_token: dagger.Secret, operation: str) -> str:
return await (
dag.localstack_dagger_module()
.ephemeral(auth_token, operation)
)
@func()
async example(authToken: Secret, operation: string): Promise<string> {
return dag
.localstackDaggerModule()
.ephemeral(authToken, operation)
}
start() 🔗
Start a LocalStack service with appropriate configuration.
If image_name is provided, starts that specific image. If auth_token is provided but no image_name, starts LocalStack Pro edition. Otherwise starts LocalStack Community edition.
Args: auth_token: Optional secret containing LocalStack Pro auth token configuration: Optional string of configuration variables in format “KEY1=value1,KEY2=value2” Example: “DEBUG=1,LS_LOG=trace” docker_sock: Optional Docker socket for container interactions image_name: Optional custom LocalStack image name to use
Returns: A running LocalStack service container
Return Type
Service !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
authToken | Secret | null | No description provided |
configuration | String | null | No description provided |
dockerSock | Socket | null | No description provided |
imageName | String | null | No description provided |
Example
echo 'Custom types are not supported in shell examples'
func (m *myModule) example() *dagger.Service {
return dag.
LocalstackDaggerModule().
Start()
}
@function
def example() -> dagger.Service:
return (
dag.localstack_dagger_module()
.start()
)
@func()
example(): Service {
return dag
.localstackDaggerModule()
.start()
}
state() 🔗
Load, save, or reset LocalStack state.
Args: auth_token: Secret containing LocalStack auth token (required for save/load) load: Name of the Cloud Pod to load save: Name of the Cloud Pod to save reset: Reset the LocalStack state endpoint: LocalStack endpoint to use (optional, defaults to host.docker.internal:4566) Returns: Output from the pod operation or error message if LocalStack is not running
Return Type
String !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
authToken | Secret | null | No description provided |
load | String | null | No description provided |
save | String | null | No description provided |
endpoint | String | null | No description provided |
reset | Boolean ! | false | No description provided |
Example
dagger -m github.com/localstack/localstack-dagger-module@17d17db8d5ed1d8fd2e427b570b4cf9693149e85 call \
state --reset boolean
func (m *myModule) example(ctx context.Context, reset bool) string {
return dag.
LocalstackDaggerModule().
State(ctxreset)
}
@function
async def example(reset: bool) -> str:
return await (
dag.localstack_dagger_module()
.state(reset)
)
@func()
async example(reset: boolean): Promise<string> {
return dag
.localstackDaggerModule()
.state(reset)
}