Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve doc for artifactory file resource #868

Merged
merged 3 commits into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
22 changes: 7 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand All @@ -35,18 +32,18 @@ Create a new Terraform file with `artifactory` resources. Also see [sample.tf](.
<details><summary>HCL Example</summary>

```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" {
Expand Down Expand Up @@ -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.
Expand All @@ -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.

Expand Down
4 changes: 1 addition & 3 deletions docs/data-sources/file.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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

Expand Down
14 changes: 7 additions & 7 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
Expand All @@ -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:
Expand All @@ -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).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
},
},
}
Expand Down
2 changes: 1 addition & 1 deletion sample.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ terraform {
required_providers {
artifactory = {
source = "registry.terraform.io/jfrog/artifactory"
version = "9.7.3"
version = "10.0.2"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/run-artifactory.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading