diff --git a/internal/pkg/cli/init.go b/internal/pkg/cli/init.go index d6d83868c64..7c798b1f0ef 100644 --- a/internal/pkg/cli/init.go +++ b/internal/pkg/cli/init.go @@ -11,6 +11,7 @@ import ( awscfn "github.com/aws/copilot-cli/internal/pkg/aws/cloudformation" "github.com/aws/copilot-cli/internal/pkg/aws/iam" + "github.com/aws/copilot-cli/internal/pkg/describe" "github.com/aws/copilot-cli/internal/pkg/docker/dockerfile" "github.com/aws/copilot-cli/internal/pkg/deploy" @@ -264,6 +265,17 @@ func newInitOpts(vars initVars) (*initOpts, error) { initParser: func(s string) dockerfileParser { return dockerfile.New(fs, s) }, + initEnvDescriber: func(appName string, envName string) (envDescriber, error) { + envDescriber, err := describe.NewEnvDescriber(describe.NewEnvDescriberConfig{ + App: appName, + Env: envName, + ConfigStore: configStore, + }) + if err != nil { + return nil, fmt.Errorf("initiate env describer: %w", err) + } + return envDescriber, nil + }, } o.initWlCmd = &opts o.schedule = &opts.schedule // Surfaced via pointer for logging @@ -292,6 +304,17 @@ func newInitOpts(vars initVars) (*initOpts, error) { opts.df = dockerfile.New(opts.fs, opts.dockerfilePath) return opts.df } + opts.initEnvDescriber = func(appName string, envName string) (envDescriber, error) { + envDescriber, err := describe.NewEnvDescriber(describe.NewEnvDescriberConfig{ + App: appName, + Env: envName, + ConfigStore: opts.store, + }) + if err != nil { + return nil, fmt.Errorf("initiate env describer: %w", err) + } + return envDescriber, nil + } o.initWlCmd = &opts o.port = &opts.port // Surfaced via pointer for logging. o.initWkldVars = &opts.initWkldVars