aws-samples / service-catalog-engine-for-terraform-os

Apache License 2.0
130 stars 40 forks source link

Update deploy-tre.sh to add validation for Service Catalog endpoint #40

Open AkshayAkyAWS opened 1 year ago

AkshayAkyAWS commented 1 year ago

Hi Team,

Please add the validation to Service Catalog endpoint in deploy-tre.sh

e) OVERRIDE_SERVICE_CATALOG_ENDPOINT="ParameterKey=ServiceCatalogEndpoint,ParameterValue=$OPTARG"

This is causing an issue in if you give any arbitrary value or if you specify any option after -e, for example

“./bin/bash/deploy-tre.sh -r “us-east-1" -e -s true”

In above command -e is taking -s as value which is an invalid Service catalog endpoint value, due to this Statemachine "ManageProvisionedProductStateMachine" and "TerminateProvisionedProductStateMachine" is failling at step "Notify provision engine workflow success result" with error "Invalid endpoint: -s"

smaly-amazon commented 1 year ago

Hi,

Thanks for mentioning this. We will consider adding validation to ensure that a non-empty value is included after the -e option.

The -e and -s options are intended primarily for testing purposes. In almost all regular usage, they should not be used. When they are not present, the engine uses the default regional endpoint for Service Catalog with SSL verification on.