Skip to content

Commit

Permalink
add token mapping strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
aq17 committed Mar 7, 2023
1 parent 758d0e3 commit c8fb666
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion provider/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/pulumi/pulumi-f5bigip/provider/v3/pkg/version"
"github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfbridge"
"github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfbridge/x"
shimv1 "github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfshim/sdk-v1"
"github.com/pulumi/pulumi/sdk/v3/go/common/tokens"
"github.com/pulumi/pulumi/sdk/v3/go/common/util/contract"
)

// all of the F5 BigIP token components used below.
Expand Down Expand Up @@ -71,7 +73,7 @@ func makeDataSource(mod string, res string) tokens.ModuleMember {

// Provider returns additional overlaid schema and metadata associated with the F5 BigIP package.
func Provider() tfbridge.ProviderInfo {
return tfbridge.ProviderInfo{
prov := tfbridge.ProviderInfo{
P: shimv1.NewProvider(bigip.Provider().(*schema.Provider)),
Name: "bigip",
Description: "A Pulumi package for creating and managing F5 BigIP resources.",
Expand Down Expand Up @@ -199,4 +201,16 @@ func Provider() tfbridge.ProviderInfo {
Namespaces: namespaceMap,
},
}

err := x.ComputeDefaults(&prov, x.TokensKnownModules("f5bigip_", mainMod, []string{
"CM_",
"Ltm_",
"Net_",
"Sys_",
"Ssl_",
"VCMP_",
}, x.MakeStandardToken(f5BigIPPkg)))
contract.AssertNoError(err)

return prov
}

0 comments on commit c8fb666

Please sign in to comment.