Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MongoDBEE Sharding Phase 1 #4610

Merged
merged 9 commits into from
Sep 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 36 additions & 18 deletions .secrets.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"files": "go.mod|go.sum|.*.map|^.secrets.baseline$",
"lines": null
},
"generated_at": "2023-08-29T14:07:58Z",
"generated_at": "2023-09-01T17:36:43Z",
"plugins_used": [
{
"name": "AWSKeyDetector"
Expand Down Expand Up @@ -826,15 +826,15 @@
"hashed_secret": "c8b6f5ef11b9223ac35a5663975a466ebe7ebba9",
"is_secret": false,
"is_verified": false,
"line_number": 1715,
"line_number": 1730,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "8abf4899c01104241510ba87685ad4de76b0c437",
"is_secret": false,
"is_verified": false,
"line_number": 1721,
"line_number": 1736,
"type": "Secret Keyword",
"verified_result": null
}
Expand Down Expand Up @@ -1116,7 +1116,7 @@
"hashed_secret": "3046d9f6cfaaeea6eed9bb7a4ab010fe49b0cfd4",
"is_secret": false,
"is_verified": false,
"line_number": 395,
"line_number": 400,
"type": "Secret Keyword",
"verified_result": null
}
Expand All @@ -1126,15 +1126,15 @@
"hashed_secret": "3046d9f6cfaaeea6eed9bb7a4ab010fe49b0cfd4",
"is_secret": false,
"is_verified": false,
"line_number": 218,
"line_number": 223,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "17f5f58d3d8d9871c52ab032989df3d810d2443e",
"is_secret": false,
"is_verified": false,
"line_number": 369,
"line_number": 378,
"type": "Secret Keyword",
"verified_result": null
}
Expand All @@ -1144,7 +1144,7 @@
"hashed_secret": "3046d9f6cfaaeea6eed9bb7a4ab010fe49b0cfd4",
"is_secret": false,
"is_verified": false,
"line_number": 444,
"line_number": 460,
"type": "Secret Keyword",
"verified_result": null
}
Expand All @@ -1154,15 +1154,15 @@
"hashed_secret": "3046d9f6cfaaeea6eed9bb7a4ab010fe49b0cfd4",
"is_secret": false,
"is_verified": false,
"line_number": 88,
"line_number": 189,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "b732fb611fd46a38e8667f9972e0cde777fbe37f",
"is_secret": false,
"is_verified": false,
"line_number": 451,
"line_number": 523,
"type": "Secret Keyword",
"verified_result": null
}
Expand Down Expand Up @@ -2050,31 +2050,31 @@
"hashed_secret": "deab23f996709b4e3d14e5499d1cc2de677bfaa8",
"is_secret": false,
"is_verified": false,
"line_number": 1551,
"line_number": 1560,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "20a25bac21219ffff1904bde871ded4027eca2f8",
"is_secret": false,
"is_verified": false,
"line_number": 2204,
"line_number": 2213,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "b732fb611fd46a38e8667f9972e0cde777fbe37f",
"is_secret": false,
"is_verified": false,
"line_number": 2223,
"line_number": 2232,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "1f5e25be9b575e9f5d39c82dfd1d9f4d73f1975c",
"is_secret": false,
"is_verified": false,
"line_number": 2488,
"line_number": 2497,
"type": "Secret Keyword",
"verified_result": null
}
Expand Down Expand Up @@ -2137,6 +2137,24 @@
"verified_result": null
}
],
"ibm/service/database/resource_ibm_database_mongodb_sharding_test.go": [
{
"hashed_secret": "75074b1c70e165b25d1a07655ce513f0053018dc",
"is_secret": false,
"is_verified": false,
"line_number": 141,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "10c28f9cf0668595d45c1090a7b4a2ae98edfa58",
"is_secret": false,
"is_verified": false,
"line_number": 173,
"type": "Secret Keyword",
"verified_result": null
}
],
"ibm/service/database/resource_ibm_database_mongodb_test.go": [
{
"hashed_secret": "10c28f9cf0668595d45c1090a7b4a2ae98edfa58",
Expand Down Expand Up @@ -3790,15 +3808,15 @@
"hashed_secret": "d47dcacc720a39e236679ac3e311a0d58bb6519e",
"is_secret": false,
"is_verified": false,
"line_number": 223,
"line_number": 227,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "e66e7d67fdf3c596c435fc7828b13205e4950a0f",
"is_secret": false,
"is_verified": false,
"line_number": 225,
"line_number": 229,
"type": "Secret Keyword",
"verified_result": null
}
Expand Down Expand Up @@ -3844,15 +3862,15 @@
"hashed_secret": "d47dcacc720a39e236679ac3e311a0d58bb6519e",
"is_secret": false,
"is_verified": false,
"line_number": 148,
"line_number": 161,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "e66e7d67fdf3c596c435fc7828b13205e4950a0f",
"is_secret": false,
"is_verified": false,
"line_number": 150,
"line_number": 163,
"type": "Secret Keyword",
"verified_result": null
}
Expand Down Expand Up @@ -5068,7 +5086,7 @@
}
]
},
"version": "0.13.1+ibm.47.dss",
"version": "0.13.1+ibm.61.dss",
"word_list": {
"file": null,
"hash": null
Expand Down
12 changes: 10 additions & 2 deletions ibm/service/database/resource_ibm_database.go
Original file line number Diff line number Diff line change
Expand Up @@ -907,7 +907,7 @@ func ResourceIBMICDValidator() *validate.ResourceValidator {
Identifier: "plan",
ValidateFunctionIdentifier: validate.ValidateAllowedStringValue,
Type: validate.TypeString,
AllowedValues: "standard, enterprise",
AllowedValues: "standard, enterprise, enterprise-sharding",
Required: true})
validateSchema = append(validateSchema,
validate.ValidateSchema{
Expand Down Expand Up @@ -985,6 +985,10 @@ func getDefaultScalingGroups(_service string, _plan string, meta interface{}) (g
service = "mongodbee"
}

if service == "mongodb" && _plan == "enterprise-sharding" {
service = "mongodbees"
}

getDefaultScalingGroupsOptions := cloudDatabasesClient.NewGetDefaultScalingGroupsOptions(service)

getDefaultScalingGroupsResponse, _, err := cloudDatabasesClient.GetDefaultScalingGroups(getDefaultScalingGroupsOptions)
Expand Down Expand Up @@ -1307,7 +1311,11 @@ func resourceIBMDatabaseInstanceCreate(context context.Context, d *schema.Resour

deployments, err := rsCatRepo.ListDeployments(servicePlan)
if err != nil {
return diag.FromErr(fmt.Errorf("[ERROR] Error retrieving deployment for plan %s : %s", plan, err))
if serviceName == "databases-for-mongodb" && plan == "enterprise-sharding" {
return diag.FromErr(fmt.Errorf("%s %s is not available yet in this region", serviceName, plan))
} else {
return diag.FromErr(fmt.Errorf("[ERROR] Error retrieving deployment for plan %s : %s", plan, err))
}
}
if len(deployments) == 0 {
return diag.FromErr(fmt.Errorf("[ERROR] No deployment found for service plan : %s", plan))
Expand Down
Loading