nitrictech / cli

Nitric CLI. Manage and run Nitric apps locally and deploy to any cloud.
https://nitric.io
Apache License 2.0
26 stars 10 forks source link

Users should not be able to run nitric up when deploying to AWS when credentials file is not present #365

Closed raksiv closed 2 years ago

raksiv commented 2 years ago

nitric up -s aws

SUCCESS Configuration gathered (4s) ERROR Updating pulumi stack : failed to run update: exit status 0xffffffff code: 4294967295 stdout: Updating (demo-1-aws)

      View Live: https://app.pulumi.com/rsiv/demo-1/demo-1-aws/updates/3

       +  pulumi:pulumi:Stack demo-1-demo-1-aws creating
          aws:resourcegroups:Group demo-1-aws  error: unable to discover AWS AccessKeyID and/or SecretAccessKey - see https://pulumi.io/install/aws.html for details on configuration
       +  pulumi:pulumi:Stack demo-1-demo-1-aws created
          aws:resourcegroups:Group demo-1-aws **failed** 1 error

      Diagnostics:
        aws:resourcegroups:Group (demo-1-aws):
          error: unable to discover AWS AccessKeyID and/or SecretAccessKey - see https://pulumi.io/install/aws.html for details on configuration

      Resources:
          + 1 created

      Duration: 2s

      stderr:
raksiv commented 2 years ago

Might be able to update the validator for each provider -

func (a *awsProvider) Validate() error {
    errList := &multierror.ErrorList{}

    .....
raksiv commented 2 years ago

Add a session check for each provider.