question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Non-interactive environment variable setting (e.g. CI pipeline)

See original GitHub issue

If 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:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
ryanblockcommented, Mar 22, 2022
2reactions
ryanblockcommented, Mar 21, 2022

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):

  • You add an env var with arc env command
  • Architect saves that env var to your app’s SSM namespace
  • You deploy your app with arc deploy
  • Architect queries your app’s SSM namespace for all the env vars you added to a given environment (eg staging) prior to deployment, then adds them to your CloudFormation template
  • Architect then deploys your app environment with its environment-specific env vars

Architect 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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found