AWS CLI inside local-exec

Hello Folks,
I wanted to execute AWS CLI inside local-exec section. Now, the complications which I am having is, i am assuming a remote AWS Account role inside my provider section. Effectively, my machine is in Account A(Dev) and I am provisioning the resources in Account B (test) & using local-exec, I wanted to run some CLI to test the stability. As far as i know, Local-exec is not aware of the credentials which provider has assumed to it will run in my local Account A.

Any help?

Hello @brucewayneigsc!

Sorry for the delayed response. You are correct in that local-exec is not aware of any credentials. We might be able to run the AWS command by setting the environment block.

Let me know how you found a way to do it!