diff --git a/internal/cli/clu2adv/clu2adv.go b/internal/cli/clu2adv/clu2adv.go index 9907e86..9977340 100644 --- a/internal/cli/clu2adv/clu2adv.go +++ b/internal/cli/clu2adv/clu2adv.go @@ -10,10 +10,10 @@ import ( func Builder() *cobra.Command { o := &struct { - *cli.BaseOpts + cli.BaseOpts includeMoved bool }{ - BaseOpts: &cli.BaseOpts{ + BaseOpts: cli.BaseOpts{ Fs: afero.NewOsFs(), }, } @@ -28,7 +28,7 @@ func Builder() *cobra.Command { Aliases: []string{"clu2adv"}, RunE: o.RunE, } - cli.SetupCommonFlags(cmd, o.BaseOpts) + cli.SetupCommonFlags(cmd, &o.BaseOpts) cmd.Flags().BoolVarP(&o.includeMoved, flag.IncludeMoved, flag.IncludeMovedShort, false, "include moved blocks in the output file") return cmd diff --git a/internal/convert/testdata/adv2v2/basic.in.tf b/internal/convert/testdata/adv2v2/basic.in.tf index 36c41a2..9cb2f49 100644 --- a/internal/convert/testdata/adv2v2/basic.in.tf +++ b/internal/convert/testdata/adv2v2/basic.in.tf @@ -1,4 +1,16 @@ -resource "mongodbatlas_advanced_cluster" "basic" { - name = "basic" - // TODO: missing fields as transformation is not implemented yet +resource "mongodbatlas_advanced_cluster" "clu" { + project_id = "66d979971ec97b7de1ef8777" + name = "clu" + cluster_type = "REPLICASET" + replication_specs { + region_configs { + priority = 7 + provider_name = "AWS" + region_name = "EU_WEST_1" + electable_specs { + instance_size = "M10" + node_count = 3 + } + } + } } diff --git a/internal/convert/testdata/adv2v2/basic.out.tf b/internal/convert/testdata/adv2v2/basic.out.tf index 36c41a2..760e016 100644 --- a/internal/convert/testdata/adv2v2/basic.out.tf +++ b/internal/convert/testdata/adv2v2/basic.out.tf @@ -1,4 +1,22 @@ -resource "mongodbatlas_advanced_cluster" "basic" { - name = "basic" - // TODO: missing fields as transformation is not implemented yet +resource "mongodbatlas_advanced_cluster" "clu" { + project_id = "66d979971ec97b7de1ef8777" + name = "clu" + cluster_type = "REPLICASET" + replication_specs = [ + { + region_configs = [ + { + priority = 7 + provider_name = "AWS" + region_name = "EU_WEST_1" + electable_specs = { + node_count = 3 + instance_size = "M10" + } + } + ] + } + ] + + # Updated by atlas-cli-plugin-terraform, please review the changes. }