Skip to content

Commit a897efb

Browse files
committed
Adding docs for archive_file resource (#112)
1 parent 5088537 commit a897efb

File tree

4 files changed

+54
-3
lines changed

4 files changed

+54
-3
lines changed

docs/data-sources/file.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
page_title: "archive_file Data Source - terraform-provider-archive"
33
subcategory: ""
44
description: |-
5-
5+
Generates an archive from content, a file, or directory of files.
66
---
77

88
# archive_file (Data Source)
99

10-
10+
Generates an archive from content, a file, or directory of files.
1111

1212
## Example Usage
1313

docs/resources/file.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "archive_file Resource - terraform-provider-archive"
4+
subcategory: ""
5+
description: |-
6+
NOTE: This resource is deprecated, use data source instead.
7+
---
8+
9+
# archive_file (Resource)
10+
11+
**NOTE**: This resource is deprecated, use data source instead.
12+
13+
14+
15+
<!-- schema generated by tfplugindocs -->
16+
## Schema
17+
18+
### Required
19+
20+
- `output_path` (String) The output of the archive file.
21+
- `type` (String) The type of archive to generate. NOTE: `zip` is supported.
22+
23+
### Optional
24+
25+
- `excludes` (Set of String) Specify files to ignore when reading the `source_dir`.
26+
- `output_file_mode` (String) String that specifies the octal file mode for all archived files. For example: `"0666"`. Setting this will ensure that cross platform usage of this module will not vary the modes of archived files (and ultimately checksums) resulting in more deterministic behavior.
27+
- `source` (Block Set) Specifies attributes of a single source file to include into the archive. (see [below for nested schema](#nestedblock--source))
28+
- `source_content` (String) Add only this content to the archive with `source_content_filename` as the filename.
29+
- `source_content_filename` (String) Set this as the filename when using `source_content`.
30+
- `source_dir` (String) Package entire contents of this directory into the archive.
31+
- `source_file` (String) Package this file into the archive.
32+
33+
### Read-Only
34+
35+
- `id` (String) The sha1 checksum hash of the output.
36+
- `output_base64sha256` (String) The base64-encoded SHA256 checksum of output archive file.
37+
- `output_md5` (String) The MD5 checksum of output archive file.
38+
- `output_sha` (String) The SHA1 checksum of output archive file.
39+
- `output_size` (Number) The byte size of the output archive file.
40+
41+
<a id="nestedblock--source"></a>
42+
### Nested Schema for `source`
43+
44+
Required:
45+
46+
- `content` (String) Add this content to the archive with `filename` as the filename.
47+
- `filename` (String) Set this as the filename when declaring a `source`.
48+
49+

internal/provider/data_source_archive_file.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ type archiveFileDataSource struct{}
2929

3030
func (d *archiveFileDataSource) GetSchema(ctx context.Context) (tfsdk.Schema, diag.Diagnostics) {
3131
return tfsdk.Schema{
32+
Description: "Generates an archive from content, a file, or directory of files.",
3233
Blocks: map[string]tfsdk.Block{
3334
"source": {
3435
Description: "Specifies attributes of a single source file to include into the archive.",

internal/provider/resource_archive_file.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ type archiveFileResource struct{}
2424

2525
func (d *archiveFileResource) GetSchema(ctx context.Context) (tfsdk.Schema, diag.Diagnostics) {
2626
return tfsdk.Schema{
27-
DeprecationMessage: "**NOTE**: Using archive_file as a resource is deprecated, use archive_file data source instead.",
27+
Description: `**NOTE**: This resource is deprecated, use data source instead.`,
28+
DeprecationMessage: `**NOTE**: This resource is deprecated, use data source instead.`,
2829
Blocks: map[string]tfsdk.Block{
2930
"source": {
3031
Description: "Specifies attributes of a single source file to include into the archive.",

0 commit comments

Comments
 (0)