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

Add reverse proxy resource #13

Merged
merged 8 commits into from
Dec 14, 2023
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
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: 1.21
-
name: Import GPG key
id: import_gpg
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
terraform-provider-jfrog
dist/
vendor/
.idea/
Expand Down
12 changes: 9 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
## 1.1.0 (Dec 14, 2023). Tested on Artifactory 7.71.8 with Terraform CLI v1.6.6

FEATURES:

* **New Resource:** `platform_reverse_proxy`: PR: [#13](https://github.com/jfrog/terraform-provider-platform/pull/13) Issue: [#11](https://github.com/jfrog/terraform-provider-platform/issues/11)

## 1.0.1 (Nov 28, 2023). Tested on Artifactory 7.71.5 with Terraform CLI v1.6.4

IMPROVEMENTS:

* Bump github.com/hashicorp/terraform-plugin-go from 0.19.0 to 0.19.1: PR [6](https://github.com/jfrog/terraform-provider-platform/pull/6)
* Bump github.com/hashicorp/terraform-plugin-testing from 1.5.0 to 1.5.1: PR [5](https://github.com/jfrog/terraform-provider-platform/pull/5)
* Bump github.com/go-resty/resty/v2 from 2.7.0 to 2.10.0: PR [4](https://github.com/jfrog/terraform-provider-platform/pull/4)
* Bump github.com/hashicorp/terraform-plugin-go from 0.19.0 to 0.19.1: PR: [6](https://github.com/jfrog/terraform-provider-platform/pull/6)
* Bump github.com/hashicorp/terraform-plugin-testing from 1.5.0 to 1.5.1: PR: [5](https://github.com/jfrog/terraform-provider-platform/pull/5)
* Bump github.com/go-resty/resty/v2 from 2.7.0 to 2.10.0: PR: [4](https://github.com/jfrog/terraform-provider-platform/pull/4)

## 1.0.0 (Nov 27, 2023)

Expand Down
57 changes: 57 additions & 0 deletions docs/resources/reverse_proxy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "platform_reverse_proxy Resource - terraform-provider-platform"
subcategory: ""
description: |-
Provides a JFrog Reverse Proxy https://jfrog.com/help/r/jfrog-artifactory-documentation/reverse-proxy-settings resource.
~>Only available for self-hosted instances.
---

# platform_reverse_proxy (Resource)

Provides a JFrog [Reverse Proxy](https://jfrog.com/help/r/jfrog-artifactory-documentation/reverse-proxy-settings) resource.

~>Only available for self-hosted instances.

## Example Usage

```terraform
resource "platform_reverse_proxy" "my-reverse-proxy" {
docker_reverse_proxy_method = "SUBDOMAIN"
server_name_expression = "*.jfrog.com"
server_provider = "NGINX"
public_server_name = "jfrog.com"
internal_hostname = "localhost"
use_https = true
http_port = 80
https_port = 443
ssl_key_path = "/etc/ssl/private/myserver.key"
ssl_certificate_path = "/etc/ssl/certs/myserver.crt"
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `server_provider` (String) Set the server provider type. Supported values: DIRECT, NGINX, APACHE.

### Optional

- `docker_reverse_proxy_method` (String) Docker access method. The default value is SUBDOMAIN. Supported values: SUBDOMAIN, REPOPATHPREFIX, PORTPERREPO.
- `http_port` (Number) The port for access via HTTP. The default value is 80. Only settable when `server_provider` is set to `NIGNIX` or `APACHE`
- `https_port` (Number) The port for access via HTTPS. The default value is 443. Only settable when `use_https` is set to `true`
- `internal_hostname` (String) The internal server name for Artifactory which will be used by the web server to access the Artifactory machine. If the web server is installed on the same machine as Artifactory you can use localhost, otherwise use the IP or hostname. Must be set when `server_provider` is set to `NIGNIX` or `APACHE`
- `public_server_name` (String) The server name that will be used to access Artifactory. Should be correlated with the base URL value. Must be set when `server_provider` is set to `NIGNIX` or `APACHE`
- `ssl_certificate_path` (String) The full path of the certificate file on the web server, e.g. `/etc/ssl/certs/myserver.crt`. Must be set when `use_https` is set to `true`
- `ssl_key_path` (String) The full path of the key file on the web server, e.g. `/etc/ssl/private/myserver.key`. Must be set when `use_https` is set to `true`
- `use_https` (Boolean) When set, Artifactory will be accessible via HTTPS at the corresponding port that is set. Only settable when `server_provider` is set to `NIGNIX` or `APACHE`

## Import

Import is supported using the following syntax:

```shell
terraform import platform_reverse_proxy.my-reverse-proxy DIRECT
```
8 changes: 8 additions & 0 deletions docs/resources/workers_service.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,11 @@ Required:

- `key` (String) The name of the secret.
- `value` (String) The name of the secret.

## Import

Import is supported using the following syntax:

```shell
terraform import platform_workers_service.my-worker-service my-worker-service-key
```
1 change: 1 addition & 0 deletions examples/resources/platform_reverse_proxy/import.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
terraform import platform_reverse_proxy.my-reverse-proxy DIRECT
12 changes: 12 additions & 0 deletions examples/resources/platform_reverse_proxy/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
resource "platform_reverse_proxy" "my-reverse-proxy" {
docker_reverse_proxy_method = "SUBDOMAIN"
server_name_expression = "*.jfrog.com"
server_provider = "NGINX"
public_server_name = "jfrog.com"
internal_hostname = "localhost"
use_https = true
http_port = 80
https_port = 443
ssl_key_path = "/etc/ssl/private/myserver.key"
ssl_certificate_path = "/etc/ssl/certs/myserver.crt"
}
1 change: 1 addition & 0 deletions examples/resources/platform_workers_service/import.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
terraform import platform_workers_service.my-worker-service my-worker-service-key
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ module github.com/jfrog/terraform-provider-platform
// if you need to do local dev, literally just uncomment the line below
// replace github.com/jfrog/terraform-provider-shared => ../terraform-provider-shared

go 1.19
go 1.21

require (
github.com/go-resty/resty/v2 v2.10.0
github.com/go-resty/resty/v2 v2.9.1
github.com/hashicorp/terraform-plugin-docs v0.16.0
github.com/hashicorp/terraform-plugin-framework v1.4.2
github.com/hashicorp/terraform-plugin-framework-validators v0.12.0
Expand Down
Loading
Loading