aws-extend-switch-roles icon indicating copy to clipboard operation
aws-extend-switch-roles copied to clipboard

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

Open iliasmer opened this issue 2 years ago • 6 comments

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

  • OS: [windows]
  • Browser [ chrome]
  • Version [...]

Additional context Add any other context about the problem here.

iliasmer avatar Nov 09 '23 09:11 iliasmer

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

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

keebrev avatar Nov 09 '23 09:11 keebrev

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.

tilfin avatar Nov 09 '23 13:11 tilfin

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.

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.

fdamstra avatar Nov 16 '23 15:11 fdamstra