Skip to content

Commit

Permalink
Project service: support for ca-tor region, support for auto_deploy f…
Browse files Browse the repository at this point in the history
…eature (#5418)

* regenerate terraform provider

* support ca-tor region, support auto_deploy feature
  • Loading branch information
riccardo-angelilli authored Jun 18, 2024
1 parent 4aba764 commit e0dd89a
Show file tree
Hide file tree
Showing 22 changed files with 57 additions and 28 deletions.
10 changes: 5 additions & 5 deletions .secrets.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@
"hashed_secret": "06d988e96c3d9325c9fbc7c0ef3c6c0f2b4eb8e7",
"is_secret": false,
"is_verified": false,
"line_number": 42,
"line_number": 43,
"type": "Secret Keyword",
"verified_result": null
}
Expand Down Expand Up @@ -2908,7 +2908,7 @@
"hashed_secret": "347cd9c53ff77d41a7b22aa56c7b4efaf54658e3",
"is_secret": false,
"is_verified": false,
"line_number": 65,
"line_number": 66,
"type": "Secret Keyword",
"verified_result": null
}
Expand Down Expand Up @@ -2936,7 +2936,7 @@
"hashed_secret": "347cd9c53ff77d41a7b22aa56c7b4efaf54658e3",
"is_secret": false,
"is_verified": false,
"line_number": 61,
"line_number": 62,
"type": "Secret Keyword",
"verified_result": null
}
Expand Down Expand Up @@ -2964,7 +2964,7 @@
"hashed_secret": "347cd9c53ff77d41a7b22aa56c7b4efaf54658e3",
"is_secret": false,
"is_verified": false,
"line_number": 62,
"line_number": 63,
"type": "Secret Keyword",
"verified_result": null
}
Expand Down Expand Up @@ -2992,7 +2992,7 @@
"hashed_secret": "347cd9c53ff77d41a7b22aa56c7b4efaf54658e3",
"is_secret": false,
"is_verified": false,
"line_number": 63,
"line_number": 64,
"type": "Secret Keyword",
"verified_result": null
}
Expand Down
1 change: 1 addition & 0 deletions examples/ibm-project/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ resource "ibm_project" "project_instance" {
description = "Sample static website test using the IBM catalog deployable architecture"
destroy_on_delete = true
monitoring_enabled = true
auto_deploy = true
}
}

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ require (
github.com/IBM/logs-go-sdk v0.2.1
github.com/IBM/networking-go-sdk v0.46.1
github.com/IBM/platform-services-go-sdk v0.62.11
github.com/IBM/project-go-sdk v0.3.2
github.com/IBM/project-go-sdk v0.3.4
github.com/IBM/push-notifications-go-sdk v0.0.0-20210310100607-5790b96c47f5
github.com/IBM/scc-go-sdk/v5 v5.1.6
github.com/IBM/schematics-go-sdk v0.2.3
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ github.com/IBM/networking-go-sdk v0.46.1 h1:DnnLR7YDJQRE38/nIeeD7PaKyxpoiIe/aW7N
github.com/IBM/networking-go-sdk v0.46.1/go.mod h1:yF4XStkswGgVwQVqPUk6b4YTP0dVap52q8HDYwY4gXQ=
github.com/IBM/platform-services-go-sdk v0.62.11 h1:EGsiY90bM9M9sSdBVgpsX4QK1z99JZzedVDlrY2gzmc=
github.com/IBM/platform-services-go-sdk v0.62.11/go.mod h1:M26dloj9C48k9AjfMcKGsgH/acEjaUvxjVS8z41Q8dg=
github.com/IBM/project-go-sdk v0.3.2 h1:cKz8Lh/zsHgIgZBpBAZye889njcgBHksTR0fk29vEk8=
github.com/IBM/project-go-sdk v0.3.2/go.mod h1:FOJM9ihQV3EEAY6YigcWiTNfVCThtdY8bLC/nhQHFvo=
github.com/IBM/project-go-sdk v0.3.4 h1:VJqGdrWZLlb+f5/fH5mcSpt8t0QoYEq4QgFWVnn8mCs=
github.com/IBM/project-go-sdk v0.3.4/go.mod h1:FOJM9ihQV3EEAY6YigcWiTNfVCThtdY8bLC/nhQHFvo=
github.com/IBM/push-notifications-go-sdk v0.0.0-20210310100607-5790b96c47f5 h1:NPUhkoOCRuv3OFWt19PmwjXGGTKlvmbuPg9fUrBUNe4=
github.com/IBM/push-notifications-go-sdk v0.0.0-20210310100607-5790b96c47f5/go.mod h1:b07XHUVh0XYnQE9s2mqgjYST1h9buaQNqN4EcKhOsX0=
github.com/IBM/sarama v1.41.2 h1:ZDBZfGPHAD4uuAtSv4U22fRZBgst0eEwGFzLj0fb85c=
Expand Down
8 changes: 7 additions & 1 deletion ibm/service/project/data_source_ibm_project.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the Mozilla Public License v2.0

/*
* IBM OpenAPI Terraform Generator Version: 3.90.1-64fd3296-20240515-180710
* IBM OpenAPI Terraform Generator Version: 3.91.0-d9755c53-20240605-153412
*/

package project
Expand Down Expand Up @@ -408,6 +408,11 @@ func DataSourceIbmProject() *schema.Resource {
Computed: true,
Description: "A brief explanation of the project's use in the configuration of a deployable architecture. You can create a project without providing a description.",
},
"auto_deploy": &schema.Schema{
Type: schema.TypeBool,
Computed: true,
Description: "A boolean flag to enable auto deploy.",
},
"monitoring_enabled": &schema.Schema{
Type: schema.TypeBool,
Computed: true,
Expand Down Expand Up @@ -676,6 +681,7 @@ func DataSourceIbmProjectProjectDefinitionPropertiesToMap(model *projectv1.Proje
modelMap["name"] = *model.Name
modelMap["destroy_on_delete"] = *model.DestroyOnDelete
modelMap["description"] = *model.Description
modelMap["auto_deploy"] = *model.AutoDeploy
if model.MonitoringEnabled != nil {
modelMap["monitoring_enabled"] = *model.MonitoringEnabled
}
Expand Down
2 changes: 1 addition & 1 deletion ibm/service/project/data_source_ibm_project_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the Mozilla Public License v2.0

/*
* IBM OpenAPI Terraform Generator Version: 3.90.1-64fd3296-20240515-180710
* IBM OpenAPI Terraform Generator Version: 3.91.0-d9755c53-20240605-153412
*/

package project
Expand Down
3 changes: 2 additions & 1 deletion ibm/service/project/data_source_ibm_project_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the Mozilla Public License v2.0

/*
* IBM OpenAPI Terraform Generator Version: 3.90.1-64fd3296-20240515-180710
* IBM OpenAPI Terraform Generator Version: 3.91.0-d9755c53-20240605-153412
*/

package project_test
Expand Down Expand Up @@ -53,6 +53,7 @@ func testAccCheckIbmProjectConfigDataSourceConfigBasic() string {
description = "acme-microservice description"
destroy_on_delete = true
monitoring_enabled = true
auto_deploy = false
}
}
Expand Down
2 changes: 1 addition & 1 deletion ibm/service/project/data_source_ibm_project_environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the Mozilla Public License v2.0

/*
* IBM OpenAPI Terraform Generator Version: 3.90.1-64fd3296-20240515-180710
* IBM OpenAPI Terraform Generator Version: 3.91.0-d9755c53-20240605-153412
*/

package project
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the Mozilla Public License v2.0

/*
* IBM OpenAPI Terraform Generator Version: 3.90.1-64fd3296-20240515-180710
* IBM OpenAPI Terraform Generator Version: 3.91.0-d9755c53-20240605-153412
*/

package project_test
Expand Down Expand Up @@ -48,6 +48,7 @@ func testAccCheckIbmProjectEnvironmentDataSourceConfigBasic() string {
description = "acme-microservice description"
destroy_on_delete = true
monitoring_enabled = true
auto_deploy = true
}
}
Expand Down
5 changes: 3 additions & 2 deletions ibm/service/project/data_source_ibm_project_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the Mozilla Public License v2.0

/*
* IBM OpenAPI Terraform Generator Version: 3.90.1-64fd3296-20240515-180710
* IBM OpenAPI Terraform Generator Version: 3.91.0-d9755c53-20240605-153412
*/

package project_test
Expand All @@ -17,7 +17,7 @@ import (
)

func TestAccIbmProjectDataSourceBasic(t *testing.T) {
projectLocation := fmt.Sprintf("us-south")
projectLocation := "us-south"
projectResourceGroup := fmt.Sprintf("Default")

resource.Test(t, resource.TestCase{
Expand Down Expand Up @@ -56,6 +56,7 @@ func testAccCheckIbmProjectDataSourceConfigBasic(projectLocation string, project
description = "acme-microservice description"
destroy_on_delete = true
monitoring_enabled = true
auto_deploy = true
}
}
Expand Down
21 changes: 16 additions & 5 deletions ibm/service/project/resource_ibm_project.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the Mozilla Public License v2.0

/*
* IBM OpenAPI Terraform Generator Version: 3.90.1-64fd3296-20240515-180710
* IBM OpenAPI Terraform Generator Version: 3.91.0-d9755c53-20240605-153412
*/

package project
Expand Down Expand Up @@ -67,6 +67,12 @@ func ResourceIbmProject() *schema.Resource {
Required: true,
Description: "A brief explanation of the project's use in the configuration of a deployable architecture. You can create a project without providing a description.",
},
"auto_deploy": &schema.Schema{
Type: schema.TypeBool,
Optional: true,
Default: false,
Description: "A boolean flag to enable auto deploy.",
},
"monitoring_enabled": &schema.Schema{
Type: schema.TypeBool,
Optional: true,
Expand Down Expand Up @@ -435,12 +441,10 @@ func ResourceIbmProjectValidator() *validate.ResourceValidator {
validateSchema = append(validateSchema,
validate.ValidateSchema{
Identifier: "location",
ValidateFunctionIdentifier: validate.ValidateRegexpLen,
ValidateFunctionIdentifier: validate.ValidateAllowedStringValue,
Type: validate.TypeString,
Required: true,
Regexp: `^$|^(us-south|us-east|eu-gb|eu-de)$`,
MinValueLength: 0,
MaxValueLength: 12,
AllowedValues: "ca-tor, eu-de, eu-gb, us-east, us-south",
},
validate.ValidateSchema{
Identifier: "resource_group",
Expand Down Expand Up @@ -691,6 +695,9 @@ func ResourceIbmProjectMapToProjectPrototypeDefinition(modelMap map[string]inter
if modelMap["description"] != nil && modelMap["description"].(string) != "" {
model.Description = core.StringPtr(modelMap["description"].(string))
}
if modelMap["auto_deploy"] != nil {
model.AutoDeploy = core.BoolPtr(modelMap["auto_deploy"].(bool))
}
if modelMap["monitoring_enabled"] != nil {
model.MonitoringEnabled = core.BoolPtr(modelMap["monitoring_enabled"].(bool))
}
Expand Down Expand Up @@ -918,6 +925,9 @@ func ResourceIbmProjectMapToProjectPatchDefinitionBlock(modelMap map[string]inte
if modelMap["destroy_on_delete"] != nil {
model.DestroyOnDelete = core.BoolPtr(modelMap["destroy_on_delete"].(bool))
}
if modelMap["auto_deploy"] != nil {
model.AutoDeploy = core.BoolPtr(modelMap["auto_deploy"].(bool))
}
if modelMap["description"] != nil && modelMap["description"].(string) != "" {
model.Description = core.StringPtr(modelMap["description"].(string))
}
Expand All @@ -932,6 +942,7 @@ func ResourceIbmProjectProjectDefinitionPropertiesToMap(model *projectv1.Project
modelMap["name"] = *model.Name
modelMap["destroy_on_delete"] = *model.DestroyOnDelete
modelMap["description"] = *model.Description
modelMap["auto_deploy"] = *model.AutoDeploy
if model.MonitoringEnabled != nil {
modelMap["monitoring_enabled"] = *model.MonitoringEnabled
}
Expand Down
2 changes: 1 addition & 1 deletion ibm/service/project/resource_ibm_project_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the Mozilla Public License v2.0

/*
* IBM OpenAPI Terraform Generator Version: 3.90.1-64fd3296-20240515-180710
* IBM OpenAPI Terraform Generator Version: 3.91.0-d9755c53-20240605-153412
*/

package project
Expand Down
3 changes: 2 additions & 1 deletion ibm/service/project/resource_ibm_project_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,14 @@ func TestAccIbmProjectConfigBasic(t *testing.T) {
func testAccCheckIbmProjectConfigConfigBasic() string {
return fmt.Sprintf(`
resource "ibm_project" "project_instance" {
location = "us-south"
location = "ca-tor"
resource_group = "Default"
definition {
name = "acme-microservice"
description = "acme-microservice description"
destroy_on_delete = true
monitoring_enabled = true
auto_deploy = false
}
}
Expand Down
2 changes: 1 addition & 1 deletion ibm/service/project/resource_ibm_project_environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the Mozilla Public License v2.0

/*
* IBM OpenAPI Terraform Generator Version: 3.90.1-64fd3296-20240515-180710
* IBM OpenAPI Terraform Generator Version: 3.91.0-d9755c53-20240605-153412
*/

package project
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ func testAccCheckIbmProjectEnvironmentConfigBasic() string {
description = "acme-microservice description"
destroy_on_delete = true
monitoring_enabled = true
auto_deploy = true
}
}
Expand Down
3 changes: 2 additions & 1 deletion ibm/service/project/resource_ibm_project_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (

func TestAccIbmProjectBasic(t *testing.T) {
var conf projectv1.Project
location := fmt.Sprintf("us-south")
location := "us-south"
resourceGroup := fmt.Sprintf("Default")

resource.Test(t, resource.TestCase{
Expand Down Expand Up @@ -52,6 +52,7 @@ func testAccCheckIbmProjectConfigBasic(location string, resourceGroup string) st
description = "acme-microservice description"
destroy_on_delete = true
monitoring_enabled = true
auto_deploy = true
}
}
`, location, resourceGroup)
Expand Down
2 changes: 2 additions & 0 deletions website/docs/d/project.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ Nested schema for **cumulative_needs_attention_view**:
* Constraints: The default value is `false`.
* `definition` - (List) The definition of the project.
Nested schema for **definition**:
* `auto_deploy` - (Boolean) A boolean flag to enable auto deploy.
* Constraints: The default value is `false`.
* `description` - (String) A brief explanation of the project's use in the configuration of a deployable architecture. You can create a project without providing a description.
* Constraints: The default value is `''`. The maximum length is `1024` characters. The minimum length is `0` characters. The value must match regular expression `/^$|^(?!\\s)(?!.*\\s$)[^\\x00-\\x1F]*$/`.
* `destroy_on_delete` - (Boolean) The policy that indicates whether the resources are destroyed or not when a project is deleted.
Expand Down
2 changes: 1 addition & 1 deletion website/docs/d/project_config.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Nested schema for **definition**:
* `instance_id` - (String) A unique ID for the instance of a compliance profile.
* Constraints: The maximum length is `128` characters. The value must match regular expression `/^[\\.\\-0-9a-zA-Z]+$/`.
* `instance_location` - (String) The location of the compliance instance.
* Constraints: The maximum length is `12` characters. The minimum length is `0` characters. The value must match regular expression `/^$|^(us-south|us-east|eu-gb|eu-de)$/`.
* Constraints: Allowable values are: `us-south`, `us-east`, `eu-gb`, `eu-de`, `ca-tor`.
* `profile_name` - (String) The name of the compliance profile.
* Constraints: The maximum length is `1024` characters. The minimum length is `0` characters. The value must match regular expression `/^(?!\\s)(?!.*\\s$)[^<>\\x00-\\x1F]*$/`.
* `description` - (String) A project configuration description.
Expand Down
2 changes: 1 addition & 1 deletion website/docs/d/project_environment.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Nested schema for **definition**:
* `instance_id` - (String) A unique ID for the instance of a compliance profile.
* Constraints: The maximum length is `128` characters. The value must match regular expression `/^[\\.\\-0-9a-zA-Z]+$/`.
* `instance_location` - (String) The location of the compliance instance.
* Constraints: The maximum length is `12` characters. The minimum length is `0` characters. The value must match regular expression `/^$|^(us-south|us-east|eu-gb|eu-de)$/`.
* Constraints: Allowable values are: `us-south`, `us-east`, `eu-gb`, `eu-de`, `ca-tor`.
* `profile_name` - (String) The name of the compliance profile.
* Constraints: The maximum length is `1024` characters. The minimum length is `0` characters. The value must match regular expression `/^(?!\\s)(?!.*\\s$)[^<>\\x00-\\x1F]*$/`.
* `description` - (String) The description of the environment.
Expand Down
3 changes: 3 additions & 0 deletions website/docs/r/project.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ resource "ibm_project" "project_instance" {
description = "Sample static website test using the IBM catalog deployable architecture"
destroy_on_delete = true
monitoring_enabled = true
auto_deploy = true
}
location = "us-south"
resource_group = "Default"
Expand All @@ -31,6 +32,8 @@ You can specify the following arguments for this resource.

* `definition` - (Required, List) The definition of the project.
Nested schema for **definition**:
* `auto_deploy` - (Required, Boolean) A boolean flag to enable auto deploy.
* Constraints: The default value is `false`.
* `description` - (Required, String) A brief explanation of the project's use in the configuration of a deployable architecture. You can create a project without providing a description.
* Constraints: The default value is `''`. The maximum length is `1024` characters. The minimum length is `0` characters. The value must match regular expression `/^$|^(?!\\s)(?!.*\\s$)[^\\x00-\\x1F]*$/`.
* `destroy_on_delete` - (Required, Boolean) The policy that indicates whether the resources are destroyed or not when a project is deleted.
Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/project_config.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Nested schema for **definition**:
* `instance_id` - (Optional, String) A unique ID for the instance of a compliance profile.
* Constraints: The maximum length is `128` characters. The value must match regular expression `/^[\\.\\-0-9a-zA-Z]+$/`.
* `instance_location` - (Optional, String) The location of the compliance instance.
* Constraints: The maximum length is `12` characters. The minimum length is `0` characters. The value must match regular expression `/^$|^(us-south|us-east|eu-gb|eu-de)$/`.
* Constraints: Allowable values are: `us-south`, `us-east`, `eu-gb`, `eu-de`, `ca-tor`.
* `profile_name` - (Optional, String) The name of the compliance profile.
* Constraints: The maximum length is `1024` characters. The minimum length is `0` characters. The value must match regular expression `/^(?!\\s)(?!.*\\s$)[^<>\\x00-\\x1F]*$/`.
* `description` - (Optional, String) A project configuration description.
Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/project_environment.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Nested schema for **definition**:
* `instance_id` - (Optional, String) A unique ID for the instance of a compliance profile.
* Constraints: The maximum length is `128` characters. The value must match regular expression `/^[\\.\\-0-9a-zA-Z]+$/`.
* `instance_location` - (Optional, String) The location of the compliance instance.
* Constraints: The maximum length is `12` characters. The minimum length is `0` characters. The value must match regular expression `/^$|^(us-south|us-east|eu-gb|eu-de)$/`.
* Constraints: Allowable values are: `us-south`, `us-east`, `eu-gb`, `eu-de`, `ca-tor`.
* `profile_name` - (Optional, String) The name of the compliance profile.
* Constraints: The maximum length is `1024` characters. The minimum length is `0` characters. The value must match regular expression `/^(?!\\s)(?!.*\\s$)[^<>\\x00-\\x1F]*$/`.
* `description` - (Required, String) The description of the environment.
Expand Down

0 comments on commit e0dd89a

Please sign in to comment.