-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #241 from datadrivers/feat/235
feat(repository): Add resource and data source for maven proxy repo
- Loading branch information
Showing
25 changed files
with
1,162 additions
and
176 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
--- | ||
page_title: "Data Source nexus_repository_maven_proxy" | ||
subcategory: "Repository" | ||
description: |- | ||
Use this data source to get an existing maven proxy repository. | ||
--- | ||
# Data Source nexus_repository_maven_proxy | ||
Use this data source to get an existing maven proxy repository. | ||
## Example Usage | ||
```terraform | ||
data "nexus_repository_maven_proxy" "maven_central" { | ||
name = "maven-central" | ||
} | ||
``` | ||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `name` (String) A unique identifier for this repository | ||
|
||
### Read-Only | ||
|
||
- `cleanup` (List of Object) Cleanup policies (see [below for nested schema](#nestedatt--cleanup)) | ||
- `http_client` (List of Object) HTTP Client configuration for proxy repositories (see [below for nested schema](#nestedatt--http_client)) | ||
- `id` (String) Used to identify data source at nexus | ||
- `maven` (List of Object) Maven contains additional data of maven repository (see [below for nested schema](#nestedatt--maven)) | ||
- `negative_cache` (List of Object) Configuration of the negative cache handling (see [below for nested schema](#nestedatt--negative_cache)) | ||
- `online` (Boolean) Whether this repository accepts incoming requests | ||
- `proxy` (List of Object) Configuration for the proxy repository (see [below for nested schema](#nestedatt--proxy)) | ||
- `routing_rule` (String) The name of the routing rule assigned to this repository | ||
- `storage` (List of Object) The storage configuration of the repository (see [below for nested schema](#nestedatt--storage)) | ||
|
||
<a id="nestedatt--cleanup"></a> | ||
### Nested Schema for `cleanup` | ||
|
||
Read-Only: | ||
|
||
- `policy_names` (Set of String) | ||
|
||
|
||
<a id="nestedatt--http_client"></a> | ||
### Nested Schema for `http_client` | ||
|
||
Read-Only: | ||
|
||
- `authentication` (List of Object) (see [below for nested schema](#nestedobjatt--http_client--authentication)) | ||
- `auto_block` (Boolean) | ||
- `blocked` (Boolean) | ||
- `connection` (List of Object) (see [below for nested schema](#nestedobjatt--http_client--connection)) | ||
|
||
<a id="nestedobjatt--http_client--authentication"></a> | ||
### Nested Schema for `http_client.authentication` | ||
|
||
Read-Only: | ||
|
||
- `ntlm_domain` (String) | ||
- `ntlm_host` (String) | ||
- `password` (String) | ||
- `preemptive` (Boolean) | ||
- `type` (String) | ||
- `username` (String) | ||
|
||
|
||
<a id="nestedobjatt--http_client--connection"></a> | ||
### Nested Schema for `http_client.connection` | ||
|
||
Read-Only: | ||
|
||
- `enable_circular_redirects` (Boolean) | ||
- `enable_cookies` (Boolean) | ||
- `retries` (Number) | ||
- `timeout` (Number) | ||
- `use_trust_store` (Boolean) | ||
- `user_agent_suffix` (String) | ||
|
||
|
||
|
||
<a id="nestedatt--maven"></a> | ||
### Nested Schema for `maven` | ||
|
||
Read-Only: | ||
|
||
- `content_disposition` (String) | ||
- `layout_policy` (String) | ||
- `version_policy` (String) | ||
|
||
|
||
<a id="nestedatt--negative_cache"></a> | ||
### Nested Schema for `negative_cache` | ||
|
||
Read-Only: | ||
|
||
- `enabled` (Boolean) | ||
- `ttl` (Number) | ||
|
||
|
||
<a id="nestedatt--proxy"></a> | ||
### Nested Schema for `proxy` | ||
|
||
Read-Only: | ||
|
||
- `content_max_age` (Number) | ||
- `metadata_max_age` (Number) | ||
- `remote_url` (String) | ||
|
||
|
||
<a id="nestedatt--storage"></a> | ||
### Nested Schema for `storage` | ||
|
||
Read-Only: | ||
|
||
- `blob_store_name` (String) | ||
- `strict_content_type_validation` (Boolean) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,162 @@ | ||
--- | ||
page_title: "Resource nexus_repository_maven_proxy" | ||
subcategory: "Repository" | ||
description: |- | ||
Use this resource to create a maven proxy repository. | ||
--- | ||
# Resource nexus_repository_maven_proxy | ||
Use this resource to create a maven proxy repository. | ||
## Example Usage | ||
```terraform | ||
resource "nexus_repository_maven_proxy" "maven_central" { | ||
name = "maven-central-repo1" | ||
online = true | ||
storage { | ||
blob_store_name = "default" | ||
strict_content_type_validation = true | ||
} | ||
proxy { | ||
remote_url = "https://repo1.maven.org/maven2/" | ||
content_max_age = 1440 | ||
metadata_max_age = 1440 | ||
} | ||
negative_cache { | ||
enabled = true | ||
time_to_live = 1440 | ||
} | ||
http_client { | ||
blocked = false | ||
auto_block = true | ||
} | ||
maven { | ||
version_policy = "RELEASE" | ||
layout_policy = "PERMISSIVE" | ||
} | ||
} | ||
``` | ||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `maven` (Block List, Min: 1, Max: 1) Maven contains additional data of maven repository (see [below for nested schema](#nestedblock--maven)) | ||
- `name` (String) A unique identifier for this repository | ||
- `proxy` (Block List, Min: 1, Max: 1) Configuration for the proxy repository (see [below for nested schema](#nestedblock--proxy)) | ||
- `storage` (Block List, Min: 1, Max: 1) The storage configuration of the repository (see [below for nested schema](#nestedblock--storage)) | ||
|
||
### Optional | ||
|
||
- `cleanup` (Block List) Cleanup policies (see [below for nested schema](#nestedblock--cleanup)) | ||
- `http_client` (Block List, Max: 1) HTTP Client configuration for proxy repositories (see [below for nested schema](#nestedblock--http_client)) | ||
- `negative_cache` (Block List, Max: 1) Configuration of the negative cache handling (see [below for nested schema](#nestedblock--negative_cache)) | ||
- `online` (Boolean) Whether this repository accepts incoming requests | ||
- `routing_rule` (String) The name of the routing rule assigned to this repository | ||
|
||
### Read-Only | ||
|
||
- `id` (String) Used to identify resource at nexus | ||
|
||
<a id="nestedblock--maven"></a> | ||
### Nested Schema for `maven` | ||
|
||
Required: | ||
|
||
- `layout_policy` (String) Validate that all paths are maven artifact or metadata paths. Possible Value: `STRICT` or `PERMISSIVE` | ||
- `version_policy` (String) What type of artifacts does this repository store? Possible Value: `RELEASE`, `SNAPSHOT` or `MIXED` | ||
|
||
Optional: | ||
|
||
- `content_disposition` (String) Add Content-Disposition header as 'Attachment' to disable some content from being inline in a browse. Possible Value: `INLINE` or `ATTACHMENT` | ||
|
||
|
||
<a id="nestedblock--proxy"></a> | ||
### Nested Schema for `proxy` | ||
|
||
Required: | ||
|
||
- `remote_url` (String) Location of the remote repository being proxied | ||
|
||
Optional: | ||
|
||
- `content_max_age` (Number) How long (in minutes) to cache artifacts before rechecking the remote repository | ||
- `metadata_max_age` (Number) How long (in minutes) to cache metadata before rechecking the remote repository. | ||
|
||
|
||
<a id="nestedblock--storage"></a> | ||
### Nested Schema for `storage` | ||
|
||
Required: | ||
|
||
- `blob_store_name` (String) Blob store used to store repository contents | ||
|
||
Optional: | ||
|
||
- `strict_content_type_validation` (Boolean) Whether to validate uploaded content's MIME type appropriate for the repository format | ||
|
||
|
||
<a id="nestedblock--cleanup"></a> | ||
### Nested Schema for `cleanup` | ||
|
||
Optional: | ||
|
||
- `policy_names` (Set of String) List of policy names | ||
|
||
|
||
<a id="nestedblock--http_client"></a> | ||
### Nested Schema for `http_client` | ||
|
||
Optional: | ||
|
||
- `authentication` (Block List, Max: 1) Authentication configuration of the HTTP client (see [below for nested schema](#nestedblock--http_client--authentication)) | ||
- `auto_block` (Boolean) Whether to auto-block outbound connections if remote peer is detected as unreachable/unresponsive | ||
- `blocked` (Boolean) Whether to block outbound connections on the repository | ||
- `connection` (Block List, Max: 1) Connection configuration of the HTTP client (see [below for nested schema](#nestedblock--http_client--connection)) | ||
|
||
<a id="nestedblock--http_client--authentication"></a> | ||
### Nested Schema for `http_client.authentication` | ||
|
||
Required: | ||
|
||
- `type` (String) Authentication type. Possible values: `ntlm` or `username` | ||
|
||
Optional: | ||
|
||
- `ntlm_domain` (String) The ntlm domain to connect | ||
- `ntlm_host` (String) The ntlm host to connect | ||
- `password` (String, Sensitive) The password used by the proxy repository | ||
- `preemptive` (Boolean) Whether to use pre-emptive authentication. Use with caution. Defaults to false. | ||
- `username` (String) The username used by the proxy repository | ||
|
||
|
||
<a id="nestedblock--http_client--connection"></a> | ||
### Nested Schema for `http_client.connection` | ||
|
||
Optional: | ||
|
||
- `enable_circular_redirects` (Boolean) Whether to enable redirects to the same location (may be required by some servers) | ||
- `enable_cookies` (Boolean) Whether to allow cookies to be stored and used | ||
- `retries` (Number) Total retries if the initial connection attempt suffers a timeout | ||
- `timeout` (Number) Seconds to wait for activity before stopping and retrying the connection | ||
- `use_trust_store` (Boolean) Use certificates stored in the Nexus Repository Manager truststore to connect to external systems | ||
- `user_agent_suffix` (String) Custom fragment to append to User-Agent header in HTTP requests | ||
|
||
|
||
|
||
<a id="nestedblock--negative_cache"></a> | ||
### Nested Schema for `negative_cache` | ||
|
||
Optional: | ||
|
||
- `enabled` (Boolean) Whether to cache responses for content not present in the proxied repository | ||
- `ttl` (Number) How long to cache the fact that a file was not found in the repository (in minutes) | ||
## Import | ||
Import is supported using the following syntax: | ||
```shell | ||
# import using the name of repository | ||
terraform import nexus_repository_maven_proxy.maven_central maven-central | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
examples/data-sources/nexus_repository_maven_proxy/data-source.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
data "nexus_repository_maven_proxy" "maven_central" { | ||
name = "maven-central" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# import using the name of repository | ||
terraform import nexus_repository_maven_proxy.maven_central maven-central |
30 changes: 30 additions & 0 deletions
30
examples/resources/nexus_repository_maven_proxy/resource.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
resource "nexus_repository_maven_proxy" "maven_central" { | ||
name = "maven-central-repo1" | ||
online = true | ||
|
||
storage { | ||
blob_store_name = "default" | ||
strict_content_type_validation = true | ||
} | ||
|
||
proxy { | ||
remote_url = "https://repo1.maven.org/maven2/" | ||
content_max_age = 1440 | ||
metadata_max_age = 1440 | ||
} | ||
|
||
negative_cache { | ||
enabled = true | ||
time_to_live = 1440 | ||
} | ||
|
||
http_client { | ||
blocked = false | ||
auto_block = true | ||
} | ||
|
||
maven { | ||
version_policy = "RELEASE" | ||
layout_policy = "PERMISSIVE" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.