@@ -295,14 +295,15 @@ func stackNameExistsValidator(projectDir string) validation.StringValidator {
295295}
296296
297297const (
298- Aws = "Pulumi AWS"
299- Azure = "Pulumi Azure"
300- Gcp = "Pulumi Google Cloud"
301- AwsTf = "Terraform AWS (Preview)"
302- GcpTf = "Terraform Google Cloud (Preview)"
298+ Aws = "Pulumi AWS"
299+ Azure = "Pulumi Azure"
300+ Gcp = "Pulumi Google Cloud"
301+ AwsTf = "Terraform AWS (Preview)"
302+ AzureTf = "Terraform Azure (Preview)"
303+ GcpTf = "Terraform Google Cloud (Preview)"
303304)
304305
305- var availableProviders = []string {Aws , Gcp , Azure , AwsTf , GcpTf }
306+ var availableProviders = []string {Aws , Gcp , Azure , AwsTf , GcpTf , AzureTf }
306307
307308func New (fs afero.Fs , args Args ) Model {
308309 // Load and update the project name in the template's nitric.yaml
@@ -347,9 +348,13 @@ func New(fs afero.Fs, args Args) Model {
347348 }
348349
349350 if args .ProviderName != "" {
350- if ! lo .Contains ([]string {"aws" , "azure" , "gcp" , "aws-tf" }, args .ProviderName ) {
351+ validProviders := lo .Map (availableProviders , func (p string , _ int ) string {
352+ return providerLabelToValue (p )
353+ })
354+
355+ if ! lo .Contains (validProviders , args .ProviderName ) {
351356 return Model {
352- err : fmt .Errorf ("cloud name is not valid, must be aws, azure, gcp, or aws-tf" ),
357+ err : fmt .Errorf ("cloud name is not valid, must be one of: %v" , strings . Join ( validProviders , ", " ) ),
353358 }
354359 }
355360
@@ -394,6 +399,8 @@ func providerLabelToValue(provider string) string {
394399 return "aws-tf"
395400 case GcpTf :
396401 return "gcp-tf"
402+ case AzureTf :
403+ return "azure-tf"
397404 }
398405
399406 return strings .ToLower (provider )
0 commit comments