diff --git a/CHANGELOG.md b/CHANGELOG.md index f5b3f2151..d0ce17b13 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 10.0.3 (Jan 12, 2024) + +IMPROVEMENTS: +* data source/artifactory_file: improve description for `path_is_aliased` attribute. PR: [#868](https://github.com/jfrog/terraform-provider-artifactory/pull/868) + ## 10.0.2 (Dec 18, 2023). Tested on Artifactory 7.71.8 with Terraform CLI v1.6.6 IMPROVEMENTS: diff --git a/README.md b/README.md index 4704c457f..2bd72aaea 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ ## Releases -Current provider major release: **9.x** +Current provider major release: **10.x** See [CHANGELOG.md](CHANGELOG.md) for full details @@ -19,14 +19,11 @@ Version 6.x is compatible with the Artifactory versions 7.49.x and below. Version 7.x and 8.x is only compatible with Artifactory between 7.50.x and 7.67.x due to changes in the projects functionality. -Version 9.x is the latest major version and is compatible with latest Artifactory versions (>=7.68.7 (self-hosted) and >=7.67.0 (cloud)). +Version 10.x is the latest major version and is compatible with latest Artifactory versions (>=7.68.7 (self-hosted) and >=7.67.0 (cloud)). ## Terraform CLI version support -Current version support [Terraform Protocol v5](https://developer.hashicorp.com/terraform/plugin/terraform-plugin-protocol#protocol-version-5) which mean Terraform CLI version 0.12 and later. - -> [!WARNING] -> We will be moving to [Terraform Protocol v6](https://developer.hashicorp.com/terraform/plugin/terraform-plugin-protocol#protocol-version-6) in **Q1 2024**. This means only Terraform CLI version 1.0 and later will be supported. +Current version support [Terraform Protocol v6](https://developer.hashicorp.com/terraform/plugin/terraform-plugin-protocol#protocol-version-6) which mean Terraform CLI version 1.0 and later. ## Quick Start @@ -35,18 +32,18 @@ Create a new Terraform file with `artifactory` resources. Also see [sample.tf](.
HCL Example ```terraform -# Required for Terraform 0.13 and up (https://www.terraform.io/upgrade-guides/0-13.html) +# Required for Terraform 1.0 and up (https://www.terraform.io/upgrade-guides) terraform { required_providers { artifactory = { source = "registry.terraform.io/jfrog/artifactory" - version = "6.6.1" + version = "10.0.2" } } } provider "artifactory" { - // supply ARTIFACTORY_USERNAME, ARTIFACTORY_ACCESS_TOKEN, and ARTIFACTORY_URL as env vars + // supply JFROG_ACCESS_TOKEN, and JFROG_URL as env vars } resource "artifactory_local_pypi_repository" "pypi-local" { @@ -110,11 +107,6 @@ $ curl -sL ${host}/artifactory/api/system/licenses/ | jq . } ``` -The following 3 license types (`jq .type`) do **NOT** support APIs: -- Community Edition for C/C++ -- JCR Edition -- OSS - ## Versioning In general, this project follows [Terraform Versioning Specification](https://www.terraform.io/plugin/sdkv2/best-practices/versioning#versioning-specification) as closely as we can for tagging releases of the package. @@ -128,7 +120,7 @@ See the [contribution guide](CONTRIBUTIONS.md). ## License -Copyright (c) 2023 JFrog. +Copyright (c) 2024 JFrog. Apache 2.0 licensed, see [LICENSE][LICENSE] file. diff --git a/docs/data-sources/file.md b/docs/data-sources/file.md index 37860d609..80692756f 100644 --- a/docs/data-sources/file.md +++ b/docs/data-sources/file.md @@ -5,7 +5,6 @@ Provides an Artifactory file datasource. This can be used to download a file fro ## Example Usage ```hcl -# data "artifactory_file" "my-file" { repository = "repo-key" path = "/path/to/the/artifact.zip" @@ -21,8 +20,7 @@ The following arguments are supported: * `path` - (Required) The path to the file within the repository. * `output_path` - (Required) The local path the file should be downloaded to. * `force_overwrite` - (Optional) If set to true, an existing file in the output_path will be overwritten. Default: `false` -* `path_is_aliased` - (Optional) If set to `true`, the provider will get the artifact directly from Artifactory without attempting to resolve it or verify it and will delegate this to artifactory - if the file exists. More details in the [official documentation](https://www.jfrog.com/confluence/display/JFROG/Artifactory+REST+API#ArtifactoryRESTAPI-RetrieveLatestArtifact) +* `path_is_aliased` - (Optional) If set to `true`, the provider will get the artifact directly from Artifactory without attempting to resolve it or verify it and will delegate this to artifactory if the file exists. When using a smart remote repository, it is recommended to set this attribute to `true`. This is necessary to ensure that the provider fetches the artifact directly from Artifactory. If this attribute is not set or is set to `false`, there is a risk of fetching the `-cache` directory in Artifactory, potentially resulting in resource expiration and a 404 error. ## Attribute Reference diff --git a/docs/index.md b/docs/index.md index 06d07be2e..563faa16c 100644 --- a/docs/index.md +++ b/docs/index.md @@ -19,18 +19,16 @@ curl -sL ${host}/artifactory/api/system/licenses/ | jq . ## Terraform CLI version support -Current version support [Terraform Protocol v5](https://developer.hashicorp.com/terraform/plugin/terraform-plugin-protocol#protocol-version-5) which mean Terraform CLI version 0.12 and later. - -~>We will be moving to [Terraform Protocol v6](https://developer.hashicorp.com/terraform/plugin/terraform-plugin-protocol#protocol-version-6) in **Q1 2024**. This means only Terraform CLI version 1.0 and later will be supported. +Current version support [Terraform Protocol v6](https://developer.hashicorp.com/terraform/plugin/terraform-plugin-protocol#protocol-version-6) which mean Terraform CLI version 1.0 and later. ## Example Usage ```tf -# Required for Terraform 0.13 and up (https://www.terraform.io/upgrade-guides/0-13.html) +# Required for Terraform 1.0 and up (https://www.terraform.io/upgrade-guides) terraform { required_providers { artifactory = { source = "registry.terraform.io/jfrog/artifactory" - version = "9.7.0" + version = "10.0.2" } } } @@ -50,11 +48,13 @@ resource "artifactory_local_pypi_repository" "pypi-libs" { ``` ## Authentication + The Artifactory provider supports two ways of authentication. The following methods are supported: * Access Token -* API Key +* API Key (deprecated) ### Access Token + Artifactory access tokens may be used via the Authorization header by providing the `access_token` attribute to the provider block. Getting this value from the environment is supported with `JFROG_ACCESS_TOKEN` or `ARTIFACTORY_ACCESS_TOKEN` variables. Usage: @@ -66,7 +66,7 @@ provider "artifactory" { } ``` -### API Key +### API Key (deprecated) !>An upcoming version will support the option to block the usage/creation of API Keys (for admins to set on their platform). In a future version (scheduled for end of Q3, 2023), the option to disable the usage/creation of API Keys will be available and set to disabled by default. Admins will be able to enable the usage/creation of API Keys. By end of Q1 2024, API Keys will be deprecated all together and the option to use them will no longer be available. See [JFrog API Key Deprecation Process](https://jfrog.com/help/r/jfrog-platform-administration-documentation/jfrog-api-key-deprecation-process). diff --git a/pkg/artifactory/datasource/artifact/datasource_artifactory_file.go b/pkg/artifactory/datasource/artifact/datasource_artifactory_file.go index e69205c17..2486f3404 100644 --- a/pkg/artifactory/datasource/artifact/datasource_artifactory_file.go +++ b/pkg/artifactory/datasource/artifact/datasource_artifactory_file.go @@ -128,7 +128,11 @@ func ArtifactoryFile() *schema.Resource { Optional: true, Default: false, Description: "If set to `true`, the provider will get the artifact path directly from Artifactory without attempting to resolve " + - "it or verify it and will delegate this to artifactory if the file exists. More details in the [official documentation](https://www.jfrog.com/confluence/display/JFROG/Artifactory+REST+API#ArtifactoryRESTAPI-RetrieveLatestArtifact)", + "it or verify it and will delegate this to artifactory if the file exists. " + + "When using a smart remote repository, it is recommended to set this attribute to `true`. " + + "This is necessary to ensure that the provider fetches the artifact directly from Artifactory. " + + "If this attribute is not set or is set to `false`, there is a risk of fetching the `-cache` directory in Artifactory, " + + "potentially resulting in resource expiration and a 404 error.", }, }, } diff --git a/sample.tf b/sample.tf index 521922bc8..fa296267a 100644 --- a/sample.tf +++ b/sample.tf @@ -3,7 +3,7 @@ terraform { required_providers { artifactory = { source = "registry.terraform.io/jfrog/artifactory" - version = "9.7.3" + version = "10.0.2" } } } diff --git a/scripts/run-artifactory.sh b/scripts/run-artifactory.sh index 122cdce6b..98b366cbe 100755 --- a/scripts/run-artifactory.sh +++ b/scripts/run-artifactory.sh @@ -3,7 +3,7 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" > /dev/null && pwd )" source "${SCRIPT_DIR}/get-access-key.sh" source "${SCRIPT_DIR}/wait-for-rt.sh" -export ARTIFACTORY_VERSION=${ARTIFACTORY_VERSION:-7.59.9} +export ARTIFACTORY_VERSION=${ARTIFACTORY_VERSION:-7.71.4} echo "ARTIFACTORY_VERSION=${ARTIFACTORY_VERSION}" set -euf