atlassian / terraform-provider-artifactory

Terraform provider to manage Artifactory
Apache License 2.0
89 stars 42 forks source link

checksum_policy_type and snapshot_version_behavior are being treated as Required and not Optional #85

Closed c0debreaker closed 4 years ago

c0debreaker commented 4 years ago

Terraform Version

Terraform v0.11.14

Your version of Terraform is out of date! The latest version is 0.12.28. You can update by downloading from www.terraform.io/downloads.html

Affected Resource(s)

artifactory_local_repository

Terraform Configuration Files

resource "artifactory_local_repository" "npm-virtual" {
    docker_api_version =        "V2"
    handle_releases =           0
    handle_snapshots =          0
    includes_pattern =          "**/*"
    key =                       "npm-virtual"
    package_type =              "npm"
    repo_layout_ref =           "npm-default"
}

Debug Output

$  terraform import artifactory_local_repository.npm-virtual npm-virtual
artifactory_local_repository.npm-virtual: Importing from ID "npm-virtual"...
artifactory_local_repository.npm-virtual: Import complete!
  Imported artifactory_local_repository (ID: npm-virtual)
artifactory_local_repository.npm-virtual: Refreshing state... (ID: npm-virtual)

Import successful!

The resources that were imported are shown above. These resources are now in
your Terraform state and will henceforth be managed by Terraform.

$  terraform plan
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.

artifactory_local_repository.npm-virtual: Refreshing state... (ID: npm-virtual)

------------------------------------------------------------------------

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  ~ artifactory_local_repository.npm-virtual
      checksum_policy_type:      "" => "client-checksums"
      snapshot_version_behavior: "" => "non-unique"

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

------------------------------------------------------------------------

Expected Behavior

The terraform plan using artifactory provider should treat checksum_policy_type and snapshot_version_behavior as optional because that's what your document is saying.

Actual Behavior

Atlassian/Artifactory plugin document says that checksum_policy_type and snapshot_version_behavior are optional. However, I cannot get terraform plan to work. It wants to change our current npm-virtual which we don't want.

Steps to Reproduce

$  terraform import artifactory_local_repository.npm-virtual npm-virtual
artifactory_local_repository.npm-virtual: Importing from ID "npm-virtual"...
artifactory_local_repository.npm-virtual: Import complete!
  Imported artifactory_local_repository (ID: npm-virtual)
artifactory_local_repository.npm-virtual: Refreshing state... (ID: npm-virtual)

Import successful!

The resources that were imported are shown above. These resources are now in
your Terraform state and will henceforth be managed by Terraform.

$  terraform plan
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.

artifactory_local_repository.npm-virtual: Refreshing state... (ID: npm-virtual)

------------------------------------------------------------------------

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  ~ artifactory_local_repository.npm-virtual
      checksum_policy_type:      "" => "client-checksums"
      snapshot_version_behavior: "" => "non-unique"

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

------------------------------------------------------------------------
c0debreaker commented 4 years ago

Please ignore. I used wrong type.