Running commands with environment variables
The Pulumi ESC CLI includes a run
command that allows you to run commands with Pulumi ESC managed environment variables, without exporting them to your shell.
You can run esc run
using an environment:
$ esc run <environment-name> <command>
For example, to list your S3 buckets with the AWS CLI using environment variables from the myorg/test
environment:
$ esc run myorg/test aws s3 ls
2023-10-10 16:09:19 my-s3-bucket
If you need to pass one or more flags to the command, prefix the command with --
:
$ esc run myorg/test -- aws s3 ls s3://my-s3-bucket --recursive --summarize
...
Total Objects: 5087
Total Size: 2419123156
For additional options and details, see esc run --help
.
Thank you for your feedback!
If you have a question about how to use Pulumi, reach out in Community Slack.
Open an issue on GitHub to report a problem or suggest an improvement.