diff --git a/mmv1/provider/terraform/common~compile.yaml b/mmv1/provider/terraform/common~compile.yaml index 2ca0e491bd18..266818c89957 100644 --- a/mmv1/provider/terraform/common~compile.yaml +++ b/mmv1/provider/terraform/common~compile.yaml @@ -102,6 +102,12 @@ -%> '<%= dir -%>/<%= fname.delete_suffix(".erb") -%>': 'third_party/terraform/framework_models/<%= fname -%>' <% end -%> +<% + Dir["third_party/terraform/functions/*.go.erb"].each do |file_path| + fname = file_path.split('/')[-1] +-%> +'<%= dir -%>/functions/<%= fname.delete_suffix(".erb") -%>': 'third_party/terraform/functions/<%= fname -%>' +<% end -%> <% Dir["third_party/terraform/scripts/**/*.erb"].each do |file_path| fname = file_path.delete_prefix("third_party/terraform/") diff --git a/mmv1/provider/terraform/common~copy.yaml b/mmv1/provider/terraform/common~copy.yaml index 1409c612a3f6..1565f5b67fea 100644 --- a/mmv1/provider/terraform/common~copy.yaml +++ b/mmv1/provider/terraform/common~copy.yaml @@ -122,6 +122,13 @@ '<%= dir -%>/envvar/<%= fname -%>': 'third_party/terraform/envvar/<%= fname -%>' <% end -%> +<% + Dir["third_party/terraform/functions/*.go"].each do |file_path| + fname = file_path.split('/')[-1] +-%> +'<%= dir -%>/functions/<%= fname -%>': 'third_party/terraform/functions/<%= fname -%>' +<% end -%> + <% Dir["third_party/terraform/scripts/**/*.*"].each do |file_path| next if file_path.end_with?('.erb') diff --git a/mmv1/third_party/terraform/functions/main.go b/mmv1/third_party/terraform/functions/main.go new file mode 100644 index 000000000000..b13ee3d60e4e --- /dev/null +++ b/mmv1/third_party/terraform/functions/main.go @@ -0,0 +1 @@ +package functions diff --git a/mmv1/third_party/terraform/fwprovider/framework_provider.go.erb b/mmv1/third_party/terraform/fwprovider/framework_provider.go.erb index 0d1aa04c979e..04f552a16fc0 100644 --- a/mmv1/third_party/terraform/fwprovider/framework_provider.go.erb +++ b/mmv1/third_party/terraform/fwprovider/framework_provider.go.erb @@ -6,6 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" "github.com/hashicorp/terraform-plugin-framework/datasource" + "github.com/hashicorp/terraform-plugin-framework/function" "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/provider" "github.com/hashicorp/terraform-plugin-framework/provider/metaschema" @@ -28,6 +29,7 @@ import ( // Ensure the implementation satisfies the expected interfaces var ( _ provider.ProviderWithMetaSchema = &FrameworkProvider{} + _ provider.ProviderWithFunctions = &FrameworkProvider{} ) // New is a helper function to simplify provider server and testing implementation. @@ -294,5 +296,10 @@ func (p *FrameworkProvider) DataSources(_ context.Context) []func() datasource.D // Resources defines the resources implemented in the provider. func (p *FrameworkProvider) Resources(_ context.Context) []func() resource.Resource { - return nil + return nil } + +// Functions defines the provider functions implemented in the provider. +func (p *FrameworkProvider) Functions(_ context.Context) []func() function.Function { + return nil +} \ No newline at end of file