Draft
Conversation
Contributor
Community GuidelinesThis comment is added to every new Pull Request to provide quick reference to how the Terraform AWS Provider is maintained. Please review the information below, and thank you for contributing to the community that keeps the provider thriving! 🚀 Voting for Prioritization
Pull Request Authors
|
Setting the `core` tag will limit the services which are registered to the provider. This is an experiment to explore whether it is feasible to publish a scoped down version of the provider without maintaining an entirely separate project. The goal is to reduce binary size and corresponding memory usage in cases where only the most common services are required.
---
When built with the `core` tag, binary size reduces from 1.2GB to 179MB
on an M1 MacBook Pro.
```console
% go build && go build -tags=core -o terraform-provider-aws-core
% ls -lh terraform-provider-aws*
-rwxr-xr-x 1 jaredbaker staff 1.2G Apr 13 13:38 terraform-provider-aws
-rwxr-xr-x 1 jaredbaker staff 179M Apr 13 13:38 terraform-provider-aws-core
```
Planning a simple configuration with a single IAM policy document data
source and IAM role with `v6.40.0` and a locally built version of the
provider with the `core` build tag exhibits a maximum resident set size
savings in line with the reduction in binary size.
```console
% /usr/bin/time -l terraform plan
<snip>
Note: You didn't use the -out option to save this plan, so Terraform can't guarantee to take exactly these actions if you run "terraform apply" now.
9.91 real 4.12 user 0.54 sys
555745280 maximum resident set size
<snip>
```
```console
% /usr/bin/time -l make plan
TF_CLI_CONFIG_FILE=dev.tfrc terraform plan
<snip>
Note: You didn't use the -out option to save this plan, so Terraform can't guarantee to take exactly these actions if you run "terraform apply" now.
0.84 real 0.53 user 0.11 sys
73203712 maximum resident set size
<snip>
```
Maximum resident set size is reported in bytes on MacOS.
| Version | Max Resident Size |
| --- | --- |
| `v6.40.0` | 555745280 (555MB) |
| core tag build | 73203712 (73MB) |
This branch in solely intended as an experiment. Acceptance testing is
non-functional with the build tag enabled, and there is no precedent (to
my knowledge) for releasing multiple providers from a single repository
as would be necessary to distribute the "core" variant.
This branch is merely a proof of concept as we continue to explore how
to best balance API coverage with performance of the provider as the
surface area of the AWS SDK continues to grow.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Setting the
coretag will limit the services which are registered to the provider. This is an experiment to explore whether it is feasible to publish a scoped down version of the provider without maintaining an entirely separate project. The goal is to reduce binary size and corresponding memory usage in cases where only the most common services are required.When built with the
coretag, binary size reduces from 1.2GB to 179MB on an M1 MacBook Pro.Planning a simple configuration with a single IAM policy document data source and IAM role with
v6.40.0and a locally built version of the provider with thecorebuild tag exhibits a maximum resident set size savings in line with the reduction in binary size.Maximum resident set size is reported in bytes on MacOS.
v6.40.0Future Considerations
This branch in solely intended as an experiment. Acceptance testing is non-functional with the build tag enabled, and there is no precedent (to my knowledge) for releasing multiple providers from a single repository as would be necessary to distribute the "core" variant.
This branch is merely a proof of concept as we continue to explore how to best balance API coverage with performance of the provider as the surface area of the AWS SDK continues to grow.