Skip to content

Commit c1e2b15

Browse files
committed
add package resource
1 parent 66e8946 commit c1e2b15

File tree

4 files changed

+683
-0
lines changed

4 files changed

+683
-0
lines changed

docs/resources/package.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "pulsar_package Resource - terraform-provider-pulsar"
4+
subcategory: ""
5+
description: |-
6+
Manages Pulsar packages that store runnable artifacts for functions, sources, and sinks.
7+
---
8+
9+
# pulsar_package (Resource)
10+
11+
Manages Pulsar packages that store runnable artifacts for functions, sources, and sinks. Packages are referenced by
12+
other resources via their fully-qualified URL (`<type>://<tenant>/<namespace>/<name>@<version>`). The provider uploads
13+
the local archive file, keeps metadata (description, contact, properties) in sync, and tracks the local file checksum
14+
so Terraform detects archive changes.
15+
16+
> **Important:** The archive file referenced by `path` must exist on the machine running `terraform plan`/`apply`
17+
> because the provider computes the SHA256 checksum to trigger updates when the file contents change.
18+
19+
<!-- schema generated by tfplugindocs -->
20+
## Schema
21+
22+
### Required
23+
24+
- `name` (String) Package name.
25+
- `namespace` (String) Namespace that owns the package.
26+
- `path` (String) Local path to the archive file that should be uploaded.
27+
- `tenant` (String) Tenant that owns the package.
28+
- `type` (String) Package type. Supported values: `function`, `sink`, `source`.
29+
- `version` (String) Package version. Changing the version creates a new package resource.
30+
31+
### Optional
32+
33+
- `contact` (String) Contact information stored alongside the package metadata.
34+
- `description` (String) Optional package description stored alongside the package metadata.
35+
- `properties` (Map of String) Additional user-defined metadata properties.
36+
37+
### Read-Only
38+
39+
- `create_time` (Number) Server-side package creation timestamp (epoch millis).
40+
- `file_checksum` (String) Checksum reported by Pulsar for the uploaded archive.
41+
- `file_name` (String) Archive file name stored in metadata.
42+
- `file_size` (Number) Archive size reported by Pulsar (bytes).
43+
- `id` (String) The ID of this resource.
44+
- `modification_time` (Number) Server-side package modification timestamp (epoch millis).
45+
- `package_url` (String) Fully-qualified package URL.
46+
- `source_hash` (String) SHA256 checksum of the local archive used to trigger updates when the file changes.

pulsar/provider.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ func Provider() *schema.Provider {
166166
"pulsar_function": resourcePulsarFunction(),
167167
"pulsar_subscription": resourcePulsarSubscription(),
168168
"pulsar_permission_grant": resourcePulsarPermissionGrant(),
169+
"pulsar_package": resourcePulsarPackage(),
169170
},
170171
}
171172

0 commit comments

Comments
 (0)