fix: load the file content instead of base64 encoded payload for uploading the zipfile in resource_alicloud_fc_layer_version.go
#8391
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What's the problem?
With the current version, a FC layer can be created with a local zipfile, but the plugin is unable to do any follow-up
terraform plan
orterraform apply
. In my testing ,my custom layer was only 1.2 MB, but still exceeding the grpc maximum input limit. I think it's because the provider plugin is trying to compare the encoded base64 contents. For a zipfile, it's payload can be incredibly large...Error message:
How to reproduce the problem?
Create a resource as follows:
My changes
As following the code block in the
resource_alicloud_fc_function.go
, I think it would be wise to use the same approach to load the content, rather than loading the raw payload of a zipfile. ref: https://github.com/aliyun/terraform-provider-alicloud/blob/master/alicloud/resource_alicloud_fc_function.go#L448-L453Please verify my changes, or let me know how shall I test them properly. I can submit another change regarding the similar code block in resource
resource_alicloud_fcv3_layer_version.go
too if this is deemed good enough. Thanks.