@@ -15,6 +15,15 @@ inputs:
1515 description : ' The pod to load on startup of LocalStack, the env var AUTO_LOAD_POD'
1616 required : false
1717 default : ' '
18+ extension-auto-install :
19+ description : ' The extension(s) to automatically install on startup of LocalStack, the env var EXTENSION_AUTO_INSTALL'
20+ required : false
21+ default : ' '
22+ lifetime :
23+ description : ' The lifetime of the ephemeral instance, how long the instance should be available for'
24+ required : false
25+ default : ' 30'
26+
1827
1928runs :
2029 using : composite
@@ -53,11 +62,14 @@ runs:
5362 # TODO: make preview name configurable!
5463 previewName=preview-$prId
5564
56- response=$(curl -X POST -d "{\"auto_load_pod\": \"${AUTO_LOAD_POD:-${{ inputs.auto-load-pod }}}\"}" \
65+ autoLoadPod="${AUTO_LOAD_POD:-${{ inputs.auto-load-pod }}}"
66+ extensionAutoInstall="${EXTENSION_AUTO_INSTALL:-${{ inputs.extension-auto-install }}}"
67+ lifetime="${{ inputs.lifetime }}"
68+
69+ response=$(curl -X POST -d "{\"instance_name\": \"${previewName}\", \"lifetime\": ${lifetime} ,\"env_vars\": {\"AUTO_LOAD_POD\": \"${autoLoadPod}\", \"EXTENSION_AUTO_INSTALL\": \"${extensionAutoInstall}\"}}"\
5770 -H "ls-api-key: ${LOCALSTACK_API_KEY:-${{ inputs.localstack-api-key }}}" \
58- -H "authorization: token ${LOCALSTACK_API_KEY:-${{ inputs.localstack-api-key }}}" \
5971 -H "content-type: application/json" \
60- https://api.localstack.cloud/v1/previews/$previewName )
72+ https://api.localstack.cloud/v1/compute/instances )
6173 endpointUrl=$(echo "$response" | jq -r .endpoint_url)
6274 if [ "$endpointUrl" = "null" ] || [ "$endpointUrl" = "" ]; then
6375 echo "Unable to create preview environment. API response: $response"
0 commit comments