dev()
Overview and basic usage
Runs the compute resource in a development mode
- Dev mode can be used to develop and debug your applications or to run integration tests.
- The development mode does the following:
- For
container workloads
:- All of the container ports specified in the
events
section will be mapped to the host. - Container's
environment
variables referenced by$ResourceParam
and$Secret
directives are automatically downloaded and injected to the workload. - Temporary credentials of the container's assumed role are injected to the workload. This means that your locally running container will have the exact same IAM permissions as the deployed version.
- The local emulation requires a deployed stack. Use the
--disableEmulation
flag if you want to locally run a workload that has not yet been deployed (without emulation). - Logs from the container are continuously pretty-printed to the console.
- You must specify the name of the container to run using the
--container
option.
- All of the container ports specified in the
- For
lambda functions
:- The lambda function is quickly and efficiently re-deployed without using Cloudformation.
- Logs of the lambda function are automatically download from Cloudwatch and continuously pretty-printed to the console
- No emulation is required as the lambda function runs in the exact same environment as in the production
- The compute resource is re-built and restarted/re-deployed, when you either:
- use the
--watch
flag and one of your source code files changes - type
rs + enter
to the terminal
- use the
Copy
import { Stacktape } from "stacktape";const stacktape = new Stacktape();stacktape.dev({region: "<<region>>",resourceName: "<<resourceName>>",stage: "<<stage>>"});
API reference
Arguments
region
Required
resourceName
Required
stage
Required
awsAccount
configPath
container
currentWorkingDirectory
disableEmulation
dockerArgs
preserveTempFiles
profile
projectName
templateId
watch