Skip to content

2-sec-vnet/main.tf - Cannot initialize end_date in azuread_service_principal_password resource #7

@bluedog13

Description

@bluedog13

In the module : 2-sec-vnet/main.tf, line 114/115

value                = random_password.vnet_peering.result
end_date_relative    = "17520h"

gives the below error when I run "terraform validate".

Error: Unsupported argument

  • An argument named "end_date_relative" is not expected here.
  • Can't configure a value for "value": its value will be decided automatically based on the result of applying this configuration.

As an alternative, the below can be used

TERRAFORM CONFIG

time = {
      source  = "registry.terraform.io/hashicorp/time"
      version = "~> 0.7.2"
    }

RESOURCES

resource "time_rotating" "vnet_peering" {
  rotation_days = 7
}


resource "azuread_service_principal_password" "vnet_peering" {
  service_principal_id = azuread_service_principal.vnet_peering.id

  keepers = {
    rotation = time_rotating.vnet_peering.id
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions