title: EC2 User Data copying outdated version of a file in S3?
body: <p>So, I'm trying to setup a Jenkins server in a EC2 instance and use CasC with it. I created an S3 bucket to store the CasC configuration and setup a user data script to copy that configuration into the specific path.
  Everything goes well in the first run of the user data script and the file gets copied to the correct path. However, when I upload a new version of the file and reboot the EC2 instance, it seems that the aws cli is copying the old version, no matter how many times I reboot the instance after that.
  Here's my user data script:</p>
  <pre><code>#! /bin/bash
  sudo su -
  yum update -y
  wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo
  rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
  yum install jenkins java-1.8.0-openjdk-devel -y
  systemctl daemon-reload
  
  systemctl stop jenkins
  
  aws s3 cp s3://jenkins-casc/jenkins.yaml /var/lib/jenkins/
  
  systemctl start jenkins
  </code></pre>
  <p>And here's the cloud-init output for the copy command:</p>
  <pre><code>download: s3://jenkins-casc/jenkins.yaml to var/lib/jenkins/jenkins.yaml
  </code></pre>