From a4b950f79b96d61d21f7d8af531849d91d70bdfd Mon Sep 17 00:00:00 2001 From: Ilija Matoski Date: Thu, 15 Dec 2022 14:09:40 +0100 Subject: [PATCH] Set AWS_SESSION_TOKEN in addition to AWS_SECURITY_TOKEN (#13297) * Set AWS_SESSION_TOKEN in addition to AWS_SECURITY_TOKEN * added AWS_SESSION_TOKEN to inventoryupdate-1 test --- awx/main/models/credential/injectors.py | 1 + awx/main/tests/data/inventory/plugins/ec2/env.json | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/awx/main/models/credential/injectors.py b/awx/main/models/credential/injectors.py index afbb30811b..93c1a37d8b 100644 --- a/awx/main/models/credential/injectors.py +++ b/awx/main/models/credential/injectors.py @@ -15,6 +15,7 @@ def aws(cred, env, private_data_dir): if cred.has_input('security_token'): env['AWS_SECURITY_TOKEN'] = cred.get_input('security_token', default='') + env['AWS_SESSION_TOKEN'] = env['AWS_SECURITY_TOKEN'] def gce(cred, env, private_data_dir): diff --git a/awx/main/tests/data/inventory/plugins/ec2/env.json b/awx/main/tests/data/inventory/plugins/ec2/env.json index 57e9c67a3b..77cedd003e 100644 --- a/awx/main/tests/data/inventory/plugins/ec2/env.json +++ b/awx/main/tests/data/inventory/plugins/ec2/env.json @@ -3,5 +3,6 @@ "ANSIBLE_TRANSFORM_INVALID_GROUP_CHARS": "never", "AWS_ACCESS_KEY_ID": "fooo", "AWS_SECRET_ACCESS_KEY": "fooo", - "AWS_SECURITY_TOKEN": "fooo" + "AWS_SECURITY_TOKEN": "fooo", + "AWS_SESSION_TOKEN": "fooo" } \ No newline at end of file