Non-interactive environment variable setting (e.g. CI pipeline)
See original GitHub issueIf I am using arc
to deploy an app via a CI pipeline and I want to add environment variables to my Lambda, should I be doing this like so:
$ arc deploy
$ arc env -e <environment> --add FOO bar
If so, when this command runs in CI, it hangs because the arc env
command is requesting input:
Env Would you like to create a local preferences file? [Y|n]
Is there a better way to deploy with these environment variables via CI, or is there a non-interactive mode? Should arc
pick up on the presence of a CI
environment variable from my pipeline and not prompt for such interactions?
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Define variables - Azure Pipelines | Microsoft Learn
Environment variables are specific to the operating system you are using. They are injected into a pipeline in platform-specific ways. The ...
Read more >GitLab CI/CD variables
CI /CD variables are a type of environment variable. You can use them to: Control the behavior of jobs and pipelines. Store values...
Read more >Autorization in non-interactive mode - Meterian
Another option is to simply set the environment variable ... In a Linux shell for example: $> export ... Using the client in...
Read more >Environment variables | Docs - Buddy.Works
Environment Variables can be defined on 4 levels: Workspace – available for all projects and pipelines. Configured on the dashboard view.
Read more >Jenkins / Hudson environment variables - Stack Overflow
You need to go to Configure Jenkins > And you can then click to add an Environment Variable key-value pair from there. eg:...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@thescientist13 that’s right! If you need an example of how we do it: https://github.com/architect/arc.codes/blob/main/.github/workflows/build.yml#L89-L103
We can add a flag to suppress that behavior, for sure. However, how you’re doing it above is not correct or necessary. Here’s how env vars flow through the system (broadly):
arc env
commandarc deploy
staging
) prior to deployment, then adds them to your CloudFormation templateArchitect does not update live env vars in your running application when you run
arc env
. Those env vars don’t go live until the next deployment.Hopefully that addresses your question as well, @thescientist13, but just to be clear: no secrets are uploaded to mysterious servers / services, Architect safely and securely stores your env vars in your app’s own secured SSM store within AWS, and those env vars are only accessed by your creds at deploy time.