From 47a0914f75114d59b68377549e1f334101cf500f Mon Sep 17 00:00:00 2001 From: arnie Date: Mon, 10 Mar 2025 11:22:48 +0100 Subject: [PATCH] Add veracode EU profiles to aws config with default names, but don't override US names where matching --- home-manager/veracode/aws-cli.nix | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/home-manager/veracode/aws-cli.nix b/home-manager/veracode/aws-cli.nix index a9624ce..3fb4eba 100644 --- a/home-manager/veracode/aws-cli.nix +++ b/home-manager/veracode/aws-cli.nix @@ -255,26 +255,21 @@ in sso_session = veracode-us region = us-east-1 output = json - - [profile id-${id}] - sso_account_id = ${id} - sso_role_name = ${account.role} - sso_session = veracode-us - region = us-east-1 - output = json '') accounts.us )} ${builtins.concatStringsSep "\n" ( lib.mapAttrsToList (id: account: '' - [profile eu-${account.name}] + ${if lib.any (usAccount: usAccount.name == account.name) (lib.attrValues accounts.us) then "" else '' + [profile ${account.name}] sso_account_id = ${id} sso_role_name = ${account.role} sso_session = veracode-eu region = eu-central-1 output = json + ''} - [profile id-${id}] + [profile eu-${account.name}] sso_account_id = ${id} sso_role_name = ${account.role} sso_session = veracode-eu