Repository: chef/automate
Pull request #8241 (2023-09-26 04:35:14)

Allow minio type endpoint url in config gen
### :nut_and_bolt: Description: What code changed, and why?
In config gen it only allows endpoint like https://s3.amazon.com which does not allow minio endpoint url which is something like `https://35.23.42.44:9000` ,with these changes now it allows both type of urls

<!-- /!\ Please ensure that you are NOT disclosing any customer information without their consent /!\ -->

### :chains: Related Resources
https://chefio.atlassian.net/browse/CHEF-6211

### :+1: Definition of Done

### :athletic_shoe: How to Build and Test the Change

### :white_check_mark: Checklist

**All PRs** must tick these:

- [ ] I have read the [CONTRIBUTING document](https://github.com/chef/automate/blob/master/CONTRIBUTING.md).
- [ ] All commits signed-off for the [Developer Certification of Origin](https://github.com/chef/chef/blob/master/CONTRIBUTING.md#developer-certification-of-origin-dco).

With occasional exceptions, all PRs **from Progress employees** must tick these:

- [ ] Is the code clear? *(complicated code or lots of comments--subdivide and use well-named methods, meaningful variable names, etc.)*
- [ ] Consistency checked? *(user notifications, user prompts, visual patterns, code patterns, variable names)*
- [ ] Repeated code blocks eliminated? *(adapt and reuse existing components, blocks, functions, etc.)*
- [ ] Spelling, grammar, typos checked? *(at a minimum use `make spell` in any component directory)*
- [ ] Code well-formatted? *(indents, line breaks, etc. improve rather than hinder readability)*

All PRs **from Progress employees** should tick these if appropriate:

- [ ] Tests added/updated? (all new code needs new tests)
- [ ] Docs added/updated? (all customer-facing changes)

*Please add a note next to any checkbox above if you are NOT ticking it.*

### :camera: Screenshots, if applicable
[video](https://progresssoftware.sharepoint.com/:v:/s/ChefCoreC/ERQvdOIyDUVHuRM1N8neQEsBsBY2UnwUu14m-s3qMbvlGg?e=F8VN4o)

netlify[bot]: ### <span aria-hidden="true">👷</span> Deploy Preview for *chef-automate* processing.


|  Name | Link |
|:-:|------------------------|
|<span aria-hidden="true">🔨</span> Latest commit | 959ebdafd82fb01b55a4d737c5266762de0f94d3 |
|<span aria-hidden="true">🔍</span> Latest deploy log | https://app.netlify.com/sites/chef-automate/deploys/65125f840f4f2c000835e12b |
sonarqube-for-infrastructure-prod[bot]: **SonarQube Quality Gate**

[![Quality Gate passed](https://raw.githubusercontent.com/SonarSource/sonarqube-static-resources/master/v97/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonar.progress.com/dashboard?id=chef_automate_AYeOVEbqJ4YHsO5MtKWC&pullRequest=8241)

[![Bug](https://raw.githubusercontent.com/SonarSource/sonarqube-static-resources/master/v97/common/bug-16px.png 'Bug')](https://sonar.progress.com/project/issues?id=chef_automate_AYeOVEbqJ4YHsO5MtKWC&pullRequest=8241&resolved=false&types=BUG) [![A](https://raw.githubusercontent.com/SonarSource/sonarqube-static-resources/master/v97/checks/RatingBadge/A-16px.png 'A')](https://sonar.progress.com/project/issues?id=chef_automate_AYeOVEbqJ4YHsO5MtKWC&pullRequest=8241&resolved=false&types=BUG) [0 Bugs](https://sonar.progress.com/project/issues?id=chef_automate_AYeOVEbqJ4YHsO5MtKWC&pullRequest=8241&resolved=false&types=BUG)  
[![Vulnerability](https://raw.githubusercontent.com/SonarSource/sonarqube-static-resources/master/v97/common/vulnerability-16px.png 'Vulnerability')](https://sonar.progress.com/project/issues?id=chef_automate_AYeOVEbqJ4YHsO5MtKWC&pullRequest=8241&resolved=false&types=VULNERABILITY) [![A](https://raw.githubusercontent.com/SonarSource/sonarqube-static-resources/master/v97/checks/RatingBadge/A-16px.png 'A')](https://sonar.progress.com/project/issues?id=chef_automate_AYeOVEbqJ4YHsO5MtKWC&pullRequest=8241&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonar.progress.com/project/issues?id=chef_automate_AYeOVEbqJ4YHsO5MtKWC&pullRequest=8241&resolved=false&types=VULNERABILITY)  
[![Security Hotspot](https://raw.githubusercontent.com/SonarSource/sonarqube-static-resources/master/v97/common/security_hotspot-16px.png 'Security Hotspot')](https://sonar.progress.com/security_hotspots?id=chef_automate_AYeOVEbqJ4YHsO5MtKWC&pullRequest=8241) [![A](https://raw.githubusercontent.com/SonarSource/sonarqube-static-resources/master/v97/checks/RatingBadge/A-16px.png 'A')](https://sonar.progress.com/security_hotspots?id=chef_automate_AYeOVEbqJ4YHsO5MtKWC&pullRequest=8241) [0 Security Hotspots](https://sonar.progress.com/security_hotspots?id=chef_automate_AYeOVEbqJ4YHsO5MtKWC&pullRequest=8241)  
[![Code Smell](https://raw.githubusercontent.com/SonarSource/sonarqube-static-resources/master/v97/common/code_smell-16px.png 'Code Smell')](https://sonar.progress.com/project/issues?id=chef_automate_AYeOVEbqJ4YHsO5MtKWC&pullRequest=8241&resolved=false&types=CODE_SMELL) [![A](https://raw.githubusercontent.com/SonarSource/sonarqube-static-resources/master/v97/checks/RatingBadge/A-16px.png 'A')](https://sonar.progress.com/project/issues?id=chef_automate_AYeOVEbqJ4YHsO5MtKWC&pullRequest=8241&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonar.progress.com/project/issues?id=chef_automate_AYeOVEbqJ4YHsO5MtKWC&pullRequest=8241&resolved=false&types=CODE_SMELL)

[![No Coverage information](https://raw.githubusercontent.com/SonarSource/sonarqube-static-resources/master/v97/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonar.progress.com/component_measures?id=chef_automate_AYeOVEbqJ4YHsO5MtKWC&pullRequest=8241&metric=coverage&view=list) No Coverage information  
[![0.0%](https://raw.githubusercontent.com/SonarSource/sonarqube-static-resources/master/v97/checks/Duplications/3-16px.png '0.0%')](https://sonar.progress.com/component_measures?id=chef_automate_AYeOVEbqJ4YHsO5MtKWC&pullRequest=8241&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonar.progress.com/component_measures?id=chef_automate_AYeOVEbqJ4YHsO5MtKWC&pullRequest=8241&metric=new_duplicated_lines_density&view=list)


sonarqube-for-infrastructure-prod[bot]: **SonarQube Quality Gate**

[![Quality Gate passed](https://raw.githubusercontent.com/SonarSource/sonarqube-static-resources/master/v97/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonar.progress.com/dashboard?id=chef_automate_AYeOVEbqJ4YHsO5MtKWC&pullRequest=8241)

[![Bug](https://raw.githubusercontent.com/SonarSource/sonarqube-static-resources/master/v97/common/bug-16px.png 'Bug')](https://sonar.progress.com/project/issues?id=chef_automate_AYeOVEbqJ4YHsO5MtKWC&pullRequest=8241&resolved=false&types=BUG) [![A](https://raw.githubusercontent.com/SonarSource/sonarqube-static-resources/master/v97/checks/RatingBadge/A-16px.png 'A')](https://sonar.progress.com/project/issues?id=chef_automate_AYeOVEbqJ4YHsO5MtKWC&pullRequest=8241&resolved=false&types=BUG) [0 Bugs](https://sonar.progress.com/project/issues?id=chef_automate_AYeOVEbqJ4YHsO5MtKWC&pullRequest=8241&resolved=false&types=BUG)  
[![Vulnerability](https://raw.githubusercontent.com/SonarSource/sonarqube-static-resources/master/v97/common/vulnerability-16px.png 'Vulnerability')](https://sonar.progress.com/project/issues?id=chef_automate_AYeOVEbqJ4YHsO5MtKWC&pullRequest=8241&resolved=false&types=VULNERABILITY) [![A](https://raw.githubusercontent.com/SonarSource/sonarqube-static-resources/master/v97/checks/RatingBadge/A-16px.png 'A')](https://sonar.progress.com/project/issues?id=chef_automate_AYeOVEbqJ4YHsO5MtKWC&pullRequest=8241&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonar.progress.com/project/issues?id=chef_automate_AYeOVEbqJ4YHsO5MtKWC&pullRequest=8241&resolved=false&types=VULNERABILITY)  
[![Security Hotspot](https://raw.githubusercontent.com/SonarSource/sonarqube-static-resources/master/v97/common/security_hotspot-16px.png 'Security Hotspot')](https://sonar.progress.com/security_hotspots?id=chef_automate_AYeOVEbqJ4YHsO5MtKWC&pullRequest=8241) [![A](https://raw.githubusercontent.com/SonarSource/sonarqube-static-resources/master/v97/checks/RatingBadge/A-16px.png 'A')](https://sonar.progress.com/security_hotspots?id=chef_automate_AYeOVEbqJ4YHsO5MtKWC&pullRequest=8241) [0 Security Hotspots](https://sonar.progress.com/security_hotspots?id=chef_automate_AYeOVEbqJ4YHsO5MtKWC&pullRequest=8241)  
[![Code Smell](https://raw.githubusercontent.com/SonarSource/sonarqube-static-resources/master/v97/common/code_smell-16px.png 'Code Smell')](https://sonar.progress.com/project/issues?id=chef_automate_AYeOVEbqJ4YHsO5MtKWC&pullRequest=8241&resolved=false&types=CODE_SMELL) [![A](https://raw.githubusercontent.com/SonarSource/sonarqube-static-resources/master/v97/checks/RatingBadge/A-16px.png 'A')](https://sonar.progress.com/project/issues?id=chef_automate_AYeOVEbqJ4YHsO5MtKWC&pullRequest=8241&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonar.progress.com/project/issues?id=chef_automate_AYeOVEbqJ4YHsO5MtKWC&pullRequest=8241&resolved=false&types=CODE_SMELL)

[![No Coverage information](https://raw.githubusercontent.com/SonarSource/sonarqube-static-resources/master/v97/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonar.progress.com/component_measures?id=chef_automate_AYeOVEbqJ4YHsO5MtKWC&pullRequest=8241&metric=coverage&view=list) No Coverage information  
[![0.0%](https://raw.githubusercontent.com/SonarSource/sonarqube-static-resources/master/v97/checks/Duplications/3-16px.png '0.0%')](https://sonar.progress.com/component_measures?id=chef_automate_AYeOVEbqJ4YHsO5MtKWC&pullRequest=8241&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonar.progress.com/component_measures?id=chef_automate_AYeOVEbqJ4YHsO5MtKWC&pullRequest=8241&metric=new_duplicated_lines_density&view=list)


sonarqube-for-infrastructure-prod[bot]: **SonarQube Quality Gate**

[![Quality Gate passed](https://raw.githubusercontent.com/SonarSource/sonarqube-static-resources/master/v97/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonar.progress.com/dashboard?id=chef_automate_AYeOVEbqJ4YHsO5MtKWC&pullRequest=8241)

[![Bug](https://raw.githubusercontent.com/SonarSource/sonarqube-static-resources/master/v97/common/bug-16px.png 'Bug')](https://sonar.progress.com/project/issues?id=chef_automate_AYeOVEbqJ4YHsO5MtKWC&pullRequest=8241&resolved=false&types=BUG) [![A](https://raw.githubusercontent.com/SonarSource/sonarqube-static-resources/master/v97/checks/RatingBadge/A-16px.png 'A')](https://sonar.progress.com/project/issues?id=chef_automate_AYeOVEbqJ4YHsO5MtKWC&pullRequest=8241&resolved=false&types=BUG) [0 Bugs](https://sonar.progress.com/project/issues?id=chef_automate_AYeOVEbqJ4YHsO5MtKWC&pullRequest=8241&resolved=false&types=BUG)  
[![Vulnerability](https://raw.githubusercontent.com/SonarSource/sonarqube-static-resources/master/v97/common/vulnerability-16px.png 'Vulnerability')](https://sonar.progress.com/project/issues?id=chef_automate_AYeOVEbqJ4YHsO5MtKWC&pullRequest=8241&resolved=false&types=VULNERABILITY) [![A](https://raw.githubusercontent.com/SonarSource/sonarqube-static-resources/master/v97/checks/RatingBadge/A-16px.png 'A')](https://sonar.progress.com/project/issues?id=chef_automate_AYeOVEbqJ4YHsO5MtKWC&pullRequest=8241&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonar.progress.com/project/issues?id=chef_automate_AYeOVEbqJ4YHsO5MtKWC&pullRequest=8241&resolved=false&types=VULNERABILITY)  
[![Security Hotspot](https://raw.githubusercontent.com/SonarSource/sonarqube-static-resources/master/v97/common/security_hotspot-16px.png 'Security Hotspot')](https://sonar.progress.com/security_hotspots?id=chef_automate_AYeOVEbqJ4YHsO5MtKWC&pullRequest=8241) [![A](https://raw.githubusercontent.com/SonarSource/sonarqube-static-resources/master/v97/checks/RatingBadge/A-16px.png 'A')](https://sonar.progress.com/security_hotspots?id=chef_automate_AYeOVEbqJ4YHsO5MtKWC&pullRequest=8241) [0 Security Hotspots](https://sonar.progress.com/security_hotspots?id=chef_automate_AYeOVEbqJ4YHsO5MtKWC&pullRequest=8241)  
[![Code Smell](https://raw.githubusercontent.com/SonarSource/sonarqube-static-resources/master/v97/common/code_smell-16px.png 'Code Smell')](https://sonar.progress.com/project/issues?id=chef_automate_AYeOVEbqJ4YHsO5MtKWC&pullRequest=8241&resolved=false&types=CODE_SMELL) [![A](https://raw.githubusercontent.com/SonarSource/sonarqube-static-resources/master/v97/checks/RatingBadge/A-16px.png 'A')](https://sonar.progress.com/project/issues?id=chef_automate_AYeOVEbqJ4YHsO5MtKWC&pullRequest=8241&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonar.progress.com/project/issues?id=chef_automate_AYeOVEbqJ4YHsO5MtKWC&pullRequest=8241&resolved=false&types=CODE_SMELL)

[![No Coverage information](https://raw.githubusercontent.com/SonarSource/sonarqube-static-resources/master/v97/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonar.progress.com/component_measures?id=chef_automate_AYeOVEbqJ4YHsO5MtKWC&pullRequest=8241&metric=coverage&view=list) No Coverage information  
[![0.0%](https://raw.githubusercontent.com/SonarSource/sonarqube-static-resources/master/v97/checks/Duplications/3-16px.png '0.0%')](https://sonar.progress.com/component_measures?id=chef_automate_AYeOVEbqJ4YHsO5MtKWC&pullRequest=8241&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonar.progress.com/component_measures?id=chef_automate_AYeOVEbqJ4YHsO5MtKWC&pullRequest=8241&metric=new_duplicated_lines_density&view=list)


sonarqube-for-infrastructure-prod[bot]: **SonarQube Quality Gate**

[![Quality Gate passed](https://raw.githubusercontent.com/SonarSource/sonarqube-static-resources/master/v97/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonar.progress.com/dashboard?id=chef_automate_AYeOVEbqJ4YHsO5MtKWC&pullRequest=8241)

[![Bug](https://raw.githubusercontent.com/SonarSource/sonarqube-static-resources/master/v97/common/bug-16px.png 'Bug')](https://sonar.progress.com/project/issues?id=chef_automate_AYeOVEbqJ4YHsO5MtKWC&pullRequest=8241&resolved=false&types=BUG) [![A](https://raw.githubusercontent.com/SonarSource/sonarqube-static-resources/master/v97/checks/RatingBadge/A-16px.png 'A')](https://sonar.progress.com/project/issues?id=chef_automate_AYeOVEbqJ4YHsO5MtKWC&pullRequest=8241&resolved=false&types=BUG) [0 Bugs](https://sonar.progress.com/project/issues?id=chef_automate_AYeOVEbqJ4YHsO5MtKWC&pullRequest=8241&resolved=false&types=BUG)  
[![Vulnerability](https://raw.githubusercontent.com/SonarSource/sonarqube-static-resources/master/v97/common/vulnerability-16px.png 'Vulnerability')](https://sonar.progress.com/project/issues?id=chef_automate_AYeOVEbqJ4YHsO5MtKWC&pullRequest=8241&resolved=false&types=VULNERABILITY) [![A](https://raw.githubusercontent.com/SonarSource/sonarqube-static-resources/master/v97/checks/RatingBadge/A-16px.png 'A')](https://sonar.progress.com/project/issues?id=chef_automate_AYeOVEbqJ4YHsO5MtKWC&pullRequest=8241&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonar.progress.com/project/issues?id=chef_automate_AYeOVEbqJ4YHsO5MtKWC&pullRequest=8241&resolved=false&types=VULNERABILITY)  
[![Security Hotspot](https://raw.githubusercontent.com/SonarSource/sonarqube-static-resources/master/v97/common/security_hotspot-16px.png 'Security Hotspot')](https://sonar.progress.com/security_hotspots?id=chef_automate_AYeOVEbqJ4YHsO5MtKWC&pullRequest=8241) [![A](https://raw.githubusercontent.com/SonarSource/sonarqube-static-resources/master/v97/checks/RatingBadge/A-16px.png 'A')](https://sonar.progress.com/security_hotspots?id=chef_automate_AYeOVEbqJ4YHsO5MtKWC&pullRequest=8241) [0 Security Hotspots](https://sonar.progress.com/security_hotspots?id=chef_automate_AYeOVEbqJ4YHsO5MtKWC&pullRequest=8241)  
[![Code Smell](https://raw.githubusercontent.com/SonarSource/sonarqube-static-resources/master/v97/common/code_smell-16px.png 'Code Smell')](https://sonar.progress.com/project/issues?id=chef_automate_AYeOVEbqJ4YHsO5MtKWC&pullRequest=8241&resolved=false&types=CODE_SMELL) [![A](https://raw.githubusercontent.com/SonarSource/sonarqube-static-resources/master/v97/checks/RatingBadge/A-16px.png 'A')](https://sonar.progress.com/project/issues?id=chef_automate_AYeOVEbqJ4YHsO5MtKWC&pullRequest=8241&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonar.progress.com/project/issues?id=chef_automate_AYeOVEbqJ4YHsO5MtKWC&pullRequest=8241&resolved=false&types=CODE_SMELL)

[![No Coverage information](https://raw.githubusercontent.com/SonarSource/sonarqube-static-resources/master/v97/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonar.progress.com/component_measures?id=chef_automate_AYeOVEbqJ4YHsO5MtKWC&pullRequest=8241&metric=coverage&view=list) No Coverage information  
[![0.0%](https://raw.githubusercontent.com/SonarSource/sonarqube-static-resources/master/v97/checks/Duplications/3-16px.png '0.0%')](https://sonar.progress.com/component_measures?id=chef_automate_AYeOVEbqJ4YHsO5MtKWC&pullRequest=8241&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonar.progress.com/component_measures?id=chef_automate_AYeOVEbqJ4YHsO5MtKWC&pullRequest=8241&metric=new_duplicated_lines_density&view=list)



Patch:
diff --git a/lib/config/genconfig/awshaprovisionconfig.go b/lib/config/genconfig/awshaprovisionconfig.go
index be8d63317..145fd3ae6 100644
--- a/lib/config/genconfig/awshaprovisionconfig.go
+++ b/lib/config/genconfig/awshaprovisionconfig.go
@@ -29,8 +29,8 @@ const (
 	AWS_ACCESS_KEY_SECRET_REGEX        = "^[A-Za-z0-9/+=]{40}$"
 	ACCESS_KEY_ID_REGEX                = "^[A-Za-z0-9/+=]+$"
 	ACCESS_KEY_SECRET_REGEX            = "^[A-Za-z0-9/+=]+$"
-	ENDPOINT_URL                       = "^((http|https)://)[-a-zA-Z0-9@:%._\\+~#?&//=]{2,256}\\.[a-z]{2,6}\\b([-a-zA-Z0-9@:%._\\+~#?&//=]*)$"
-	ENDPOINT_URL_SAMPLE                = "http://bucket-endpoint.com or https://bucket-endpoint.com"
+	ENDPOINT_URL                       = "^(https?://(?:[a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,}(?::[0-9]{1,5})?|https?://(?:[0-9]{1,3}\\.){3}[0-9]{1,3}(?::[0-9]{1,5})?)$"
+	ENDPOINT_URL_SAMPLE                = "http://bucket-endpoint.com or https://bucket.endpoint.com or http://35.182.23.44:9200 or https://35.182.23.44"
 	AUTOMATE_ADMIN_PASSWORD_REGEX      = "^.{8,35}$"
 	AWS_MACHINE_TYPE_REGEX_SAMPLE      = "m5.large, m5.xlarge"
 	IP_REGEX_SAMPLE                    = "172.31.0.0"
diff --git a/lib/config/genconfig/hadeployconfig.go b/lib/config/genconfig/hadeployconfig.go
index 006a4dd02..74cf93586 100644
--- a/lib/config/genconfig/hadeployconfig.go
+++ b/lib/config/genconfig/hadeployconfig.go
@@ -24,7 +24,7 @@ const (
 	ERR_MSG_AWS_ACCESS_KEY_SECRET = "Please provide valid AWS Access Key Secret of 40 alpha numeric characters"
 	ERR_MSG_ACCESS_KEY            = "Please provide valid Access Key ID with Alpha numeric characters"
 	ERR_MSG_IP                    = "Please provide valid IP Address, like: 192.168.1.1"
-	ERR_MSG_BUCKET_ENDPOINT       = "Please provide a valid Bucket Endpoint URL, like: https://my-object-store.example.com"
+	ERR_MSG_BUCKET_ENDPOINT       = "Please provide a valid Bucket Endpoint URL, like: https://my-object-store.example.com or https://35.2.44.4:9200"
 	ERR_MSG_DIR_LOC               = "Please provide a valid Directory Location on local linux filesystem, like: /mnt/automate_backups"
 )
 


Test patch:
diff --git a/lib/config/genconfig/hadeployconfig_test.go b/lib/config/genconfig/hadeployconfig_test.go
index 223a25352..612cd0f48 100644
--- a/lib/config/genconfig/hadeployconfig_test.go
+++ b/lib/config/genconfig/hadeployconfig_test.go
@@ -1068,6 +1068,60 @@ func TestOnPremPromptChefInfraServerNodesCustomCert(t *testing.T) {
 	assert.Equal(t, ip3, c.Config.ExistingInfra.Config.ChefServerPrivateIps[2])
 }
 
+func TestOnPremPromptBackupObjectStorage(t *testing.T) {
+	b := bytes.NewBuffer([]byte(""))
+	in := io.NopCloser(b)
+	enableBackup := true
+	input(b, "\r")
+
+	useObjectStorage := true
+	input(b, moveDown+moveDown+"\r")
+
+	backupBucketName := "automate-backup"
+	input(b, backupBucketName+"\r")
+
+	backupAcessKeyId := "AKEKFKEIDKETODDFEDFE"
+	input(b, backupAcessKeyId+"\r")
+
+	backupAcessKeySecret := "sdfsdflsdlfkjsdlkjeflilsfldijflsdkfjddfd"
+	input(b, backupAcessKeySecret+"\r")
+	backupEndpoint := "https://s3.amazonaws.com"
+	input(b, backupEndpoint+"\r")
+
+	mfsu := &fileutils.MockFileSystemUtils{
+		ReadFileFunc: func(filepath string) (data []byte, err error) {
+			return
+		},
+		StatFunc: func(name string) (fi os.FileInfo, err error) {
+			if name == "test.pem" {
+				fi = fileutils.MockFileInfo{IsDirFunc: func() bool { return false }}
+			} else {
+				err = errors.New("file not found")
+			}
+			return
+		},
+	}
+	outBuf := &bytes.Buffer{}
+	out := ioutils.NewNopWriteCloser(outBuf)
+	p := pmt.PromptFactory(in, out, mfsu)
+
+	c := HaDeployConfigGen{
+		Prompt:    p,
+		FileUtils: mfsu,
+		Config:    &config.HaDeployConfig{},
+	}
+
+	err := c.PromptBackup()
+
+	assert.NoError(t, err)
+	assert.Equal(t, enableBackup, c.Config.Architecture.ExistingInfra.BackupConfig != "")
+	assert.Equal(t, useObjectStorage, c.Config.Architecture.ExistingInfra.BackupConfig == "object_storage")
+	assert.Equal(t, backupBucketName, c.Config.ObjectStorage.Config.BucketName)
+	assert.Equal(t, backupAcessKeyId, c.Config.ObjectStorage.Config.AccessKey)
+	assert.Equal(t, backupEndpoint, c.Config.ObjectStorage.Config.Endpoint)
+	assert.Equal(t, "/mnt/automate_backups", c.Config.Architecture.ExistingInfra.BackupMount)
+}
+
 func TestOnPremPromptBackupMinio(t *testing.T) {
 	b := bytes.NewBuffer([]byte(""))
 	in := io.NopCloser(b)
@@ -1086,7 +1140,7 @@ func TestOnPremPromptBackupMinio(t *testing.T) {
 	backupAcessKeySecret := "sdfsdflsdlfkjsdlkjeflilsfldijflsdkfjddfd"
 	input(b, backupAcessKeySecret+"\r")
 
-	backupEndpoint := "https://minio.automate.com"
+	backupEndpoint := "http://35.182.23.44:9000"
 	input(b, backupEndpoint+"\r")
 
 	mfsu := &fileutils.MockFileSystemUtils{
@@ -1123,6 +1177,116 @@ func TestOnPremPromptBackupMinio(t *testing.T) {
 	assert.Equal(t, "/mnt/automate_backups", c.Config.Architecture.ExistingInfra.BackupMount)
 }
 
+func TestOnPremPromptBackupMinioWithDomain(t *testing.T) {
+	b := bytes.NewBuffer([]byte(""))
+	in := io.NopCloser(b)
+	enableBackup := true
+	input(b, "\r")
+
+	useMinio := true
+	input(b, moveDown+"\r")
+
+	backupBucketName := "automate-backup"
+	input(b, backupBucketName+"\r")
+
+	backupAcessKeyId := "AKEKFKEIDKETODDFEDFE"
+	input(b, backupAcessKeyId+"\r")
+
+	backupAcessKeySecret := "sdfsdflsdlfkjsdlkjeflilsfldijflsdkfjddfd"
+	input(b, backupAcessKeySecret+"\r")
+
+	backupEndpoint := "http://s3.amazonaws.com:9000"
+	input(b, backupEndpoint+"\r")
+
+	mfsu := &fileutils.MockFileSystemUtils{
+		ReadFileFunc: func(filepath string) (data []byte, err error) {
+			return
+		},
+		StatFunc: func(name string) (fi os.FileInfo, err error) {
+			if name == "test.pem" {
+				fi = fileutils.MockFileInfo{IsDirFunc: func() bool { return false }}
+			} else {
+				err = errors.New("file not found")
+			}
+			return
+		},
+	}
+	outBuf := &bytes.Buffer{}
+	out := ioutils.NewNopWriteCloser(outBuf)
+	p := pmt.PromptFactory(in, out, mfsu)
+
+	c := HaDeployConfigGen{
+		Prompt:    p,
+		FileUtils: mfsu,
+		Config:    &config.HaDeployConfig{},
+	}
+
+	err := c.PromptBackup()
+
+	assert.NoError(t, err)
+	assert.Equal(t, enableBackup, c.Config.Architecture.ExistingInfra.BackupConfig != "")
+	assert.Equal(t, useMinio, c.Config.Architecture.ExistingInfra.BackupConfig == "object_storage")
+	assert.Equal(t, backupBucketName, c.Config.ObjectStorage.Config.BucketName)
+	assert.Equal(t, backupAcessKeyId, c.Config.ObjectStorage.Config.AccessKey)
+	assert.Equal(t, backupEndpoint, c.Config.ObjectStorage.Config.Endpoint)
+	assert.Equal(t, "/mnt/automate_backups", c.Config.Architecture.ExistingInfra.BackupMount)
+}
+
+func TestOnPremPromptBackupMinioerror(t *testing.T) {
+	b := bytes.NewBuffer([]byte(""))
+	in := io.NopCloser(b)
+	enableBackup := true
+	input(b, "\r")
+
+	useMinio := true
+	input(b, moveDown+"\r")
+
+	backupBucketName := "automate-backup"
+	input(b, backupBucketName+"\r")
+
+	backupAcessKeyId := "AKEKFKEIDKETODDFEDFE"
+	input(b, backupAcessKeyId+"\r")
+
+	backupAcessKeySecret := "sdfsdflsdlfkjsdlkjeflilsfldijflsdkfjddfd"
+	input(b, backupAcessKeySecret+"\r")
+
+	backupEndpoint := "https://192.168.1.1:"
+	input(b, backupEndpoint+"\r")
+
+	mfsu := &fileutils.MockFileSystemUtils{
+		ReadFileFunc: func(filepath string) (data []byte, err error) {
+			return
+		},
+		StatFunc: func(name string) (fi os.FileInfo, err error) {
+			if name == "test.pem" {
+				fi = fileutils.MockFileInfo{IsDirFunc: func() bool { return false }}
+			} else {
+				err = errors.New("file not found")
+			}
+			return
+		},
+	}
+	outBuf := &bytes.Buffer{}
+	out := ioutils.NewNopWriteCloser(outBuf)
+	p := pmt.PromptFactory(in, out, mfsu)
+
+	c := HaDeployConfigGen{
+		Prompt:    p,
+		FileUtils: mfsu,
+		Config:    &config.HaDeployConfig{},
+	}
+
+	err := c.PromptBackup()
+
+
+	assert.Error(t, err)
+	assert.Equal(t, enableBackup, c.Config.Architecture.ExistingInfra.BackupConfig != "")
+	assert.Equal(t, useMinio, c.Config.Architecture.ExistingInfra.BackupConfig == "object_storage")
+	assert.Equal(t, backupBucketName, c.Config.ObjectStorage.Config.BucketName)
+	assert.Equal(t, backupAcessKeyId, c.Config.ObjectStorage.Config.AccessKey)
+	assert.Equal(t, "/mnt/automate_backups", c.Config.Architecture.ExistingInfra.BackupMount)
+}
+
 func TestOnPremPromptBackupNFS(t *testing.T) {
 	b := bytes.NewBuffer([]byte(""))
 	in := io.NopCloser(b)