Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rotation is not working #11

Open
outcast292 opened this issue Sep 10, 2024 · 0 comments · May be fixed by #21
Open

Rotation is not working #11

outcast292 opened this issue Sep 10, 2024 · 0 comments · May be fixed by #21

Comments

@outcast292
Copy link

outcast292 commented Sep 10, 2024

Multirotation is not working, here's a simple code I have made to replicate the issue.

resource "multirotate_set" "token_rotation" {
  rotation_period = "0h1m30s"
  number          = 3
}


resource "null_resource" "foo" {
  count = 3
  provisioner "local-exec" {
    command = "echo creating service key number [${count.index}]"
  }
  # triggers = {
  #   rotation = multirotate_set.token_rotation.rotation_set[count.index].expiration
  # }
  lifecycle {
    replace_triggered_by = [ multirotate_set.token_rotation.rotation_set[count.index] ]
  }
}

the first run will result in this snapshot from state file

   "instances": [
        {
          "schema_version": 0,
          "attributes": {
            "current_rotation": 2,
            "last_rotate": "2024-09-06T13:34:51+02:00",
            "number": 3,
            "rotation_period": "0h1m30s",
            "rotation_set": [
              {
                "creation": "2024-09-06T13:33:21+02:00",
                "expiration": "2024-09-06T13:34:51+02:00",
                "version": ""
              },
              {
                "creation": "2024-09-06T13:33:21+02:00",
                "expiration": "2024-09-06T13:36:21+02:00",
                "version": ""
              },
              {
                "creation": "2024-09-06T13:33:21+02:00",
                "expiration": "2024-09-06T13:37:51+02:00",
                "version": ""
              }
            ],
            "timestamp": "2024-09-06T13:33:21+02:00",
            "version": ""
          },
          "sensitive_attributes": []
        }
      ]

yet, re-running terraform apply/plan will result
image

and by rechecking the tfstate, I see no changes

@JonasKop JonasKop linked a pull request Dec 22, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant