okta / terraform-provider-okta

A Terraform provider to manage Okta resources, enabling infrastructure-as-code provisioning and management of users, groups, applications, and other Okta objects.
https://registry.terraform.io/providers/okta/okta
Mozilla Public License 2.0
256 stars 207 forks source link

okta_app_bookmark import missing authentication_policy #1942

Closed jeremysells-canv closed 5 months ago

jeremysells-canv commented 7 months ago

Community Note

Terraform Version

% terraform -v
Terraform v1.7.5
on darwin_arm64

Affected Resource(s)

Terraform Configuration Files

terraform {
  backend "local" {
    path = "terraform.tfstate"
  }
  required_providers {
    okta = {
      source = "okta/okta"
      version = "4.8.0"
    }
  }
}

provider "okta" {}

resource "okta_app_bookmark" "example" {
  label  = "Terraform Test"
  url    = "https://example.com"
  authentication_policy = "12345"
}

Debug Output

terraform init
terraform plan
# Shows it is going to add the app which is correct (as it has not been imported yet)
terraform import okta_app_bookmark.example abcde
terraform plan
# Now shows it is going to set the authentication policy which should have been imported

Plan Output

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following
symbols:
  ~ update in-place

Terraform will perform the following actions:

  # okta_app_bookmark.example will be updated in-place
  ~ resource "okta_app_bookmark" "example" {
      + authentication_policy      = "12345"
        id                         = "abcde"
        name                       = "bookmark"
        # (11 unchanged attributes hidden)
    }

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

Panic Output

n.a.

Expected Behavior

Terraform app was imported so it should not be making any changes to the authentication policy. In the Okta Admin the authentication_policy is set to the same value as in the Terraform configuration so no changes should be on the Terraform plan output (after import).

Can this be done in the Admin UI?

n.a.

Can this be done in the actual API call?

n.a.

Actual Behavior

(see above)

Steps to Reproduce

(see above)

Important Factoids

n.a.

References

Notes

duytiennguyen-okta commented 7 months ago

OKTA internal reference https://oktainc.atlassian.net/browse/OKTA-712699

exitcode0 commented 5 months ago

this appears to occur on okta_app_saml as well its possible that these occur on all okta_app_* resources

I'm curious if the maintainers think that authentication_policy assignment should be split out into its own resource away from the okta_app resources themselves, something for V5 perhaps ¯\(ツ)

duytiennguyen-okta commented 5 months ago

@exitcode0 It will stay with okta_app for now. I am fixing this issue