title: Terraform recreating aws_iam_access_key each time
body: <p>I have a Terraform module which creates a user for my CI environment to publish to ECR.</p>
  
  <pre><code>resource "aws_iam_user" "continuous-deployment" {
    name = "continuous-deployment"
    path = "/system/"
  }
  
  resource "aws_iam_access_key" "continuous-deployment" {
    user    = "${aws_iam_user.continuous-deployment.name}"
    pgp_key = "${var.pgp_key}"
  }
  
  resource "aws_iam_user_policy" "continuous-deployment" {
    name = "continuous-deployment"
    user = "${aws_iam_user.continuous-deployment.name}"
  
    policy = &lt;&lt;EOF
  {
    "Version": "2012-10-17",
    "Statement": [
      {
        "Action": [
            "ecr:GetAuthorizationToken",
            "ecr:BatchCheckLayerAvailability",
            "ecr:GetDownloadUrlForLayer",
            "ecr:GetRepositoryPolicy",
            "ecr:DescribeRepositories",
            "ecr:ListImages",
            "ecr:DescribeImages",
            "ecr:BatchGetImage",
            "ecr:InitiateLayerUpload",
            "ecr:UploadLayerPart",
            "ecr:CompleteLayerUpload",
            "ecr:PutImage",
            "ecr:GetLoginToken"
        ],
        "Effect": "Allow",
        "Resource": "*"
      }
    ]
  }
  EOF
  }
  
  output "aws_access_key_id" {
    value = "${aws_iam_access_key.continuous-deployment.id}"
  }
  
  output "aws_secret_access_key" {
    value = "${aws_iam_access_key.continuous-deployment.encrypted_secret}"
  }
  </code></pre>
  
  <p>The issue I am having is that on each <code>terraform apply</code>, Terraform wants to delete and recreate these resources even when they have not changed.</p>
  
  <p>I have no idea why this is happening and can't find anyone in a similar position unfortunately. Ideas?</p>