The following is an example .terraformrc configuration generated by make:
provider_installation {
filesystem_mirror {
path = ".cache/tools/darwin_arm64"
include = ["hashicorp/aws"]
}
direct {
exclude = ["hashicorp/aws"]
}
}
When using the above configuration, Terraform CLI locates the provider binary at registry.terraform.io/hashicorp/aws/5.31.0/darwin_arm64/terraform-provider-aws, where 5.31.0 is the example provider version, inside the filesystem mirror directory.
Custom provider release is installed at .cache/tools/darwin_arm64/registry.terraform.io/hashicorp/aws/5.31.0/darwin_arm64/terraform-provider-aws on an Apple Silicon Mac. On other platforms, installation location is the equivalent path, for instance .cache/tools/linux_amd64/registry.terraform.io/hashicorp/aws/5.31.0/linux_amd64/terraform-provider-aws on an Intel/AMD Linux).
[ ] Run make reviewable to ensure this PR is ready for review.
[ ] Added backport release-x.y labels to auto-backport this PR if necessary.
How has this code been tested
Remove config/schema.json.
Run make config/schema.json.
Observe that config/schema.json is created.
Above steps will not result in any difference in config/schema.json. During development, I used a development build of the provider that has a new resource, aws_mq_user, added. In that case, I observed that aws_mq_user schema exists in the output, config/schema.json.
Description of your changes
Code generation depends on JSON schema of terraform-provider-aws (
config/schema.json
). Converting a Terraform provider's schema to JSON is performed by Terraform CLI, which requires a provider binary. Therefore, when we introduce a new resource, such as MQ User, to our fork of terraform-provider-aws, we also release the provider as binary. This PR introduces necessary changes to download custom provider release and let Terraform CLI use it instead of the official provider.The following is an example
.terraformrc
configuration generated bymake
:When using the above configuration, Terraform CLI locates the provider binary at
registry.terraform.io/hashicorp/aws/5.31.0/darwin_arm64/terraform-provider-aws
, where5.31.0
is the example provider version, inside the filesystem mirror directory.Custom provider release is installed at
.cache/tools/darwin_arm64/registry.terraform.io/hashicorp/aws/5.31.0/darwin_arm64/terraform-provider-aws
on an Apple Silicon Mac. On other platforms, installation location is the equivalent path, for instance.cache/tools/linux_amd64/registry.terraform.io/hashicorp/aws/5.31.0/linux_amd64/terraform-provider-aws
on an Intel/AMD Linux).I have:
make reviewable
to ensure this PR is ready for review.backport release-x.y
labels to auto-backport this PR if necessary.How has this code been tested
config/schema.json
.make config/schema.json
.config/schema.json
is created.Above steps will not result in any difference in
config/schema.json
. During development, I used a development build of the provider that has a new resource,aws_mq_user
, added. In that case, I observed thataws_mq_user
schema exists in the output,config/schema.json
.