-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlocalstack_dagger_module_ephemeral.sh
More file actions
47 lines (40 loc) · 1.41 KB
/
localstack_dagger_module_ephemeral.sh
File metadata and controls
47 lines (40 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
# Check if LOCALSTACK_AUTH_TOKEN is set
if [ -z "$LOCALSTACK_AUTH_TOKEN" ]; then
echo "Error: LOCALSTACK_AUTH_TOKEN environment variable is not set"
echo "Please set your LocalStack auth token:"
echo "export LOCALSTACK_AUTH_TOKEN='your-token-here'"
exit 1
fi
# Create a new ephemeral instance
echo "Creating new ephemeral instance 'my-temp-instance'..."
dagger -m github.com/localstack/localstack-dagger-module \
call ephemeral \
--auth-token=env:LOCALSTACK_AUTH_TOKEN \
--operation=create \
--name=my-temp-instance \
--lifetime=60
# Wait for instance to be ready
echo "Waiting for instance to be ready..."
sleep 15
# List all active ephemeral instances
echo "Listing all active ephemeral instances..."
dagger -m github.com/localstack/localstack-dagger-module \
call ephemeral \
--auth-token=env:LOCALSTACK_AUTH_TOKEN \
--operation=list
# Get logs for our instance
echo "Getting logs for 'my-temp-instance'..."
dagger -m github.com/localstack/localstack-dagger-module \
call ephemeral \
--auth-token=env:LOCALSTACK_AUTH_TOKEN \
--operation=logs \
--name=my-temp-instance
# Delete the instance
echo "Deleting 'my-temp-instance'..."
dagger -m github.com/localstack/localstack-dagger-module \
call ephemeral \
--auth-token=env:LOCALSTACK_AUTH_TOKEN \
--operation=delete \
--name=my-temp-instance
echo "Ephemeral instance operations completed!"