Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
A simple construct that executes a command locally. This is useful to run build steps within your CDKTF Program or to run a post action after a resource is created.
A simple construct that executes a command locally. This is useful to run build steps within your CDKTF Program or to run a post action after a resource is created.
cdktf-local-exec is in technical preview, which means it's a community supported project. It still requires extensive testing and polishing to mature into a HashiCorp officially supported project. Please file issues generously and detail your experience while using the library. We welcome your feedback.
By using the software in this repository, you acknowledge that:
cdktf
>= 0.20.0constructs
>= 10.0.25The construct uses the null provider to achieve this so it can be trusted to only run after all dependencies are met.
import { Provider, LocalExec } from "cdktf-local-exec";
// LocalExec extends from the null provider,
// so if you already have the provider initialized you can skip this step
new Provider(this, "local-exec");
const frontend = new LocalExec(this, "frontend-build", {
// Will copy this into an asset directory
cwd: "/path/to/project/frontend",
command: "npm install && npm build",
});
const pathToUpload = `${frontend.path}/dist`;
new LocalExec(this, "frontend-upload", {
cwd: pathToUpload,
command: `aws s3 cp --recursive ${pathToUpload} s3://${bucket.name}/frontend`,
});
new LocalExec(this, "backend-build", {
cwd: "/path/to/project/backend",
copyBeforeRun: false, // can not run remotely since the runner has no docker access
command: "docker build -t foo . && docker push foo",
});
cwd
: The working directory to run the command in. It will be copied before execution to ensure the asset can be used in a remote execution environment.command
: The command to execute.copyBeforeRun
: If true, the command will copy the cwd
directory into a tmp dir and run there. If false, the command will be executed in the cwd
directory.FAQs
A simple construct that executes a command locally. This is useful to run build steps within your CDKTF Program or to run a post action after a resource is created.
We found that cdktf-local-exec demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.