1

I'm trying to import AWS credentials from csv file with headers

User name,Password,Access key ID,Secret access key,Console login link

and using command

aws configure import --csv file://myfile.csv --region us-east-1

But the region comes back as empty. I tried setting region header in CSV file too but nothing works.

Below is the output of aws configure list

      Name                    Value             Type    Location
      ----                    -----             ----    --------
      profile       deployment_admin              env    ['AWS_PROFILE', 'AWS_DEFAULT_PROFILE']
      access_key     ****************.   shared-credentials-file    
      secret_key     ****************.   shared-credentials-file    
      region                <not set>             None    None
Maurice
  • 11,482
  • 2
  • 25
  • 45
mbxzxz
  • 366
  • 2
  • 14

1 Answers1

3

I don't think that's supported. The --region parameter is listed under the Global Options, i.e. can be used with all CLI operations.

Global Options

[...]

--region (string)

The region to use. Overrides config/env settings.

docs

Usually, you can use it to direct an API call to a specific region. Since there is no API call here, it shouldn't do anything.

Looking at the implementation, it seems like the code really only considers the 'User Name', 'Access Key ID', and 'Secret Access key' columns in the CSV so there's no sneaky way to add the region.

Maurice
  • 11,482
  • 2
  • 25
  • 45
  • That really sucks, I have a GitLab pipeline config file and I need to run tree times `aws configure set` command for access key id, secret acess key and region, if `configure` supported the `--region` flag as users expects it would be very helpful – fudo Mar 07 '23 at 14:24
  • 1
    @fudo If you're running in a pipeline anyway, just set the `AWS_REGION` environment variable to the region the job is supposed to be running in. – Maurice Mar 08 '23 at 06:43