title: Why are the STS credentials getting expired within 45 minutes?
body: <p>I have this setup where my Ansible playbook runs, which runs an ML script which takes around 3-4 hours for execution, and some AWS tasks running after the ML script. </p>
  
  <p>So, I am running a background <code>updatecredentials.py</code> python file which updates both the <code>/home/ubuntu/.aws/config</code> and the file from where my AWS takes credentials from.
  This file runs every <strong>45</strong> minutes.</p>
  
  <p>The updates are as follows:</p>
  
  <p>For the first instance of the run, the <code>stat</code> of the config file is as follows:</p>
  
  <pre><code>  File: ‘/home/ubuntu/.aws/config’
    Size: 480         Blocks: 8          IO Block: 4096   regular file
  Device: ca01h/51713d    Inode: 275461      Links: 1
  Access: (0664/-rw-rw-r--)  Uid: ( 1000/  ubuntu)   Gid: ( 1000/  ubuntu)
  Access: 2017-08-09 09:53:20.600856000 +0000
  Modify: 2017-08-09 09:53:18.804856000 +0000
  Change: 2017-08-09 09:53:18.804856000 +0000
  </code></pre>
  
  <p>For the second instance, it is:</p>
  
  <pre><code>  File: ‘/home/ubuntu/.aws/config’
    Size: 480         Blocks: 8          IO Block: 4096   regular file
  Device: ca01h/51713d    Inode: 275461      Links: 1
  Access: (0664/-rw-rw-r--)  Uid: ( 1000/  ubuntu)   Gid: ( 1000/  ubuntu)
  Access: 2017-08-09 12:10:29.072856000 +0000
  Modify: 2017-08-09 10:38:18.892856000 +0000
  Change: 2017-08-09 10:38:18.892856000 +0000
  </code></pre>
  
  <p>So, the <code>nohup</code> is working.  However, I get the error in the <code>.err</code> file of the nohup code as:</p>
  
  <pre><code>botocore.exceptions.ClientError: An error occurred (ExpiredToken) when calling the AssumeRole operation: The security token included in the request is expired
  </code></pre>
  
  <p>And when I did <code>stat</code> to the <code>creds.err</code> file, it shows:</p>
  
  <pre><code>  File: ‘creds.err’
    Size: 594         Blocks: 8          IO Block: 4096   regular file
  Device: ca01h/51713d    Inode: 275463      Links: 1
  Access: (0664/-rw-rw-r--)  Uid: ( 1000/  ubuntu)   Gid: ( 1000/  ubuntu)
  Access: 2017-08-09 12:04:49.952856000 +0000
  Modify: 2017-08-09 11:23:18.940856000 +0000
  Change: 2017-08-09 11:23:18.940856000 +0000
   Birth: -
  </code></pre>
  
  <p><strong>Does this mean that my STS[/temporary] credentials expired within 45 minutes?</strong></p>