I have one lambda from which I am accessing one cross account by assume role
sts = boto3.client('sts')
sts.assume_role(RoleArn='A', RoleSessionName='aaa')
Now I did some operation after accessing this
Like I get some instance information .
ec2 = boto3.client('ec2')
desc = ec2.describe_instaces() #this all are working fine
Now I want to back my lambda role(B) and store this data.
sts2 = boto3.client('sts')
sts2.assume_role(RoleArn='B', RoleSessionName='bbb')
and want to store desc
those instance data into one s3 bucket of my current lambda account.
I tried these but it is not able to store the data...Is there any way I can able to force expire the assume role and get my current access role to store the data