hashicorp / terraform-provider-time

Utility provider that provides Time-Based Resources
https://registry.terraform.io/providers/hashicorp/time/latest
Mozilla Public License 2.0
104 stars 30 forks source link

`time_rotating` resource errors when providing a `base_rfc3339` attribute #36

Closed robzr closed 3 years ago

robzr commented 3 years ago

Community Note

Terraform Version

v0.15.1

Affected Resource(s)

Terraform Configuration Files

terraform {
  required_providers {
    time = {
      source = "hashicorp/time"
      version = "0.7.1"
    }
  }
}

provider "time" {}

resource "time_rotating" "this" {
  base_rfc3339 = "2021-05-04T17:42:13Z"
}

Debug Output

https://gist.github.com/robzr/d788a443f2b950f648fe1a2cedfb3f79

Panic Output

n/a

Expected Behavior

Attribute should work, according to docs

Actual Behavior

Terraform issues error An argument named "base_rfc3339" is not expected here.

Steps to Reproduce

  1. terraform apply

Important Factoids

n/a

References

bflad commented 3 years ago

Hi @robzr πŸ‘‹ Thank you for raising this and sorry you ran into trouble there. This happens to be a documentation bug which we can get resolved, but changing the argument from base_rfc3339 to rfc3339 will match the underlying implementation so the configuration can be applied. e.g.

terraform {
  required_providers {
    time = {
      source  = "hashicorp/time"
      version = "0.7.1"
    }
  }
}

provider "time" {}

resource "time_rotating" "this" {
  rfc3339       = "2021-05-04T17:42:13Z"
  rotation_days = 1
}
$ terraform apply

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # time_rotating.this will be created
  + resource "time_rotating" "this" {
      + day              = (known after apply)
      + hour             = (known after apply)
      + id               = (known after apply)
      + minute           = (known after apply)
      + month            = (known after apply)
      + rfc3339          = "2021-05-04T17:42:13Z"
      + rotation_days    = 1
      + rotation_rfc3339 = (known after apply)
      + second           = (known after apply)
      + unix             = (known after apply)
      + year             = (known after apply)
    }

Plan: 1 to add, 0 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

time_rotating.this: Creating...
time_rotating.this: Creation complete after 0s [id=2021-05-04T17:42:13Z]

Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
github-actions[bot] commented 5 months ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.