From c8867113635aa712655482b4eab5cef59888f98a Mon Sep 17 00:00:00 2001 From: dvesperini Date: Thu, 11 May 2023 06:39:42 +0200 Subject: [PATCH] New code for project service (#4561) * fix: generate project code Signed-off-by: dvesperini * fix: fix build Signed-off-by: dvesperini * fix: add examples and markdown files Signed-off-by: dvesperini * fix: mark new false positive secrets Signed-off-by: dvesperini * fix: fix review Signed-off-by: dvesperini * fix: fix links Signed-off-by: dvesperini * fix: fix test Signed-off-by: dvesperini * fix: remove regex check Signed-off-by: dvesperini * fix: fix id to project_id Signed-off-by: dvesperini * fix: fix integration test project Signed-off-by: dvesperini * fix: fix resource_group values Signed-off-by: dvesperini * fix: last changes Signed-off-by: dvesperini * fix integration test * fix integration test * fix integration test * fix integration test * fix integration test * fix integration test * fix name * pr comments * pr comments * fix doc * fix doc * new version * new version * new version * new version * update code to the latest SDK level * fix integration tests * fix integration tests * fix integration tests * fix integration tests * address PR comment --------- Signed-off-by: dvesperini Co-authored-by: Riccardo Angelilli --- examples/ibm-project/README.md | 12 +-- examples/ibm-project/main.tf | 5 +- examples/ibm-project/outputs.tf | 2 +- examples/ibm-project/variables.tf | 12 +-- go.mod | 4 +- go.sum | 10 +- ...a_source_ibm_project_event_notification.go | 51 ++++------ ...rce_ibm_project_event_notification_test.go | 25 +++-- .../project/resource_ibm_project_instance.go | 94 +++++++++++++------ .../resource_ibm_project_instance_test.go | 44 ++++++--- .../project_event_notification.html.markdown | 46 ++++----- website/docs/r/project_instance.html.markdown | 46 +++++---- 12 files changed, 190 insertions(+), 161 deletions(-) diff --git a/examples/ibm-project/README.md b/examples/ibm-project/README.md index ecbb9fffc2..010899110e 100644 --- a/examples/ibm-project/README.md +++ b/examples/ibm-project/README.md @@ -24,7 +24,7 @@ Run `terraform destroy` when you don't need these resources. project_instance resource: ```hcl -resource "project_instance" "project_instance_instance" { +resource "project_instance" "project_instance" { name = var.project_instance_name description = var.project_instance_description configs = var.project_instance_configs @@ -40,8 +40,6 @@ project_event_notification data source: ```hcl data "project_event_notification" "project_event_notification_instance" { id = var.project_event_notification_id - exclude_configs = var.project_event_notification_exclude_configs - complete = var.project_event_notification_complete } ``` @@ -73,11 +71,9 @@ data "project_event_notification" "project_event_notification_instance" { | name | The project name. | `string` | true | | description | A project's descriptive text. | `string` | false | | configs | The project configurations. | `list()` | false | -| resource_group | Group name of the customized collection of resources. | `string` | false | -| location | Data center locations for resource deployment. | `string` | false | -| id | The ID of the project, which uniquely identifies it. | `string` | true | -| exclude_configs | Only return with the active configuration, no drafts. | `bool` | false | -| complete | The flag to determine if full metadata should be returned. | `bool` | false | +| resource_group | The resource group where the project's data and tools are created. | `string` | true | +| location | The location where the project's data and tools are created. | `string` | true | +| project_id | The unique project ID. | `string` | true | ## Outputs diff --git a/examples/ibm-project/main.tf b/examples/ibm-project/main.tf index 7a3d974e9f..d3348263c7 100644 --- a/examples/ibm-project/main.tf +++ b/examples/ibm-project/main.tf @@ -7,7 +7,6 @@ resource "ibm_project_instance" "project_instance" { name = "My static website" description = "Sample static website test using the IBM catalog deployable architecture" configs { - id = "0013790d-6cb5-4adc-8927-a725a1261d0c" name = "static-website-dev" labels = [ "env:dev", "billing:internal" ] description = "Website - development" @@ -29,8 +28,6 @@ resource "ibm_project_instance" "project_instance" { /* // Create project_event_notification data source data "ibm_project_event_notification" "project_event_notification_instance" { - id = var.project_event_notification_id - exclude_configs = var.project_event_notification_exclude_configs - complete = var.project_event_notification_complete + project_id = var.project_event_notification_id } */ diff --git a/examples/ibm-project/outputs.tf b/examples/ibm-project/outputs.tf index 45d917b875..8a59bbf786 100644 --- a/examples/ibm-project/outputs.tf +++ b/examples/ibm-project/outputs.tf @@ -1,6 +1,6 @@ // This allows project_instance data to be referenced by other resources and the terraform CLI // Modify this if only certain data should be exposed output "ibm_project_instance" { - value = ibm_project_instance.project_instance_instance + value = ibm_project_instance.project_instance description = "project_instance resource instance" } diff --git a/examples/ibm-project/variables.tf b/examples/ibm-project/variables.tf index e6ac2ae7e5..240c070647 100644 --- a/examples/ibm-project/variables.tf +++ b/examples/ibm-project/variables.tf @@ -27,17 +27,7 @@ variable "project_instance_location" { // Data source arguments for project_event_notification variable "project_event_notification_id" { - description = "The ID of the project, which uniquely identifies it." + description = "The unique project ID." type = string default = "id" } -variable "project_event_notification_exclude_configs" { - description = "Only return with the active configuration, no drafts." - type = bool - default = false -} -variable "project_event_notification_complete" { - description = "The flag to determine if full metadata should be returned." - type = bool - default = false -} diff --git a/go.mod b/go.mod index 0c680b052a..345b4c243b 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/IBM/continuous-delivery-go-sdk v1.1.0 github.com/IBM/event-notifications-go-admin-sdk v0.2.1 github.com/IBM/eventstreams-go-sdk v1.2.0 - github.com/IBM/go-sdk-core/v5 v5.13.0 + github.com/IBM/go-sdk-core/v5 v5.13.1 github.com/IBM/ibm-cos-sdk-go v1.10.0 github.com/IBM/ibm-cos-sdk-go-config v1.2.0 github.com/IBM/ibm-hpcs-tke-sdk v0.0.0-20211109141421-a4b61b05f7d1 @@ -58,12 +58,12 @@ require ( require ( github.com/IBM/go-sdk-core/v3 v3.2.4 + github.com/IBM/project-go-sdk v0.0.10 github.com/pkg/errors v0.9.1 gopkg.in/yaml.v3 v3.0.1 ) require ( - github.com/IBM/project-go-sdk v0.0.0-20230405195937-52b52b875b03 // indirect github.com/Logicalis/asn1 v0.0.0-20190312173541-d60463189a56 // indirect github.com/PromonLogicalis/asn1 v0.0.0-20190312173541-d60463189a56 // indirect github.com/PuerkitoBio/purell v1.1.1 // indirect diff --git a/go.sum b/go.sum index 7ae33aa866..c3ed966a7f 100644 --- a/go.sum +++ b/go.sum @@ -74,8 +74,8 @@ github.com/IBM/go-sdk-core/v5 v5.7.0/go.mod h1:+YbdhrjCHC84ls4MeBp+Hj4NZCni+tDAc github.com/IBM/go-sdk-core/v5 v5.9.2/go.mod h1:YlOwV9LeuclmT/qi/LAK2AsobbAP42veV0j68/rlZsE= github.com/IBM/go-sdk-core/v5 v5.9.5/go.mod h1:YlOwV9LeuclmT/qi/LAK2AsobbAP42veV0j68/rlZsE= github.com/IBM/go-sdk-core/v5 v5.10.2/go.mod h1:WZPFasUzsKab/2mzt29xPcfruSk5js2ywAPwW4VJjdI= -github.com/IBM/go-sdk-core/v5 v5.13.0 h1:foXLa2LfTSr3kgldpizaSDXH3gS/HB3YKj1BK8ywrE4= -github.com/IBM/go-sdk-core/v5 v5.13.0/go.mod h1:pVkN7IGmsSdmR1ZCU4E/cLcCclqRKMYgg7ya+O2Mk6g= +github.com/IBM/go-sdk-core/v5 v5.13.1 h1:zD6p3t1whAlRJo/VBmE69c8RcH9LCHL1n0/sO1MWlpw= +github.com/IBM/go-sdk-core/v5 v5.13.1/go.mod h1:pVkN7IGmsSdmR1ZCU4E/cLcCclqRKMYgg7ya+O2Mk6g= github.com/IBM/ibm-cos-sdk-go v1.3.1/go.mod h1:YLBAYobEA8bD27P7xpMwSQeNQu6W3DNBtBComXrRzRY= github.com/IBM/ibm-cos-sdk-go v1.10.0 h1:/2VIev2/jBei39OqU2+nSZQnoWJ+KtkiSAIDkqsd7uU= github.com/IBM/ibm-cos-sdk-go v1.10.0/go.mod h1:C8KRTRaoD3CWPPBOa6FCOpdh0ZMlUjKAAA4i3F+Q/sc= @@ -91,8 +91,8 @@ github.com/IBM/networking-go-sdk v0.40.0 h1:NdHTG0YXtN2D/B62BRgy6iJRFLdiJtSFCdTz github.com/IBM/networking-go-sdk v0.40.0/go.mod h1:lTUZwtUkMANMnrLHFIgRhHrkBfwASY/Iho1fabaPHxo= github.com/IBM/platform-services-go-sdk v0.34.0 h1:ozGdyWdBByNS8sw07FP4qx2r1qUc59D0BoN3rMTgtIk= github.com/IBM/platform-services-go-sdk v0.34.0/go.mod h1:oFW/DQyAXGBcGytB+DtKjE3yNdEGM2bmw5SDOjrRwTw= -github.com/IBM/project-go-sdk v0.0.0-20230405195937-52b52b875b03 h1:mpz4CSzFeqfWSx+rP55n1afeZeACDcZGvtud2fY1KKA= -github.com/IBM/project-go-sdk v0.0.0-20230405195937-52b52b875b03/go.mod h1:yO1Pqm7Y9hWrn6eUlfPKwipqFAbvp9QeuLRb07H3/Ks= +github.com/IBM/project-go-sdk v0.0.10 h1:vHSuemwZ4S4c6BEb22tzsEcPTs/5LnZ0yKpP3GG/GL8= +github.com/IBM/project-go-sdk v0.0.10/go.mod h1:lqe0M4cKvABI1iHR1b+KfasVcxQL6nl2VJ8eOyQs8Ig= 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/scc-go-sdk/v3 v3.1.6 h1:wg7yujuJJ1O1pcGrIn8ITq6i6GeXb7GRBPNq6kLrkMU= @@ -792,8 +792,6 @@ go.mongodb.org/mongo-driver v1.7.0/go.mod h1:Q4oFMbo1+MSNqICAdYMlC/zSTrwCogR4R8N go.mongodb.org/mongo-driver v1.7.3/go.mod h1:NqaYOwnXWr5Pm7AOpO5QFxKJ503nbMse/R79oO62zWg= go.mongodb.org/mongo-driver v1.7.5/go.mod h1:VXEWRZ6URJIkUq2SCAyapmhH0ZLRBP+FT4xhp5Zvxng= go.mongodb.org/mongo-driver v1.10.0/go.mod h1:wsihk0Kdgv8Kqu1Anit4sfK+22vSFbUrAVEYRhCXrA8= -go.mongodb.org/mongo-driver v1.11.2 h1:+1v2rDQUWNcGW7/7E0Jvdz51V38XXxJfhzbV17aNHCw= -go.mongodb.org/mongo-driver v1.11.2/go.mod h1:s7p5vEtfbeR1gYi6pnj3c3/urpbLv2T5Sfd6Rp2HBB8= go.mongodb.org/mongo-driver v1.11.3 h1:Ql6K6qYHEzB6xvu4+AU0BoRoqf9vFPcc4o7MUIdPW8Y= go.mongodb.org/mongo-driver v1.11.3/go.mod h1:PTSz5yu21bkT/wXpkS7WR5f0ddqw5quethTUn9WM+2g= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= diff --git a/ibm/service/project/data_source_ibm_project_event_notification.go b/ibm/service/project/data_source_ibm_project_event_notification.go index 07e9ce6000..7ffac8fd48 100644 --- a/ibm/service/project/data_source_ibm_project_event_notification.go +++ b/ibm/service/project/data_source_ibm_project_event_notification.go @@ -24,19 +24,7 @@ func DataSourceIbmProjectEventNotification() *schema.Resource { "project_id": &schema.Schema{ Type: schema.TypeString, Required: true, - Description: "The ID of the project, which uniquely identifies it.", - }, - "exclude_configs": &schema.Schema{ - Type: schema.TypeBool, - Optional: true, - Default: false, - Description: "Only return with the active configuration, no drafts.", - }, - "complete": &schema.Schema{ - Type: schema.TypeBool, - Optional: true, - Default: false, - Description: "The flag to determine if full metadata should be returned.", + Description: "The unique project ID.", }, "name": &schema.Schema{ Type: schema.TypeString, @@ -62,7 +50,7 @@ func DataSourceIbmProjectEventNotification() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeString, Computed: true, - Description: "The unique ID of a project.", + Description: "The ID of the configuration. If this parameter is empty, an ID is automatically created for the configuration.", }, "name": &schema.Schema{ Type: schema.TypeString, @@ -85,7 +73,7 @@ func DataSourceIbmProjectEventNotification() *schema.Resource { "locator_id": &schema.Schema{ Type: schema.TypeString, Computed: true, - Description: "The location ID of a project configuration manual property.", + Description: "A dotted value of catalogID.versionID.", }, "type": &schema.Schema{ Type: schema.TypeString, @@ -108,6 +96,11 @@ func DataSourceIbmProjectEventNotification() *schema.Resource { Computed: true, Description: "The variable type.", }, + "value": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Can be any value - a string, number, boolean, array, or object.", + }, "required": &schema.Schema{ Type: schema.TypeBool, Computed: true, @@ -133,12 +126,9 @@ func DataSourceIbmProjectEventNotification() *schema.Resource { Description: "A short explanation of the output value.", }, "value": &schema.Schema{ - Type: schema.TypeList, + Type: schema.TypeString, Computed: true, - Description: "The output value.", - Elem: &schema.Schema{ - Type: schema.TypeString, - }, + Description: "Can be any value - a string, number, boolean, array, or object.", }, }, }, @@ -146,7 +136,7 @@ func DataSourceIbmProjectEventNotification() *schema.Resource { "setting": &schema.Schema{ Type: schema.TypeList, Computed: true, - Description: "An optional setting object that's passed to the cart API.", + Description: "Schematics environment variables to use to deploy the configuration.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "name": &schema.Schema{ @@ -157,7 +147,7 @@ func DataSourceIbmProjectEventNotification() *schema.Resource { "value": &schema.Schema{ Type: schema.TypeString, Computed: true, - Description: "The value of a the configuration setting.", + Description: "The value of the configuration setting.", }, }, }, @@ -179,7 +169,7 @@ func DataSourceIbmProjectEventNotification() *schema.Resource { "created_at": &schema.Schema{ Type: schema.TypeString, Computed: true, - Description: "A date/time value in the format YYYY-MM-DDTHH:mm:ssZ or YYYY-MM-DDTHH:mm:ss.sssZ, matching the date-time format as specified by RFC 3339.", + Description: "A date and time value in the format YYYY-MM-DDTHH:mm:ssZ or YYYY-MM-DDTHH:mm:ss.sssZ, matching the date and time format as specified by RFC 3339.", }, "cumulative_needs_attention_view": &schema.Schema{ Type: schema.TypeList, @@ -218,12 +208,12 @@ func DataSourceIbmProjectEventNotification() *schema.Resource { "location": &schema.Schema{ Type: schema.TypeString, Computed: true, - Description: "The location where the project was created.", + Description: "The IBM Cloud location where a resource is deployed.", }, "resource_group": &schema.Schema{ Type: schema.TypeString, Computed: true, - Description: "The resource group where the project was created.", + Description: "The resource group where the project's data and tools are created.", }, "state": &schema.Schema{ Type: schema.TypeString, @@ -251,12 +241,6 @@ func dataSourceIbmProjectEventNotificationRead(context context.Context, d *schem getProjectOptions := &projectv1.GetProjectOptions{} getProjectOptions.SetID(d.Get("project_id").(string)) - if _, ok := d.GetOk("exclude_configs"); ok { - getProjectOptions.SetExcludeConfigs(d.Get("exclude_configs").(bool)) - } - if _, ok := d.GetOk("complete"); ok { - getProjectOptions.SetComplete(d.Get("complete").(bool)) - } project, response, err := projectClient.GetProjectWithContext(context, getProjectOptions) if err != nil { @@ -310,7 +294,7 @@ func dataSourceIbmProjectEventNotificationRead(context context.Context, d *schem func dataSourceIbmProjectEventNotificationProjectConfigToMap(model *projectv1.ProjectConfig) (map[string]interface{}, error) { modelMap := make(map[string]interface{}) if model.ID != nil { - modelMap["id"] = model.ID + modelMap["project_id"] = model.ID } if model.Name != nil { modelMap["name"] = model.Name @@ -371,6 +355,9 @@ func dataSourceIbmProjectEventNotificationInputVariableToMap(model *projectv1.In if model.Type != nil { modelMap["type"] = model.Type } + if model.Value != nil { + modelMap["value"] = model.Value + } if model.Required != nil { modelMap["required"] = model.Required } diff --git a/ibm/service/project/data_source_ibm_project_event_notification_test.go b/ibm/service/project/data_source_ibm_project_event_notification_test.go index 3abc12706f..a4bb083448 100644 --- a/ibm/service/project/data_source_ibm_project_event_notification_test.go +++ b/ibm/service/project/data_source_ibm_project_event_notification_test.go @@ -15,13 +15,15 @@ import ( func TestAccIbmProjectEventNotificationDataSourceBasic(t *testing.T) { projectName := fmt.Sprintf("tf_name_%d", acctest.RandIntRange(10, 100)) + projectResourceGroup := fmt.Sprintf("Default") + projectLocation := fmt.Sprintf("us-south") resource.Test(t, resource.TestCase{ PreCheck: func() { acc.TestAccPreCheck(t) }, Providers: acc.TestAccProviders, Steps: []resource.TestStep{ resource.TestStep{ - Config: testAccCheckIbmProjectEventNotificationDataSourceConfigBasic(projectName), + Config: testAccCheckIbmProjectEventNotificationDataSourceConfigBasic(projectResourceGroup, projectLocation, projectName), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttrSet("data.ibm_project_event_notification.project_event_notification", "project_id"), resource.TestCheckResourceAttrSet("data.ibm_project_event_notification.project_event_notification", "name"), @@ -45,8 +47,6 @@ func TestAccIbmProjectEventNotificationDataSourceAllArgs(t *testing.T) { Config: testAccCheckIbmProjectEventNotificationDataSourceConfig(projectName, projectDescription, projectResourceGroup, projectLocation), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttrSet("data.ibm_project_event_notification.project_event_notification", "project_id"), - resource.TestCheckResourceAttrSet("data.ibm_project_event_notification.project_event_notification", "exclude_configs"), - resource.TestCheckResourceAttrSet("data.ibm_project_event_notification.project_event_notification", "complete"), resource.TestCheckResourceAttrSet("data.ibm_project_event_notification.project_event_notification", "name"), resource.TestCheckResourceAttrSet("data.ibm_project_event_notification.project_event_notification", "description"), resource.TestCheckResourceAttrSet("data.ibm_project_event_notification.project_event_notification", "metadata.#"), @@ -56,27 +56,26 @@ func TestAccIbmProjectEventNotificationDataSourceAllArgs(t *testing.T) { }) } -func testAccCheckIbmProjectEventNotificationDataSourceConfigBasic(projectName string) string { +func testAccCheckIbmProjectEventNotificationDataSourceConfigBasic(projectResourceGroup string, projectLocation string, projectName string) string { return fmt.Sprintf(` - resource "ibm_project_instance" "project_instance_instance" { + resource "ibm_project_instance" "project_instance" { + resource_group = "%s" + location = "%s" name = "%s" } data "ibm_project_event_notification" "project_event_notification" { - project_id = ibm_project_instance.project_instance_instance.id - exclude_configs = false - complete = true + project_id = ibm_project_instance.project_instance.id } - `, projectName) + `, projectResourceGroup, projectLocation, projectName) } func testAccCheckIbmProjectEventNotificationDataSourceConfig(projectName string, projectDescription string, projectResourceGroup string, projectLocation string) string { return fmt.Sprintf(` - resource "ibm_project_instance" "project_instance_instance" { + resource "ibm_project_instance" "project_instance" { name = "%s" description = "%s" configs { - id = "0013790d-6cb5-4adc-8927-a725a1261d0c" name = "name" labels = [ "labels" ] description = "description" @@ -94,9 +93,7 @@ func testAccCheckIbmProjectEventNotificationDataSourceConfig(projectName string, } data "ibm_project_event_notification" "project_event_notification" { - project_id = ibm_project_instance.project_instance_instance.id - exclude_configs = false - complete = true + project_id = ibm_project_instance.project_instance.id } `, projectName, projectDescription, projectResourceGroup, projectLocation) } diff --git a/ibm/service/project/resource_ibm_project_instance.go b/ibm/service/project/resource_ibm_project_instance.go index 4956aaaaa9..2d4c5af5a4 100644 --- a/ibm/service/project/resource_ibm_project_instance.go +++ b/ibm/service/project/resource_ibm_project_instance.go @@ -14,7 +14,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" - "github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex" "github.com/IBM-Cloud/terraform-provider-ibm/ibm/validate" "github.com/IBM/go-sdk-core/v5/core" "github.com/IBM/project-go-sdk/projectv1" @@ -53,7 +52,7 @@ func ResourceIbmProjectInstance() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeString, Optional: true, - Description: "The unique ID of a project.", + Description: "The ID of the configuration. If this parameter is empty, an ID is automatically created for the configuration.", }, "name": &schema.Schema{ Type: schema.TypeString, @@ -74,12 +73,12 @@ func ResourceIbmProjectInstance() *schema.Resource { "locator_id": &schema.Schema{ Type: schema.TypeString, Required: true, - Description: "The location ID of a project configuration manual property.", + Description: "A dotted value of catalogID.versionID.", }, "input": &schema.Schema{ Type: schema.TypeList, Optional: true, - Description: "The inputs of a Schematics template property.", + Description: "The input values to use to deploy the configuration.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "name": &schema.Schema{ @@ -87,13 +86,18 @@ func ResourceIbmProjectInstance() *schema.Resource { Required: true, Description: "The variable name.", }, + "value": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Description: "Can be any value - a string, number, boolean, array, or object.", + }, }, }, }, "setting": &schema.Schema{ Type: schema.TypeList, Optional: true, - Description: "An optional setting object that's passed to the cart API.", + Description: "Schematics environment variables to use to deploy the configuration.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "name": &schema.Schema{ @@ -104,7 +108,7 @@ func ResourceIbmProjectInstance() *schema.Resource { "value": &schema.Schema{ Type: schema.TypeString, Required: true, - Description: "The value of a the configuration setting.", + Description: "The value of the configuration setting.", }, }, }, @@ -114,15 +118,13 @@ func ResourceIbmProjectInstance() *schema.Resource { }, "resource_group": &schema.Schema{ Type: schema.TypeString, - Optional: true, - Default: "Default", - Description: "Group name of the customized collection of resources.", + Required: true, + Description: "The resource group where the project's data and tools are created.", }, "location": &schema.Schema{ Type: schema.TypeString, - Optional: true, - Default: "us-south", - Description: "Data center locations for resource deployment.", + Required: true, + Description: "The location where the project's data and tools are created.", }, "crn": &schema.Schema{ Type: schema.TypeString, @@ -143,7 +145,7 @@ func ResourceIbmProjectInstance() *schema.Resource { "created_at": &schema.Schema{ Type: schema.TypeString, Computed: true, - Description: "A date/time value in the format YYYY-MM-DDTHH:mm:ssZ or YYYY-MM-DDTHH:mm:ss.sssZ, matching the date-time format as specified by RFC 3339.", + Description: "A date and time value in the format YYYY-MM-DDTHH:mm:ssZ or YYYY-MM-DDTHH:mm:ss.sssZ, matching the date and time format as specified by RFC 3339.", }, "cumulative_needs_attention_view": &schema.Schema{ Type: schema.TypeList, @@ -182,12 +184,12 @@ func ResourceIbmProjectInstance() *schema.Resource { "location": &schema.Schema{ Type: schema.TypeString, Computed: true, - Description: "The location where the project was created.", + Description: "The IBM Cloud location where a resource is deployed.", }, "resource_group": &schema.Schema{ Type: schema.TypeString, Computed: true, - Description: "The resource group where the project was created.", + Description: "The resource group where the project's data and tools are created.", }, "state": &schema.Schema{ Type: schema.TypeString, @@ -213,7 +215,7 @@ func ResourceIbmProjectInstanceValidator() *validate.ResourceValidator { Identifier: "name", Type: validate.TypeString, Required: true, - Regexp: `^(?!\s).+\S$`, + Regexp: `^(?!\s)(?!.*\s$)[^'"<>{}\x00-\x1F]+$`, MinValueLength: 1, MaxValueLength: 64, }, @@ -228,15 +230,15 @@ func ResourceIbmProjectInstanceValidator() *validate.ResourceValidator { validate.ValidateSchema{ Identifier: "resource_group", Type: validate.TypeString, - Optional: true, - Regexp: `^$|^(?!\s).*\S$`, + Required: true, + Regexp: `^$|^(?!\s)(?!.*\s$)[^'"<>{}\x00-\x1F]*$`, MinValueLength: 0, MaxValueLength: 40, }, validate.ValidateSchema{ Identifier: "location", Type: validate.TypeString, - Optional: true, + Required: true, Regexp: `^$|^(us-south|us-east|eu-gb|eu-de)$`, MinValueLength: 0, MaxValueLength: 12, @@ -351,20 +353,28 @@ func resourceIbmProjectInstanceRead(context context.Context, d *schema.ResourceD return diag.FromErr(fmt.Errorf("Error setting crn: %s", err)) } } - if !core.IsNil(project.Name) { - if err = d.Set("name", project.Name); err != nil { - return diag.FromErr(fmt.Errorf("Error setting name: %s", err)) + if err = d.Set("name", project.Name); err != nil { + return diag.FromErr(fmt.Errorf("Error setting name: %s", err)) + } + if !core.IsNil(project.Description) { + if err = d.Set("description", project.Description); err != nil { + return diag.FromErr(fmt.Errorf("Error setting description: %s", err)) + } + } + if !core.IsNil(project.Configs) { + configs := []map[string]interface{}{} + if err = d.Set("configs", configs); err != nil { + return diag.FromErr(fmt.Errorf("Error setting configs: %s", err)) } } - metadataMap := make(map[string]interface{}) if !core.IsNil(project.Metadata) { - metadataMap, err = resourceIbmProjectInstanceProjectMetadataToMap(project.Metadata) + metadataMap, err := resourceIbmProjectInstanceProjectMetadataToMap(project.Metadata) if err != nil { return diag.FromErr(err) } - } - if err = d.Set("metadata", []map[string]interface{}{metadataMap}); err != nil { - return diag.FromErr(fmt.Errorf("Error setting metadata: %s", err)) + if err = d.Set("metadata", []map[string]interface{}{metadataMap}); err != nil { + return diag.FromErr(fmt.Errorf("Error setting metadata: %s", err)) + } } return nil @@ -382,6 +392,27 @@ func resourceIbmProjectInstanceUpdate(context context.Context, d *schema.Resourc hasChange := false + if d.HasChange("name") { + updateProjectOptions.SetName(d.Get("name").(string)) + hasChange = true + } + if d.HasChange("description") { + updateProjectOptions.SetDescription(d.Get("description").(string)) + hasChange = true + } + if d.HasChange("configs") { + var configs []projectv1.ProjectConfigPrototype + for _, v := range d.Get("configs").([]interface{}) { + value := v.(map[string]interface{}) + configsItem, err := resourceIbmProjectInstanceMapToProjectConfigPrototype(value) + if err != nil { + return diag.FromErr(err) + } + configs = append(configs, *configsItem) + } + hasChange = true + } + if hasChange { _, response, err := projectClient.UpdateProjectWithContext(context, updateProjectOptions) if err != nil { @@ -496,6 +527,9 @@ func resourceIbmProjectInstanceMapToProjectConfigPrototype(modelMap map[string]i func resourceIbmProjectInstanceMapToProjectConfigInputVariable(modelMap map[string]interface{}) (*projectv1.ProjectConfigInputVariable, error) { model := &projectv1.ProjectConfigInputVariable{} model.Name = core.StringPtr(modelMap["name"].(string)) + if modelMap["value"] != nil { + model.Value = modelMap["value"].(string) + } return model, nil } @@ -547,6 +581,9 @@ func resourceIbmProjectInstanceProjectConfigPrototypeToMap(model *projectv1.Proj func resourceIbmProjectInstanceProjectConfigInputVariableToMap(model *projectv1.ProjectConfigInputVariable) (map[string]interface{}, error) { modelMap := make(map[string]interface{}) modelMap["name"] = model.Name + if model.Value != nil { + modelMap["value"] = model.Value + } return modelMap, nil } @@ -605,8 +642,5 @@ func resourceIbmProjectInstanceCumulativeNeedsAttentionToMap(model *projectv1.Cu if model.ConfigID != nil { modelMap["config_id"] = model.ConfigID } - if model.ConfigVersion != nil { - modelMap["config_version"] = flex.IntValue(model.ConfigVersion) - } return modelMap, nil } diff --git a/ibm/service/project/resource_ibm_project_instance_test.go b/ibm/service/project/resource_ibm_project_instance_test.go index 33df503484..088784f11b 100644 --- a/ibm/service/project/resource_ibm_project_instance_test.go +++ b/ibm/service/project/resource_ibm_project_instance_test.go @@ -20,6 +20,8 @@ func TestAccIbmProjectInstanceBasic(t *testing.T) { var conf projectv1.Project name := fmt.Sprintf("tf_name_%d", acctest.RandIntRange(10, 100)) nameUpdate := fmt.Sprintf("tf_name_update_%d", acctest.RandIntRange(10, 100)) + resourceGroup := fmt.Sprintf("Default") + location := fmt.Sprintf("us-south") resource.Test(t, resource.TestCase{ PreCheck: func() { acc.TestAccPreCheck(t) }, @@ -27,15 +29,19 @@ func TestAccIbmProjectInstanceBasic(t *testing.T) { CheckDestroy: testAccCheckIbmProjectInstanceDestroy, Steps: []resource.TestStep{ resource.TestStep{ - Config: testAccCheckIbmProjectInstanceConfigBasic(name), + Config: testAccCheckIbmProjectInstanceConfigBasic(resourceGroup, location, name), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckIbmProjectInstanceExists("ibm_project_instance.project_instance", conf), + resource.TestCheckResourceAttr("ibm_project_instance.project_instance", "resource_group", resourceGroup), + resource.TestCheckResourceAttr("ibm_project_instance.project_instance", "location", location), resource.TestCheckResourceAttr("ibm_project_instance.project_instance", "name", name), ), }, resource.TestStep{ - Config: testAccCheckIbmProjectInstanceConfigBasic(nameUpdate), + Config: testAccCheckIbmProjectInstanceConfigBasic(resourceGroup, location, nameUpdate), Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr("ibm_project_instance.project_instance", "resource_group", resourceGroup), + resource.TestCheckResourceAttr("ibm_project_instance.project_instance", "location", location), resource.TestCheckResourceAttr("ibm_project_instance.project_instance", "name", nameUpdate), ), }, @@ -47,6 +53,10 @@ func TestAccIbmProjectInstanceAllArgs(t *testing.T) { var conf projectv1.Project name := fmt.Sprintf("tf_name_%d", acctest.RandIntRange(10, 100)) nameUpdate := fmt.Sprintf("tf_name_%d", acctest.RandIntRange(10, 100)) + description := fmt.Sprintf("tf_description_%d", acctest.RandIntRange(10, 100)) + descriptionUpdate := fmt.Sprintf("tf_description_%d", acctest.RandIntRange(10, 100)) + resourceGroup := fmt.Sprintf("Default") + location := fmt.Sprintf("us-south") resource.Test(t, resource.TestCase{ PreCheck: func() { acc.TestAccPreCheck(t) }, @@ -54,16 +64,22 @@ func TestAccIbmProjectInstanceAllArgs(t *testing.T) { CheckDestroy: testAccCheckIbmProjectInstanceDestroy, Steps: []resource.TestStep{ resource.TestStep{ - Config: testAccCheckIbmProjectInstanceConfig(name), + Config: testAccCheckIbmProjectInstanceConfig(name, description, resourceGroup, location), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckIbmProjectInstanceExists("ibm_project_instance.project_instance", conf), + resource.TestCheckResourceAttr("ibm_project_instance.project_instance", "resource_group", resourceGroup), + resource.TestCheckResourceAttr("ibm_project_instance.project_instance", "location", location), resource.TestCheckResourceAttr("ibm_project_instance.project_instance", "name", name), + resource.TestCheckResourceAttr("ibm_project_instance.project_instance", "description", description), ), }, resource.TestStep{ - Config: testAccCheckIbmProjectInstanceConfig(nameUpdate), + Config: testAccCheckIbmProjectInstanceConfig(nameUpdate, descriptionUpdate, resourceGroup, location), Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr("ibm_project_instance.project_instance", "resource_group", resourceGroup), + resource.TestCheckResourceAttr("ibm_project_instance.project_instance", "location", location), resource.TestCheckResourceAttr("ibm_project_instance.project_instance", "name", nameUpdate), + resource.TestCheckResourceAttr("ibm_project_instance.project_instance", "description", descriptionUpdate), ), }, resource.TestStep{ @@ -80,22 +96,26 @@ func TestAccIbmProjectInstanceAllArgs(t *testing.T) { }) } -func testAccCheckIbmProjectInstanceConfigBasic(name string) string { +func testAccCheckIbmProjectInstanceConfigBasic(resourceGroup string, location string, name string) string { return fmt.Sprintf(` resource "ibm_project_instance" "project_instance" { + resource_group = "%s" + location = "%s" name = "%s" } - `, name) + `, resourceGroup, location, name) } -func testAccCheckIbmProjectInstanceConfig(name string) string { +func testAccCheckIbmProjectInstanceConfig(name string, description string, resourceGroup string, location string) string { return fmt.Sprintf(` - resource "ibm_project_instance" "project_instance" { - name = "%s" + resource "ibm_project_instance" "project_instance" { + name = "%s" + description = "%s" + resource_group = "%s" + location = "%s" configs { - id = "id" name = "name" labels = [ "labels" ] description = "description" @@ -108,8 +128,8 @@ func testAccCheckIbmProjectInstanceConfig(name string) string { value = "value" } } - } - `, name) + } + `, name, description, resourceGroup, location) } func testAccCheckIbmProjectInstanceExists(n string, obj projectv1.Project) resource.TestCheckFunc { diff --git a/website/docs/d/project_event_notification.html.markdown b/website/docs/d/project_event_notification.html.markdown index bc6b73a1d9..e546b6e542 100644 --- a/website/docs/d/project_event_notification.html.markdown +++ b/website/docs/d/project_event_notification.html.markdown @@ -22,11 +22,7 @@ data "ibm_project_event_notification" "project_event_notification" { Review the argument reference that you can specify for your data source. -* `complete` - (Optional, Boolean) The flag to determine if full metadata should be returned. - * Constraints: The default value is `false`. -* `exclude_configs` - (Optional, Boolean) Only return with the active configuration, no drafts. - * Constraints: The default value is `false`. -* `id` - (Required, Forces new resource, String) The ID of the project, which uniquely identifies it. +* `id` - (Required, Forces new resource, String) The unique project ID. * Constraints: The maximum length is `128` characters. The value must match regular expression `/^[\\.\\-0-9a-zA-Z]+$/`. ## Attribute Reference @@ -38,39 +34,39 @@ In addition to all argument references listed, you can access the following attr * Constraints: The maximum length is `10000` items. The minimum length is `0` items. Nested scheme for **configs**: * `description` - (String) The project configuration description. - * Constraints: The maximum length is `1024` characters. The minimum length is `0` characters. The value must match regular expression `/^(?!\\s).*\\S$/`. - * `id` - (String) The unique ID of a project. + * Constraints: The maximum length is `1024` characters. The minimum length is `0` characters. The value must match regular expression `/^$|^(?!\\s).*\\S$/`. + * `id` - (String) The ID of the configuration. If this parameter is empty, an ID is automatically created for the configuration. * Constraints: The maximum length is `128` characters. The value must match regular expression `/^[\\.\\-0-9a-zA-Z]+$/`. * `input` - (List) The outputs of a Schematics template property. * Constraints: The maximum length is `10000` items. The minimum length is `0` items. Nested scheme for **input**: * `name` - (String) The variable name. - * Constraints: The maximum length is `64` characters. The minimum length is `1` character. The value must match regular expression `/^(?!\\s).+\\S$/`. + * Constraints: The maximum length is `256` characters. The minimum length is `1` character. The value must match regular expression `/^(?!\\s)(?!.*\\s$).+$/`. * `required` - (Boolean) Whether the variable is required or not. * `type` - (String) The variable type. * Constraints: Allowable values are: `array`, `boolean`, `float`, `int`, `number`, `password`, `string`, `object`. + * `value` - (String) Can be any value - a string, number, boolean, array, or object. * `labels` - (List) A collection of configuration labels. * Constraints: The list items must match regular expression `/^[_\\-a-z0-9:\/=]+$/`. The maximum length is `10000` items. The minimum length is `0` items. - * `locator_id` - (String) The location ID of a project configuration manual property. - * Constraints: The maximum length is `512` characters. The minimum length is `1` character. The value must match regular expression `/^(?!\\s).+\\S$/`. + * `locator_id` - (String) A dotted value of catalogID.versionID. + * Constraints: The maximum length is `512` characters. The minimum length is `1` character. The value must match regular expression `/^(?!\\s)(?!.*\\s$)[\\.0-9a-z-A-Z_-]+$/`. * `name` - (String) The configuration name. - * Constraints: The maximum length is `64` characters. The minimum length is `1` character. The value must match regular expression `/^(?!\\s).+\\S$/`. + * Constraints: The maximum length is `64` characters. The minimum length is `1` character. The value must match regular expression `/^[a-zA-Z0-9][a-zA-Z0-9-_ ]*$/`. * `output` - (List) The outputs of a Schematics template property. * Constraints: The maximum length is `10000` items. The minimum length is `0` items. Nested scheme for **output**: * `description` - (String) A short explanation of the output value. * Constraints: The maximum length is `1024` characters. The minimum length is `0` characters. The value must match regular expression `/^$|^(?!\\s).*\\S$/`. * `name` - (String) The variable name. - * Constraints: The maximum length is `64` characters. The minimum length is `1` character. The value must match regular expression `/^(?!\\s).+\\S$/`. - * `value` - (List) The output value. - * Constraints: The list items must match regular expression `/^(?!\\s).+\\S$/`. The maximum length is `10000` items. The minimum length is `0` items. - * `setting` - (List) An optional setting object that's passed to the cart API. + * Constraints: The maximum length is `256` characters. The minimum length is `1` character. The value must match regular expression `/^(?!\\s)(?!.*\\s$).+$/`. + * `value` - (String) Can be any value - a string, number, boolean, array, or object. + * `setting` - (List) Schematics environment variables to use to deploy the configuration. * Constraints: The maximum length is `10000` items. The minimum length is `0` items. Nested scheme for **setting**: * `name` - (String) The name of the configuration setting. - * Constraints: The maximum length is `64` characters. The minimum length is `1` character. The value must match regular expression `/^(?!\\s).+\\S$/`. - * `value` - (String) The value of a the configuration setting. - * Constraints: The maximum length is `64` characters. The minimum length is `1` character. The value must match regular expression `/^(?!\\s).+\\S$/`. + * Constraints: The maximum length is `256` characters. The minimum length is `1` character. The value must match regular expression `/^(?!\\s)(?!.*\\s$).+$/`. + * `value` - (String) The value of the configuration setting. + * Constraints: The maximum length is `1024` characters. The minimum length is `1` character. The value must match regular expression `/^(?!\\s)(?!.*\\s$).+$/`. * `type` - (String) The type of a project configuration manual property. * Constraints: Allowable values are: `terraform_template`, `schematics_blueprint`. @@ -78,10 +74,11 @@ Nested scheme for **configs**: * Constraints: The maximum length is `512` characters. The minimum length is `9` characters. The value must match regular expression `/^crn:v[0-9](:([A-Za-z0-9\\-._~!$&'()*+,;=@\/]|%[0-9A-Z]{2})*){8}$/`. * `description` - (String) A project descriptive text. + * Constraints: The maximum length is `1024` characters. The minimum length is `0` characters. The value must match regular expression `/^$|^(?!\\s).*\\S$/`. * `metadata` - (List) The metadata of the project. Nested scheme for **metadata**: - * `created_at` - (String) A date/time value in the format YYYY-MM-DDTHH:mm:ssZ or YYYY-MM-DDTHH:mm:ss.sssZ, matching the date-time format as specified by RFC 3339. + * `created_at` - (String) A date and time value in the format YYYY-MM-DDTHH:mm:ssZ or YYYY-MM-DDTHH:mm:ss.sssZ, matching the date and time format as specified by RFC 3339. * `crn` - (String) An IBM Cloud resource name, which uniquely identifies a resource. * Constraints: The maximum length is `512` characters. The minimum length is `9` characters. The value must match regular expression `/^crn:v[0-9](:([A-Za-z0-9\\-._~!$&'()*+,;=@\/]|%[0-9A-Z]{2})*){8}$/`. * `cumulative_needs_attention_view` - (List) The cumulative list of needs attention items for a project. @@ -91,15 +88,20 @@ Nested scheme for **metadata**: * Constraints: The maximum length is `128` characters. The value must match regular expression `/^[\\.\\-0-9a-zA-Z]+$/`. * `config_version` - (Integer) The version number of the configuration. * `event` - (String) The event name. + * Constraints: The maximum length is `64` characters. The minimum length is `0` characters. The value must match regular expression `/^(?!\\s)(?!.*\\s$)[^'"`<>{}\\x00-\\x1F]*$/`. * `event_id` - (String) The unique ID of a project. * Constraints: The maximum length is `128` characters. The value must match regular expression `/^[\\.\\-0-9a-zA-Z]+$/`. * `cumulative_needs_attention_view_err` - (String) \"True\" indicates that the fetch of the needs attention items failed. + * Constraints: The maximum length is `64` characters. The minimum length is `0` characters. The value must match regular expression `/^(?!\\s)(?!.*\\s$)[^'"`<>{}\\x00-\\x1F]*$/`. * `event_notifications_crn` - (String) The CRN of the event notifications instance if one is connected to this project. - * `location` - (String) The location where the project was created. - * `resource_group` - (String) The resource group where the project was created. + * Constraints: The maximum length is `512` characters. The minimum length is `9` characters. The value must match regular expression `/^crn:v[0-9](:([A-Za-z0-9\\-._~!$&'()*+,;=@\/]|%[0-9A-Z]{2})*){8}$/`. + * `location` - (String) The IBM Cloud location where a resource is deployed. + * Constraints: The maximum length is `64` characters. The minimum length is `0` characters. The value must match regular expression `/^(?!\\s)(?!.*\\s$)[^'"`<>{}\\x00-\\x1F]*$/`. + * `resource_group` - (String) The resource group where the project's data and tools are created. + * Constraints: The maximum length is `64` characters. The minimum length is `0` characters. The value must match regular expression `/^(?!\\s)(?!.*\\s$)[^'"`<>{}\\x00-\\x1F]*$/`. * `state` - (String) The project status value. * Constraints: The maximum length is `64` characters. The minimum length is `1` character. The value must match regular expression `/^(CREATING|CREATING_FAILED|UPDATING|UPDATING_FAILED|READY)$/`. * `name` - (String) The project name. - * Constraints: The maximum length is `64` characters. The minimum length is `1` character. The value must match regular expression `/^(?!\\s).+\\S$/`. + * Constraints: The maximum length is `64` characters. The minimum length is `1` character. The value must match regular expression `/^(?!\\s)(?!.*\\s$)[^'"`<>{}\\x00-\\x1F]+$/`. diff --git a/website/docs/r/project_instance.html.markdown b/website/docs/r/project_instance.html.markdown index c53f47f14d..f3fdacd7f2 100644 --- a/website/docs/r/project_instance.html.markdown +++ b/website/docs/r/project_instance.html.markdown @@ -30,6 +30,8 @@ resource "ibm_project" "project_instance" { } description = "Sample static website test using the IBM catalog deployable architecture" name = "My static website" + location = "us-south" + resource_group = "Default" } ``` @@ -41,35 +43,36 @@ Review the argument reference that you can specify for your resource. * Constraints: The maximum length is `10000` items. The minimum length is `0` items. Nested scheme for **configs**: * `description` - (Optional, String) The project configuration description. - * Constraints: The maximum length is `1024` characters. The minimum length is `0` characters. The value must match regular expression `/^(?!\\s).*\\S$/`. - * `id` - (Optional, String) The unique ID of a project. + * Constraints: The maximum length is `1024` characters. The minimum length is `0` characters. The value must match regular expression `/^$|^(?!\\s).*\\S$/`. + * `id` - (Optional, String) The ID of the configuration. If this parameter is empty, an ID is automatically created for the configuration. * Constraints: The maximum length is `128` characters. The value must match regular expression `/^[\\.\\-0-9a-zA-Z]+$/`. - * `input` - (Optional, List) The inputs of a Schematics template property. + * `input` - (Optional, List) The input values to use to deploy the configuration. * Constraints: The maximum length is `10000` items. The minimum length is `0` items. Nested scheme for **input**: * `name` - (Required, String) The variable name. - * Constraints: The maximum length is `64` characters. The minimum length is `1` character. The value must match regular expression `/^(?!\\s).+\\S$/`. + * Constraints: The maximum length is `256` characters. The minimum length is `1` character. The value must match regular expression `/^(?!\\s)(?!.*\\s$).+$/`. + * `value` - (Optional, String) Can be any value - a string, number, boolean, array, or object. * `labels` - (Optional, List) A collection of configuration labels. * Constraints: The list items must match regular expression `/^[_\\-a-z0-9:\/=]+$/`. The maximum length is `10000` items. The minimum length is `0` items. - * `locator_id` - (Required, String) The location ID of a project configuration manual property. - * Constraints: The maximum length is `512` characters. The minimum length is `1` character. The value must match regular expression `/^.+$/`. + * `locator_id` - (Required, String) A dotted value of catalogID.versionID. + * Constraints: The maximum length is `512` characters. The minimum length is `1` character. The value must match regular expression `/^(?!\\s)(?!.*\\s$)[\\.0-9a-z-A-Z_-]+$/`. * `name` - (Required, String) The configuration name. - * Constraints: The maximum length is `64` characters. The minimum length is `1` character. The value must match regular expression `/^(?!\\s).+\\S$/`. - * `setting` - (Optional, List) An optional setting object that's passed to the cart API. + * Constraints: The maximum length is `64` characters. The minimum length is `1` character. The value must match regular expression `/^[a-zA-Z0-9][a-zA-Z0-9-_ ]*$/`. + * `setting` - (Optional, List) Schematics environment variables to use to deploy the configuration. * Constraints: The maximum length is `10000` items. The minimum length is `0` items. Nested scheme for **setting**: * `name` - (Required, String) The name of the configuration setting. - * Constraints: The maximum length is `64` characters. The minimum length is `1` character. The value must match regular expression `/^(?!\\s).+\\S$/`. - * `value` - (Required, String) The value of a the configuration setting. - * Constraints: The maximum length is `64` characters. The minimum length is `1` character. The value must match regular expression `/^(?!\\s).+\\S$/`. + * Constraints: The maximum length is `256` characters. The minimum length is `1` character. The value must match regular expression `/^(?!\\s)(?!.*\\s$).+$/`. + * `value` - (Required, String) The value of the configuration setting. + * Constraints: The maximum length is `1024` characters. The minimum length is `1` character. The value must match regular expression `/^(?!\\s)(?!.*\\s$).+$/`. * `description` - (Optional, String) A project's descriptive text. * Constraints: The maximum length is `1024` characters. The minimum length is `0` characters. The value must match regular expression `/^$|^(?!\\s).*\\S$/`. -* `location` - (Optional, String) Data center locations for resource deployment. - * Constraints: The default value is `us-south`. 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)$/`. +* `location` - (Required, String) The location where the project's data and tools are created. + * 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)$/`. * `name` - (Required, String) The project name. - * Constraints: The maximum length is `64` characters. The minimum length is `1` character. The value must match regular expression `/^(?!\\s).+\\S$/`. -* `resource_group` - (Optional, String) Group name of the customized collection of resources. - * Constraints: The default value is `Default`. The maximum length is `40` characters. The minimum length is `0` characters. The value must match regular expression `/^$|^(?!\\s).*\\S$/`. + * Constraints: The maximum length is `64` characters. The minimum length is `1` character. The value must match regular expression `/^(?!\\s)(?!.*\\s$)[^'"`<>{}\\x00-\\x1F]+$/`. +* `resource_group` - (Required, String) The resource group where the project's data and tools are created. + * Constraints: The maximum length is `40` characters. The minimum length is `0` characters. The value must match regular expression `/^$|^(?!\\s)(?!.*\\s$)[^'"`<>{}\\x00-\\x1F]*$/`. ## Attribute Reference @@ -80,7 +83,7 @@ In addition to all argument references listed, you can access the following attr * Constraints: The maximum length is `512` characters. The minimum length is `9` characters. The value must match regular expression `/^crn:v[0-9](:([A-Za-z0-9\\-._~!$&'()*+,;=@\/]|%[0-9A-Z]{2})*){8}$/`. * `metadata` - (List) The metadata of the project. Nested scheme for **metadata**: - * `created_at` - (String) A date/time value in the format YYYY-MM-DDTHH:mm:ssZ or YYYY-MM-DDTHH:mm:ss.sssZ, matching the date-time format as specified by RFC 3339. + * `created_at` - (String) A date and time value in the format YYYY-MM-DDTHH:mm:ssZ or YYYY-MM-DDTHH:mm:ss.sssZ, matching the date and time format as specified by RFC 3339. * `crn` - (String) An IBM Cloud resource name, which uniquely identifies a resource. * Constraints: The maximum length is `512` characters. The minimum length is `9` characters. The value must match regular expression `/^crn:v[0-9](:([A-Za-z0-9\\-._~!$&'()*+,;=@\/]|%[0-9A-Z]{2})*){8}$/`. * `cumulative_needs_attention_view` - (List) The cumulative list of needs attention items for a project. @@ -90,12 +93,17 @@ Nested scheme for **metadata**: * Constraints: The maximum length is `128` characters. The value must match regular expression `/^[\\.\\-0-9a-zA-Z]+$/`. * `config_version` - (Integer) The version number of the configuration. * `event` - (String) The event name. + * Constraints: The maximum length is `64` characters. The minimum length is `0` characters. The value must match regular expression `/^(?!\\s)(?!.*\\s$)[^'"`<>{}\\x00-\\x1F]*$/`. * `event_id` - (String) The unique ID of a project. * Constraints: The maximum length is `128` characters. The value must match regular expression `/^[\\.\\-0-9a-zA-Z]+$/`. * `cumulative_needs_attention_view_err` - (String) \"True\" indicates that the fetch of the needs attention items failed. + * Constraints: The maximum length is `64` characters. The minimum length is `0` characters. The value must match regular expression `/^(?!\\s)(?!.*\\s$)[^'"`<>{}\\x00-\\x1F]*$/`. * `event_notifications_crn` - (String) The CRN of the event notifications instance if one is connected to this project. - * `location` - (String) The location where the project was created. - * `resource_group` - (String) The resource group where the project was created. + * Constraints: The maximum length is `512` characters. The minimum length is `9` characters. The value must match regular expression `/^crn:v[0-9](:([A-Za-z0-9\\-._~!$&'()*+,;=@\/]|%[0-9A-Z]{2})*){8}$/`. + * `location` - (String) The IBM Cloud location where a resource is deployed. + * Constraints: The maximum length is `64` characters. The minimum length is `0` characters. The value must match regular expression `/^(?!\\s)(?!.*\\s$)[^'"`<>{}\\x00-\\x1F]*$/`. + * `resource_group` - (String) The resource group where the project's data and tools are created. + * Constraints: The maximum length is `64` characters. The minimum length is `0` characters. The value must match regular expression `/^(?!\\s)(?!.*\\s$)[^'"`<>{}\\x00-\\x1F]*$/`. * `state` - (String) The project status value. * Constraints: The maximum length is `64` characters. The minimum length is `1` character. The value must match regular expression `/^(CREATING|CREATING_FAILED|UPDATING|UPDATING_FAILED|READY)$/`.