Skip to content

Commit 64e2246

Browse files
feat: Support Rust cargo resource & datasource (#517)
* add cargo repository resource * add cargo repository dataSource * docs: generate docs for cargo resources --------- Co-authored-by: Christopher Rücker <[email protected]>
1 parent f636ce1 commit 64e2246

33 files changed

+1731
-0
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
page_title: "Data Source nexus_repository_cargo_group"
3+
subcategory: "Repository"
4+
description: |-
5+
Use this data source to get an existing cargo group repository.
6+
---
7+
# Data Source nexus_repository_cargo_group
8+
Use this data source to get an existing cargo group repository.
9+
## Example Usage
10+
```terraform
11+
data "nexus_repository_cargo_group" "cargo_public" {
12+
name = "cargo-public"
13+
}
14+
```
15+
<!-- schema generated by tfplugindocs -->
16+
## Schema
17+
18+
### Required
19+
20+
- `name` (String) A unique identifier for this repository
21+
22+
### Read-Only
23+
24+
- `group` (List of Object) Configuration for repository group (see [below for nested schema](#nestedatt--group))
25+
- `id` (String) Used to identify data source at nexus
26+
- `online` (Boolean) Whether this repository accepts incoming requests
27+
- `storage` (List of Object) The storage configuration of the repository (see [below for nested schema](#nestedatt--storage))
28+
29+
<a id="nestedatt--group"></a>
30+
### Nested Schema for `group`
31+
32+
Read-Only:
33+
34+
- `member_names` (List of String)
35+
36+
37+
<a id="nestedatt--storage"></a>
38+
### Nested Schema for `storage`
39+
40+
Read-Only:
41+
42+
- `blob_store_name` (String)
43+
- `strict_content_type_validation` (Boolean)
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
---
2+
page_title: "Data Source nexus_repository_cargo_hosted"
3+
subcategory: "Repository"
4+
description: |-
5+
Use this data source to get an existing hosted cargo repository.
6+
---
7+
# Data Source nexus_repository_cargo_hosted
8+
Use this data source to get an existing hosted cargo repository.
9+
## Example Usage
10+
```terraform
11+
data "nexus_repository_cargo_hosted" "releases" {
12+
name = "cargo-releases"
13+
}
14+
```
15+
<!-- schema generated by tfplugindocs -->
16+
## Schema
17+
18+
### Required
19+
20+
- `name` (String) A unique identifier for this repository
21+
22+
### Read-Only
23+
24+
- `cleanup` (List of Object) Cleanup policies (see [below for nested schema](#nestedatt--cleanup))
25+
- `component` (List of Object) Component configuration for the hosted repository (see [below for nested schema](#nestedatt--component))
26+
- `id` (String) Used to identify data source at nexus
27+
- `online` (Boolean) Whether this repository accepts incoming requests
28+
- `storage` (List of Object) The storage configuration of the repository (see [below for nested schema](#nestedatt--storage))
29+
30+
<a id="nestedatt--cleanup"></a>
31+
### Nested Schema for `cleanup`
32+
33+
Read-Only:
34+
35+
- `policy_names` (Set of String)
36+
37+
38+
<a id="nestedatt--component"></a>
39+
### Nested Schema for `component`
40+
41+
Read-Only:
42+
43+
- `proprietary_components` (Boolean)
44+
45+
46+
<a id="nestedatt--storage"></a>
47+
### Nested Schema for `storage`
48+
49+
Read-Only:
50+
51+
- `blob_store_name` (String)
52+
- `strict_content_type_validation` (Boolean)
53+
- `write_policy` (String)
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
---
2+
page_title: "Data Source nexus_repository_cargo_proxy"
3+
subcategory: "Repository"
4+
description: |-
5+
Use this data source to get an existing cargo proxy repository.
6+
---
7+
# Data Source nexus_repository_cargo_proxy
8+
Use this data source to get an existing cargo proxy repository.
9+
## Example Usage
10+
```terraform
11+
data "nexus_repository_cargo_proxy" "cratesio" {
12+
name = "cratesio"
13+
}
14+
```
15+
<!-- schema generated by tfplugindocs -->
16+
## Schema
17+
18+
### Required
19+
20+
- `name` (String) A unique identifier for this repository
21+
22+
### Read-Only
23+
24+
- `cargo_version` (String) Cargo protocol version
25+
- `cleanup` (List of Object) Cleanup policies (see [below for nested schema](#nestedatt--cleanup))
26+
- `http_client` (List of Object) HTTP Client configuration for proxy repositories (see [below for nested schema](#nestedatt--http_client))
27+
- `id` (String) Used to identify data source at nexus
28+
- `negative_cache` (List of Object) Configuration of the negative cache handling (see [below for nested schema](#nestedatt--negative_cache))
29+
- `online` (Boolean) Whether this repository accepts incoming requests
30+
- `proxy` (List of Object) Configuration for the proxy repository (see [below for nested schema](#nestedatt--proxy))
31+
- `query_cache_item_max_age` (Number) How long to cache query results from the proxied repository (in seconds)
32+
- `routing_rule` (String) The name of the routing rule assigned to this repository
33+
- `storage` (List of Object) The storage configuration of the repository (see [below for nested schema](#nestedatt--storage))
34+
35+
<a id="nestedatt--cleanup"></a>
36+
### Nested Schema for `cleanup`
37+
38+
Read-Only:
39+
40+
- `policy_names` (Set of String)
41+
42+
43+
<a id="nestedatt--http_client"></a>
44+
### Nested Schema for `http_client`
45+
46+
Read-Only:
47+
48+
- `authentication` (List of Object) (see [below for nested schema](#nestedobjatt--http_client--authentication))
49+
- `auto_block` (Boolean)
50+
- `blocked` (Boolean)
51+
- `connection` (List of Object) (see [below for nested schema](#nestedobjatt--http_client--connection))
52+
53+
<a id="nestedobjatt--http_client--authentication"></a>
54+
### Nested Schema for `http_client.authentication`
55+
56+
Read-Only:
57+
58+
- `ntlm_domain` (String)
59+
- `ntlm_host` (String)
60+
- `password` (String)
61+
- `type` (String)
62+
- `username` (String)
63+
64+
65+
<a id="nestedobjatt--http_client--connection"></a>
66+
### Nested Schema for `http_client.connection`
67+
68+
Read-Only:
69+
70+
- `enable_circular_redirects` (Boolean)
71+
- `enable_cookies` (Boolean)
72+
- `retries` (Number)
73+
- `timeout` (Number)
74+
- `use_trust_store` (Boolean)
75+
- `user_agent_suffix` (String)
76+
77+
78+
79+
<a id="nestedatt--negative_cache"></a>
80+
### Nested Schema for `negative_cache`
81+
82+
Read-Only:
83+
84+
- `enabled` (Boolean)
85+
- `ttl` (Number)
86+
87+
88+
<a id="nestedatt--proxy"></a>
89+
### Nested Schema for `proxy`
90+
91+
Read-Only:
92+
93+
- `content_max_age` (Number)
94+
- `metadata_max_age` (Number)
95+
- `remote_url` (String)
96+
97+
98+
<a id="nestedatt--storage"></a>
99+
### Nested Schema for `storage`
100+
101+
Read-Only:
102+
103+
- `blob_store_name` (String)
104+
- `strict_content_type_validation` (Boolean)
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
---
2+
page_title: "Resource nexus_repository_cargo_group"
3+
subcategory: "Repository"
4+
description: |-
5+
Use this resource to create a group cargo repository.
6+
---
7+
# Resource nexus_repository_cargo_group
8+
Use this resource to create a group cargo repository.
9+
## Example Usage
10+
```terraform
11+
resource "nexus_repository_cargo_hosted" "releases" {
12+
name = "cargo-releases"
13+
online = true
14+
15+
storage {
16+
blob_store_name = "default"
17+
strict_content_type_validation = false
18+
write_policy = "ALLOW"
19+
}
20+
21+
}
22+
23+
24+
resource "nexus_repository_cargo_group" "group" {
25+
name = "cargo-group"
26+
online = true
27+
28+
group {
29+
member_names = [
30+
nexus_repository_cargo_hosted.releases.name,
31+
]
32+
}
33+
34+
storage {
35+
blob_store_name = "default"
36+
strict_content_type_validation = true
37+
}
38+
}
39+
```
40+
<!-- schema generated by tfplugindocs -->
41+
## Schema
42+
43+
### Required
44+
45+
- `group` (Block List, Min: 1, Max: 1) Configuration for repository group (see [below for nested schema](#nestedblock--group))
46+
- `name` (String) A unique identifier for this repository
47+
- `storage` (Block List, Min: 1, Max: 1) The storage configuration of the repository (see [below for nested schema](#nestedblock--storage))
48+
49+
### Optional
50+
51+
- `online` (Boolean) Whether this repository accepts incoming requests
52+
53+
### Read-Only
54+
55+
- `id` (String) Used to identify resource at nexus
56+
57+
<a id="nestedblock--group"></a>
58+
### Nested Schema for `group`
59+
60+
Required:
61+
62+
- `member_names` (List of String) Member repositories names
63+
64+
65+
<a id="nestedblock--storage"></a>
66+
### Nested Schema for `storage`
67+
68+
Required:
69+
70+
- `blob_store_name` (String) Blob store used to store repository contents
71+
72+
Optional:
73+
74+
- `strict_content_type_validation` (Boolean) Whether to validate uploaded content's MIME type appropriate for the repository format
75+
## Import
76+
Import is supported using the following syntax:
77+
```shell
78+
# import using the name of repository
79+
terraform import nexus_repository_cargo_group.group cargo-group
80+
```
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
---
2+
page_title: "Resource nexus_repository_cargo_hosted"
3+
subcategory: "Repository"
4+
description: |-
5+
Use this resource to create a hosted Cargo repository.
6+
---
7+
# Resource nexus_repository_cargo_hosted
8+
Use this resource to create a hosted Cargo repository.
9+
## Example Usage
10+
```terraform
11+
resource "nexus_repository_cargo_hosted" "releases" {
12+
name = "cargo-releases"
13+
online = true
14+
15+
storage {
16+
blob_store_name = "default"
17+
strict_content_type_validation = false
18+
write_policy = "ALLOW"
19+
}
20+
21+
}
22+
```
23+
<!-- schema generated by tfplugindocs -->
24+
## Schema
25+
26+
### Required
27+
28+
- `name` (String) A unique identifier for this repository
29+
- `storage` (Block List, Min: 1, Max: 1) The storage configuration of the repository (see [below for nested schema](#nestedblock--storage))
30+
31+
### Optional
32+
33+
- `cleanup` (Block List) Cleanup policies (see [below for nested schema](#nestedblock--cleanup))
34+
- `component` (Block List, Max: 1) Component configuration for the hosted repository (see [below for nested schema](#nestedblock--component))
35+
- `online` (Boolean) Whether this repository accepts incoming requests
36+
37+
### Read-Only
38+
39+
- `id` (String) Used to identify resource at nexus
40+
41+
<a id="nestedblock--storage"></a>
42+
### Nested Schema for `storage`
43+
44+
Required:
45+
46+
- `blob_store_name` (String) Blob store used to store repository contents
47+
- `strict_content_type_validation` (Boolean) Whether to validate uploaded content's MIME type appropriate for the repository format
48+
49+
Optional:
50+
51+
- `write_policy` (String) Controls if deployments of and updates to assets are allowed
52+
53+
54+
<a id="nestedblock--cleanup"></a>
55+
### Nested Schema for `cleanup`
56+
57+
Optional:
58+
59+
- `policy_names` (Set of String) List of policy names
60+
61+
62+
<a id="nestedblock--component"></a>
63+
### Nested Schema for `component`
64+
65+
Required:
66+
67+
- `proprietary_components` (Boolean) Components in this repository count as proprietary for namespace conflict attacks (requires Sonatype Nexus Firewall)
68+
## Import
69+
Import is supported using the following syntax:
70+
```shell
71+
# import using the name of repository
72+
terraform import nexus_repository_cargo_hosted.releases cargo-releases
73+
```

0 commit comments

Comments
 (0)