You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Terraform resets the package to whatever is configured (value of module.pkg.content) if it has been altered outside of terraform
Actual Behavior
Terraform doesn't identify the drift and does nothing, even if the content of module.pkg.content doesn't match what is currently deployed.
Details
Using the above configuration, when the remote package is changed (e.g. through manual upload in UI), terraform doesn't detect the drift and does nothing.
There is an option source_code_hash which seems to invoke the behavior I want, but it conflicts with providing content. I tried building the provider locally and removing this conflict and providing source_code_hash. This seems to create the behavior I'm seeking.
diff --git a/fastly/block_fastly_service_package.go b/fastly/block_fastly_service_package.go
index 69d38480a3cc77fd070698be1cd00c5a4849d0d6..ff3baca51f394cf48afb8a7a649662bf9b20d4e3 100644
--- a/fastly/block_fastly_service_package.go+++ b/fastly/block_fastly_service_package.go@@ -51,7 +51,6 @@ func (h *PackageServiceAttributeHandler) Register(s *schema.Resource) error {
Optional: true,
Computed: true,
Description: "Used to trigger updates. Must be set to a SHA512 hash of all files (in sorted order) within the package. The usual way to set this is using the fastly_package_hash data source.",
- ConflictsWith: []string{"package.0.content"},
},
},
},
I'm not aware of why this ConflictsWith is there. It stands to reason that you should be able to provide the file hash, regardless of where the bytes of the package comes from.
I've created a PR for my changes if I'm not misunderstanding the use for source_code_hash: #909
The text was updated successfully, but these errors were encountered:
noseglid
changed the title
fastly_service_compute.package does not update if package changes remotelyfastly_service_compute.package does not update if package changes remotely and content is specified without filename
Dec 18, 2024
Affected Fastly Terraform Resource(s)
fastly_service_compute
Terraform Configuration Files
Expected Behavior
Terraform resets the package to whatever is configured (value of
module.pkg.content
) if it has been altered outside of terraformActual Behavior
Terraform doesn't identify the drift and does nothing, even if the content of
module.pkg.content
doesn't match what is currently deployed.Details
Using the above configuration, when the remote package is changed (e.g. through manual upload in UI), terraform doesn't detect the drift and does nothing.
There is an option
source_code_hash
which seems to invoke the behavior I want, but it conflicts with providingcontent
. I tried building the provider locally and removing this conflict and providingsource_code_hash
. This seems to create the behavior I'm seeking.I'm not aware of why this
ConflictsWith
is there. It stands to reason that you should be able to provide the file hash, regardless of where the bytes of the package comes from.I've created a PR for my changes if I'm not misunderstanding the use for
source_code_hash
: #909The text was updated successfully, but these errors were encountered: