cli icon indicating copy to clipboard operation
cli copied to clipboard

overmind cli: confusion around running aws source

Open tphoney opened this issue 2 years ago • 0 comments

When running the cli command, we start and run the aws-source. we are heavily dependant on aws_profile env variable being set.

we should probably check for the environment variable being set, if its not. At least throw a warning message.

eg

PS Microsoft.PowerShell.Core\FileSystem::\\wsl.localhost\Ubuntu-24.04\home\frame\workspace\workspace\terraform-example> overmind terraform plan
✔︎ Connected to Overmind
✔︎ Using stored token
✗ Configuring AWS Access
  ✗ Error initialising sources
  ✔︎ stdlib Source: running

  │ Fatal Error: failed to initialise sources: failed to initialize AWS source engine: error getting caller identity
  for
  │ region : operation error STS: GetCallerIdentity, get identity: get credentials: failed to refresh cached
  │ credentials, no EC2 IMDS role found, operation error ec2imds: GetMetadata, exceeded maximum number of attempts, 3,
  │ request send failed, Get "http://169.254.169.254/latest/meta-data/iam/security-credentials/": dial tcp
  │ 169.254.169.254:80: connectex: A socket operation was attempted to an unreachable network.


PS Microsoft.PowerShell.Core\FileSystem::\\wsl.localhost\Ubuntu-24.04\home\frame\workspace\workspace\terraform-example> AWS_PROFILE=terraform-example ..\cli\cli.exe explore
AWS_PROFILE=terraform-example : The term 'AWS_PROFILE=terraform-example' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ AWS_PROFILE=terraform-example ..\cli\cli.exe explore
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (AWS_PROFILE=terraform-example:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

PS Microsoft.PowerShell.Core\FileSystem::\\wsl.localhost\Ubuntu-24.04\home\frame\workspace\workspace\terraform-example> AWS_PROFILE=terraform-example ..\cli\cli.exe explore^C
PS Microsoft.PowerShell.Core\FileSystem::\\wsl.localhost\Ubuntu-24.04\home\frame\workspace\workspace\terraform-example> $ENV:AWS_PROFILE = "terraform-example";  ..\cli\cli.exe explore
 ✔︎  Connected to Overmind
 ✔︎  Stdlib source engine started
 ✔︎  AWS source engine started

Explore your infrastructure graph at https://app.overmind.tech/explore

 ✔︎  Press Ctrl+C to stop the locally running sources
PS Microsoft.PowerShell.Core\FileSystem::\\wsl.localhost\Ubuntu-24.04\home\frame\workspace\workspace\terraform-example>

tphoney avatar Sep 27 '24 11:09 tphoney