From 31a979afe8b98532091b7f7516fa3f313e1b2a10 Mon Sep 17 00:00:00 2001 From: Cody Maust Date: Thu, 12 Sep 2024 13:59:45 -0400 Subject: [PATCH] docs: notes for `archive_file` `resource` versus `data` source --- docs/data-sources/file.md | 4 ++-- internal/provider/data_source_archive_file.go | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/data-sources/file.md b/docs/data-sources/file.md index 7a6246a5..ad54a602 100644 --- a/docs/data-sources/file.md +++ b/docs/data-sources/file.md @@ -2,12 +2,12 @@ page_title: "archive_file Data Source - terraform-provider-archive" subcategory: "" description: |- - Generates an archive from content, a file, or directory of files. + Generates an archive from content, a file, or directory of files. The archive is built during the terraform plan, so you must persist the archive through to the terraform apply. See the archive_file resource for an alternative if you cannot persist the file, such as in a multi-phase CI or build server context. --- # archive_file (Data Source) -Generates an archive from content, a file, or directory of files. +Generates an archive from content, a file, or directory of files. The archive is built during the terraform plan, so you must persist the archive through to the terraform apply. See the `archive_file` resource for an alternative if you cannot persist the file, such as in a multi-phase CI or build server context. ## Example Usage diff --git a/internal/provider/data_source_archive_file.go b/internal/provider/data_source_archive_file.go index c65755bf..990e3e6a 100644 --- a/internal/provider/data_source_archive_file.go +++ b/internal/provider/data_source_archive_file.go @@ -46,7 +46,10 @@ func (d *archiveFileDataSource) ConfigValidators(context.Context) []datasource.C func (d *archiveFileDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) { resp.Schema = schema.Schema{ - Description: "Generates an archive from content, a file, or directory of files.", + Description: "Generates an archive from content, a file, or directory of files. " + + "The archive is built during the terraform plan, so you must persist the archive through to the terraform apply. " + + "See the `archive_file` resource for an alternative if you cannot persist the file, " + + "such as in a multi-phase CI or build server context.", Blocks: map[string]schema.Block{ "source": schema.SetNestedBlock{ Description: "Specifies attributes of a single source file to include into the archive. " +