tilfinltd / aws-extend-switch-roles

Extend your AWS IAM switching roles by Chrome extension, Firefox add-on, or Edge add-on
https://goo.gl/0QFjow
MIT License
1.31k stars 140 forks source link

Cannot save (ERROR: singles[0].role_name is required to be a valid string) #331

Open iliasmer opened 8 months ago

iliasmer commented 8 months ago

Describe the bug When I try to save my configurations it is unable to do so, throwing this error: singles[0].role_name is required to be a valid string. This error is at least when using Chrome, I have not tested with other browsers.

To Reproduce Steps to reproduce the behavior:

  1. Go to 'Configuration'
  2. Click on 'Save', with or without making changes to the current config
  3. See error

Expected behavior Save the configuration.

Screenshots image

Environment

Additional context Add any other context about the problem here.

joost-wolfsen-cloudnation commented 8 months ago

I'm suffering from the same issue with the newest version of the plugin in Chrome on Windows 10 and on Windows 11

keebrev commented 8 months ago

Same issue here. MacOS Sonoma 14.1 with Chrome 119.0.6045.105 for ARM64. Plugin version 4.0.2.

tilfin commented 8 months ago

AESR has enhanced configuration validation in a recent update.

singles[0].role_name is required to be a valid string.

This error message means that the role_name in the 0th (first) definition of the profile by 'Simple Configuration' is not the correct string. 'Simple Configuration' means a single profile definition not referenced in source_profile.

Perhaps there is a profile definition for the base account that is incorrect with the profile name specified in source_profile.

joost-wolfsen-cloudnation commented 8 months ago

Thanks, i've redone my profile list and now it is saving again. Weird though that it suddenly became an issue whereas i haven't changed the first 50 rows of my configuration in the past 1,5 years.

fdamstra commented 7 months ago

In #333 , @tilfin said:

It is not possible to share exactly the same settings as ~/.aws/config.

It disappoints me that parity with ~/.aws/config isn't a goal of this extension. I thought it was. Being able to keep the extend roles configuration and my ~/.aws/config configuration in sync was one of the great features of this plugin, and I have been doing it for years. It wasn't until I recently had to make updates to my configuration that it wouldn't save (and in fact was functioning just fine).

But I believe this inconsistency is what we're running into in this thread, too.

The simplest example of a configuration that is valid in ~/.aws/config but not in switch roles is:

[profile mybase]
aws_account_id=987654321987
region=us-east-2

It cannot be saved due to the singles[0].role_name requirement.

Notably, it does save if I add a profile that references it:

[profile mybase]
aws_account_id=987654321987
region=us-east-2

[profile target]
role_arn = arn:aws:iam::987654321987:role/Role1
source_profile = mybase

But for some of my accounts, I don't currently have any roles to assume.