From f2bebc855fcc1360f62c2e6e0899c8a365de5895 Mon Sep 17 00:00:00 2001 From: Brian Gleeson Date: Thu, 25 Jul 2024 16:10:13 +0100 Subject: [PATCH 1/4] feat(tekton): Add support for CEL filtering --- .../data_source_ibm_cd_tekton_pipeline.go | 38 ++- ...ce_ibm_cd_tekton_pipeline_property_test.go | 6 +- ...a_source_ibm_cd_tekton_pipeline_trigger.go | 27 +- ...d_tekton_pipeline_trigger_property_test.go | 6 +- ...rce_ibm_cd_tekton_pipeline_trigger_test.go | 10 +- .../resource_ibm_cd_tekton_pipeline.go | 118 ++++---- ...esource_ibm_cd_tekton_pipeline_property.go | 36 +-- ...ce_ibm_cd_tekton_pipeline_property_test.go | 12 +- ...resource_ibm_cd_tekton_pipeline_trigger.go | 276 ++++++++---------- ...ibm_cd_tekton_pipeline_trigger_property.go | 36 +-- ...d_tekton_pipeline_trigger_property_test.go | 12 +- ...rce_ibm_cd_tekton_pipeline_trigger_test.go | 20 +- .../docs/d/cd_tekton_pipeline.html.markdown | 62 ++-- ...d_tekton_pipeline_definition.html.markdown | 12 +- .../cd_tekton_pipeline_property.html.markdown | 6 +- .../cd_tekton_pipeline_trigger.html.markdown | 39 +-- ...on_pipeline_trigger_property.html.markdown | 6 +- .../docs/r/cd_tekton_pipeline.html.markdown | 124 +++----- ...d_tekton_pipeline_definition.html.markdown | 67 +---- .../cd_tekton_pipeline_property.html.markdown | 64 +--- .../cd_tekton_pipeline_trigger.html.markdown | 108 ++----- ...on_pipeline_trigger_property.html.markdown | 64 +--- 22 files changed, 452 insertions(+), 697 deletions(-) diff --git a/ibm/service/cdtektonpipeline/data_source_ibm_cd_tekton_pipeline.go b/ibm/service/cdtektonpipeline/data_source_ibm_cd_tekton_pipeline.go index 4e116e6254..609edc44e3 100644 --- a/ibm/service/cdtektonpipeline/data_source_ibm_cd_tekton_pipeline.go +++ b/ibm/service/cdtektonpipeline/data_source_ibm_cd_tekton_pipeline.go @@ -236,7 +236,7 @@ func DataSourceIBMCdTektonPipeline() *schema.Resource { "properties": &schema.Schema{ Type: schema.TypeList, Computed: true, - Description: "Optional trigger properties used to override or supplement the pipeline properties when triggering a pipeline run.", + Description: "Optional trigger properties are used to override or supplement the pipeline properties when triggering a pipeline run.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "name": &schema.Schema{ @@ -320,7 +320,7 @@ func DataSourceIBMCdTektonPipeline() *schema.Resource { "enabled": &schema.Schema{ Type: schema.TypeBool, Computed: true, - Description: "Flag whether the trigger is enabled.", + Description: "Flag to check if the trigger is enabled.", }, "favorite": &schema.Schema{ Type: schema.TypeBool, @@ -352,12 +352,12 @@ func DataSourceIBMCdTektonPipeline() *schema.Resource { "branch": &schema.Schema{ Type: schema.TypeString, Computed: true, - Description: "Name of a branch from the repo. One of branch or pattern must be specified, but only one or the other.", + Description: "Name of a branch from the repo. Only one of branch, pattern, or filter should be specified.", }, "pattern": &schema.Schema{ Type: schema.TypeString, Computed: true, - Description: "The pattern of Git branch or tag to which to listen. You can specify a glob pattern such as '!test' or '*master' to match against multiple tags/branches in the repository. The glob pattern used must conform to Bash 4.3 specifications, see bash documentation for more info: https://www.gnu.org/software/bash/manual/bash.html#Pattern-Matching. One of branch or pattern must be specified, but only one or the other.", + Description: "The pattern of Git branch or tag. You can specify a glob pattern such as '!test' or '*master' to match against multiple tags or branches in the repository.The glob pattern used must conform to Bash 4.3 specifications, see bash documentation for more info: https://www.gnu.org/software/bash/manual/bash.html#Pattern-Matching. Only one of branch, pattern, or filter should be specified.", }, "blind_connection": &schema.Schema{ Type: schema.TypeBool, @@ -367,7 +367,7 @@ func DataSourceIBMCdTektonPipeline() *schema.Resource { "hook_id": &schema.Schema{ Type: schema.TypeString, Computed: true, - Description: "ID of the webhook from the repo. Computed upon creation of the trigger.", + Description: "Repository webhook ID. It is generated upon trigger creation.", }, "tool": &schema.Schema{ Type: schema.TypeList, @@ -392,25 +392,30 @@ func DataSourceIBMCdTektonPipeline() *schema.Resource { "events": &schema.Schema{ Type: schema.TypeList, Computed: true, - Description: "Only needed for Git triggers. List of events to which a Git trigger listens. Choose one or more from: 'push', 'pull_request' and 'pull_request_closed'. For SCM repositories that use 'merge request' events, such events map to the equivalent 'pull request' events.", + Description: "Either 'events' or 'filter' is required specifically for Git triggers. Stores a list of events that a Git trigger listens to. Choose one or more from 'push', 'pull_request', and 'pull_request_closed'. If SCM repositories use the 'merge request' term, they correspond to the generic term i.e. 'pull request'.", Elem: &schema.Schema{ Type: schema.TypeString, }, }, + "filter": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Either 'events' or 'filter' can be used. Stores the CEL (Common Expression Language) expression value which is used for event filtering against the Git webhook payloads.", + }, "cron": &schema.Schema{ Type: schema.TypeString, Computed: true, - Description: "Only needed for timer triggers. Cron expression that indicates when this trigger will activate. Maximum frequency is every 5 minutes. The string is based on UNIX crontab syntax: minute, hour, day of month, month, day of week. Example: 0 *_/2 * * * - every 2 hours.", + Description: "Only needed for timer triggers. CRON expression that indicates when this trigger will activate. Maximum frequency is every 5 minutes. The string is based on UNIX crontab syntax: minute, hour, day of month, month, day of week. Example: The CRON expression 0 *_/2 * * * - translates to - every 2 hours.", }, "timezone": &schema.Schema{ Type: schema.TypeString, Computed: true, - Description: "Only used for timer triggers. Specify the timezone used for this timer trigger, which will ensure the cron activates this trigger relative to the specified timezone. If no timezone is specified, the default timezone used is UTC. Valid timezones are those listed in the IANA timezone database, https://www.iana.org/time-zones.", + Description: "Only used for timer triggers. Specify the timezone used for this timer trigger, which will ensure the CRON activates this trigger relative to the specified timezone. If no timezone is specified, the default timezone used is UTC. Valid timezones are those listed in the IANA timezone database, https://www.iana.org/time-zones.", }, "secret": &schema.Schema{ Type: schema.TypeList, Computed: true, - Description: "Only needed for generic webhook trigger type. Secret used to start generic webhook trigger.", + Description: "Only needed for Generic Webhook trigger type. The secret is used to start the Generic Webhook trigger.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "type": &schema.Schema{ @@ -496,17 +501,17 @@ func DataSourceIBMCdTektonPipeline() *schema.Resource { "enable_notifications": &schema.Schema{ Type: schema.TypeBool, Computed: true, - Description: "Flag whether to enable notifications for this pipeline. When enabled, pipeline run events will be published on all slack integration specified channels in the parent toolchain. If omitted, this feature is disabled by default.", + Description: "Flag to enable notifications for this pipeline. If enabled, the Tekton pipeline run events will be published to all the destinations specified by the Slack and Event Notifications integrations in the parent toolchain. If omitted, this feature is disabled by default.", }, "enable_partial_cloning": &schema.Schema{ Type: schema.TypeBool, Computed: true, - Description: "Flag whether to enable partial cloning for this pipeline. When partial clone is enabled, only the files contained within the paths specified in definition repositories are read and cloned, this means that symbolic links might not work. If omitted, this feature is disabled by default.", + Description: "Flag to enable partial cloning for this pipeline. When partial clone is enabled, only the files contained within the paths specified in definition repositories are read and cloned, this means that symbolic links might not work. If omitted, this feature is disabled by default.", }, "enabled": &schema.Schema{ Type: schema.TypeBool, Computed: true, - Description: "Flag whether this pipeline is enabled.", + Description: "Flag to check if the trigger is enabled.", }, }, } @@ -810,6 +815,9 @@ func dataSourceIBMCdTektonPipelineTriggerToMap(model cdtektonpipelinev2.TriggerI if model.Events != nil { modelMap["events"] = model.Events } + if model.Filter != nil { + modelMap["filter"] = model.Filter + } if model.Cron != nil { modelMap["cron"] = model.Cron } @@ -1005,6 +1013,9 @@ func dataSourceIBMCdTektonPipelineTriggerScmTriggerToMap(model *cdtektonpipeline if model.Events != nil { modelMap["events"] = model.Events } + if model.Filter != nil { + modelMap["filter"] = model.Filter + } return modelMap, nil } @@ -1101,5 +1112,8 @@ func dataSourceIBMCdTektonPipelineTriggerGenericTriggerToMap(model *cdtektonpipe if model.WebhookURL != nil { modelMap["webhook_url"] = model.WebhookURL } + if model.Filter != nil { + modelMap["filter"] = model.Filter + } return modelMap, nil } diff --git a/ibm/service/cdtektonpipeline/data_source_ibm_cd_tekton_pipeline_property_test.go b/ibm/service/cdtektonpipeline/data_source_ibm_cd_tekton_pipeline_property_test.go index 039e66f382..c29ce37471 100644 --- a/ibm/service/cdtektonpipeline/data_source_ibm_cd_tekton_pipeline_property_test.go +++ b/ibm/service/cdtektonpipeline/data_source_ibm_cd_tekton_pipeline_property_test.go @@ -37,8 +37,8 @@ func TestAccIBMCdTektonPipelinePropertyDataSourceBasic(t *testing.T) { func TestAccIBMCdTektonPipelinePropertyDataSourceAllArgs(t *testing.T) { propertyName := fmt.Sprintf("tf_name_%d", acctest.RandIntRange(10, 100)) - propertyValue := fmt.Sprintf("tf_value_%d", acctest.RandIntRange(10, 100)) propertyType := "text" + propertyValue := fmt.Sprintf("tf_value_%d", acctest.RandIntRange(10, 100)) propertyLocked := "true" propertyPath := fmt.Sprintf("tf_path_%d", acctest.RandIntRange(10, 100)) @@ -47,7 +47,7 @@ func TestAccIBMCdTektonPipelinePropertyDataSourceAllArgs(t *testing.T) { Providers: acc.TestAccProviders, Steps: []resource.TestStep{ resource.TestStep{ - Config: testAccCheckIBMCdTektonPipelinePropertyDataSourceConfig("", propertyName, propertyValue, propertyType, propertyLocked, propertyPath), + Config: testAccCheckIBMCdTektonPipelinePropertyDataSourceConfig("", propertyName, propertyType, propertyValue, propertyLocked, propertyPath), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttrSet("data.ibm_cd_tekton_pipeline_property.cd_tekton_pipeline_property", "id"), resource.TestCheckResourceAttrSet("data.ibm_cd_tekton_pipeline_property.cd_tekton_pipeline_property", "pipeline_id"), @@ -106,7 +106,7 @@ func testAccCheckIBMCdTektonPipelinePropertyDataSourceConfigBasic(propertyPipeli `, rgName, tcName) } -func testAccCheckIBMCdTektonPipelinePropertyDataSourceConfig(propertyPipelineID string, propertyName string, propertyValue string, propertyType string, propertyLocked string, propertyPath string) string { +func testAccCheckIBMCdTektonPipelinePropertyDataSourceConfig(propertyPipelineID string, propertyName string, propertyType string, propertyValue string, propertyLocked string, propertyPath string) string { rgName := acc.CdResourceGroupName tcName := fmt.Sprintf("tf_name_%d", acctest.RandIntRange(10, 100)) return fmt.Sprintf(` diff --git a/ibm/service/cdtektonpipeline/data_source_ibm_cd_tekton_pipeline_trigger.go b/ibm/service/cdtektonpipeline/data_source_ibm_cd_tekton_pipeline_trigger.go index 78b5908680..8115dcc4fb 100644 --- a/ibm/service/cdtektonpipeline/data_source_ibm_cd_tekton_pipeline_trigger.go +++ b/ibm/service/cdtektonpipeline/data_source_ibm_cd_tekton_pipeline_trigger.go @@ -54,7 +54,7 @@ func DataSourceIBMCdTektonPipelineTrigger() *schema.Resource { "properties": &schema.Schema{ Type: schema.TypeList, Computed: true, - Description: "Optional trigger properties used to override or supplement the pipeline properties when triggering a pipeline run.", + Description: "Optional trigger properties are used to override or supplement the pipeline properties when triggering a pipeline run.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "name": &schema.Schema{ @@ -138,7 +138,7 @@ func DataSourceIBMCdTektonPipelineTrigger() *schema.Resource { "enabled": &schema.Schema{ Type: schema.TypeBool, Computed: true, - Description: "Flag whether the trigger is enabled.", + Description: "Flag to check if the trigger is enabled.", }, "favorite": &schema.Schema{ Type: schema.TypeBool, @@ -170,12 +170,12 @@ func DataSourceIBMCdTektonPipelineTrigger() *schema.Resource { "branch": &schema.Schema{ Type: schema.TypeString, Computed: true, - Description: "Name of a branch from the repo. One of branch or pattern must be specified, but only one or the other.", + Description: "Name of a branch from the repo. Only one of branch, pattern, or filter should be specified.", }, "pattern": &schema.Schema{ Type: schema.TypeString, Computed: true, - Description: "The pattern of Git branch or tag to which to listen. You can specify a glob pattern such as '!test' or '*master' to match against multiple tags/branches in the repository. The glob pattern used must conform to Bash 4.3 specifications, see bash documentation for more info: https://www.gnu.org/software/bash/manual/bash.html#Pattern-Matching. One of branch or pattern must be specified, but only one or the other.", + Description: "The pattern of Git branch or tag. You can specify a glob pattern such as '!test' or '*master' to match against multiple tags or branches in the repository.The glob pattern used must conform to Bash 4.3 specifications, see bash documentation for more info: https://www.gnu.org/software/bash/manual/bash.html#Pattern-Matching. Only one of branch, pattern, or filter should be specified.", }, "blind_connection": &schema.Schema{ Type: schema.TypeBool, @@ -185,7 +185,7 @@ func DataSourceIBMCdTektonPipelineTrigger() *schema.Resource { "hook_id": &schema.Schema{ Type: schema.TypeString, Computed: true, - Description: "ID of the webhook from the repo. Computed upon creation of the trigger.", + Description: "Repository webhook ID. It is generated upon trigger creation.", }, "tool": &schema.Schema{ Type: schema.TypeList, @@ -210,25 +210,30 @@ func DataSourceIBMCdTektonPipelineTrigger() *schema.Resource { "events": &schema.Schema{ Type: schema.TypeList, Computed: true, - Description: "Only needed for Git triggers. List of events to which a Git trigger listens. Choose one or more from: 'push', 'pull_request' and 'pull_request_closed'. For SCM repositories that use 'merge request' events, such events map to the equivalent 'pull request' events.", + Description: "Either 'events' or 'filter' is required specifically for Git triggers. Stores a list of events that a Git trigger listens to. Choose one or more from 'push', 'pull_request', and 'pull_request_closed'. If SCM repositories use the 'merge request' term, they correspond to the generic term i.e. 'pull request'.", Elem: &schema.Schema{ Type: schema.TypeString, }, }, + "filter": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + Description: "Either 'events' or 'filter' can be used. Stores the CEL (Common Expression Language) expression value which is used for event filtering against the Git webhook payloads.", + }, "cron": &schema.Schema{ Type: schema.TypeString, Computed: true, - Description: "Only needed for timer triggers. Cron expression that indicates when this trigger will activate. Maximum frequency is every 5 minutes. The string is based on UNIX crontab syntax: minute, hour, day of month, month, day of week. Example: 0 *_/2 * * * - every 2 hours.", + Description: "Only needed for timer triggers. CRON expression that indicates when this trigger will activate. Maximum frequency is every 5 minutes. The string is based on UNIX crontab syntax: minute, hour, day of month, month, day of week. Example: The CRON expression 0 *_/2 * * * - translates to - every 2 hours.", }, "timezone": &schema.Schema{ Type: schema.TypeString, Computed: true, - Description: "Only used for timer triggers. Specify the timezone used for this timer trigger, which will ensure the cron activates this trigger relative to the specified timezone. If no timezone is specified, the default timezone used is UTC. Valid timezones are those listed in the IANA timezone database, https://www.iana.org/time-zones.", + Description: "Only used for timer triggers. Specify the timezone used for this timer trigger, which will ensure the CRON activates this trigger relative to the specified timezone. If no timezone is specified, the default timezone used is UTC. Valid timezones are those listed in the IANA timezone database, https://www.iana.org/time-zones.", }, "secret": &schema.Schema{ Type: schema.TypeList, Computed: true, - Description: "Only needed for generic webhook trigger type. Secret used to start generic webhook trigger.", + Description: "Only needed for Generic Webhook trigger type. The secret is used to start the Generic Webhook trigger.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "type": &schema.Schema{ @@ -366,6 +371,10 @@ func dataSourceIBMCdTektonPipelineTriggerRead(context context.Context, d *schema return diag.FromErr(fmt.Errorf("Error setting source %s", err)) } + if err = d.Set("filter", trigger.Filter); err != nil { + return diag.FromErr(fmt.Errorf("Error setting filter: %s", err)) + } + if err = d.Set("cron", trigger.Cron); err != nil { return diag.FromErr(fmt.Errorf("Error setting cron: %s", err)) } diff --git a/ibm/service/cdtektonpipeline/data_source_ibm_cd_tekton_pipeline_trigger_property_test.go b/ibm/service/cdtektonpipeline/data_source_ibm_cd_tekton_pipeline_trigger_property_test.go index 8446b940c4..7e547027c8 100644 --- a/ibm/service/cdtektonpipeline/data_source_ibm_cd_tekton_pipeline_trigger_property_test.go +++ b/ibm/service/cdtektonpipeline/data_source_ibm_cd_tekton_pipeline_trigger_property_test.go @@ -36,8 +36,8 @@ func TestAccIBMCdTektonPipelineTriggerPropertyDataSourceBasic(t *testing.T) { func TestAccIBMCdTektonPipelineTriggerPropertyDataSourceAllArgs(t *testing.T) { triggerPropertyName := fmt.Sprintf("tf_name_%d", acctest.RandIntRange(10, 100)) - triggerPropertyValue := fmt.Sprintf("tf_value_%d", acctest.RandIntRange(10, 100)) triggerPropertyType := "text" + triggerPropertyValue := fmt.Sprintf("tf_value_%d", acctest.RandIntRange(10, 100)) triggerPropertyPath := fmt.Sprintf("tf_path_%d", acctest.RandIntRange(10, 100)) triggerPropertyLocked := "true" @@ -46,7 +46,7 @@ func TestAccIBMCdTektonPipelineTriggerPropertyDataSourceAllArgs(t *testing.T) { Providers: acc.TestAccProviders, Steps: []resource.TestStep{ resource.TestStep{ - Config: testAccCheckIBMCdTektonPipelineTriggerPropertyDataSourceConfig("", "", triggerPropertyName, triggerPropertyValue, triggerPropertyType, triggerPropertyPath, triggerPropertyLocked), + Config: testAccCheckIBMCdTektonPipelineTriggerPropertyDataSourceConfig("", "", triggerPropertyName, triggerPropertyType, triggerPropertyValue, triggerPropertyPath, triggerPropertyLocked), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttrSet("data.ibm_cd_tekton_pipeline_trigger_property.cd_tekton_pipeline_trigger_property", "id"), resource.TestCheckResourceAttrSet("data.ibm_cd_tekton_pipeline_trigger_property.cd_tekton_pipeline_trigger_property", "property_name"), @@ -135,7 +135,7 @@ func testAccCheckIBMCdTektonPipelineTriggerPropertyDataSourceConfigBasic(trigger `, rgName, tcName) } -func testAccCheckIBMCdTektonPipelineTriggerPropertyDataSourceConfig(triggerPropertyPipelineID string, triggerPropertyTriggerID string, triggerPropertyName string, triggerPropertyValue string, triggerPropertyType string, triggerPropertyPath string, triggerPropertyLocked string) string { +func testAccCheckIBMCdTektonPipelineTriggerPropertyDataSourceConfig(triggerPropertyPipelineID string, triggerPropertyTriggerID string, triggerPropertyName string, triggerPropertyType string, triggerPropertyValue string, triggerPropertyPath string, triggerPropertyLocked string) string { rgName := acc.CdResourceGroupName tcName := fmt.Sprintf("tf_name_%d", acctest.RandIntRange(10, 100)) return fmt.Sprintf(` diff --git a/ibm/service/cdtektonpipeline/data_source_ibm_cd_tekton_pipeline_trigger_test.go b/ibm/service/cdtektonpipeline/data_source_ibm_cd_tekton_pipeline_trigger_test.go index 0eac444401..4507b5e64d 100644 --- a/ibm/service/cdtektonpipeline/data_source_ibm_cd_tekton_pipeline_trigger_test.go +++ b/ibm/service/cdtektonpipeline/data_source_ibm_cd_tekton_pipeline_trigger_test.go @@ -1,4 +1,4 @@ -// Copyright IBM Corp. 2023 All Rights Reserved. +// Copyright IBM Corp. 2024 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 package cdtektonpipeline_test @@ -42,16 +42,17 @@ func TestAccIBMCdTektonPipelineTriggerDataSourceAllArgs(t *testing.T) { triggerEventListener := fmt.Sprintf("tf_event_listener_%d", acctest.RandIntRange(10, 100)) triggerMaxConcurrentRuns := fmt.Sprintf("%d", acctest.RandIntRange(10, 100)) triggerEnabled := "false" - triggerFavorite := "true" triggerCron := fmt.Sprintf("tf_cron_%d", acctest.RandIntRange(10, 100)) triggerTimezone := fmt.Sprintf("tf_timezone_%d", acctest.RandIntRange(10, 100)) + triggerFilter := fmt.Sprintf("tf_filter_%d", acctest.RandIntRange(10, 100)) + triggerFavorite := "true" resource.Test(t, resource.TestCase{ PreCheck: func() { acc.TestAccPreCheck(t) }, Providers: acc.TestAccProviders, Steps: []resource.TestStep{ resource.TestStep{ - Config: testAccCheckIBMCdTektonPipelineTriggerDataSourceConfig(triggerPipelineID, triggerType, triggerName, triggerEventListener, triggerMaxConcurrentRuns, triggerEnabled, triggerFavorite, triggerCron, triggerTimezone), + Config: testAccCheckIBMCdTektonPipelineTriggerDataSourceConfig(triggerPipelineID, triggerType, triggerName, triggerEventListener, triggerMaxConcurrentRuns, triggerEnabled, triggerCron, triggerTimezone, triggerFilter, triggerFavorite), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttrSet("data.ibm_cd_tekton_pipeline_trigger.cd_tekton_pipeline_trigger", "id"), resource.TestCheckResourceAttrSet("data.ibm_cd_tekton_pipeline_trigger.cd_tekton_pipeline_trigger", "pipeline_id"), @@ -66,6 +67,7 @@ func TestAccIBMCdTektonPipelineTriggerDataSourceAllArgs(t *testing.T) { resource.TestCheckResourceAttrSet("data.ibm_cd_tekton_pipeline_trigger.cd_tekton_pipeline_trigger", "enabled"), resource.TestCheckResourceAttrSet("data.ibm_cd_tekton_pipeline_trigger.cd_tekton_pipeline_trigger", "favorite"), resource.TestCheckResourceAttrSet("data.ibm_cd_tekton_pipeline_trigger.cd_tekton_pipeline_trigger", "source.#"), + resource.TestCheckResourceAttrSet("data.ibm_cd_tekton_pipeline_trigger.cd_tekton_pipeline_trigger", "filter"), resource.TestCheckResourceAttrSet("data.ibm_cd_tekton_pipeline_trigger.cd_tekton_pipeline_trigger", "secret.#"), ), }, @@ -140,7 +142,7 @@ func testAccCheckIBMCdTektonPipelineTriggerDataSourceConfigBasic(triggerPipeline `, rgName, tcName, triggerType, triggerName, triggerEventListener) } -func testAccCheckIBMCdTektonPipelineTriggerDataSourceConfig(triggerPipelineID string, triggerType string, triggerName string, triggerEventListener string, triggerMaxConcurrentRuns string, triggerEnabled string, triggerFavorite string, triggerCron string, triggerTimezone string) string { +func testAccCheckIBMCdTektonPipelineTriggerDataSourceConfig(triggerPipelineID string, triggerType string, triggerName string, triggerEventListener string, triggerMaxConcurrentRuns string, triggerEnabled string, triggerCron string, triggerTimezone string, triggerFilter string, triggerFavorite string) string { rgName := acc.CdResourceGroupName tcName := fmt.Sprintf("tf_name_%d", acctest.RandIntRange(10, 100)) return fmt.Sprintf(` diff --git a/ibm/service/cdtektonpipeline/resource_ibm_cd_tekton_pipeline.go b/ibm/service/cdtektonpipeline/resource_ibm_cd_tekton_pipeline.go index f202c024b9..2330f74faa 100644 --- a/ibm/service/cdtektonpipeline/resource_ibm_cd_tekton_pipeline.go +++ b/ibm/service/cdtektonpipeline/resource_ibm_cd_tekton_pipeline.go @@ -27,47 +27,37 @@ func ResourceIBMCdTektonPipeline() *schema.Resource { Importer: &schema.ResourceImporter{}, Schema: map[string]*schema.Schema{ - "worker": &schema.Schema{ - Type: schema.TypeList, - MaxItems: 1, - Optional: true, - Description: "Details of the worker used to run the pipeline.", - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "Name of the worker. Computed based on the worker ID.", - }, - "type": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "Type of the worker. Computed based on the worker ID.", - }, - "id": &schema.Schema{ - Type: schema.TypeString, - Required: true, - Description: "ID of the worker.", - }, - }, - }, - }, "next_build_number": &schema.Schema{ Type: schema.TypeInt, Optional: true, - Description: "The build number that will be used for the next pipeline run.", + Description: "Specify the build number that will be used for the next pipeline run. Build numbers can be any positive whole number between 0 and 100000000000000.", }, "enable_notifications": &schema.Schema{ Type: schema.TypeBool, Optional: true, Default: false, - Description: "Flag whether to enable notifications for this pipeline. When enabled, pipeline run events will be published on all slack integration specified channels in the parent toolchain. If omitted, this feature is disabled by default.", + Description: "Flag to enable notifications for this pipeline. If enabled, the Tekton pipeline run events will be published to all the destinations specified by the Slack and Event Notifications integrations in the parent toolchain.", }, "enable_partial_cloning": &schema.Schema{ Type: schema.TypeBool, Optional: true, Default: false, - Description: "Flag whether to enable partial cloning for this pipeline. When partial clone is enabled, only the files contained within the paths specified in definition repositories are read and cloned, this means that symbolic links might not work. If omitted, this feature is disabled by default.", + Description: "Flag to enable partial cloning for this pipeline. When partial clone is enabled, only the files contained within the paths specified in definition repositories are read and cloned, this means that symbolic links might not work.", + }, + "worker": &schema.Schema{ + Type: schema.TypeList, + MaxItems: 1, + Optional: true, + Description: "Specify the worker that is to be used to run the trigger, indicated by a worker object with only the worker ID. If not specified or set as `worker: { id: 'public' }`, the IBM Managed shared workers are used.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "id": &schema.Schema{ + Type: schema.TypeString, + Required: true, + Description: "ID of the worker.", + }, + }, + }, }, "pipeline_id": &schema.Schema{ Type: schema.TypeString, @@ -291,7 +281,7 @@ func ResourceIBMCdTektonPipeline() *schema.Resource { "properties": &schema.Schema{ Type: schema.TypeList, Optional: true, - Description: "Optional trigger properties used to override or supplement the pipeline properties when triggering a pipeline run.", + Description: "Optional trigger properties are used to override or supplement the pipeline properties when triggering a pipeline run.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "name": &schema.Schema{ @@ -376,7 +366,7 @@ func ResourceIBMCdTektonPipeline() *schema.Resource { Type: schema.TypeBool, Optional: true, Default: true, - Description: "Flag whether the trigger is enabled.", + Description: "Flag to check if the trigger is enabled.", }, "favorite": &schema.Schema{ Type: schema.TypeBool, @@ -413,12 +403,12 @@ func ResourceIBMCdTektonPipeline() *schema.Resource { "branch": &schema.Schema{ Type: schema.TypeString, Optional: true, - Description: "Name of a branch from the repo. One of branch or pattern must be specified, but only one or the other.", + Description: "Name of a branch from the repo. Only one of branch, pattern, or filter should be specified.", }, "pattern": &schema.Schema{ Type: schema.TypeString, Optional: true, - Description: "The pattern of Git branch or tag to which to listen. You can specify a glob pattern such as '!test' or '*master' to match against multiple tags/branches in the repository. The glob pattern used must conform to Bash 4.3 specifications, see bash documentation for more info: https://www.gnu.org/software/bash/manual/bash.html#Pattern-Matching. One of branch or pattern must be specified, but only one or the other.", + Description: "The pattern of Git branch or tag. You can specify a glob pattern such as '!test' or '*master' to match against multiple tags or branches in the repository.The glob pattern used must conform to Bash 4.3 specifications, see bash documentation for more info: https://www.gnu.org/software/bash/manual/bash.html#Pattern-Matching. Only one of branch, pattern, or filter should be specified.", }, "blind_connection": &schema.Schema{ Type: schema.TypeBool, @@ -428,7 +418,7 @@ func ResourceIBMCdTektonPipeline() *schema.Resource { "hook_id": &schema.Schema{ Type: schema.TypeString, Computed: true, - Description: "ID of the webhook from the repo. Computed upon creation of the trigger.", + Description: "Repository webhook ID. It is generated upon trigger creation.", }, "tool": &schema.Schema{ Type: schema.TypeList, @@ -454,24 +444,29 @@ func ResourceIBMCdTektonPipeline() *schema.Resource { Type: schema.TypeList, Optional: true, DiffSuppressFunc: flex.SuppressTriggerEvents, - Description: "Only needed for Git triggers. List of events to which a Git trigger listens. Choose one or more from: 'push', 'pull_request' and 'pull_request_closed'. For SCM repositories that use 'merge request' events, such events map to the equivalent 'pull request' events.", + Description: "Either 'events' or 'filter' is required specifically for Git triggers. Stores a list of events that a Git trigger listens to. Choose one or more from 'push', 'pull_request', and 'pull_request_closed'. If SCM repositories use the 'merge request' term, they correspond to the generic term i.e. 'pull request'.", Elem: &schema.Schema{Type: schema.TypeString}, }, + "filter": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Description: "Either 'events' or 'filter' can be used. Stores the CEL (Common Expression Language) expression value which is used for event filtering against the Git webhook payloads.", + }, "cron": &schema.Schema{ Type: schema.TypeString, Optional: true, - Description: "Only needed for timer triggers. Cron expression that indicates when this trigger will activate. Maximum frequency is every 5 minutes. The string is based on UNIX crontab syntax: minute, hour, day of month, month, day of week. Example: 0 *_/2 * * * - every 2 hours.", + Description: "Only needed for timer triggers. CRON expression that indicates when this trigger will activate. Maximum frequency is every 5 minutes. The string is based on UNIX crontab syntax: minute, hour, day of month, month, day of week. Example: The CRON expression 0 *_/2 * * * - translates to - every 2 hours.", }, "timezone": &schema.Schema{ Type: schema.TypeString, Optional: true, - Description: "Only used for timer triggers. Specify the timezone used for this timer trigger, which will ensure the cron activates this trigger relative to the specified timezone. If no timezone is specified, the default timezone used is UTC. Valid timezones are those listed in the IANA timezone database, https://www.iana.org/time-zones.", + Description: "Only used for timer triggers. Specify the timezone used for this timer trigger, which will ensure the CRON activates this trigger relative to the specified timezone. If no timezone is specified, the default timezone used is UTC. Valid timezones are those listed in the IANA timezone database, https://www.iana.org/time-zones.", }, "secret": &schema.Schema{ Type: schema.TypeList, MaxItems: 1, Optional: true, - Description: "Only needed for generic webhook trigger type. Secret used to start generic webhook trigger.", + Description: "Only needed for Generic Webhook trigger type. The secret is used to start the Generic Webhook trigger.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "type": &schema.Schema{ @@ -529,7 +524,7 @@ func ResourceIBMCdTektonPipeline() *schema.Resource { "enabled": &schema.Schema{ Type: schema.TypeBool, Computed: true, - Description: "Flag whether this pipeline is enabled.", + Description: "Flag to check if the trigger is enabled.", }, }, } @@ -611,15 +606,6 @@ func resourceIBMCdTektonPipelineRead(context context.Context, d *schema.Resource return diag.FromErr(fmt.Errorf("GetTektonPipelineWithContext failed %s\n%s", err, response)) } - if !core.IsNil(tektonPipeline.Worker) { - workerMap, err := resourceIBMCdTektonPipelineWorkerToMap(tektonPipeline.Worker) - if err != nil { - return diag.FromErr(err) - } - if err = d.Set("worker", []map[string]interface{}{workerMap}); err != nil { - return diag.FromErr(fmt.Errorf("Error setting worker: %s", err)) - } - } if !core.IsNil(tektonPipeline.NextBuildNumber) { if err = d.Set("next_build_number", flex.IntValue(tektonPipeline.NextBuildNumber)); err != nil { return diag.FromErr(fmt.Errorf("Error setting next_build_number: %s", err)) @@ -635,6 +621,15 @@ func resourceIBMCdTektonPipelineRead(context context.Context, d *schema.Resource return diag.FromErr(fmt.Errorf("Error setting enable_partial_cloning: %s", err)) } } + if !core.IsNil(tektonPipeline.Worker) { + workerMap, err := resourceIBMCdTektonPipelineWorkerIdentityToMap(tektonPipeline.Worker) + if err != nil { + return diag.FromErr(err) + } + if err = d.Set("worker", []map[string]interface{}{workerMap}); err != nil { + return diag.FromErr(fmt.Errorf("Error setting worker: %s", err)) + } + } if err = d.Set("pipeline_id", tektonPipeline.ID); err != nil { return diag.FromErr(fmt.Errorf("Error setting pipeline_id: %s", err)) } @@ -791,14 +786,8 @@ func resourceIBMCdTektonPipelineMapToWorkerIdentity(modelMap map[string]interfac return model, nil } -func resourceIBMCdTektonPipelineWorkerToMap(model *cdtektonpipelinev2.Worker) (map[string]interface{}, error) { +func resourceIBMCdTektonPipelineWorkerIdentityToMap(model *cdtektonpipelinev2.Worker) (map[string]interface{}, error) { modelMap := make(map[string]interface{}) - if model.Name != nil { - modelMap["name"] = model.Name - } - if model.Type != nil { - modelMap["type"] = model.Type - } modelMap["id"] = model.ID return modelMap, nil } @@ -958,6 +947,9 @@ func resourceIBMCdTektonPipelineTriggerToMap(model cdtektonpipelinev2.TriggerInt if model.Events != nil { modelMap["events"] = model.Events } + if model.Filter != nil { + modelMap["filter"] = model.Filter + } if model.Cron != nil { modelMap["cron"] = model.Cron } @@ -1002,6 +994,18 @@ func resourceIBMCdTektonPipelineTriggerPropertyToMap(model *cdtektonpipelinev2.T return modelMap, nil } +func resourceIBMCdTektonPipelineWorkerToMap(model *cdtektonpipelinev2.Worker) (map[string]interface{}, error) { + modelMap := make(map[string]interface{}) + if model.Name != nil { + modelMap["name"] = model.Name + } + if model.Type != nil { + modelMap["type"] = model.Type + } + modelMap["id"] = model.ID + return modelMap, nil +} + func resourceIBMCdTektonPipelineTriggerSourceToMap(model *cdtektonpipelinev2.TriggerSource) (map[string]interface{}, error) { modelMap := make(map[string]interface{}) modelMap["type"] = model.Type @@ -1141,6 +1145,9 @@ func resourceIBMCdTektonPipelineTriggerScmTriggerToMap(model *cdtektonpipelinev2 if model.Events != nil { modelMap["events"] = model.Events } + if model.Filter != nil { + modelMap["filter"] = model.Filter + } return modelMap, nil } @@ -1237,5 +1244,8 @@ func resourceIBMCdTektonPipelineTriggerGenericTriggerToMap(model *cdtektonpipeli if model.WebhookURL != nil { modelMap["webhook_url"] = model.WebhookURL } + if model.Filter != nil { + modelMap["filter"] = model.Filter + } return modelMap, nil } diff --git a/ibm/service/cdtektonpipeline/resource_ibm_cd_tekton_pipeline_property.go b/ibm/service/cdtektonpipeline/resource_ibm_cd_tekton_pipeline_property.go index 064aaafd7a..dfddc9844f 100644 --- a/ibm/service/cdtektonpipeline/resource_ibm_cd_tekton_pipeline_property.go +++ b/ibm/service/cdtektonpipeline/resource_ibm_cd_tekton_pipeline_property.go @@ -41,6 +41,13 @@ func ResourceIBMCdTektonPipelineProperty() *schema.Resource { ValidateFunc: validate.InvokeValidator("ibm_cd_tekton_pipeline_property", "name"), Description: "Property name.", }, + "type": &schema.Schema{ + Type: schema.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validate.InvokeValidator("ibm_cd_tekton_pipeline_property", "type"), + Description: "Property type.", + }, "value": &schema.Schema{ Type: schema.TypeString, Optional: true, @@ -54,13 +61,6 @@ func ResourceIBMCdTektonPipelineProperty() *schema.Resource { Description: "Options for `single_select` property type. Only needed when using `single_select` property type.", Elem: &schema.Schema{Type: schema.TypeString}, }, - "type": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validate.InvokeValidator("ibm_cd_tekton_pipeline_property", "type"), - Description: "Property type.", - }, "locked": &schema.Schema{ Type: schema.TypeBool, Optional: true, @@ -71,7 +71,7 @@ func ResourceIBMCdTektonPipelineProperty() *schema.Resource { Type: schema.TypeString, Optional: true, ValidateFunc: validate.InvokeValidator("ibm_cd_tekton_pipeline_property", "path"), - Description: "A dot notation path for `integration` type properties only, that selects a value from the tool integration. If left blank the full tool integration data will be used.", + Description: "A dot notation path for `integration` type properties only, to select a value from the tool integration. If left blank the full tool integration data will be used.", }, "href": &schema.Schema{ Type: schema.TypeString, @@ -103,6 +103,13 @@ func ResourceIBMCdTektonPipelinePropertyValidator() *validate.ResourceValidator MinValueLength: 1, MaxValueLength: 253, }, + validate.ValidateSchema{ + Identifier: "type", + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, + Required: true, + AllowedValues: "appconfig, integration, secure, single_select, text", + }, validate.ValidateSchema{ Identifier: "value", ValidateFunctionIdentifier: validate.ValidateRegexpLen, @@ -112,13 +119,6 @@ func ResourceIBMCdTektonPipelinePropertyValidator() *validate.ResourceValidator MinValueLength: 0, MaxValueLength: 4096, }, - validate.ValidateSchema{ - Identifier: "type", - ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, - Type: validate.TypeString, - Required: true, - AllowedValues: "appconfig, integration, secure, single_select, text", - }, validate.ValidateSchema{ Identifier: "path", ValidateFunctionIdentifier: validate.ValidateRegexpLen, @@ -206,6 +206,9 @@ func resourceIBMCdTektonPipelinePropertyRead(context context.Context, d *schema. if err = d.Set("name", property.Name); err != nil { return diag.FromErr(fmt.Errorf("Error setting name: %s", err)) } + if err = d.Set("type", property.Type); err != nil { + return diag.FromErr(fmt.Errorf("Error setting type: %s", err)) + } if !core.IsNil(property.Value) { if err = d.Set("value", property.Value); err != nil { return diag.FromErr(fmt.Errorf("Error setting value: %s", err)) @@ -216,9 +219,6 @@ func resourceIBMCdTektonPipelinePropertyRead(context context.Context, d *schema. return diag.FromErr(fmt.Errorf("Error setting enum: %s", err)) } } - if err = d.Set("type", property.Type); err != nil { - return diag.FromErr(fmt.Errorf("Error setting type: %s", err)) - } if !core.IsNil(property.Locked) { if err = d.Set("locked", property.Locked); err != nil { return diag.FromErr(fmt.Errorf("Error setting locked: %s", err)) diff --git a/ibm/service/cdtektonpipeline/resource_ibm_cd_tekton_pipeline_property_test.go b/ibm/service/cdtektonpipeline/resource_ibm_cd_tekton_pipeline_property_test.go index 0cf2bd361d..74171f47ec 100644 --- a/ibm/service/cdtektonpipeline/resource_ibm_cd_tekton_pipeline_property_test.go +++ b/ibm/service/cdtektonpipeline/resource_ibm_cd_tekton_pipeline_property_test.go @@ -41,8 +41,8 @@ func TestAccIBMCdTektonPipelinePropertyBasic(t *testing.T) { func TestAccIBMCdTektonPipelinePropertyAllArgs(t *testing.T) { var conf cdtektonpipelinev2.Property name := fmt.Sprintf("tf_name_%d", acctest.RandIntRange(10, 100)) - value := fmt.Sprintf("tf_value_%d", acctest.RandIntRange(10, 100)) typeVar := "text" + value := fmt.Sprintf("tf_value_%d", acctest.RandIntRange(10, 100)) locked := "true" path := fmt.Sprintf("tf_path_%d", acctest.RandIntRange(10, 100)) valueUpdate := fmt.Sprintf("tf_value_%d", acctest.RandIntRange(10, 100)) @@ -55,21 +55,21 @@ func TestAccIBMCdTektonPipelinePropertyAllArgs(t *testing.T) { CheckDestroy: testAccCheckIBMCdTektonPipelinePropertyDestroy, Steps: []resource.TestStep{ resource.TestStep{ - Config: testAccCheckIBMCdTektonPipelinePropertyConfig("", name, value, typeVar, locked, path), + Config: testAccCheckIBMCdTektonPipelinePropertyConfig("", name, typeVar, value, locked, path), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckIBMCdTektonPipelinePropertyExists("ibm_cd_tekton_pipeline_property.cd_tekton_pipeline_property", conf), resource.TestCheckResourceAttr("ibm_cd_tekton_pipeline_property.cd_tekton_pipeline_property", "name", name), - resource.TestCheckResourceAttr("ibm_cd_tekton_pipeline_property.cd_tekton_pipeline_property", "value", value), resource.TestCheckResourceAttr("ibm_cd_tekton_pipeline_property.cd_tekton_pipeline_property", "type", typeVar), + resource.TestCheckResourceAttr("ibm_cd_tekton_pipeline_property.cd_tekton_pipeline_property", "value", value), resource.TestCheckResourceAttr("ibm_cd_tekton_pipeline_property.cd_tekton_pipeline_property", "locked", locked), ), }, resource.TestStep{ - Config: testAccCheckIBMCdTektonPipelinePropertyConfig("", name, valueUpdate, typeVar, lockedUpdate, pathUpdate), + Config: testAccCheckIBMCdTektonPipelinePropertyConfig("", name, typeVar, valueUpdate, lockedUpdate, pathUpdate), Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttr("ibm_cd_tekton_pipeline_property.cd_tekton_pipeline_property", "name", name), - resource.TestCheckResourceAttr("ibm_cd_tekton_pipeline_property.cd_tekton_pipeline_property", "value", valueUpdate), resource.TestCheckResourceAttr("ibm_cd_tekton_pipeline_property.cd_tekton_pipeline_property", "type", typeVar), + resource.TestCheckResourceAttr("ibm_cd_tekton_pipeline_property.cd_tekton_pipeline_property", "value", valueUpdate), resource.TestCheckResourceAttr("ibm_cd_tekton_pipeline_property.cd_tekton_pipeline_property", "locked", lockedUpdate), ), }, @@ -121,7 +121,7 @@ func testAccCheckIBMCdTektonPipelinePropertyConfigBasic(pipelineID string, name `, rgName, tcName) } -func testAccCheckIBMCdTektonPipelinePropertyConfig(pipelineID string, name string, value string, typeVar string, locked string, path string) string { +func testAccCheckIBMCdTektonPipelinePropertyConfig(pipelineID string, name string, typeVar string, value string, locked string, path string) string { rgName := acc.CdResourceGroupName tcName := fmt.Sprintf("tf_name_%d", acctest.RandIntRange(10, 100)) return fmt.Sprintf(` diff --git a/ibm/service/cdtektonpipeline/resource_ibm_cd_tekton_pipeline_trigger.go b/ibm/service/cdtektonpipeline/resource_ibm_cd_tekton_pipeline_trigger.go index 47378fd1bd..ff3f66a237 100644 --- a/ibm/service/cdtektonpipeline/resource_ibm_cd_tekton_pipeline_trigger.go +++ b/ibm/service/cdtektonpipeline/resource_ibm_cd_tekton_pipeline_trigger.go @@ -56,26 +56,16 @@ func ResourceIBMCdTektonPipelineTrigger() *schema.Resource { "tags": &schema.Schema{ Type: schema.TypeList, Optional: true, - Description: "Optional trigger tags array.", + Description: "Trigger tags array.", Elem: &schema.Schema{Type: schema.TypeString}, }, "worker": &schema.Schema{ Type: schema.TypeList, MaxItems: 1, Optional: true, - Description: "Details of the worker used to run the trigger.", + Description: "Specify the worker used to run the trigger. Use `worker: { id: 'public' }` to use the IBM Managed workers. The default is to inherit the worker set in the pipeline settings, which can also be explicitly set using `worker: { id: 'inherit' }`.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "name": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "Name of the worker. Computed based on the worker ID.", - }, - "type": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "Type of the worker. Computed based on the worker ID.", - }, "id": &schema.Schema{ Type: schema.TypeString, Required: true, @@ -93,13 +83,55 @@ func ResourceIBMCdTektonPipelineTrigger() *schema.Resource { Type: schema.TypeBool, Optional: true, Default: true, - Description: "Flag whether the trigger is enabled.", + Description: "Flag to check if the trigger is enabled. If omitted the trigger is enabled by default.", }, - "favorite": &schema.Schema{ - Type: schema.TypeBool, + "secret": &schema.Schema{ + Type: schema.TypeList, + MaxItems: 1, Optional: true, - Default: false, - Description: "Mark the trigger as a favorite.", + Description: "Only needed for Generic Webhook trigger type. The secret is used to start the Generic Webhook trigger.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "type": &schema.Schema{ + Type: schema.TypeString, + Required: true, + Description: "Secret type.", + }, + "value": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + DiffSuppressFunc: flex.SuppressGenericWebhookRawSecret, + Description: "Secret value, not needed if secret type is `internal_validation`.", + }, + "source": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Description: "Secret location, not needed if secret type is `internal_validation`.", + }, + "key_name": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Description: "Secret name, not needed if type is `internal_validation`.", + }, + "algorithm": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Description: "Algorithm used for `digest_matches` secret type. Only needed for `digest_matches` secret type.", + }, + }, + }, + }, + "cron": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + ValidateFunc: validate.InvokeValidator("ibm_cd_tekton_pipeline_trigger", "cron"), + Description: "Only needed for timer triggers. CRON expression that indicates when this trigger will activate. Maximum frequency is every 5 minutes. The string is based on UNIX crontab syntax: minute, hour, day of month, month, day of week. Example: The CRON expression 0 *_/2 * * * - translates to - every 2 hours.", + }, + "timezone": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + ValidateFunc: validate.InvokeValidator("ibm_cd_tekton_pipeline_trigger", "timezone"), + Description: "Only used for timer triggers. Specify the timezone used for this timer trigger, which will ensure the CRON activates this trigger relative to the specified timezone. If no timezone is specified, the default timezone used is UTC. Valid timezones are those listed in the IANA timezone database, https://www.iana.org/time-zones.", }, "source": &schema.Schema{ Type: schema.TypeList, @@ -130,36 +162,12 @@ func ResourceIBMCdTektonPipelineTrigger() *schema.Resource { "branch": &schema.Schema{ Type: schema.TypeString, Optional: true, - Description: "Name of a branch from the repo. One of branch or pattern must be specified, but only one or the other.", + Description: "Name of a branch from the repo. Only one of branch, pattern, or filter should be specified.", }, "pattern": &schema.Schema{ Type: schema.TypeString, Optional: true, - Description: "The pattern of Git branch or tag to which to listen. You can specify a glob pattern such as '!test' or '*master' to match against multiple tags/branches in the repository. The glob pattern used must conform to Bash 4.3 specifications, see bash documentation for more info: https://www.gnu.org/software/bash/manual/bash.html#Pattern-Matching. One of branch or pattern must be specified, but only one or the other.", - }, - "blind_connection": &schema.Schema{ - Type: schema.TypeBool, - Computed: true, - Description: "True if the repository server is not addressable on the public internet. IBM Cloud will not be able to validate the connection details you provide.", - }, - "hook_id": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "ID of the webhook from the repo. Computed upon creation of the trigger.", - }, - "tool": &schema.Schema{ - Type: schema.TypeList, - Computed: true, - Description: "Reference to the repository tool in the parent toolchain.", - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "id": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "ID of the repository tool instance in the parent toolchain.", - }, - }, - }, + Description: "The pattern of Git branch or tag. You can specify a glob pattern such as '!test' or '*master' to match against multiple tags or branches in the repository.The glob pattern used must conform to Bash 4.3 specifications, see bash documentation for more info: https://www.gnu.org/software/bash/manual/bash.html#Pattern-Matching. Only one of branch, pattern, or filter should be specified.", }, }, }, @@ -171,56 +179,20 @@ func ResourceIBMCdTektonPipelineTrigger() *schema.Resource { Type: schema.TypeList, Optional: true, DiffSuppressFunc: flex.SuppressTriggerEvents, - Description: "Only needed for Git triggers. List of events to which a Git trigger listens. Choose one or more from: 'push', 'pull_request' and 'pull_request_closed'. For SCM repositories that use 'merge request' events, such events map to the equivalent 'pull request' events.", + Description: "Either 'events' or 'filter' is required specifically for Git triggers. Stores a list of events that a Git trigger listens to. Choose one or more from 'push', 'pull_request', and 'pull_request_closed'. If SCM repositories use the 'merge request' term, they correspond to the generic term i.e. 'pull request'.", Elem: &schema.Schema{Type: schema.TypeString}, }, - "cron": &schema.Schema{ + "filter": &schema.Schema{ Type: schema.TypeString, Optional: true, - ValidateFunc: validate.InvokeValidator("ibm_cd_tekton_pipeline_trigger", "cron"), - Description: "Only needed for timer triggers. Cron expression that indicates when this trigger will activate. Maximum frequency is every 5 minutes. The string is based on UNIX crontab syntax: minute, hour, day of month, month, day of week. Example: 0 *_/2 * * * - every 2 hours.", + ValidateFunc: validate.InvokeValidator("ibm_cd_tekton_pipeline_trigger", "filter"), + Description: "Either 'events' or 'filter' can be used. Stores the CEL (Common Expression Language) expression value which is used for event filtering against the Git webhook payloads.", }, - "timezone": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ValidateFunc: validate.InvokeValidator("ibm_cd_tekton_pipeline_trigger", "timezone"), - Description: "Only used for timer triggers. Specify the timezone used for this timer trigger, which will ensure the cron activates this trigger relative to the specified timezone. If no timezone is specified, the default timezone used is UTC. Valid timezones are those listed in the IANA timezone database, https://www.iana.org/time-zones.", - }, - "secret": &schema.Schema{ - Type: schema.TypeList, - MaxItems: 1, + "favorite": &schema.Schema{ + Type: schema.TypeBool, Optional: true, - Description: "Only needed for generic webhook trigger type. Secret used to start generic webhook trigger.", - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "type": &schema.Schema{ - Type: schema.TypeString, - Required: true, - Description: "Secret type.", - }, - "value": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - DiffSuppressFunc: flex.SuppressGenericWebhookRawSecret, - Description: "Secret value, not needed if secret type is `internal_validation`.", - }, - "source": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Description: "Secret location, not needed if secret type is `internal_validation`.", - }, - "key_name": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Description: "Secret name, not needed if type is `internal_validation`.", - }, - "algorithm": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Description: "Algorithm used for `digest_matches` secret type. Only needed for `digest_matches` secret type.", - }, - }, - }, + Default: false, + Description: "Mark the trigger as a favorite.", }, "href": &schema.Schema{ Type: schema.TypeString, @@ -230,7 +202,7 @@ func ResourceIBMCdTektonPipelineTrigger() *schema.Resource { "properties": &schema.Schema{ Type: schema.TypeList, Computed: true, - Description: "Optional trigger properties used to override or supplement the pipeline properties when triggering a pipeline run.", + Description: "Optional trigger properties are used to override or supplement the pipeline properties when triggering a pipeline run.", Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "name": &schema.Schema{ @@ -344,6 +316,15 @@ func ResourceIBMCdTektonPipelineTriggerValidator() *validate.ResourceValidator { MinValueLength: 1, MaxValueLength: 253, }, + validate.ValidateSchema{ + Identifier: "filter", + ValidateFunctionIdentifier: validate.ValidateRegexpLen, + Type: validate.TypeString, + Optional: true, + Regexp: `^.*$`, + MinValueLength: 1, + MaxValueLength: 4096, + }, ) resourceValidator := validate.ResourceValidator{ResourceName: "ibm_cd_tekton_pipeline_trigger", Schema: validateSchema} @@ -411,6 +392,9 @@ func resourceIBMCdTektonPipelineTriggerCreate(context context.Context, d *schema sort.Strings(events) createTektonPipelineTriggerOptions.SetEvents(events) } + if _, ok := d.GetOk("filter"); ok { + createTektonPipelineTriggerOptions.SetFilter(d.Get("filter").(string)) + } if _, ok := d.GetOk("favorite"); ok { createTektonPipelineTriggerOptions.SetFavorite(d.Get("favorite").(bool)) } @@ -472,7 +456,7 @@ func resourceIBMCdTektonPipelineTriggerRead(context context.Context, d *schema.R } } if !core.IsNil(trigger.Worker) { - workerMap, err := resourceIBMCdTektonPipelineTriggerWorkerToMap(trigger.Worker) + workerMap, err := resourceIBMCdTektonPipelineTriggerWorkerIdentityToMap(trigger.Worker) if err != nil { return diag.FromErr(err) } @@ -490,23 +474,13 @@ func resourceIBMCdTektonPipelineTriggerRead(context context.Context, d *schema.R return diag.FromErr(fmt.Errorf("Error setting enabled: %s", err)) } } - if !core.IsNil(trigger.Favorite) { - if err = d.Set("favorite", trigger.Favorite); err != nil { - return diag.FromErr(fmt.Errorf("Error setting favorite: %s", err)) - } - } - if !core.IsNil(trigger.Source) { - sourceMap, err := resourceIBMCdTektonPipelineTriggerTriggerSourceToMap(trigger.Source) + if !core.IsNil(trigger.Secret) { + secretMap, err := resourceIBMCdTektonPipelineTriggerGenericSecretToMap(trigger.Secret) if err != nil { return diag.FromErr(err) } - if err = d.Set("source", []map[string]interface{}{sourceMap}); err != nil { - return diag.FromErr(fmt.Errorf("Error setting source: %s", err)) - } - } - if !core.IsNil(trigger.Events) { - if err = d.Set("events", trigger.Events); err != nil { - return diag.FromErr(fmt.Errorf("Error setting events: %s", err)) + if err = d.Set("secret", []map[string]interface{}{secretMap}); err != nil { + return diag.FromErr(fmt.Errorf("Error setting secret: %s", err)) } } if !core.IsNil(trigger.Cron) { @@ -519,13 +493,28 @@ func resourceIBMCdTektonPipelineTriggerRead(context context.Context, d *schema.R return diag.FromErr(fmt.Errorf("Error setting timezone: %s", err)) } } - if !core.IsNil(trigger.Secret) { - secretMap, err := resourceIBMCdTektonPipelineTriggerGenericSecretToMap(trigger.Secret) + if !core.IsNil(trigger.Source) { + sourceMap, err := resourceIBMCdTektonPipelineTriggerTriggerSourcePrototypeToMap(trigger.Source) if err != nil { return diag.FromErr(err) } - if err = d.Set("secret", []map[string]interface{}{secretMap}); err != nil { - return diag.FromErr(fmt.Errorf("Error setting secret: %s", err)) + if err = d.Set("source", []map[string]interface{}{sourceMap}); err != nil { + return diag.FromErr(fmt.Errorf("Error setting source: %s", err)) + } + } + if !core.IsNil(trigger.Events) { + if err = d.Set("events", trigger.Events); err != nil { + return diag.FromErr(fmt.Errorf("Error setting events: %s", err)) + } + } + if !core.IsNil(trigger.Filter) { + if err = d.Set("filter", trigger.Filter); err != nil { + return diag.FromErr(fmt.Errorf("Error setting filter: %s", err)) + } + } + if !core.IsNil(trigger.Favorite) { + if err = d.Set("favorite", trigger.Favorite); err != nil { + return diag.FromErr(fmt.Errorf("Error setting favorite: %s", err)) } } if !core.IsNil(trigger.Href) { @@ -583,17 +572,11 @@ func resourceIBMCdTektonPipelineTriggerUpdate(context context.Context, d *schema return diag.FromErr(fmt.Errorf("Cannot update resource property \"%s\" with the ForceNew annotation."+ " The resource must be re-created to update this property.", "pipeline_id")) } - if d.HasChange("type") { + if d.HasChange("type") || d.HasChange("name") || d.HasChange("event_listener") { newType := d.Get("type").(string) patchVals.Type = &newType - hasChange = true - } - if d.HasChange("name") { newName := d.Get("name").(string) patchVals.Name = &newName - hasChange = true - } - if d.HasChange("event_listener") { newEventListener := d.Get("event_listener").(string) patchVals.EventListener = &newEventListener hasChange = true @@ -755,22 +738,36 @@ func resourceIBMCdTektonPipelineTriggerMapToTriggerSourcePropertiesPrototype(mod return model, nil } -func resourceIBMCdTektonPipelineTriggerWorkerToMap(model *cdtektonpipelinev2.Worker) (map[string]interface{}, error) { +func resourceIBMCdTektonPipelineTriggerWorkerIdentityToMap(model *cdtektonpipelinev2.Worker) (map[string]interface{}, error) { + modelMap := make(map[string]interface{}) + modelMap["id"] = model.ID + return modelMap, nil +} + +func resourceIBMCdTektonPipelineTriggerGenericSecretToMap(model *cdtektonpipelinev2.GenericSecret) (map[string]interface{}, error) { modelMap := make(map[string]interface{}) - if model.Name != nil { - modelMap["name"] = model.Name - } if model.Type != nil { modelMap["type"] = model.Type } - modelMap["id"] = model.ID + if model.Value != nil { + modelMap["value"] = model.Value + } + if model.Source != nil { + modelMap["source"] = model.Source + } + if model.KeyName != nil { + modelMap["key_name"] = model.KeyName + } + if model.Algorithm != nil { + modelMap["algorithm"] = model.Algorithm + } return modelMap, nil } -func resourceIBMCdTektonPipelineTriggerTriggerSourceToMap(model *cdtektonpipelinev2.TriggerSource) (map[string]interface{}, error) { +func resourceIBMCdTektonPipelineTriggerTriggerSourcePrototypeToMap(model *cdtektonpipelinev2.TriggerSource) (map[string]interface{}, error) { modelMap := make(map[string]interface{}) modelMap["type"] = model.Type - propertiesMap, err := resourceIBMCdTektonPipelineTriggerTriggerSourcePropertiesToMap(model.Properties) + propertiesMap, err := resourceIBMCdTektonPipelineTriggerTriggerSourcePropertiesPrototypeToMap(model.Properties) if err != nil { return modelMap, err } @@ -778,7 +775,7 @@ func resourceIBMCdTektonPipelineTriggerTriggerSourceToMap(model *cdtektonpipelin return modelMap, nil } -func resourceIBMCdTektonPipelineTriggerTriggerSourcePropertiesToMap(model *cdtektonpipelinev2.TriggerSourceProperties) (map[string]interface{}, error) { +func resourceIBMCdTektonPipelineTriggerTriggerSourcePropertiesPrototypeToMap(model *cdtektonpipelinev2.TriggerSourceProperties) (map[string]interface{}, error) { modelMap := make(map[string]interface{}) modelMap["url"] = model.URL if model.Branch != nil { @@ -787,41 +784,6 @@ func resourceIBMCdTektonPipelineTriggerTriggerSourcePropertiesToMap(model *cdtek if model.Pattern != nil { modelMap["pattern"] = model.Pattern } - modelMap["blind_connection"] = model.BlindConnection - if model.HookID != nil { - modelMap["hook_id"] = model.HookID - } - toolMap, err := resourceIBMCdTektonPipelineTriggerToolToMap(model.Tool) - if err != nil { - return modelMap, err - } - modelMap["tool"] = []map[string]interface{}{toolMap} - return modelMap, nil -} - -func resourceIBMCdTektonPipelineTriggerToolToMap(model *cdtektonpipelinev2.Tool) (map[string]interface{}, error) { - modelMap := make(map[string]interface{}) - modelMap["id"] = model.ID - return modelMap, nil -} - -func resourceIBMCdTektonPipelineTriggerGenericSecretToMap(model *cdtektonpipelinev2.GenericSecret) (map[string]interface{}, error) { - modelMap := make(map[string]interface{}) - if model.Type != nil { - modelMap["type"] = model.Type - } - if model.Value != nil { - modelMap["value"] = model.Value - } - if model.Source != nil { - modelMap["source"] = model.Source - } - if model.KeyName != nil { - modelMap["key_name"] = model.KeyName - } - if model.Algorithm != nil { - modelMap["algorithm"] = model.Algorithm - } return modelMap, nil } diff --git a/ibm/service/cdtektonpipeline/resource_ibm_cd_tekton_pipeline_trigger_property.go b/ibm/service/cdtektonpipeline/resource_ibm_cd_tekton_pipeline_trigger_property.go index 6bc7117888..871b7e30a1 100644 --- a/ibm/service/cdtektonpipeline/resource_ibm_cd_tekton_pipeline_trigger_property.go +++ b/ibm/service/cdtektonpipeline/resource_ibm_cd_tekton_pipeline_trigger_property.go @@ -48,6 +48,13 @@ func ResourceIBMCdTektonPipelineTriggerProperty() *schema.Resource { ValidateFunc: validate.InvokeValidator("ibm_cd_tekton_pipeline_trigger_property", "name"), Description: "Property name.", }, + "type": &schema.Schema{ + Type: schema.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validate.InvokeValidator("ibm_cd_tekton_pipeline_trigger_property", "type"), + Description: "Property type.", + }, "value": &schema.Schema{ Type: schema.TypeString, Optional: true, @@ -61,18 +68,11 @@ func ResourceIBMCdTektonPipelineTriggerProperty() *schema.Resource { Description: "Options for `single_select` property type. Only needed for `single_select` property type.", Elem: &schema.Schema{Type: schema.TypeString}, }, - "type": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validate.InvokeValidator("ibm_cd_tekton_pipeline_trigger_property", "type"), - Description: "Property type.", - }, "path": &schema.Schema{ Type: schema.TypeString, Optional: true, ValidateFunc: validate.InvokeValidator("ibm_cd_tekton_pipeline_trigger_property", "path"), - Description: "A dot notation path for `integration` type properties only, that selects a value from the tool integration. If left blank the full tool integration data will be used.", + Description: "A dot notation path for `integration` type properties only, to select a value from the tool integration. If left blank the full tool integration data will be used.", }, "locked": &schema.Schema{ Type: schema.TypeBool, @@ -119,6 +119,13 @@ func ResourceIBMCdTektonPipelineTriggerPropertyValidator() *validate.ResourceVal MinValueLength: 1, MaxValueLength: 253, }, + validate.ValidateSchema{ + Identifier: "type", + ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, + Type: validate.TypeString, + Required: true, + AllowedValues: "appconfig, integration, secure, single_select, text", + }, validate.ValidateSchema{ Identifier: "value", ValidateFunctionIdentifier: validate.ValidateRegexpLen, @@ -128,13 +135,6 @@ func ResourceIBMCdTektonPipelineTriggerPropertyValidator() *validate.ResourceVal MinValueLength: 0, MaxValueLength: 4096, }, - validate.ValidateSchema{ - Identifier: "type", - ValidateFunctionIdentifier: validate.ValidateAllowedStringValue, - Type: validate.TypeString, - Required: true, - AllowedValues: "appconfig, integration, secure, single_select, text", - }, validate.ValidateSchema{ Identifier: "path", ValidateFunctionIdentifier: validate.ValidateRegexpLen, @@ -227,6 +227,9 @@ func resourceIBMCdTektonPipelineTriggerPropertyRead(context context.Context, d * if err = d.Set("name", triggerProperty.Name); err != nil { return diag.FromErr(fmt.Errorf("Error setting name: %s", err)) } + if err = d.Set("type", triggerProperty.Type); err != nil { + return diag.FromErr(fmt.Errorf("Error setting type: %s", err)) + } if !core.IsNil(triggerProperty.Value) { if err = d.Set("value", triggerProperty.Value); err != nil { return diag.FromErr(fmt.Errorf("Error setting value: %s", err)) @@ -237,9 +240,6 @@ func resourceIBMCdTektonPipelineTriggerPropertyRead(context context.Context, d * return diag.FromErr(fmt.Errorf("Error setting enum: %s", err)) } } - if err = d.Set("type", triggerProperty.Type); err != nil { - return diag.FromErr(fmt.Errorf("Error setting type: %s", err)) - } if !core.IsNil(triggerProperty.Path) { if err = d.Set("path", triggerProperty.Path); err != nil { return diag.FromErr(fmt.Errorf("Error setting path: %s", err)) diff --git a/ibm/service/cdtektonpipeline/resource_ibm_cd_tekton_pipeline_trigger_property_test.go b/ibm/service/cdtektonpipeline/resource_ibm_cd_tekton_pipeline_trigger_property_test.go index a734ff057d..fe5bcbf629 100644 --- a/ibm/service/cdtektonpipeline/resource_ibm_cd_tekton_pipeline_trigger_property_test.go +++ b/ibm/service/cdtektonpipeline/resource_ibm_cd_tekton_pipeline_trigger_property_test.go @@ -41,8 +41,8 @@ func TestAccIBMCdTektonPipelineTriggerPropertyBasic(t *testing.T) { func TestAccIBMCdTektonPipelineTriggerPropertyAllArgs(t *testing.T) { var conf cdtektonpipelinev2.TriggerProperty name := fmt.Sprintf("tf_name_%d", acctest.RandIntRange(10, 100)) - value := fmt.Sprintf("tf_value_%d", acctest.RandIntRange(10, 100)) typeVar := "text" + value := fmt.Sprintf("tf_value_%d", acctest.RandIntRange(10, 100)) path := fmt.Sprintf("tf_path_%d", acctest.RandIntRange(10, 100)) locked := "true" valueUpdate := fmt.Sprintf("tf_value_%d", acctest.RandIntRange(10, 100)) @@ -55,21 +55,21 @@ func TestAccIBMCdTektonPipelineTriggerPropertyAllArgs(t *testing.T) { CheckDestroy: testAccCheckIBMCdTektonPipelineTriggerPropertyDestroy, Steps: []resource.TestStep{ resource.TestStep{ - Config: testAccCheckIBMCdTektonPipelineTriggerPropertyConfig("", "", name, value, typeVar, path, locked), + Config: testAccCheckIBMCdTektonPipelineTriggerPropertyConfig("", "", name, typeVar, value, path, locked), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckIBMCdTektonPipelineTriggerPropertyExists("ibm_cd_tekton_pipeline_trigger_property.cd_tekton_pipeline_trigger_property", conf), resource.TestCheckResourceAttr("ibm_cd_tekton_pipeline_trigger_property.cd_tekton_pipeline_trigger_property", "name", name), - resource.TestCheckResourceAttr("ibm_cd_tekton_pipeline_trigger_property.cd_tekton_pipeline_trigger_property", "value", value), resource.TestCheckResourceAttr("ibm_cd_tekton_pipeline_trigger_property.cd_tekton_pipeline_trigger_property", "type", typeVar), + resource.TestCheckResourceAttr("ibm_cd_tekton_pipeline_trigger_property.cd_tekton_pipeline_trigger_property", "value", value), resource.TestCheckResourceAttr("ibm_cd_tekton_pipeline_trigger_property.cd_tekton_pipeline_trigger_property", "locked", locked), ), }, resource.TestStep{ - Config: testAccCheckIBMCdTektonPipelineTriggerPropertyConfig("", "", name, valueUpdate, typeVar, pathUpdate, lockedUpdate), + Config: testAccCheckIBMCdTektonPipelineTriggerPropertyConfig("", "", name, typeVar, valueUpdate, pathUpdate, lockedUpdate), Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttr("ibm_cd_tekton_pipeline_trigger_property.cd_tekton_pipeline_trigger_property", "name", name), - resource.TestCheckResourceAttr("ibm_cd_tekton_pipeline_trigger_property.cd_tekton_pipeline_trigger_property", "value", valueUpdate), resource.TestCheckResourceAttr("ibm_cd_tekton_pipeline_trigger_property.cd_tekton_pipeline_trigger_property", "type", typeVar), + resource.TestCheckResourceAttr("ibm_cd_tekton_pipeline_trigger_property.cd_tekton_pipeline_trigger_property", "value", valueUpdate), resource.TestCheckResourceAttr("ibm_cd_tekton_pipeline_trigger_property.cd_tekton_pipeline_trigger_property", "locked", lockedUpdate), ), }, @@ -151,7 +151,7 @@ func testAccCheckIBMCdTektonPipelineTriggerPropertyConfigBasic(pipelineID string `, rgName, tcName) } -func testAccCheckIBMCdTektonPipelineTriggerPropertyConfig(pipelineID string, triggerID string, name string, value string, typeVar string, path string, locked string) string { +func testAccCheckIBMCdTektonPipelineTriggerPropertyConfig(pipelineID string, triggerID string, name string, typeVar string, value string, path string, locked string) string { rgName := acc.CdResourceGroupName tcName := fmt.Sprintf("tf_name_%d", acctest.RandIntRange(10, 100)) return fmt.Sprintf(` diff --git a/ibm/service/cdtektonpipeline/resource_ibm_cd_tekton_pipeline_trigger_test.go b/ibm/service/cdtektonpipeline/resource_ibm_cd_tekton_pipeline_trigger_test.go index 07fb372eb4..748f3ab368 100644 --- a/ibm/service/cdtektonpipeline/resource_ibm_cd_tekton_pipeline_trigger_test.go +++ b/ibm/service/cdtektonpipeline/resource_ibm_cd_tekton_pipeline_trigger_test.go @@ -1,4 +1,4 @@ -// Copyright IBM Corp. 2023 All Rights Reserved. +// Copyright IBM Corp. 2024 All Rights Reserved. // Licensed under the Mozilla Public License v2.0 package cdtektonpipeline_test @@ -62,17 +62,19 @@ func TestAccIBMCdTektonPipelineTriggerAllArgs(t *testing.T) { eventListener := "listener" maxConcurrentRuns := fmt.Sprintf("%d", acctest.RandIntRange(3, 4)) enabled := "false" - favorite := "false" cron := fmt.Sprintf("*/5 10 10 %d *", acctest.RandIntRange(1, 12)) timezone := "Europe/London" + filter := "test" + favorite := "false" typeVarUpdate := "generic" nameUpdate := fmt.Sprintf("tf_name_%d", acctest.RandIntRange(10, 100)) eventListenerUpdate := fmt.Sprintf("tf_event_listener_%d", acctest.RandIntRange(10, 100)) maxConcurrentRunsUpdate := fmt.Sprintf("%d", acctest.RandIntRange(1, 2)) enabledUpdate := "true" - favoriteUpdate := "true" cronUpdate := fmt.Sprintf("*/10 %d 10 10 *", acctest.RandIntRange(1, 23)) timezoneUpdate := "America/New_York" + filterUpdate := "true" + favoriteUpdate := "true" resource.Test(t, resource.TestCase{ PreCheck: func() { acc.TestAccPreCheck(t) }, @@ -80,7 +82,7 @@ func TestAccIBMCdTektonPipelineTriggerAllArgs(t *testing.T) { CheckDestroy: testAccCheckIBMCdTektonPipelineTriggerDestroy, Steps: []resource.TestStep{ resource.TestStep{ - Config: testAccCheckIBMCdTektonPipelineTriggerConfig(pipelineID, typeVar, name, eventListener, maxConcurrentRuns, enabled, favorite, cron, timezone), + Config: testAccCheckIBMCdTektonPipelineTriggerConfig(pipelineID, typeVar, name, eventListener, maxConcurrentRuns, enabled, cron, timezone, filter, favorite), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckIBMCdTektonPipelineTriggerExists("ibm_cd_tekton_pipeline_trigger.cd_tekton_pipeline_trigger", conf), testAccCheckIBMCdTektonPipelineTriggerExists("ibm_cd_tekton_pipeline_trigger.cd_tekton_pipeline_trigger2", conf), @@ -88,9 +90,10 @@ func TestAccIBMCdTektonPipelineTriggerAllArgs(t *testing.T) { resource.TestCheckResourceAttr("ibm_cd_tekton_pipeline_trigger.cd_tekton_pipeline_trigger", "name", name), resource.TestCheckResourceAttr("ibm_cd_tekton_pipeline_trigger.cd_tekton_pipeline_trigger", "max_concurrent_runs", maxConcurrentRuns), resource.TestCheckResourceAttr("ibm_cd_tekton_pipeline_trigger.cd_tekton_pipeline_trigger", "enabled", enabled), - resource.TestCheckResourceAttr("ibm_cd_tekton_pipeline_trigger.cd_tekton_pipeline_trigger", "favorite", favorite), resource.TestCheckResourceAttr("ibm_cd_tekton_pipeline_trigger.cd_tekton_pipeline_trigger2", "cron", cron), resource.TestCheckResourceAttr("ibm_cd_tekton_pipeline_trigger.cd_tekton_pipeline_trigger2", "timezone", timezone), + resource.TestCheckResourceAttr("ibm_cd_tekton_pipeline_trigger.cd_tekton_pipeline_trigger", "filter", filter), + resource.TestCheckResourceAttr("ibm_cd_tekton_pipeline_trigger.cd_tekton_pipeline_trigger", "favorite", favorite), resource.TestCheckResourceAttrSet("ibm_cd_tekton_pipeline_trigger.cd_tekton_pipeline_trigger", "pipeline_id"), resource.TestCheckResourceAttrSet("ibm_cd_tekton_pipeline_trigger.cd_tekton_pipeline_trigger", "trigger_id"), resource.TestCheckResourceAttrSet("ibm_cd_tekton_pipeline_trigger.cd_tekton_pipeline_trigger2", "pipeline_id"), @@ -106,14 +109,15 @@ func TestAccIBMCdTektonPipelineTriggerAllArgs(t *testing.T) { ), }, resource.TestStep{ - Config: testAccCheckIBMCdTektonPipelineTriggerConfig(pipelineID, typeVarUpdate, nameUpdate, eventListenerUpdate, maxConcurrentRunsUpdate, enabledUpdate, favoriteUpdate, cronUpdate, timezoneUpdate), + Config: testAccCheckIBMCdTektonPipelineTriggerConfig(pipelineID, typeVarUpdate, nameUpdate, eventListenerUpdate, maxConcurrentRunsUpdate, enabledUpdate, cronUpdate, timezoneUpdate, filterUpdate, favoriteUpdate), Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttr("ibm_cd_tekton_pipeline_trigger.cd_tekton_pipeline_trigger", "name", nameUpdate), resource.TestCheckResourceAttr("ibm_cd_tekton_pipeline_trigger.cd_tekton_pipeline_trigger", "max_concurrent_runs", maxConcurrentRunsUpdate), resource.TestCheckResourceAttr("ibm_cd_tekton_pipeline_trigger.cd_tekton_pipeline_trigger", "enabled", enabledUpdate), - resource.TestCheckResourceAttr("ibm_cd_tekton_pipeline_trigger.cd_tekton_pipeline_trigger", "favorite", favoriteUpdate), resource.TestCheckResourceAttr("ibm_cd_tekton_pipeline_trigger.cd_tekton_pipeline_trigger2", "cron", cronUpdate), resource.TestCheckResourceAttr("ibm_cd_tekton_pipeline_trigger.cd_tekton_pipeline_trigger2", "timezone", timezoneUpdate), + resource.TestCheckResourceAttr("ibm_cd_tekton_pipeline_trigger.cd_tekton_pipeline_trigger", "filter", filterUpdate), + resource.TestCheckResourceAttr("ibm_cd_tekton_pipeline_trigger.cd_tekton_pipeline_trigger", "favorite", favoriteUpdate), resource.TestCheckResourceAttrSet("ibm_cd_tekton_pipeline_trigger.cd_tekton_pipeline_trigger", "pipeline_id"), resource.TestCheckResourceAttrSet("ibm_cd_tekton_pipeline_trigger.cd_tekton_pipeline_trigger", "trigger_id"), resource.TestCheckResourceAttrSet("ibm_cd_tekton_pipeline_trigger.cd_tekton_pipeline_trigger2", "pipeline_id"), @@ -199,7 +203,7 @@ func testAccCheckIBMCdTektonPipelineTriggerConfigBasic(pipelineID string, typeVa `, rgName, tcName, typeVar, name, eventListener) } -func testAccCheckIBMCdTektonPipelineTriggerConfig(pipelineID string, typeVar string, name string, eventListener string, maxConcurrentRuns string, enabled string, favorite string, cron string, timezone string) string { +func testAccCheckIBMCdTektonPipelineTriggerConfig(pipelineID string, typeVar string, name string, eventListener string, maxConcurrentRuns string, enabled string, cron string, timezone string, filter string, favorite string) string { rgName := acc.CdResourceGroupName tcName := fmt.Sprintf("tf_name_%d", acctest.RandIntRange(10, 100)) return fmt.Sprintf(` diff --git a/website/docs/d/cd_tekton_pipeline.html.markdown b/website/docs/d/cd_tekton_pipeline.html.markdown index ea9ec48c00..910dd17c6b 100644 --- a/website/docs/d/cd_tekton_pipeline.html.markdown +++ b/website/docs/d/cd_tekton_pipeline.html.markdown @@ -8,7 +8,7 @@ subcategory: "Continuous Delivery" # ibm_cd_tekton_pipeline -Provides a read-only data source to retrieve information about a cd_tekton_pipeline. You can then reference the fields of the data source in other resources within the same configuration by using interpolation syntax. +Provides a read-only data source for cd_tekton_pipeline. You can then reference the fields of the data source in other resources within the same configuration using interpolation syntax. ## Example Usage @@ -20,14 +20,14 @@ data "ibm_cd_tekton_pipeline" "cd_tekton_pipeline" { ## Argument Reference -You can specify the following arguments for this data source. +Review the argument reference that you can specify for your data source. * `pipeline_id` - (Required, Forces new resource, String) ID of current instance. * Constraints: The maximum length is `36` characters. The minimum length is `36` characters. The value must match regular expression `/^[-0-9a-z]+$/`. ## Attribute Reference -After your data source is created, you can read values from the following attributes. +In addition to all argument references listed, you can access the following attribute references after your data source is created. * `id` - The unique identifier of the cd_tekton_pipeline. * `build_number` - (Integer) The latest pipeline run build number. If this property is absent, the pipeline hasn't had any pipeline runs. @@ -37,15 +37,15 @@ After your data source is created, you can read values from the following attrib * `definitions` - (List) Definition list. * Constraints: The maximum length is `128` items. The minimum length is `0` items. -Nested schema for **definitions**: +Nested scheme for **definitions**: * `href` - (String) API URL for interacting with the definition. * Constraints: The maximum length is `2048` characters. The minimum length is `10` characters. The value must match regular expression `/^http(s)?:\/\/([^\/?#]*)([^?#]*)(\\?([^#]*))?(#(.*))?$/`. * `id` - (String) The aggregated definition ID. * Constraints: The maximum length is `36` characters. The minimum length is `36` characters. The value must match regular expression `/^[-0-9a-z]+$/`. * `source` - (List) Source repository containing the Tekton pipeline definition. - Nested schema for **source**: + Nested scheme for **source**: * `properties` - (List) Properties of the source, which define the URL of the repository and a branch or tag. - Nested schema for **properties**: + Nested scheme for **properties**: * `branch` - (String) A branch from the repo, specify one of branch or tag only. * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z_.]{1,253}$/`. * `path` - (String) The path to the definition's YAML files. @@ -53,7 +53,7 @@ Nested schema for **definitions**: * `tag` - (String) A tag from the repo, specify one of branch or tag only. * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z_]{1,253}$/`. * `tool` - (List) Reference to the repository tool in the parent toolchain. - Nested schema for **tool**: + Nested scheme for **tool**: * `id` - (String) ID of the repository tool instance in the parent toolchain. * Constraints: The maximum length is `36` characters. The minimum length is `36` characters. The value must match regular expression `/^[-0-9a-z]+$/`. * `url` - (Forces new resource, String) URL of the definition repository. @@ -61,11 +61,11 @@ Nested schema for **definitions**: * `type` - (String) The only supported source type is "git", indicating that the source is a git repository. * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^git$/`. -* `enable_notifications` - (Boolean) Flag whether to enable notifications for this pipeline. When enabled, pipeline run events will be published on all slack integration specified channels in the parent toolchain. If omitted, this feature is disabled by default. +* `enable_notifications` - (Boolean) Flag to enable notifications for this pipeline. If enabled, the Tekton pipeline run events will be published to all the destinations specified by the Slack and Event Notifications integrations in the parent toolchain. If omitted, this feature is disabled by default. -* `enable_partial_cloning` - (Boolean) Flag whether to enable partial cloning for this pipeline. When partial clone is enabled, only the files contained within the paths specified in definition repositories are read and cloned, this means that symbolic links might not work. If omitted, this feature is disabled by default. +* `enable_partial_cloning` - (Boolean) Flag to enable partial cloning for this pipeline. When partial clone is enabled, only the files contained within the paths specified in definition repositories are read and cloned, this means that symbolic links might not work. If omitted, this feature is disabled by default. -* `enabled` - (Boolean) Flag whether this pipeline is enabled. +* `enabled` - (Boolean) Flag to check if the trigger is enabled. * Constraints: The default value is `true`. * `href` - (String) API URL for interacting with the pipeline. @@ -79,7 +79,7 @@ Nested schema for **definitions**: * `properties` - (List) Tekton pipeline's environment properties. * Constraints: The maximum length is `1024` items. The minimum length is `0` items. -Nested schema for **properties**: +Nested scheme for **properties**: * `enum` - (List) Options for `single_select` property type. Only needed when using `single_select` property type. * Constraints: The list items must match regular expression `/^[-0-9a-zA-Z_.]{1,253}$/`. The maximum length is `256` items. The minimum length is `0` items. * `href` - (String) API URL for interacting with the property. @@ -95,7 +95,7 @@ Nested schema for **properties**: * Constraints: The maximum length is `4096` characters. The minimum length is `0` characters. The value must match regular expression `/^.*$/`. * `resource_group` - (List) The resource group in which the pipeline was created. -Nested schema for **resource_group**: +Nested scheme for **resource_group**: * `id` - (String) ID. * Constraints: The maximum length is `64` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z_]+$/`. @@ -106,7 +106,7 @@ Nested schema for **resource_group**: * Constraints: Allowable values are: `configured`, `configuring`. * `toolchain` - (List) Toolchain object containing references to the parent toolchain. -Nested schema for **toolchain**: +Nested scheme for **toolchain**: * `crn` - (String) The CRN for the toolchain that contains the Tekton pipeline. * 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}$/`. * `id` - (String) UUID. @@ -114,17 +114,19 @@ Nested schema for **toolchain**: * `triggers` - (List) Tekton pipeline triggers list. * Constraints: The maximum length is `1024` items. The minimum length is `0` items. -Nested schema for **triggers**: - * `cron` - (String) Only needed for timer triggers. Cron expression that indicates when this trigger will activate. Maximum frequency is every 5 minutes. The string is based on UNIX crontab syntax: minute, hour, day of month, month, day of week. Example: 0 *_/2 * * * - every 2 hours. +Nested scheme for **triggers**: + * `cron` - (String) Only needed for timer triggers. CRON expression that indicates when this trigger will activate. Maximum frequency is every 5 minutes. The string is based on UNIX crontab syntax: minute, hour, day of month, month, day of week. Example: The CRON expression 0 *_/2 * * * - translates to - every 2 hours. * Constraints: The maximum length is `253` characters. The minimum length is `5` characters. The value must match regular expression `/^[-0-9a-zA-Z,\\*\/ ]{5,253}$/`. - * `enabled` - (Boolean) Flag whether the trigger is enabled. + * `enabled` - (Boolean) Flag to check if the trigger is enabled. * Constraints: The default value is `true`. * `event_listener` - (String) Event listener name. The name of the event listener to which the trigger is associated. The event listeners are defined in the definition repositories of the Tekton pipeline. * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z_.]{1,253}$/`. - * `events` - (List) Only needed for Git triggers. List of events to which a Git trigger listens. Choose one or more from: 'push', 'pull_request' and 'pull_request_closed'. For SCM repositories that use 'merge request' events, such events map to the equivalent 'pull request' events. + * `events` - (List) Either 'events' or 'filter' is required specifically for Git triggers. Stores a list of events that a Git trigger listens to. Choose one or more from 'push', 'pull_request', and 'pull_request_closed'. If SCM repositories use the 'merge request' term, they correspond to the generic term i.e. 'pull request'. * Constraints: Allowable list items are: `push`, `pull_request`, `pull_request_closed`. The maximum length is `3` items. The minimum length is `0` items. * `favorite` - (Boolean) Mark the trigger as a favorite. * Constraints: The default value is `false`. + * `filter` - (String) Either 'events' or 'filter' can be used. Stores the CEL (Common Expression Language) expression value which is used for event filtering against the Git webhook payloads. + * Constraints: The maximum length is `4096` characters. The minimum length is `1` character. The value must match regular expression `/^.*$/`. * `href` - (String) API URL for interacting with the trigger. Only included when fetching the list of pipeline triggers. * Constraints: The maximum length is `2048` characters. The minimum length is `10` characters. The value must match regular expression `/^http(s)?:\/\/([^\/?#]*)([^?#]*)(\\?([^#]*))?(#(.*))?$/`. * `id` - (String) The Trigger ID. @@ -132,9 +134,9 @@ Nested schema for **triggers**: * `max_concurrent_runs` - (Integer) Defines the maximum number of concurrent runs for this trigger. If omitted then the concurrency limit is disabled for this trigger. * `name` - (String) Trigger name. * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^([a-zA-Z0-9]{1,2}|[a-zA-Z0-9][0-9a-zA-Z-_.: \/\\(\\)\\[\\]]{1,251}[a-zA-Z0-9])$/`. - * `properties` - (List) Optional trigger properties used to override or supplement the pipeline properties when triggering a pipeline run. + * `properties` - (List) Optional trigger properties are used to override or supplement the pipeline properties when triggering a pipeline run. * Constraints: The maximum length is `1024` items. The minimum length is `0` items. - Nested schema for **properties**: + Nested scheme for **properties**: * `enum` - (List) Options for `single_select` property type. Only needed for `single_select` property type. * Constraints: The list items must match regular expression `/^[-0-9a-zA-Z_.]{1,253}$/`. The maximum length is `256` items. The minimum length is `0` items. * `href` - (String) API URL for interacting with the trigger property. @@ -148,8 +150,8 @@ Nested schema for **triggers**: * Constraints: Allowable values are: `secure`, `text`, `integration`, `single_select`, `appconfig`. * `value` - (String) Property value. Any string value is valid. * Constraints: The maximum length is `4096` characters. The minimum length is `0` characters. The value must match regular expression `/^.*$/`. - * `secret` - (List) Only needed for generic webhook trigger type. Secret used to start generic webhook trigger. - Nested schema for **secret**: + * `secret` - (List) Only needed for Generic Webhook trigger type. The secret is used to start the Generic Webhook trigger. + Nested scheme for **secret**: * `algorithm` - (String) Algorithm used for `digest_matches` secret type. Only needed for `digest_matches` secret type. * Constraints: Allowable values are: `md4`, `md5`, `sha1`, `sha256`, `sha384`, `sha512`, `sha512_224`, `sha512_256`, `ripemd160`. * `key_name` - (String) Secret name, not needed if type is `internal_validation`. @@ -161,18 +163,18 @@ Nested schema for **triggers**: * `value` - (String) Secret value, not needed if secret type is `internal_validation`. * Constraints: The maximum length is `4096` characters. The minimum length is `0` characters. The value must match regular expression `/^.*$/`. * `source` - (List) Source repository for a Git trigger. Only required for Git triggers. The referenced repository URL must match the URL of a repository tool integration in the parent toolchain. Obtain the list of integrations from the toolchain API https://cloud.ibm.com/apidocs/toolchain#list-tools. - Nested schema for **source**: + Nested scheme for **source**: * `properties` - (List) Properties of the source, which define the URL of the repository and a branch or pattern. - Nested schema for **properties**: + Nested scheme for **properties**: * `blind_connection` - (Boolean) True if the repository server is not addressable on the public internet. IBM Cloud will not be able to validate the connection details you provide. - * `branch` - (String) Name of a branch from the repo. One of branch or pattern must be specified, but only one or the other. + * `branch` - (String) Name of a branch from the repo. Only one of branch, pattern, or filter should be specified. * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z_.]{1,253}$/`. - * `hook_id` - (String) ID of the webhook from the repo. Computed upon creation of the trigger. + * `hook_id` - (String) Repository webhook ID. It is generated upon trigger creation. * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z_.]{1,253}$/`. - * `pattern` - (String) The pattern of Git branch or tag to which to listen. You can specify a glob pattern such as '!test' or '*master' to match against multiple tags/branches in the repository. The glob pattern used must conform to Bash 4.3 specifications, see bash documentation for more info: https://www.gnu.org/software/bash/manual/bash.html#Pattern-Matching. One of branch or pattern must be specified, but only one or the other. + * `pattern` - (String) The pattern of Git branch or tag. You can specify a glob pattern such as '!test' or '*master' to match against multiple tags or branches in the repository.The glob pattern used must conform to Bash 4.3 specifications, see bash documentation for more info: https://www.gnu.org/software/bash/manual/bash.html#Pattern-Matching. Only one of branch, pattern, or filter should be specified. * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z_.:@=$&^\/\\?\\!\\*\\+\\[\\]\\(\\)\\{\\}\\|\\\\]*$/`. * `tool` - (List) Reference to the repository tool in the parent toolchain. - Nested schema for **tool**: + Nested scheme for **tool**: * `id` - (String) ID of the repository tool instance in the parent toolchain. * Constraints: The maximum length is `36` characters. The minimum length is `36` characters. The value must match regular expression `/^[-0-9a-z]+$/`. * `url` - (Forces new resource, String) URL of the repository to which the trigger is listening. @@ -181,14 +183,14 @@ Nested schema for **triggers**: * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^git$/`. * `tags` - (List) Optional trigger tags array. * Constraints: The list items must match regular expression `/^[-0-9a-zA-Z_.]{1,253}$/`. The maximum length is `128` items. The minimum length is `0` items. - * `timezone` - (String) Only used for timer triggers. Specify the timezone used for this timer trigger, which will ensure the cron activates this trigger relative to the specified timezone. If no timezone is specified, the default timezone used is UTC. Valid timezones are those listed in the IANA timezone database, https://www.iana.org/time-zones. + * `timezone` - (String) Only used for timer triggers. Specify the timezone used for this timer trigger, which will ensure the CRON activates this trigger relative to the specified timezone. If no timezone is specified, the default timezone used is UTC. Valid timezones are those listed in the IANA timezone database, https://www.iana.org/time-zones. * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z+_., \/]{1,253}$/`. * `type` - (String) Trigger type. * Constraints: Allowable values are: `manual`, `scm`, `timer`, `generic`. * `webhook_url` - (String) Webhook URL that can be used to trigger pipeline runs. * Constraints: The maximum length is `2048` characters. The minimum length is `10` characters. The value must match regular expression `/^http(s)?:\/\/([^\/?#]*)([^?#]*)(\\?([^#]*))?(#(.*))?$/`. * `worker` - (List) Details of the worker used to run the trigger. - Nested schema for **worker**: + Nested scheme for **worker**: * `id` - (String) ID of the worker. * Constraints: The maximum length is `36` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z]{1,36}$/`. * `name` - (String) Name of the worker. Computed based on the worker ID. @@ -199,7 +201,7 @@ Nested schema for **triggers**: * `updated_at` - (String) Standard RFC 3339 Date Time String. * `worker` - (List) Details of the worker used to run the pipeline. -Nested schema for **worker**: +Nested scheme for **worker**: * `id` - (String) ID of the worker. * Constraints: The maximum length is `36` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z]{1,36}$/`. * `name` - (String) Name of the worker. Computed based on the worker ID. diff --git a/website/docs/d/cd_tekton_pipeline_definition.html.markdown b/website/docs/d/cd_tekton_pipeline_definition.html.markdown index eb8d6b1fa8..50e4ca46d4 100644 --- a/website/docs/d/cd_tekton_pipeline_definition.html.markdown +++ b/website/docs/d/cd_tekton_pipeline_definition.html.markdown @@ -8,7 +8,7 @@ subcategory: "Continuous Delivery" # ibm_cd_tekton_pipeline_definition -Provides a read-only data source to retrieve information about a cd_tekton_pipeline_definition. You can then reference the fields of the data source in other resources within the same configuration by using interpolation syntax. +Provides a read-only data source for cd_tekton_pipeline_definition. You can then reference the fields of the data source in other resources within the same configuration using interpolation syntax. ## Example Usage @@ -21,7 +21,7 @@ data "ibm_cd_tekton_pipeline_definition" "cd_tekton_pipeline_definition" { ## Argument Reference -You can specify the following arguments for this data source. +Review the argument reference that you can specify for your data source. * `definition_id` - (Required, Forces new resource, String) The definition ID. * Constraints: The maximum length is `36` characters. The minimum length is `36` characters. The value must match regular expression `/^[-0-9a-z]+$/`. @@ -30,16 +30,16 @@ You can specify the following arguments for this data source. ## Attribute Reference -After your data source is created, you can read values from the following attributes. +In addition to all argument references listed, you can access the following attribute references after your data source is created. * `id` - The unique identifier of the cd_tekton_pipeline_definition. * `href` - (String) API URL for interacting with the definition. * Constraints: The maximum length is `2048` characters. The minimum length is `10` characters. The value must match regular expression `/^http(s)?:\/\/([^\/?#]*)([^?#]*)(\\?([^#]*))?(#(.*))?$/`. * `source` - (List) Source repository containing the Tekton pipeline definition. -Nested schema for **source**: +Nested scheme for **source**: * `properties` - (List) Properties of the source, which define the URL of the repository and a branch or tag. - Nested schema for **properties**: + Nested scheme for **properties**: * `branch` - (String) A branch from the repo, specify one of branch or tag only. * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z_.]{1,253}$/`. * `path` - (String) The path to the definition's YAML files. @@ -47,7 +47,7 @@ Nested schema for **source**: * `tag` - (String) A tag from the repo, specify one of branch or tag only. * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z_]{1,253}$/`. * `tool` - (List) Reference to the repository tool in the parent toolchain. - Nested schema for **tool**: + Nested scheme for **tool**: * `id` - (String) ID of the repository tool instance in the parent toolchain. * Constraints: The maximum length is `36` characters. The minimum length is `36` characters. The value must match regular expression `/^[-0-9a-z]+$/`. * `url` - (Forces new resource, String) URL of the definition repository. diff --git a/website/docs/d/cd_tekton_pipeline_property.html.markdown b/website/docs/d/cd_tekton_pipeline_property.html.markdown index 820be2a01b..2316b7e8af 100644 --- a/website/docs/d/cd_tekton_pipeline_property.html.markdown +++ b/website/docs/d/cd_tekton_pipeline_property.html.markdown @@ -8,7 +8,7 @@ subcategory: "Continuous Delivery" # ibm_cd_tekton_pipeline_property -Provides a read-only data source to retrieve information about a cd_tekton_pipeline_property. You can then reference the fields of the data source in other resources within the same configuration by using interpolation syntax. +Provides a read-only data source for cd_tekton_pipeline_property. You can then reference the fields of the data source in other resources within the same configuration using interpolation syntax. ## Example Usage @@ -21,7 +21,7 @@ data "ibm_cd_tekton_pipeline_property" "cd_tekton_pipeline_property" { ## Argument Reference -You can specify the following arguments for this data source. +Review the argument reference that you can specify for your data source. * `pipeline_id` - (Required, Forces new resource, String) The Tekton pipeline ID. * Constraints: The maximum length is `36` characters. The minimum length is `36` characters. The value must match regular expression `/^[-0-9a-z]+$/`. @@ -30,7 +30,7 @@ You can specify the following arguments for this data source. ## Attribute Reference -After your data source is created, you can read values from the following attributes. +In addition to all argument references listed, you can access the following attribute references after your data source is created. * `id` - The unique identifier of the cd_tekton_pipeline_property. * `enum` - (List) Options for `single_select` property type. Only needed when using `single_select` property type. diff --git a/website/docs/d/cd_tekton_pipeline_trigger.html.markdown b/website/docs/d/cd_tekton_pipeline_trigger.html.markdown index c3daa65898..3469425bc6 100644 --- a/website/docs/d/cd_tekton_pipeline_trigger.html.markdown +++ b/website/docs/d/cd_tekton_pipeline_trigger.html.markdown @@ -8,7 +8,7 @@ subcategory: "Continuous Delivery" # ibm_cd_tekton_pipeline_trigger -Provides a read-only data source to retrieve information about a cd_tekton_pipeline_trigger. You can then reference the fields of the data source in other resources within the same configuration by using interpolation syntax. +Provides a read-only data source for cd_tekton_pipeline_trigger. You can then reference the fields of the data source in other resources within the same configuration using interpolation syntax. ## Example Usage @@ -21,7 +21,7 @@ data "ibm_cd_tekton_pipeline_trigger" "cd_tekton_pipeline_trigger" { ## Argument Reference -You can specify the following arguments for this data source. +Review the argument reference that you can specify for your data source. * `pipeline_id` - (Required, Forces new resource, String) The Tekton pipeline ID. * Constraints: The maximum length is `36` characters. The minimum length is `36` characters. The value must match regular expression `/^[-0-9a-z]+$/`. @@ -30,24 +30,27 @@ You can specify the following arguments for this data source. ## Attribute Reference -After your data source is created, you can read values from the following attributes. +In addition to all argument references listed, you can access the following attribute references after your data source is created. * `id` - The unique identifier of the cd_tekton_pipeline_trigger. -* `cron` - (String) Only needed for timer triggers. Cron expression that indicates when this trigger will activate. Maximum frequency is every 5 minutes. The string is based on UNIX crontab syntax: minute, hour, day of month, month, day of week. Example: 0 *_/2 * * * - every 2 hours. +* `cron` - (String) Only needed for timer triggers. CRON expression that indicates when this trigger will activate. Maximum frequency is every 5 minutes. The string is based on UNIX crontab syntax: minute, hour, day of month, month, day of week. Example: The CRON expression 0 *_/2 * * * - translates to - every 2 hours. * Constraints: The maximum length is `253` characters. The minimum length is `5` characters. The value must match regular expression `/^[-0-9a-zA-Z,\\*\/ ]{5,253}$/`. -* `enabled` - (Boolean) Flag whether the trigger is enabled. +* `enabled` - (Boolean) Flag to check if the trigger is enabled. * Constraints: The default value is `true`. * `event_listener` - (String) Event listener name. The name of the event listener to which the trigger is associated. The event listeners are defined in the definition repositories of the Tekton pipeline. * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z_.]{1,253}$/`. -* `events` - (List) Only needed for Git triggers. List of events to which a Git trigger listens. Choose one or more from: 'push', 'pull_request' and 'pull_request_closed'. For SCM repositories that use 'merge request' events, such events map to the equivalent 'pull request' events. +* `events` - (List) Either 'events' or 'filter' is required specifically for Git triggers. Stores a list of events that a Git trigger listens to. Choose one or more from 'push', 'pull_request', and 'pull_request_closed'. If SCM repositories use the 'merge request' term, they correspond to the generic term i.e. 'pull request'. * Constraints: Allowable list items are: `push`, `pull_request`, `pull_request_closed`. The maximum length is `3` items. The minimum length is `0` items. * `favorite` - (Boolean) Mark the trigger as a favorite. * Constraints: The default value is `false`. +* `filter` - (String) Either 'events' or 'filter' can be used. Stores the CEL (Common Expression Language) expression value which is used for event filtering against the Git webhook payloads. + * Constraints: The maximum length is `4096` characters. The minimum length is `1` character. The value must match regular expression `/^.*$/`. + * `href` - (String) API URL for interacting with the trigger. Only included when fetching the list of pipeline triggers. * Constraints: The maximum length is `2048` characters. The minimum length is `10` characters. The value must match regular expression `/^http(s)?:\/\/([^\/?#]*)([^?#]*)(\\?([^#]*))?(#(.*))?$/`. @@ -56,9 +59,9 @@ After your data source is created, you can read values from the following attrib * `name` - (String) Trigger name. * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^([a-zA-Z0-9]{1,2}|[a-zA-Z0-9][0-9a-zA-Z-_.: \/\\(\\)\\[\\]]{1,251}[a-zA-Z0-9])$/`. -* `properties` - (List) Optional trigger properties used to override or supplement the pipeline properties when triggering a pipeline run. +* `properties` - (List) Optional trigger properties are used to override or supplement the pipeline properties when triggering a pipeline run. * Constraints: The maximum length is `1024` items. The minimum length is `0` items. -Nested schema for **properties**: +Nested scheme for **properties**: * `enum` - (List) Options for `single_select` property type. Only needed for `single_select` property type. * Constraints: The list items must match regular expression `/^[-0-9a-zA-Z_.]{1,253}$/`. The maximum length is `256` items. The minimum length is `0` items. * `href` - (String) API URL for interacting with the trigger property. @@ -73,8 +76,8 @@ Nested schema for **properties**: * `value` - (String) Property value. Any string value is valid. * Constraints: The maximum length is `4096` characters. The minimum length is `0` characters. The value must match regular expression `/^.*$/`. -* `secret` - (List) Only needed for generic webhook trigger type. Secret used to start generic webhook trigger. -Nested schema for **secret**: +* `secret` - (List) Only needed for Generic Webhook trigger type. The secret is used to start the Generic Webhook trigger. +Nested scheme for **secret**: * `algorithm` - (String) Algorithm used for `digest_matches` secret type. Only needed for `digest_matches` secret type. * Constraints: Allowable values are: `md4`, `md5`, `sha1`, `sha256`, `sha384`, `sha512`, `sha512_224`, `sha512_256`, `ripemd160`. * `key_name` - (String) Secret name, not needed if type is `internal_validation`. @@ -87,18 +90,18 @@ Nested schema for **secret**: * Constraints: The maximum length is `4096` characters. The minimum length is `0` characters. The value must match regular expression `/^.*$/`. * `source` - (List) Source repository for a Git trigger. Only required for Git triggers. The referenced repository URL must match the URL of a repository tool integration in the parent toolchain. Obtain the list of integrations from the toolchain API https://cloud.ibm.com/apidocs/toolchain#list-tools. -Nested schema for **source**: +Nested scheme for **source**: * `properties` - (List) Properties of the source, which define the URL of the repository and a branch or pattern. - Nested schema for **properties**: + Nested scheme for **properties**: * `blind_connection` - (Boolean) True if the repository server is not addressable on the public internet. IBM Cloud will not be able to validate the connection details you provide. - * `branch` - (String) Name of a branch from the repo. One of branch or pattern must be specified, but only one or the other. + * `branch` - (String) Name of a branch from the repo. Only one of branch, pattern, or filter should be specified. * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z_.]{1,253}$/`. - * `hook_id` - (String) ID of the webhook from the repo. Computed upon creation of the trigger. + * `hook_id` - (String) Repository webhook ID. It is generated upon trigger creation. * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z_.]{1,253}$/`. - * `pattern` - (String) The pattern of Git branch or tag to which to listen. You can specify a glob pattern such as '!test' or '*master' to match against multiple tags/branches in the repository. The glob pattern used must conform to Bash 4.3 specifications, see bash documentation for more info: https://www.gnu.org/software/bash/manual/bash.html#Pattern-Matching. One of branch or pattern must be specified, but only one or the other. + * `pattern` - (String) The pattern of Git branch or tag. You can specify a glob pattern such as '!test' or '*master' to match against multiple tags or branches in the repository.The glob pattern used must conform to Bash 4.3 specifications, see bash documentation for more info: https://www.gnu.org/software/bash/manual/bash.html#Pattern-Matching. Only one of branch, pattern, or filter should be specified. * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z_.:@=$&^\/\\?\\!\\*\\+\\[\\]\\(\\)\\{\\}\\|\\\\]*$/`. * `tool` - (List) Reference to the repository tool in the parent toolchain. - Nested schema for **tool**: + Nested scheme for **tool**: * `id` - (String) ID of the repository tool instance in the parent toolchain. * Constraints: The maximum length is `36` characters. The minimum length is `36` characters. The value must match regular expression `/^[-0-9a-z]+$/`. * `url` - (Forces new resource, String) URL of the repository to which the trigger is listening. @@ -109,7 +112,7 @@ Nested schema for **source**: * `tags` - (List) Optional trigger tags array. * Constraints: The list items must match regular expression `/^[-0-9a-zA-Z_.]{1,253}$/`. The maximum length is `128` items. The minimum length is `0` items. -* `timezone` - (String) Only used for timer triggers. Specify the timezone used for this timer trigger, which will ensure the cron activates this trigger relative to the specified timezone. If no timezone is specified, the default timezone used is UTC. Valid timezones are those listed in the IANA timezone database, https://www.iana.org/time-zones. +* `timezone` - (String) Only used for timer triggers. Specify the timezone used for this timer trigger, which will ensure the CRON activates this trigger relative to the specified timezone. If no timezone is specified, the default timezone used is UTC. Valid timezones are those listed in the IANA timezone database, https://www.iana.org/time-zones. * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z+_., \/]{1,253}$/`. * `type` - (String) Trigger type. @@ -119,7 +122,7 @@ Nested schema for **source**: * Constraints: The maximum length is `2048` characters. The minimum length is `10` characters. The value must match regular expression `/^http(s)?:\/\/([^\/?#]*)([^?#]*)(\\?([^#]*))?(#(.*))?$/`. * `worker` - (List) Details of the worker used to run the trigger. -Nested schema for **worker**: +Nested scheme for **worker**: * `id` - (String) ID of the worker. * Constraints: The maximum length is `36` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z]{1,36}$/`. * `name` - (String) Name of the worker. Computed based on the worker ID. diff --git a/website/docs/d/cd_tekton_pipeline_trigger_property.html.markdown b/website/docs/d/cd_tekton_pipeline_trigger_property.html.markdown index 8e39c53fe6..fcdfffa3e9 100644 --- a/website/docs/d/cd_tekton_pipeline_trigger_property.html.markdown +++ b/website/docs/d/cd_tekton_pipeline_trigger_property.html.markdown @@ -8,7 +8,7 @@ subcategory: "Continuous Delivery" # ibm_cd_tekton_pipeline_trigger_property -Provides a read-only data source to retrieve information about a cd_tekton_pipeline_trigger_property. You can then reference the fields of the data source in other resources within the same configuration by using interpolation syntax. +Provides a read-only data source for cd_tekton_pipeline_trigger_property. You can then reference the fields of the data source in other resources within the same configuration using interpolation syntax. ## Example Usage @@ -22,7 +22,7 @@ data "ibm_cd_tekton_pipeline_trigger_property" "cd_tekton_pipeline_trigger_prope ## Argument Reference -You can specify the following arguments for this data source. +Review the argument reference that you can specify for your data source. * `pipeline_id` - (Required, Forces new resource, String) The Tekton pipeline ID. * Constraints: The maximum length is `36` characters. The minimum length is `36` characters. The value must match regular expression `/^[-0-9a-z]+$/`. @@ -33,7 +33,7 @@ You can specify the following arguments for this data source. ## Attribute Reference -After your data source is created, you can read values from the following attributes. +In addition to all argument references listed, you can access the following attribute references after your data source is created. * `id` - The unique identifier of the cd_tekton_pipeline_trigger_property. * `enum` - (List) Options for `single_select` property type. Only needed for `single_select` property type. diff --git a/website/docs/r/cd_tekton_pipeline.html.markdown b/website/docs/r/cd_tekton_pipeline.html.markdown index 11bcae1503..52a8729c25 100644 --- a/website/docs/r/cd_tekton_pipeline.html.markdown +++ b/website/docs/r/cd_tekton_pipeline.html.markdown @@ -8,7 +8,7 @@ subcategory: "Continuous Delivery" # ibm_cd_tekton_pipeline -Create, update, and delete cd_tekton_pipelines with this resource. +Provides a resource for cd_tekton_pipeline. This allows cd_tekton_pipeline to be created, updated and deleted. ## Example Usage @@ -23,26 +23,24 @@ resource "ibm_cd_tekton_pipeline" "cd_tekton_pipeline_instance" { ## Argument Reference -You can specify the following arguments for this resource. +Review the argument reference that you can specify for your resource. * `pipeline_id` - (Required, String) ID of the pipeline tool in your toolchain. Can be referenced from your `ibm_cd_toolchain_tool_pipeline` resource, e.g. `pipeline_id = ibm_cd_toolchain_tool_pipeline.my_pipeline.tool_id` * Constraints: The maximum length is `36` characters. The minimum length is `36` characters. The value must match regular expression `/^[-0-9a-z]+$/`. -* `enable_notifications` - (Optional, Boolean) Flag whether to enable notifications for this pipeline. When enabled, pipeline run events will be published on all slack integration specified channels in the parent toolchain. If omitted, this feature is disabled by default. -* `enable_partial_cloning` - (Optional, Boolean) Flag whether to enable partial cloning for this pipeline. When partial clone is enabled, only the files contained within the paths specified in definition repositories are read and cloned, this means that symbolic links might not work. If omitted, this feature is disabled by default. -* `next_build_number` - (Optional, Integer) The build number that will be used for the next pipeline run. +* `enable_notifications` - (Optional, Boolean) Flag to enable notifications for this pipeline. If enabled, the Tekton pipeline run events will be published to all the destinations specified by the Slack and Event Notifications integrations in the parent toolchain. + * Constraints: The default value is `false`. +* `enable_partial_cloning` - (Optional, Boolean) Flag to enable partial cloning for this pipeline. When partial clone is enabled, only the files contained within the paths specified in definition repositories are read and cloned, this means that symbolic links might not work. + * Constraints: The default value is `false`. +* `next_build_number` - (Optional, Integer) Specify the build number that will be used for the next pipeline run. Build numbers can be any positive whole number between 0 and 100000000000000. * Constraints: The maximum value is `99999999999999`. The minimum value is `1`. -* `worker` - (Optional, List) Details of the worker used to run the pipeline. -Nested schema for **worker**: +* `worker` - (Optional, List) Specify the worker that is to be used to run the trigger, indicated by a worker object with only the worker ID. If not specified or set as `worker: { id: 'public' }`, the IBM Managed shared workers are used. +Nested scheme for **worker**: * `id` - (Required, String) ID of the worker. - * Constraints: The maximum length is `36` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z]{1,36}$/`. - * `name` - (Computed, String) Name of the worker. Computed based on the worker ID. - * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z_. \\(\\)\\[\\]]{1,253}$/`. - * `type` - (Computed, String) Type of the worker. Computed based on the worker ID. - * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z_.]{1,253}$/`. + * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z]{1,253}$/`. ## Attribute Reference -After your resource is created, you can read values from the listed arguments and the following attributes. +In addition to all argument references listed, you can access the following attribute references after your resource is created. * `id` - The unique identifier of the cd_tekton_pipeline. * `build_number` - (Integer) The latest pipeline run build number. If this property is absent, the pipeline hasn't had any pipeline runs. @@ -50,15 +48,15 @@ After your resource is created, you can read values from the listed arguments an * `created_at` - (String) Standard RFC 3339 Date Time String. * `definitions` - (List) Definition list. * Constraints: The maximum length is `128` items. The minimum length is `0` items. -Nested schema for **definitions**: +Nested scheme for **definitions**: * `href` - (String) API URL for interacting with the definition. * Constraints: The maximum length is `2048` characters. The minimum length is `10` characters. The value must match regular expression `/^http(s)?:\/\/([^\/?#]*)([^?#]*)(\\?([^#]*))?(#(.*))?$/`. * `id` - (String) The aggregated definition ID. * Constraints: The maximum length is `36` characters. The minimum length is `36` characters. The value must match regular expression `/^[-0-9a-z]+$/`. * `source` - (List) Source repository containing the Tekton pipeline definition. - Nested schema for **source**: + Nested scheme for **source**: * `properties` - (List) Properties of the source, which define the URL of the repository and a branch or tag. - Nested schema for **properties**: + Nested scheme for **properties**: * `branch` - (String) A branch from the repo, specify one of branch or tag only. * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z_.]{1,253}$/`. * `path` - (String) The path to the definition's YAML files. @@ -66,14 +64,14 @@ Nested schema for **definitions**: * `tag` - (String) A tag from the repo, specify one of branch or tag only. * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z_]{1,253}$/`. * `tool` - (List) Reference to the repository tool in the parent toolchain. - Nested schema for **tool**: + Nested scheme for **tool**: * `id` - (String) ID of the repository tool instance in the parent toolchain. * Constraints: The maximum length is `36` characters. The minimum length is `36` characters. The value must match regular expression `/^[-0-9a-z]+$/`. * `url` - (Forces new resource, String) URL of the definition repository. * Constraints: The maximum length is `2048` characters. The minimum length is `10` characters. The value must match regular expression `/^http(s)?:\/\/([^\/?#]*)([^?#]*)(\\?([^#]*))?(#(.*))?$/`. * `type` - (String) The only supported source type is "git", indicating that the source is a git repository. * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^git$/`. -* `enabled` - (Boolean) Flag whether this pipeline is enabled. +* `enabled` - (Boolean) Flag to check if the trigger is enabled. * Constraints: The default value is `true`. * `href` - (String) API URL for interacting with the pipeline. * Constraints: The maximum length is `2048` characters. The minimum length is `10` characters. The value must match regular expression `/^http(s)?:\/\/([^\/?#]*)([^?#]*)(\\?([^#]*))?(#(.*))?$/`. @@ -81,11 +79,12 @@ Nested schema for **definitions**: * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^[a-zA-Z0-9][-0-9a-zA-Z_. ]{1,251}[a-zA-Z0-9]$/`. * `properties` - (List) Tekton pipeline's environment properties. * Constraints: The maximum length is `1024` items. The minimum length is `0` items. -Nested schema for **properties**: +Nested scheme for **properties**: * `enum` - (List) Options for `single_select` property type. Only needed when using `single_select` property type. * Constraints: The list items must match regular expression `/^[-0-9a-zA-Z_.]{1,253}$/`. The maximum length is `256` items. The minimum length is `0` items. * `href` - (String) API URL for interacting with the property. * Constraints: The maximum length is `2048` characters. The minimum length is `10` characters. The value must match regular expression `/^http(s)?:\/\/([^\/?#]*)([^?#]*)(\\?([^#]*))?(#(.*))?$/`. + * `locked` - (Boolean) When true, this property cannot be overridden by a trigger property or at runtime. Attempting to override it will result in run requests being rejected. The default is false. * `name` - (Forces new resource, String) Property name. * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z_.]{1,253}$/`. * `path` - (String) A dot notation path for `integration` type properties only, that selects a value from the tool integration. If left blank the full tool integration data will be used. @@ -95,7 +94,7 @@ Nested schema for **properties**: * `value` - (String) Property value. Any string value is valid. * Constraints: The maximum length is `4096` characters. The minimum length is `0` characters. The value must match regular expression `/^.*$/`. * `resource_group` - (List) The resource group in which the pipeline was created. -Nested schema for **resource_group**: +Nested scheme for **resource_group**: * `id` - (String) ID. * Constraints: The maximum length is `64` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z_]+$/`. * `runs_url` - (String) URL for this pipeline showing the list of pipeline runs. @@ -103,24 +102,26 @@ Nested schema for **resource_group**: * `status` - (String) Pipeline status. * Constraints: Allowable values are: `configured`, `configuring`. * `toolchain` - (List) Toolchain object containing references to the parent toolchain. -Nested schema for **toolchain**: +Nested scheme for **toolchain**: * `crn` - (String) The CRN for the toolchain that contains the Tekton pipeline. * 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}$/`. * `id` - (String) UUID. * Constraints: The maximum length is `36` characters. The minimum length is `36` characters. The value must match regular expression `/^[-0-9a-z]+$/`. * `triggers` - (List) Tekton pipeline triggers list. * Constraints: The maximum length is `1024` items. The minimum length is `0` items. -Nested schema for **triggers**: - * `cron` - (String) Only needed for timer triggers. Cron expression that indicates when this trigger will activate. Maximum frequency is every 5 minutes. The string is based on UNIX crontab syntax: minute, hour, day of month, month, day of week. Example: 0 *_/2 * * * - every 2 hours. +Nested scheme for **triggers**: + * `cron` - (String) Only needed for timer triggers. CRON expression that indicates when this trigger will activate. Maximum frequency is every 5 minutes. The string is based on UNIX crontab syntax: minute, hour, day of month, month, day of week. Example: The CRON expression 0 *_/2 * * * - translates to - every 2 hours. * Constraints: The maximum length is `253` characters. The minimum length is `5` characters. The value must match regular expression `/^[-0-9a-zA-Z,\\*\/ ]{5,253}$/`. - * `enabled` - (Boolean) Flag whether the trigger is enabled. + * `enabled` - (Boolean) Flag to check if the trigger is enabled. * Constraints: The default value is `true`. * `event_listener` - (String) Event listener name. The name of the event listener to which the trigger is associated. The event listeners are defined in the definition repositories of the Tekton pipeline. * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z_.]{1,253}$/`. - * `events` - (List) Only needed for Git triggers. List of events to which a Git trigger listens. Choose one or more from: 'push', 'pull_request' and 'pull_request_closed'. For SCM repositories that use 'merge request' events, such events map to the equivalent 'pull request' events. + * `events` - (List) Either 'events' or 'filter' is required specifically for Git triggers. Stores a list of events that a Git trigger listens to. Choose one or more from 'push', 'pull_request', and 'pull_request_closed'. If SCM repositories use the 'merge request' term, they correspond to the generic term i.e. 'pull request'. * Constraints: Allowable list items are: `push`, `pull_request`, `pull_request_closed`. The maximum length is `3` items. The minimum length is `0` items. * `favorite` - (Boolean) Mark the trigger as a favorite. * Constraints: The default value is `false`. + * `filter` - (String) Either 'events' or 'filter' can be used. Stores the CEL (Common Expression Language) expression value which is used for event filtering against the Git webhook payloads. + * Constraints: The maximum length is `4096` characters. The minimum length is `1` character. The value must match regular expression `/^.*$/`. * `href` - (String) API URL for interacting with the trigger. Only included when fetching the list of pipeline triggers. * Constraints: The maximum length is `2048` characters. The minimum length is `10` characters. The value must match regular expression `/^http(s)?:\/\/([^\/?#]*)([^?#]*)(\\?([^#]*))?(#(.*))?$/`. * `id` - (String) The Trigger ID. @@ -128,9 +129,9 @@ Nested schema for **triggers**: * `max_concurrent_runs` - (Integer) Defines the maximum number of concurrent runs for this trigger. If omitted then the concurrency limit is disabled for this trigger. * `name` - (String) Trigger name. * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^([a-zA-Z0-9]{1,2}|[a-zA-Z0-9][0-9a-zA-Z-_.: \/\\(\\)\\[\\]]{1,251}[a-zA-Z0-9])$/`. - * `properties` - (List) Optional trigger properties used to override or supplement the pipeline properties when triggering a pipeline run. + * `properties` - (List) Optional trigger properties are used to override or supplement the pipeline properties when triggering a pipeline run. * Constraints: The maximum length is `1024` items. The minimum length is `0` items. - Nested schema for **properties**: + Nested scheme for **properties**: * `enum` - (List) Options for `single_select` property type. Only needed for `single_select` property type. * Constraints: The list items must match regular expression `/^[-0-9a-zA-Z_.]{1,253}$/`. The maximum length is `256` items. The minimum length is `0` items. * `href` - (String) API URL for interacting with the trigger property. @@ -144,8 +145,8 @@ Nested schema for **triggers**: * Constraints: Allowable values are: `secure`, `text`, `integration`, `single_select`, `appconfig`. * `value` - (String) Property value. Any string value is valid. * Constraints: The maximum length is `4096` characters. The minimum length is `0` characters. The value must match regular expression `/^.*$/`. - * `secret` - (List) Only needed for generic webhook trigger type. Secret used to start generic webhook trigger. - Nested schema for **secret**: + * `secret` - (List) Only needed for Generic Webhook trigger type. The secret is used to start the Generic Webhook trigger. + Nested scheme for **secret**: * `algorithm` - (String) Algorithm used for `digest_matches` secret type. Only needed for `digest_matches` secret type. * Constraints: Allowable values are: `md4`, `md5`, `sha1`, `sha256`, `sha384`, `sha512`, `sha512_224`, `sha512_256`, `ripemd160`. * `key_name` - (String) Secret name, not needed if type is `internal_validation`. @@ -157,18 +158,18 @@ Nested schema for **triggers**: * `value` - (String) Secret value, not needed if secret type is `internal_validation`. * Constraints: The maximum length is `4096` characters. The minimum length is `0` characters. The value must match regular expression `/^.*$/`. * `source` - (List) Source repository for a Git trigger. Only required for Git triggers. The referenced repository URL must match the URL of a repository tool integration in the parent toolchain. Obtain the list of integrations from the toolchain API https://cloud.ibm.com/apidocs/toolchain#list-tools. - Nested schema for **source**: + Nested scheme for **source**: * `properties` - (List) Properties of the source, which define the URL of the repository and a branch or pattern. - Nested schema for **properties**: + Nested scheme for **properties**: * `blind_connection` - (Boolean) True if the repository server is not addressable on the public internet. IBM Cloud will not be able to validate the connection details you provide. - * `branch` - (String) Name of a branch from the repo. One of branch or pattern must be specified, but only one or the other. + * `branch` - (String) Name of a branch from the repo. Only one of branch, pattern, or filter should be specified. * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z_.]{1,253}$/`. - * `hook_id` - (String) ID of the webhook from the repo. Computed upon creation of the trigger. + * `hook_id` - (String) Repository webhook ID. It is generated upon trigger creation. * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z_.]{1,253}$/`. - * `pattern` - (String) The pattern of Git branch or tag to which to listen. You can specify a glob pattern such as '!test' or '*master' to match against multiple tags/branches in the repository. The glob pattern used must conform to Bash 4.3 specifications, see bash documentation for more info: https://www.gnu.org/software/bash/manual/bash.html#Pattern-Matching. One of branch or pattern must be specified, but only one or the other. + * `pattern` - (String) The pattern of Git branch or tag. You can specify a glob pattern such as '!test' or '*master' to match against multiple tags or branches in the repository.The glob pattern used must conform to Bash 4.3 specifications, see bash documentation for more info: https://www.gnu.org/software/bash/manual/bash.html#Pattern-Matching. Only one of branch, pattern, or filter should be specified. * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z_.:@=$&^\/\\?\\!\\*\\+\\[\\]\\(\\)\\{\\}\\|\\\\]*$/`. * `tool` - (List) Reference to the repository tool in the parent toolchain. - Nested schema for **tool**: + Nested scheme for **tool**: * `id` - (String) ID of the repository tool instance in the parent toolchain. * Constraints: The maximum length is `36` characters. The minimum length is `36` characters. The value must match regular expression `/^[-0-9a-z]+$/`. * `url` - (Forces new resource, String) URL of the repository to which the trigger is listening. @@ -177,14 +178,14 @@ Nested schema for **triggers**: * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^git$/`. * `tags` - (List) Optional trigger tags array. * Constraints: The list items must match regular expression `/^[-0-9a-zA-Z_.]{1,253}$/`. The maximum length is `128` items. The minimum length is `0` items. - * `timezone` - (String) Only used for timer triggers. Specify the timezone used for this timer trigger, which will ensure the cron activates this trigger relative to the specified timezone. If no timezone is specified, the default timezone used is UTC. Valid timezones are those listed in the IANA timezone database, https://www.iana.org/time-zones. + * `timezone` - (String) Only used for timer triggers. Specify the timezone used for this timer trigger, which will ensure the CRON activates this trigger relative to the specified timezone. If no timezone is specified, the default timezone used is UTC. Valid timezones are those listed in the IANA timezone database, https://www.iana.org/time-zones. * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z+_., \/]{1,253}$/`. * `type` - (String) Trigger type. * Constraints: Allowable values are: `manual`, `scm`, `timer`, `generic`. * `webhook_url` - (String) Webhook URL that can be used to trigger pipeline runs. * Constraints: The maximum length is `2048` characters. The minimum length is `10` characters. The value must match regular expression `/^http(s)?:\/\/([^\/?#]*)([^?#]*)(\\?([^#]*))?(#(.*))?$/`. * `worker` - (List) Details of the worker used to run the trigger. - Nested schema for **worker**: + Nested scheme for **worker**: * `id` - (String) ID of the worker. * Constraints: The maximum length is `36` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z]{1,36}$/`. * `name` - (String) Name of the worker. Computed based on the worker ID. @@ -193,55 +194,6 @@ Nested schema for **triggers**: * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z_.]{1,253}$/`. * `updated_at` - (String) Standard RFC 3339 Date Time String. -## Provider Configuration - -The IBM Cloud provider offers a flexible means of providing credentials for authentication. The following methods are supported, in this order, and explained below: - -- Static credentials -- Environment variables - -To find which credentials are required for this resource, see the service table [here](https://cloud.ibm.com/docs/ibm-cloud-provider-for-terraform?topic=ibm-cloud-provider-for-terraform-provider-reference#required-parameters). - -### Static credentials - -You can provide your static credentials by adding the `ibmcloud_api_key`, `iaas_classic_username`, and `iaas_classic_api_key` arguments in the IBM Cloud provider block. - -Usage: -``` -provider "ibm" { - ibmcloud_api_key = "" - iaas_classic_username = "" - iaas_classic_api_key = "" -} -``` - -### Environment variables - -You can provide your credentials by exporting the `IC_API_KEY`, `IAAS_CLASSIC_USERNAME`, and `IAAS_CLASSIC_API_KEY` environment variables, representing your IBM Cloud platform API key, IBM Cloud Classic Infrastructure (SoftLayer) user name, and IBM Cloud infrastructure API key, respectively. - -``` -provider "ibm" {} -``` - -Usage: -``` -export IC_API_KEY="ibmcloud_api_key" -export IAAS_CLASSIC_USERNAME="iaas_classic_username" -export IAAS_CLASSIC_API_KEY="iaas_classic_api_key" -terraform plan -``` - -Note: - -1. Create or find your `ibmcloud_api_key` and `iaas_classic_api_key` [here](https://cloud.ibm.com/iam/apikeys). - - Select `My IBM Cloud API Keys` option from view dropdown for `ibmcloud_api_key` - - Select `Classic Infrastructure API Keys` option from view dropdown for `iaas_classic_api_key` -2. For iaas_classic_username - - Go to [Users](https://cloud.ibm.com/iam/users) - - Click on user. - - Find user name in the `VPN password` section under `User Details` tab - -For more informaton, see [here](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs#authentication). ## Import diff --git a/website/docs/r/cd_tekton_pipeline_definition.html.markdown b/website/docs/r/cd_tekton_pipeline_definition.html.markdown index 26c31c12a2..49bb97727a 100644 --- a/website/docs/r/cd_tekton_pipeline_definition.html.markdown +++ b/website/docs/r/cd_tekton_pipeline_definition.html.markdown @@ -8,7 +8,7 @@ subcategory: "Continuous Delivery" # ibm_cd_tekton_pipeline_definition -Create, update, and delete cd_tekton_pipeline_definitions with this resource. +Provides a resource for cd_tekton_pipeline_definition. This allows cd_tekton_pipeline_definition to be created, updated and deleted. ## Example Usage @@ -32,14 +32,14 @@ resource "ibm_cd_tekton_pipeline_definition" "cd_tekton_pipeline_definition_inst ## Argument Reference -You can specify the following arguments for this resource. +Review the argument reference that you can specify for your resource. * `pipeline_id` - (Required, Forces new resource, String) The Tekton pipeline ID. * Constraints: The maximum length is `36` characters. The minimum length is `36` characters. The value must match regular expression `/^[-0-9a-z]+$/`. * `source` - (Required, List) Source repository containing the Tekton pipeline definition. -Nested schema for **source**: +Nested scheme for **source**: * `properties` - (Required, List) Properties of the source, which define the URL of the repository and a branch or tag. - Nested schema for **properties**: + Nested scheme for **properties**: * `branch` - (Optional, String) A branch from the repo, specify one of branch or tag only. * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z_.]{1,253}$/`. * `path` - (Required, String) The path to the definition's YAML files. @@ -47,7 +47,7 @@ Nested schema for **source**: * `tag` - (Optional, String) A tag from the repo, specify one of branch or tag only. * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z_]{1,253}$/`. * `tool` - (Optional, List) Reference to the repository tool in the parent toolchain. - Nested schema for **tool**: + Nested scheme for **tool**: * `id` - (Computed, String) ID of the repository tool instance in the parent toolchain. * Constraints: The maximum length is `36` characters. The minimum length is `36` characters. The value must match regular expression `/^[-0-9a-z]+$/`. * `url` - (Required, Forces new resource, String) URL of the definition repository. @@ -57,7 +57,7 @@ Nested schema for **source**: ## Attribute Reference -After your resource is created, you can read values from the listed arguments and the following attributes. +In addition to all argument references listed, you can access the following attribute references after your resource is created. * `id` - The unique identifier of the cd_tekton_pipeline_definition. * `definition_id` - (String) The aggregated definition ID. @@ -65,64 +65,15 @@ After your resource is created, you can read values from the listed arguments an * `href` - (String) API URL for interacting with the definition. * Constraints: The maximum length is `2048` characters. The minimum length is `10` characters. The value must match regular expression `/^http(s)?:\/\/([^\/?#]*)([^?#]*)(\\?([^#]*))?(#(.*))?$/`. -## Provider Configuration - -The IBM Cloud provider offers a flexible means of providing credentials for authentication. The following methods are supported, in this order, and explained below: - -- Static credentials -- Environment variables - -To find which credentials are required for this resource, see the service table [here](https://cloud.ibm.com/docs/ibm-cloud-provider-for-terraform?topic=ibm-cloud-provider-for-terraform-provider-reference#required-parameters). - -### Static credentials - -You can provide your static credentials by adding the `ibmcloud_api_key`, `iaas_classic_username`, and `iaas_classic_api_key` arguments in the IBM Cloud provider block. - -Usage: -``` -provider "ibm" { - ibmcloud_api_key = "" - iaas_classic_username = "" - iaas_classic_api_key = "" -} -``` - -### Environment variables - -You can provide your credentials by exporting the `IC_API_KEY`, `IAAS_CLASSIC_USERNAME`, and `IAAS_CLASSIC_API_KEY` environment variables, representing your IBM Cloud platform API key, IBM Cloud Classic Infrastructure (SoftLayer) user name, and IBM Cloud infrastructure API key, respectively. - -``` -provider "ibm" {} -``` - -Usage: -``` -export IC_API_KEY="ibmcloud_api_key" -export IAAS_CLASSIC_USERNAME="iaas_classic_username" -export IAAS_CLASSIC_API_KEY="iaas_classic_api_key" -terraform plan -``` - -Note: - -1. Create or find your `ibmcloud_api_key` and `iaas_classic_api_key` [here](https://cloud.ibm.com/iam/apikeys). - - Select `My IBM Cloud API Keys` option from view dropdown for `ibmcloud_api_key` - - Select `Classic Infrastructure API Keys` option from view dropdown for `iaas_classic_api_key` -2. For iaas_classic_username - - Go to [Users](https://cloud.ibm.com/iam/users) - - Click on user. - - Find user name in the `VPN password` section under `User Details` tab - -For more informaton, see [here](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs#authentication). ## Import You can import the `ibm_cd_tekton_pipeline_definition` resource by using `id`. The `id` property can be formed from `pipeline_id`, and `definition_id` in the following format: -``` -/ -``` +
+<pipeline_id>/<definition_id>
+
* `pipeline_id`: A string in the format `94619026-912b-4d92-8f51-6c74f0692d90`. The Tekton pipeline ID. * `definition_id`: A string in the format `94299034-d45f-4e9a-8ed5-6bd5c7bb7ada`. The definition ID. diff --git a/website/docs/r/cd_tekton_pipeline_property.html.markdown b/website/docs/r/cd_tekton_pipeline_property.html.markdown index 129d14c545..fbc85ec9d0 100644 --- a/website/docs/r/cd_tekton_pipeline_property.html.markdown +++ b/website/docs/r/cd_tekton_pipeline_property.html.markdown @@ -8,7 +8,7 @@ subcategory: "Continuous Delivery" # ibm_cd_tekton_pipeline_property -Create, update, and delete cd_tekton_pipeline_propertys with this resource. +Provides a resource for cd_tekton_pipeline_property. This allows cd_tekton_pipeline_property to be created, updated and deleted. ## Example Usage @@ -23,14 +23,15 @@ resource "ibm_cd_tekton_pipeline_property" "cd_tekton_pipeline_property_instance ## Argument Reference -You can specify the following arguments for this resource. +Review the argument reference that you can specify for your resource. * `enum` - (Optional, List) Options for `single_select` property type. Only needed when using `single_select` property type. * Constraints: The list items must match regular expression `/^[-0-9a-zA-Z_.]{1,253}$/`. The maximum length is `256` items. The minimum length is `0` items. * `locked` - (Optional, Boolean) When true, this property cannot be overridden by a trigger property or at runtime. Attempting to override it will result in run requests being rejected. The default is false. + * Constraints: The default value is `false`. * `name` - (Required, Forces new resource, String) Property name. * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z_.]{1,253}$/`. -* `path` - (Optional, String) A dot notation path for `integration` type properties only, that selects a value from the tool integration. If left blank the full tool integration data will be used. +* `path` - (Optional, String) A dot notation path for `integration` type properties only, to select a value from the tool integration. If left blank the full tool integration data will be used. * Constraints: The maximum length is `4096` characters. The minimum length is `0` characters. The value must match regular expression `/^[-0-9a-zA-Z_.]*$/`. * `pipeline_id` - (Required, Forces new resource, String) The Tekton pipeline ID. * Constraints: The maximum length is `36` characters. The minimum length is `36` characters. The value must match regular expression `/^[-0-9a-z]+$/`. @@ -41,70 +42,21 @@ You can specify the following arguments for this resource. ## Attribute Reference -After your resource is created, you can read values from the listed arguments and the following attributes. +In addition to all argument references listed, you can access the following attribute references after your resource is created. * `id` - The unique identifier of the cd_tekton_pipeline_property. * `href` - (String) API URL for interacting with the property. * Constraints: The maximum length is `2048` characters. The minimum length is `10` characters. The value must match regular expression `/^http(s)?:\/\/([^\/?#]*)([^?#]*)(\\?([^#]*))?(#(.*))?$/`. -## Provider Configuration - -The IBM Cloud provider offers a flexible means of providing credentials for authentication. The following methods are supported, in this order, and explained below: - -- Static credentials -- Environment variables - -To find which credentials are required for this resource, see the service table [here](https://cloud.ibm.com/docs/ibm-cloud-provider-for-terraform?topic=ibm-cloud-provider-for-terraform-provider-reference#required-parameters). - -### Static credentials - -You can provide your static credentials by adding the `ibmcloud_api_key`, `iaas_classic_username`, and `iaas_classic_api_key` arguments in the IBM Cloud provider block. - -Usage: -``` -provider "ibm" { - ibmcloud_api_key = "" - iaas_classic_username = "" - iaas_classic_api_key = "" -} -``` - -### Environment variables - -You can provide your credentials by exporting the `IC_API_KEY`, `IAAS_CLASSIC_USERNAME`, and `IAAS_CLASSIC_API_KEY` environment variables, representing your IBM Cloud platform API key, IBM Cloud Classic Infrastructure (SoftLayer) user name, and IBM Cloud infrastructure API key, respectively. - -``` -provider "ibm" {} -``` - -Usage: -``` -export IC_API_KEY="ibmcloud_api_key" -export IAAS_CLASSIC_USERNAME="iaas_classic_username" -export IAAS_CLASSIC_API_KEY="iaas_classic_api_key" -terraform plan -``` - -Note: - -1. Create or find your `ibmcloud_api_key` and `iaas_classic_api_key` [here](https://cloud.ibm.com/iam/apikeys). - - Select `My IBM Cloud API Keys` option from view dropdown for `ibmcloud_api_key` - - Select `Classic Infrastructure API Keys` option from view dropdown for `iaas_classic_api_key` -2. For iaas_classic_username - - Go to [Users](https://cloud.ibm.com/iam/users) - - Click on user. - - Find user name in the `VPN password` section under `User Details` tab - -For more informaton, see [here](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs#authentication). ## Import You can import the `ibm_cd_tekton_pipeline_property` resource by using `name`. The `name` property can be formed from `pipeline_id`, and `property_name` in the following format: -``` -/ -``` +
+<pipeline_id>/<property_name>
+
* `pipeline_id`: A string in the format `94619026-912b-4d92-8f51-6c74f0692d90`. The Tekton pipeline ID. * `property_name`: A string in the format `debug-pipeline`. The property name. diff --git a/website/docs/r/cd_tekton_pipeline_trigger.html.markdown b/website/docs/r/cd_tekton_pipeline_trigger.html.markdown index b76499e23d..5ef9cca975 100644 --- a/website/docs/r/cd_tekton_pipeline_trigger.html.markdown +++ b/website/docs/r/cd_tekton_pipeline_trigger.html.markdown @@ -8,7 +8,7 @@ subcategory: "Continuous Delivery" # ibm_cd_tekton_pipeline_trigger -Create, update, and delete cd_tekton_pipeline_triggers with this resource. +Provides a resource for cd_tekton_pipeline_trigger. This allows cd_tekton_pipeline_trigger to be created, updated and deleted. ## Example Usage @@ -27,25 +27,27 @@ resource "ibm_cd_tekton_pipeline_trigger" "cd_tekton_pipeline_trigger_instance" ## Argument Reference -You can specify the following arguments for this resource. +Review the argument reference that you can specify for your resource. -* `cron` - (Optional, String) Only needed for timer triggers. Cron expression that indicates when this trigger will activate. Maximum frequency is every 5 minutes. The string is based on UNIX crontab syntax: minute, hour, day of month, month, day of week. Example: 0 *_/2 * * * - every 2 hours. +* `cron` - (Optional, String) Only needed for timer triggers. CRON expression that indicates when this trigger will activate. Maximum frequency is every 5 minutes. The string is based on UNIX crontab syntax: minute, hour, day of month, month, day of week. Example: The CRON expression 0 *_/2 * * * - translates to - every 2 hours. * Constraints: The maximum length is `253` characters. The minimum length is `5` characters. The value must match regular expression `/^[-0-9a-zA-Z,\\*\/ ]{5,253}$/`. -* `enabled` - (Optional, Boolean) Flag whether the trigger is enabled. +* `enabled` - (Optional, Boolean) Flag to check if the trigger is enabled. If omitted the trigger is enabled by default. * Constraints: The default value is `true`. * `event_listener` - (Required, String) Event listener name. The name of the event listener to which the trigger is associated. The event listeners are defined in the definition repositories of the Tekton pipeline. * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z_.]{1,253}$/`. -* `events` - (Optional, List) Only needed for Git triggers. List of events to which a Git trigger listens. Choose one or more from: 'push', 'pull_request' and 'pull_request_closed'. For SCM repositories that use 'merge request' events, such events map to the equivalent 'pull request' events. +* `events` - (Optional, List) Either 'events' or 'filter' is required specifically for Git triggers. Stores a list of events that a Git trigger listens to. Choose one or more from 'push', 'pull_request', and 'pull_request_closed'. If SCM repositories use the 'merge request' term, they correspond to the generic term i.e. 'pull request'. * Constraints: Allowable list items are: `push`, `pull_request`, `pull_request_closed`. The maximum length is `3` items. The minimum length is `0` items. * `favorite` - (Optional, Boolean) Mark the trigger as a favorite. * Constraints: The default value is `false`. +* `filter` - (Optional, String) Either 'events' or 'filter' can be used. Stores the CEL (Common Expression Language) expression value which is used for event filtering against the Git webhook payloads. + * Constraints: The maximum length is `4096` characters. The minimum length is `1` character. The value must match regular expression `/^.*$/`. * `max_concurrent_runs` - (Optional, Integer) Defines the maximum number of concurrent runs for this trigger. If omitted then the concurrency limit is disabled for this trigger. * `name` - (Required, String) Trigger name. * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^([a-zA-Z0-9]{1,2}|[a-zA-Z0-9][0-9a-zA-Z-_.: \/\\(\\)\\[\\]]{1,251}[a-zA-Z0-9])$/`. * `pipeline_id` - (Required, Forces new resource, String) The Tekton pipeline ID. * Constraints: The maximum length is `36` characters. The minimum length is `36` characters. The value must match regular expression `/^[-0-9a-z]+$/`. -* `secret` - (Optional, List) Only needed for generic webhook trigger type. Secret used to start generic webhook trigger. -Nested schema for **secret**: +* `secret` - (Optional, List) Only needed for Generic Webhook trigger type. The secret is used to start the Generic Webhook trigger. +Nested scheme for **secret**: * `algorithm` - (Optional, String) Algorithm used for `digest_matches` secret type. Only needed for `digest_matches` secret type. * Constraints: Allowable values are: `md4`, `md5`, `sha1`, `sha256`, `sha384`, `sha512`, `sha512_224`, `sha512_256`, `ripemd160`. * `key_name` - (Optional, String) Secret name, not needed if type is `internal_validation`. @@ -57,49 +59,38 @@ Nested schema for **secret**: * `value` - (Optional, String) Secret value, not needed if secret type is `internal_validation`. * Constraints: The maximum length is `4096` characters. The minimum length is `0` characters. The value must match regular expression `/^.*$/`. * `source` - (Optional, List) Source repository for a Git trigger. Only required for Git triggers. The referenced repository URL must match the URL of a repository tool integration in the parent toolchain. Obtain the list of integrations from the toolchain API https://cloud.ibm.com/apidocs/toolchain#list-tools. -Nested schema for **source**: +Nested scheme for **source**: * `properties` - (Required, List) Properties of the source, which define the URL of the repository and a branch or pattern. - Nested schema for **properties**: - * `blind_connection` - (Computed, Boolean) True if the repository server is not addressable on the public internet. IBM Cloud will not be able to validate the connection details you provide. - * `branch` - (Optional, String) Name of a branch from the repo. One of branch or pattern must be specified, but only one or the other. + Nested scheme for **properties**: + * `branch` - (Optional, String) Name of a branch from the repo. Only one of branch, pattern, or filter should be specified. * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z_.]{1,253}$/`. - * `hook_id` - (Computed, String) ID of the webhook from the repo. Computed upon creation of the trigger. - * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z_.]{1,253}$/`. - * `pattern` - (Optional, String) The pattern of Git branch or tag to which to listen. You can specify a glob pattern such as '!test' or '*master' to match against multiple tags/branches in the repository. The glob pattern used must conform to Bash 4.3 specifications, see bash documentation for more info: https://www.gnu.org/software/bash/manual/bash.html#Pattern-Matching. One of branch or pattern must be specified, but only one or the other. + * `pattern` - (Optional, String) The pattern of Git branch or tag. You can specify a glob pattern such as '!test' or '*master' to match against multiple tags or branches in the repository.The glob pattern used must conform to Bash 4.3 specifications, see bash documentation for more info: https://www.gnu.org/software/bash/manual/bash.html#Pattern-Matching. Only one of branch, pattern, or filter should be specified. * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z_.:@=$&^\/\\?\\!\\*\\+\\[\\]\\(\\)\\{\\}\\|\\\\]*$/`. - * `tool` - (Required, List) Reference to the repository tool in the parent toolchain. - Nested schema for **tool**: - * `id` - (Computed, String) ID of the repository tool instance in the parent toolchain. - * Constraints: The maximum length is `36` characters. The minimum length is `36` characters. The value must match regular expression `/^[-0-9a-z]+$/`. * `url` - (Required, Forces new resource, String) URL of the repository to which the trigger is listening. * Constraints: The maximum length is `2048` characters. The minimum length is `10` characters. The value must match regular expression `/^http(s)?:\/\/([^\/?#]*)([^?#]*)(\\?([^#]*))?(#(.*))?$/`. * `type` - (Required, String) The only supported source type is "git", indicating that the source is a git repository. * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^git$/`. -* `tags` - (Optional, List) Optional trigger tags array. +* `tags` - (Optional, List) Trigger tags array. * Constraints: The list items must match regular expression `/^[-0-9a-zA-Z_.]{1,253}$/`. The maximum length is `128` items. The minimum length is `0` items. -* `timezone` - (Optional, String) Only used for timer triggers. Specify the timezone used for this timer trigger, which will ensure the cron activates this trigger relative to the specified timezone. If no timezone is specified, the default timezone used is UTC. Valid timezones are those listed in the IANA timezone database, https://www.iana.org/time-zones. +* `timezone` - (Optional, String) Only used for timer triggers. Specify the timezone used for this timer trigger, which will ensure the CRON activates this trigger relative to the specified timezone. If no timezone is specified, the default timezone used is UTC. Valid timezones are those listed in the IANA timezone database, https://www.iana.org/time-zones. * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z+_., \/]{1,253}$/`. * `type` - (Required, String) Trigger type. - * Constraints: Allowable values are: . -* `worker` - (Optional, List) Details of the worker used to run the trigger. -Nested schema for **worker**: + * Constraints: Allowable values are: `manual`, `scm`, `timer`, `generic`. +* `worker` - (Optional, List) Specify the worker used to run the trigger. Use `worker: { id: 'public' }` to use the IBM Managed workers. The default is to inherit the worker set in the pipeline settings, which can also be explicitly set using `worker: { id: 'inherit' }`. +Nested scheme for **worker**: * `id` - (Required, String) ID of the worker. - * Constraints: The maximum length is `36` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z]{1,36}$/`. - * `name` - (Computed, String) Name of the worker. Computed based on the worker ID. - * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z_. \\(\\)\\[\\]]{1,253}$/`. - * `type` - (Computed, String) Type of the worker. Computed based on the worker ID. - * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z_.]{1,253}$/`. + * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z]{1,253}$/`. ## Attribute Reference -After your resource is created, you can read values from the listed arguments and the following attributes. +In addition to all argument references listed, you can access the following attribute references after your resource is created. * `id` - The unique identifier of the cd_tekton_pipeline_trigger. * `href` - (String) API URL for interacting with the trigger. Only included when fetching the list of pipeline triggers. * Constraints: The maximum length is `2048` characters. The minimum length is `10` characters. The value must match regular expression `/^http(s)?:\/\/([^\/?#]*)([^?#]*)(\\?([^#]*))?(#(.*))?$/`. -* `properties` - (List) Optional trigger properties used to override or supplement the pipeline properties when triggering a pipeline run. +* `properties` - (List) Optional trigger properties are used to override or supplement the pipeline properties when triggering a pipeline run. * Constraints: The maximum length is `1024` items. The minimum length is `0` items. -Nested schema for **properties**: +Nested scheme for **properties**: * `enum` - (List) Options for `single_select` property type. Only needed for `single_select` property type. * Constraints: The list items must match regular expression `/^[-0-9a-zA-Z_.]{1,253}$/`. The maximum length is `256` items. The minimum length is `0` items. * `href` - (String) API URL for interacting with the trigger property. @@ -118,64 +109,15 @@ Nested schema for **properties**: * `webhook_url` - (String) Webhook URL that can be used to trigger pipeline runs. * Constraints: The maximum length is `2048` characters. The minimum length is `10` characters. The value must match regular expression `/^http(s)?:\/\/([^\/?#]*)([^?#]*)(\\?([^#]*))?(#(.*))?$/`. -## Provider Configuration - -The IBM Cloud provider offers a flexible means of providing credentials for authentication. The following methods are supported, in this order, and explained below: - -- Static credentials -- Environment variables - -To find which credentials are required for this resource, see the service table [here](https://cloud.ibm.com/docs/ibm-cloud-provider-for-terraform?topic=ibm-cloud-provider-for-terraform-provider-reference#required-parameters). - -### Static credentials - -You can provide your static credentials by adding the `ibmcloud_api_key`, `iaas_classic_username`, and `iaas_classic_api_key` arguments in the IBM Cloud provider block. - -Usage: -``` -provider "ibm" { - ibmcloud_api_key = "" - iaas_classic_username = "" - iaas_classic_api_key = "" -} -``` - -### Environment variables - -You can provide your credentials by exporting the `IC_API_KEY`, `IAAS_CLASSIC_USERNAME`, and `IAAS_CLASSIC_API_KEY` environment variables, representing your IBM Cloud platform API key, IBM Cloud Classic Infrastructure (SoftLayer) user name, and IBM Cloud infrastructure API key, respectively. - -``` -provider "ibm" {} -``` - -Usage: -``` -export IC_API_KEY="ibmcloud_api_key" -export IAAS_CLASSIC_USERNAME="iaas_classic_username" -export IAAS_CLASSIC_API_KEY="iaas_classic_api_key" -terraform plan -``` - -Note: - -1. Create or find your `ibmcloud_api_key` and `iaas_classic_api_key` [here](https://cloud.ibm.com/iam/apikeys). - - Select `My IBM Cloud API Keys` option from view dropdown for `ibmcloud_api_key` - - Select `Classic Infrastructure API Keys` option from view dropdown for `iaas_classic_api_key` -2. For iaas_classic_username - - Go to [Users](https://cloud.ibm.com/iam/users) - - Click on user. - - Find user name in the `VPN password` section under `User Details` tab - -For more informaton, see [here](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs#authentication). ## Import You can import the `ibm_cd_tekton_pipeline_trigger` resource by using `id`. The `id` property can be formed from `pipeline_id`, and `trigger_id` in the following format: -``` -/ -``` +
+<pipeline_id>/<trigger_id>
+
* `pipeline_id`: A string in the format `94619026-912b-4d92-8f51-6c74f0692d90`. The Tekton pipeline ID. * `trigger_id`: A string in the format `1bb892a1-2e04-4768-a369-b1159eace147`. The trigger ID. diff --git a/website/docs/r/cd_tekton_pipeline_trigger_property.html.markdown b/website/docs/r/cd_tekton_pipeline_trigger_property.html.markdown index efe2d54c08..0947a3d79b 100644 --- a/website/docs/r/cd_tekton_pipeline_trigger_property.html.markdown +++ b/website/docs/r/cd_tekton_pipeline_trigger_property.html.markdown @@ -8,7 +8,7 @@ subcategory: "Continuous Delivery" # ibm_cd_tekton_pipeline_trigger_property -Create, update, and delete cd_tekton_pipeline_trigger_propertys with this resource. +Provides a resource for cd_tekton_pipeline_trigger_property. This allows cd_tekton_pipeline_trigger_property to be created, updated and deleted. ## Example Usage @@ -24,14 +24,15 @@ resource "ibm_cd_tekton_pipeline_trigger_property" "cd_tekton_pipeline_trigger_p ## Argument Reference -You can specify the following arguments for this resource. +Review the argument reference that you can specify for your resource. * `enum` - (Optional, List) Options for `single_select` property type. Only needed for `single_select` property type. * Constraints: The list items must match regular expression `/^[-0-9a-zA-Z_.]{1,253}$/`. The maximum length is `256` items. The minimum length is `0` items. * `locked` - (Optional, Boolean) When true, this property cannot be overridden at runtime. Attempting to override it will result in run requests being rejected. The default is false. + * Constraints: The default value is `false`. * `name` - (Required, Forces new resource, String) Property name. * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z_.]{1,253}$/`. -* `path` - (Optional, String) A dot notation path for `integration` type properties only, that selects a value from the tool integration. If left blank the full tool integration data will be used. +* `path` - (Optional, String) A dot notation path for `integration` type properties only, to select a value from the tool integration. If left blank the full tool integration data will be used. * Constraints: The maximum length is `4096` characters. The minimum length is `0` characters. The value must match regular expression `/^[-0-9a-zA-Z_.]*$/`. * `pipeline_id` - (Required, Forces new resource, String) The Tekton pipeline ID. * Constraints: The maximum length is `36` characters. The minimum length is `36` characters. The value must match regular expression `/^[-0-9a-z]+$/`. @@ -44,70 +45,21 @@ You can specify the following arguments for this resource. ## Attribute Reference -After your resource is created, you can read values from the listed arguments and the following attributes. +In addition to all argument references listed, you can access the following attribute references after your resource is created. * `id` - The unique identifier of the cd_tekton_pipeline_trigger_property. * `href` - (String) API URL for interacting with the trigger property. * Constraints: The maximum length is `2048` characters. The minimum length is `10` characters. The value must match regular expression `/^http(s)?:\/\/([^\/?#]*)([^?#]*)(\\?([^#]*))?(#(.*))?$/`. -## Provider Configuration - -The IBM Cloud provider offers a flexible means of providing credentials for authentication. The following methods are supported, in this order, and explained below: - -- Static credentials -- Environment variables - -To find which credentials are required for this resource, see the service table [here](https://cloud.ibm.com/docs/ibm-cloud-provider-for-terraform?topic=ibm-cloud-provider-for-terraform-provider-reference#required-parameters). - -### Static credentials - -You can provide your static credentials by adding the `ibmcloud_api_key`, `iaas_classic_username`, and `iaas_classic_api_key` arguments in the IBM Cloud provider block. - -Usage: -``` -provider "ibm" { - ibmcloud_api_key = "" - iaas_classic_username = "" - iaas_classic_api_key = "" -} -``` - -### Environment variables - -You can provide your credentials by exporting the `IC_API_KEY`, `IAAS_CLASSIC_USERNAME`, and `IAAS_CLASSIC_API_KEY` environment variables, representing your IBM Cloud platform API key, IBM Cloud Classic Infrastructure (SoftLayer) user name, and IBM Cloud infrastructure API key, respectively. - -``` -provider "ibm" {} -``` - -Usage: -``` -export IC_API_KEY="ibmcloud_api_key" -export IAAS_CLASSIC_USERNAME="iaas_classic_username" -export IAAS_CLASSIC_API_KEY="iaas_classic_api_key" -terraform plan -``` - -Note: - -1. Create or find your `ibmcloud_api_key` and `iaas_classic_api_key` [here](https://cloud.ibm.com/iam/apikeys). - - Select `My IBM Cloud API Keys` option from view dropdown for `ibmcloud_api_key` - - Select `Classic Infrastructure API Keys` option from view dropdown for `iaas_classic_api_key` -2. For iaas_classic_username - - Go to [Users](https://cloud.ibm.com/iam/users) - - Click on user. - - Find user name in the `VPN password` section under `User Details` tab - -For more informaton, see [here](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs#authentication). ## Import You can import the `ibm_cd_tekton_pipeline_trigger_property` resource by using `name`. The `name` property can be formed from `pipeline_id`, `trigger_id`, and `property_name` in the following format: -``` -// -``` +
+<pipeline_id>/<trigger_id>/<property_name>
+
* `pipeline_id`: A string in the format `94619026-912b-4d92-8f51-6c74f0692d90`. The Tekton pipeline ID. * `trigger_id`: A string in the format `1bb892a1-2e04-4768-a369-b1159eace147`. The trigger ID. * `property_name`: A string in the format `debug-pipeline`. The property name. From 221ff62b45a019e550ae70bf5a907a50b4674fed Mon Sep 17 00:00:00 2001 From: Brian Gleeson Date: Mon, 29 Jul 2024 13:12:14 +0100 Subject: [PATCH 2/4] chore: bump CD go sdk version --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index cee89aba5c..7956f78379 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/IBM/cloudant-go-sdk v0.0.43 github.com/IBM/code-engine-go-sdk v0.0.0-20240126185534-a6e054aa01ed github.com/IBM/container-registry-go-sdk v1.1.0 - github.com/IBM/continuous-delivery-go-sdk v1.5.0 + github.com/IBM/continuous-delivery-go-sdk v1.6.0 github.com/IBM/event-notifications-go-admin-sdk v0.6.1 github.com/IBM/eventstreams-go-sdk v1.4.0 github.com/IBM/go-sdk-core/v3 v3.2.4 diff --git a/go.sum b/go.sum index 242f8e7a1e..818326f563 100644 --- a/go.sum +++ b/go.sum @@ -104,8 +104,8 @@ github.com/IBM/code-engine-go-sdk v0.0.0-20240126185534-a6e054aa01ed h1:X0VrZW5u github.com/IBM/code-engine-go-sdk v0.0.0-20240126185534-a6e054aa01ed/go.mod h1:m4pD/58c6NVzlAFkN3XCYXpmDFmUyTG31ivLy/loyHQ= github.com/IBM/container-registry-go-sdk v1.1.0 h1:sYyknIod8R4RJZQqAheiduP6wbSTphE9Ag8ho28yXjc= github.com/IBM/container-registry-go-sdk v1.1.0/go.mod h1:4TwsCnQtVfZ4Vkapy/KPvQBKFc3VOyUZYkwRU4FTPrs= -github.com/IBM/continuous-delivery-go-sdk v1.5.0 h1:FHSRruNt9WK7SavpIVuV6N+xll90UgZsuQjZvQ+slB4= -github.com/IBM/continuous-delivery-go-sdk v1.5.0/go.mod h1:nZdKUnubXNLo+zo28R4Rd+TGDqiJ/xoE8WO/A3kLw1E= +github.com/IBM/continuous-delivery-go-sdk v1.6.0 h1:eAL/jIWHrDFlWDF+Qd9Y5UN99Pr5Mjd/H/bvTbXUbz4= +github.com/IBM/continuous-delivery-go-sdk v1.6.0/go.mod h1:nZdKUnubXNLo+zo28R4Rd+TGDqiJ/xoE8WO/A3kLw1E= github.com/IBM/event-notifications-go-admin-sdk v0.6.1 h1:85gB9evVX8AmNyd4Fh1O2G/0mgpt2HIQpyeWOoftEb4= github.com/IBM/event-notifications-go-admin-sdk v0.6.1/go.mod h1:xRsMCxmPLXvmmWEXF8rshZlZgMrllPSiT9MBi4+Q6cs= github.com/IBM/eventstreams-go-sdk v1.4.0 h1:yS/Ns29sBOe8W2tynQmz9HTKqQZ0ckse4Py5Oy/F2rM= From 1f9c166e7f38b303417ec1ea6d7e5aaacf0f6e47 Mon Sep 17 00:00:00 2001 From: Brian Gleeson Date: Mon, 29 Jul 2024 15:29:51 +0100 Subject: [PATCH 3/4] Fix unit tests --- .../data_source_ibm_cd_tekton_pipeline_trigger_test.go | 1 - .../resource_ibm_cd_tekton_pipeline_trigger_test.go | 2 -- 2 files changed, 3 deletions(-) diff --git a/ibm/service/cdtektonpipeline/data_source_ibm_cd_tekton_pipeline_trigger_test.go b/ibm/service/cdtektonpipeline/data_source_ibm_cd_tekton_pipeline_trigger_test.go index 4507b5e64d..914eb58815 100644 --- a/ibm/service/cdtektonpipeline/data_source_ibm_cd_tekton_pipeline_trigger_test.go +++ b/ibm/service/cdtektonpipeline/data_source_ibm_cd_tekton_pipeline_trigger_test.go @@ -67,7 +67,6 @@ func TestAccIBMCdTektonPipelineTriggerDataSourceAllArgs(t *testing.T) { resource.TestCheckResourceAttrSet("data.ibm_cd_tekton_pipeline_trigger.cd_tekton_pipeline_trigger", "enabled"), resource.TestCheckResourceAttrSet("data.ibm_cd_tekton_pipeline_trigger.cd_tekton_pipeline_trigger", "favorite"), resource.TestCheckResourceAttrSet("data.ibm_cd_tekton_pipeline_trigger.cd_tekton_pipeline_trigger", "source.#"), - resource.TestCheckResourceAttrSet("data.ibm_cd_tekton_pipeline_trigger.cd_tekton_pipeline_trigger", "filter"), resource.TestCheckResourceAttrSet("data.ibm_cd_tekton_pipeline_trigger.cd_tekton_pipeline_trigger", "secret.#"), ), }, diff --git a/ibm/service/cdtektonpipeline/resource_ibm_cd_tekton_pipeline_trigger_test.go b/ibm/service/cdtektonpipeline/resource_ibm_cd_tekton_pipeline_trigger_test.go index 748f3ab368..1da2ffac65 100644 --- a/ibm/service/cdtektonpipeline/resource_ibm_cd_tekton_pipeline_trigger_test.go +++ b/ibm/service/cdtektonpipeline/resource_ibm_cd_tekton_pipeline_trigger_test.go @@ -92,7 +92,6 @@ func TestAccIBMCdTektonPipelineTriggerAllArgs(t *testing.T) { resource.TestCheckResourceAttr("ibm_cd_tekton_pipeline_trigger.cd_tekton_pipeline_trigger", "enabled", enabled), resource.TestCheckResourceAttr("ibm_cd_tekton_pipeline_trigger.cd_tekton_pipeline_trigger2", "cron", cron), resource.TestCheckResourceAttr("ibm_cd_tekton_pipeline_trigger.cd_tekton_pipeline_trigger2", "timezone", timezone), - resource.TestCheckResourceAttr("ibm_cd_tekton_pipeline_trigger.cd_tekton_pipeline_trigger", "filter", filter), resource.TestCheckResourceAttr("ibm_cd_tekton_pipeline_trigger.cd_tekton_pipeline_trigger", "favorite", favorite), resource.TestCheckResourceAttrSet("ibm_cd_tekton_pipeline_trigger.cd_tekton_pipeline_trigger", "pipeline_id"), resource.TestCheckResourceAttrSet("ibm_cd_tekton_pipeline_trigger.cd_tekton_pipeline_trigger", "trigger_id"), @@ -116,7 +115,6 @@ func TestAccIBMCdTektonPipelineTriggerAllArgs(t *testing.T) { resource.TestCheckResourceAttr("ibm_cd_tekton_pipeline_trigger.cd_tekton_pipeline_trigger", "enabled", enabledUpdate), resource.TestCheckResourceAttr("ibm_cd_tekton_pipeline_trigger.cd_tekton_pipeline_trigger2", "cron", cronUpdate), resource.TestCheckResourceAttr("ibm_cd_tekton_pipeline_trigger.cd_tekton_pipeline_trigger2", "timezone", timezoneUpdate), - resource.TestCheckResourceAttr("ibm_cd_tekton_pipeline_trigger.cd_tekton_pipeline_trigger", "filter", filterUpdate), resource.TestCheckResourceAttr("ibm_cd_tekton_pipeline_trigger.cd_tekton_pipeline_trigger", "favorite", favoriteUpdate), resource.TestCheckResourceAttrSet("ibm_cd_tekton_pipeline_trigger.cd_tekton_pipeline_trigger", "pipeline_id"), resource.TestCheckResourceAttrSet("ibm_cd_tekton_pipeline_trigger.cd_tekton_pipeline_trigger", "trigger_id"), From c34af27aa39a3858a8d4036d1eca66c4c0e5dd55 Mon Sep 17 00:00:00 2001 From: Brian Gleeson Date: Mon, 12 Aug 2024 14:35:09 +0100 Subject: [PATCH 4/4] fix(docs): Fix schema in docs --- .../docs/d/cd_tekton_pipeline.html.markdown | 34 ++++++++----------- ...d_tekton_pipeline_definition.html.markdown | 7 ++-- .../cd_tekton_pipeline_trigger.html.markdown | 16 ++++----- .../docs/r/cd_tekton_pipeline.html.markdown | 30 ++++++++-------- ...d_tekton_pipeline_definition.html.markdown | 6 ++-- .../cd_tekton_pipeline_trigger.html.markdown | 10 +++--- 6 files changed, 47 insertions(+), 56 deletions(-) diff --git a/website/docs/d/cd_tekton_pipeline.html.markdown b/website/docs/d/cd_tekton_pipeline.html.markdown index 910dd17c6b..57a70aed00 100644 --- a/website/docs/d/cd_tekton_pipeline.html.markdown +++ b/website/docs/d/cd_tekton_pipeline.html.markdown @@ -37,15 +37,15 @@ In addition to all argument references listed, you can access the following attr * `definitions` - (List) Definition list. * Constraints: The maximum length is `128` items. The minimum length is `0` items. -Nested scheme for **definitions**: +Nested schema for **definitions**: * `href` - (String) API URL for interacting with the definition. * Constraints: The maximum length is `2048` characters. The minimum length is `10` characters. The value must match regular expression `/^http(s)?:\/\/([^\/?#]*)([^?#]*)(\\?([^#]*))?(#(.*))?$/`. * `id` - (String) The aggregated definition ID. * Constraints: The maximum length is `36` characters. The minimum length is `36` characters. The value must match regular expression `/^[-0-9a-z]+$/`. * `source` - (List) Source repository containing the Tekton pipeline definition. - Nested scheme for **source**: + Nested schema for **source**: * `properties` - (List) Properties of the source, which define the URL of the repository and a branch or tag. - Nested scheme for **properties**: + Nested schema for **properties**: * `branch` - (String) A branch from the repo, specify one of branch or tag only. * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z_.]{1,253}$/`. * `path` - (String) The path to the definition's YAML files. @@ -53,7 +53,7 @@ Nested scheme for **definitions**: * `tag` - (String) A tag from the repo, specify one of branch or tag only. * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z_]{1,253}$/`. * `tool` - (List) Reference to the repository tool in the parent toolchain. - Nested scheme for **tool**: + Nested schema for **tool**: * `id` - (String) ID of the repository tool instance in the parent toolchain. * Constraints: The maximum length is `36` characters. The minimum length is `36` characters. The value must match regular expression `/^[-0-9a-z]+$/`. * `url` - (Forces new resource, String) URL of the definition repository. @@ -79,7 +79,7 @@ Nested scheme for **definitions**: * `properties` - (List) Tekton pipeline's environment properties. * Constraints: The maximum length is `1024` items. The minimum length is `0` items. -Nested scheme for **properties**: +Nested schema for **properties**: * `enum` - (List) Options for `single_select` property type. Only needed when using `single_select` property type. * Constraints: The list items must match regular expression `/^[-0-9a-zA-Z_.]{1,253}$/`. The maximum length is `256` items. The minimum length is `0` items. * `href` - (String) API URL for interacting with the property. @@ -93,20 +93,17 @@ Nested scheme for **properties**: * Constraints: Allowable values are: `secure`, `text`, `integration`, `single_select`, `appconfig`. * `value` - (String) Property value. Any string value is valid. * Constraints: The maximum length is `4096` characters. The minimum length is `0` characters. The value must match regular expression `/^.*$/`. - * `resource_group` - (List) The resource group in which the pipeline was created. -Nested scheme for **resource_group**: +Nested schema for **resource_group**: * `id` - (String) ID. * Constraints: The maximum length is `64` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z_]+$/`. - * `runs_url` - (String) URL for this pipeline showing the list of pipeline runs. * Constraints: The maximum length is `2048` characters. The minimum length is `10` characters. The value must match regular expression `/^http(s)?:\/\/([^\/?#]*)([^?#]*)(\\?([^#]*))?(#(.*))?$/`. * `status` - (String) Pipeline status. * Constraints: Allowable values are: `configured`, `configuring`. - * `toolchain` - (List) Toolchain object containing references to the parent toolchain. -Nested scheme for **toolchain**: +Nested schema for **toolchain**: * `crn` - (String) The CRN for the toolchain that contains the Tekton pipeline. * 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}$/`. * `id` - (String) UUID. @@ -114,7 +111,7 @@ Nested scheme for **toolchain**: * `triggers` - (List) Tekton pipeline triggers list. * Constraints: The maximum length is `1024` items. The minimum length is `0` items. -Nested scheme for **triggers**: +Nested schema for **triggers**: * `cron` - (String) Only needed for timer triggers. CRON expression that indicates when this trigger will activate. Maximum frequency is every 5 minutes. The string is based on UNIX crontab syntax: minute, hour, day of month, month, day of week. Example: The CRON expression 0 *_/2 * * * - translates to - every 2 hours. * Constraints: The maximum length is `253` characters. The minimum length is `5` characters. The value must match regular expression `/^[-0-9a-zA-Z,\\*\/ ]{5,253}$/`. * `enabled` - (Boolean) Flag to check if the trigger is enabled. @@ -136,7 +133,7 @@ Nested scheme for **triggers**: * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^([a-zA-Z0-9]{1,2}|[a-zA-Z0-9][0-9a-zA-Z-_.: \/\\(\\)\\[\\]]{1,251}[a-zA-Z0-9])$/`. * `properties` - (List) Optional trigger properties are used to override or supplement the pipeline properties when triggering a pipeline run. * Constraints: The maximum length is `1024` items. The minimum length is `0` items. - Nested scheme for **properties**: + Nested schema for **properties**: * `enum` - (List) Options for `single_select` property type. Only needed for `single_select` property type. * Constraints: The list items must match regular expression `/^[-0-9a-zA-Z_.]{1,253}$/`. The maximum length is `256` items. The minimum length is `0` items. * `href` - (String) API URL for interacting with the trigger property. @@ -151,7 +148,7 @@ Nested scheme for **triggers**: * `value` - (String) Property value. Any string value is valid. * Constraints: The maximum length is `4096` characters. The minimum length is `0` characters. The value must match regular expression `/^.*$/`. * `secret` - (List) Only needed for Generic Webhook trigger type. The secret is used to start the Generic Webhook trigger. - Nested scheme for **secret**: + Nested schema for **secret**: * `algorithm` - (String) Algorithm used for `digest_matches` secret type. Only needed for `digest_matches` secret type. * Constraints: Allowable values are: `md4`, `md5`, `sha1`, `sha256`, `sha384`, `sha512`, `sha512_224`, `sha512_256`, `ripemd160`. * `key_name` - (String) Secret name, not needed if type is `internal_validation`. @@ -163,9 +160,9 @@ Nested scheme for **triggers**: * `value` - (String) Secret value, not needed if secret type is `internal_validation`. * Constraints: The maximum length is `4096` characters. The minimum length is `0` characters. The value must match regular expression `/^.*$/`. * `source` - (List) Source repository for a Git trigger. Only required for Git triggers. The referenced repository URL must match the URL of a repository tool integration in the parent toolchain. Obtain the list of integrations from the toolchain API https://cloud.ibm.com/apidocs/toolchain#list-tools. - Nested scheme for **source**: + Nested schema for **source**: * `properties` - (List) Properties of the source, which define the URL of the repository and a branch or pattern. - Nested scheme for **properties**: + Nested schema for **properties**: * `blind_connection` - (Boolean) True if the repository server is not addressable on the public internet. IBM Cloud will not be able to validate the connection details you provide. * `branch` - (String) Name of a branch from the repo. Only one of branch, pattern, or filter should be specified. * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z_.]{1,253}$/`. @@ -174,7 +171,7 @@ Nested scheme for **triggers**: * `pattern` - (String) The pattern of Git branch or tag. You can specify a glob pattern such as '!test' or '*master' to match against multiple tags or branches in the repository.The glob pattern used must conform to Bash 4.3 specifications, see bash documentation for more info: https://www.gnu.org/software/bash/manual/bash.html#Pattern-Matching. Only one of branch, pattern, or filter should be specified. * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z_.:@=$&^\/\\?\\!\\*\\+\\[\\]\\(\\)\\{\\}\\|\\\\]*$/`. * `tool` - (List) Reference to the repository tool in the parent toolchain. - Nested scheme for **tool**: + Nested schema for **tool**: * `id` - (String) ID of the repository tool instance in the parent toolchain. * Constraints: The maximum length is `36` characters. The minimum length is `36` characters. The value must match regular expression `/^[-0-9a-z]+$/`. * `url` - (Forces new resource, String) URL of the repository to which the trigger is listening. @@ -190,7 +187,7 @@ Nested scheme for **triggers**: * `webhook_url` - (String) Webhook URL that can be used to trigger pipeline runs. * Constraints: The maximum length is `2048` characters. The minimum length is `10` characters. The value must match regular expression `/^http(s)?:\/\/([^\/?#]*)([^?#]*)(\\?([^#]*))?(#(.*))?$/`. * `worker` - (List) Details of the worker used to run the trigger. - Nested scheme for **worker**: + Nested schema for **worker**: * `id` - (String) ID of the worker. * Constraints: The maximum length is `36` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z]{1,36}$/`. * `name` - (String) Name of the worker. Computed based on the worker ID. @@ -199,9 +196,8 @@ Nested scheme for **triggers**: * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z_.]{1,253}$/`. * `updated_at` - (String) Standard RFC 3339 Date Time String. - * `worker` - (List) Details of the worker used to run the pipeline. -Nested scheme for **worker**: +Nested schema for **worker**: * `id` - (String) ID of the worker. * Constraints: The maximum length is `36` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z]{1,36}$/`. * `name` - (String) Name of the worker. Computed based on the worker ID. diff --git a/website/docs/d/cd_tekton_pipeline_definition.html.markdown b/website/docs/d/cd_tekton_pipeline_definition.html.markdown index 50e4ca46d4..1348def3eb 100644 --- a/website/docs/d/cd_tekton_pipeline_definition.html.markdown +++ b/website/docs/d/cd_tekton_pipeline_definition.html.markdown @@ -35,11 +35,10 @@ In addition to all argument references listed, you can access the following attr * `id` - The unique identifier of the cd_tekton_pipeline_definition. * `href` - (String) API URL for interacting with the definition. * Constraints: The maximum length is `2048` characters. The minimum length is `10` characters. The value must match regular expression `/^http(s)?:\/\/([^\/?#]*)([^?#]*)(\\?([^#]*))?(#(.*))?$/`. - * `source` - (List) Source repository containing the Tekton pipeline definition. -Nested scheme for **source**: +Nested schema for **source**: * `properties` - (List) Properties of the source, which define the URL of the repository and a branch or tag. - Nested scheme for **properties**: + Nested schema for **properties**: * `branch` - (String) A branch from the repo, specify one of branch or tag only. * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z_.]{1,253}$/`. * `path` - (String) The path to the definition's YAML files. @@ -47,7 +46,7 @@ Nested scheme for **source**: * `tag` - (String) A tag from the repo, specify one of branch or tag only. * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z_]{1,253}$/`. * `tool` - (List) Reference to the repository tool in the parent toolchain. - Nested scheme for **tool**: + Nested schema for **tool**: * `id` - (String) ID of the repository tool instance in the parent toolchain. * Constraints: The maximum length is `36` characters. The minimum length is `36` characters. The value must match regular expression `/^[-0-9a-z]+$/`. * `url` - (Forces new resource, String) URL of the definition repository. diff --git a/website/docs/d/cd_tekton_pipeline_trigger.html.markdown b/website/docs/d/cd_tekton_pipeline_trigger.html.markdown index 3469425bc6..888943eaec 100644 --- a/website/docs/d/cd_tekton_pipeline_trigger.html.markdown +++ b/website/docs/d/cd_tekton_pipeline_trigger.html.markdown @@ -58,10 +58,9 @@ In addition to all argument references listed, you can access the following attr * `name` - (String) Trigger name. * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^([a-zA-Z0-9]{1,2}|[a-zA-Z0-9][0-9a-zA-Z-_.: \/\\(\\)\\[\\]]{1,251}[a-zA-Z0-9])$/`. - * `properties` - (List) Optional trigger properties are used to override or supplement the pipeline properties when triggering a pipeline run. * Constraints: The maximum length is `1024` items. The minimum length is `0` items. -Nested scheme for **properties**: +Nested schema for **properties**: * `enum` - (List) Options for `single_select` property type. Only needed for `single_select` property type. * Constraints: The list items must match regular expression `/^[-0-9a-zA-Z_.]{1,253}$/`. The maximum length is `256` items. The minimum length is `0` items. * `href` - (String) API URL for interacting with the trigger property. @@ -75,9 +74,8 @@ Nested scheme for **properties**: * Constraints: Allowable values are: `secure`, `text`, `integration`, `single_select`, `appconfig`. * `value` - (String) Property value. Any string value is valid. * Constraints: The maximum length is `4096` characters. The minimum length is `0` characters. The value must match regular expression `/^.*$/`. - * `secret` - (List) Only needed for Generic Webhook trigger type. The secret is used to start the Generic Webhook trigger. -Nested scheme for **secret**: +Nested schema for **secret**: * `algorithm` - (String) Algorithm used for `digest_matches` secret type. Only needed for `digest_matches` secret type. * Constraints: Allowable values are: `md4`, `md5`, `sha1`, `sha256`, `sha384`, `sha512`, `sha512_224`, `sha512_256`, `ripemd160`. * `key_name` - (String) Secret name, not needed if type is `internal_validation`. @@ -88,11 +86,10 @@ Nested scheme for **secret**: * Constraints: Allowable values are: `token_matches`, `digest_matches`, `internal_validation`. * `value` - (String) Secret value, not needed if secret type is `internal_validation`. * Constraints: The maximum length is `4096` characters. The minimum length is `0` characters. The value must match regular expression `/^.*$/`. - * `source` - (List) Source repository for a Git trigger. Only required for Git triggers. The referenced repository URL must match the URL of a repository tool integration in the parent toolchain. Obtain the list of integrations from the toolchain API https://cloud.ibm.com/apidocs/toolchain#list-tools. -Nested scheme for **source**: +Nested schema for **source**: * `properties` - (List) Properties of the source, which define the URL of the repository and a branch or pattern. - Nested scheme for **properties**: + Nested schema for **properties**: * `blind_connection` - (Boolean) True if the repository server is not addressable on the public internet. IBM Cloud will not be able to validate the connection details you provide. * `branch` - (String) Name of a branch from the repo. Only one of branch, pattern, or filter should be specified. * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z_.]{1,253}$/`. @@ -101,7 +98,7 @@ Nested scheme for **source**: * `pattern` - (String) The pattern of Git branch or tag. You can specify a glob pattern such as '!test' or '*master' to match against multiple tags or branches in the repository.The glob pattern used must conform to Bash 4.3 specifications, see bash documentation for more info: https://www.gnu.org/software/bash/manual/bash.html#Pattern-Matching. Only one of branch, pattern, or filter should be specified. * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z_.:@=$&^\/\\?\\!\\*\\+\\[\\]\\(\\)\\{\\}\\|\\\\]*$/`. * `tool` - (List) Reference to the repository tool in the parent toolchain. - Nested scheme for **tool**: + Nested schema for **tool**: * `id` - (String) ID of the repository tool instance in the parent toolchain. * Constraints: The maximum length is `36` characters. The minimum length is `36` characters. The value must match regular expression `/^[-0-9a-z]+$/`. * `url` - (Forces new resource, String) URL of the repository to which the trigger is listening. @@ -120,9 +117,8 @@ Nested scheme for **source**: * `webhook_url` - (String) Webhook URL that can be used to trigger pipeline runs. * Constraints: The maximum length is `2048` characters. The minimum length is `10` characters. The value must match regular expression `/^http(s)?:\/\/([^\/?#]*)([^?#]*)(\\?([^#]*))?(#(.*))?$/`. - * `worker` - (List) Details of the worker used to run the trigger. -Nested scheme for **worker**: +Nested schema for **worker**: * `id` - (String) ID of the worker. * Constraints: The maximum length is `36` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z]{1,36}$/`. * `name` - (String) Name of the worker. Computed based on the worker ID. diff --git a/website/docs/r/cd_tekton_pipeline.html.markdown b/website/docs/r/cd_tekton_pipeline.html.markdown index 52a8729c25..d4c7ec08c0 100644 --- a/website/docs/r/cd_tekton_pipeline.html.markdown +++ b/website/docs/r/cd_tekton_pipeline.html.markdown @@ -34,7 +34,7 @@ Review the argument reference that you can specify for your resource. * `next_build_number` - (Optional, Integer) Specify the build number that will be used for the next pipeline run. Build numbers can be any positive whole number between 0 and 100000000000000. * Constraints: The maximum value is `99999999999999`. The minimum value is `1`. * `worker` - (Optional, List) Specify the worker that is to be used to run the trigger, indicated by a worker object with only the worker ID. If not specified or set as `worker: { id: 'public' }`, the IBM Managed shared workers are used. -Nested scheme for **worker**: +Nested schema for **worker**: * `id` - (Required, String) ID of the worker. * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z]{1,253}$/`. @@ -48,15 +48,15 @@ In addition to all argument references listed, you can access the following attr * `created_at` - (String) Standard RFC 3339 Date Time String. * `definitions` - (List) Definition list. * Constraints: The maximum length is `128` items. The minimum length is `0` items. -Nested scheme for **definitions**: +Nested schema for **definitions**: * `href` - (String) API URL for interacting with the definition. * Constraints: The maximum length is `2048` characters. The minimum length is `10` characters. The value must match regular expression `/^http(s)?:\/\/([^\/?#]*)([^?#]*)(\\?([^#]*))?(#(.*))?$/`. * `id` - (String) The aggregated definition ID. * Constraints: The maximum length is `36` characters. The minimum length is `36` characters. The value must match regular expression `/^[-0-9a-z]+$/`. * `source` - (List) Source repository containing the Tekton pipeline definition. - Nested scheme for **source**: + Nested schema for **source**: * `properties` - (List) Properties of the source, which define the URL of the repository and a branch or tag. - Nested scheme for **properties**: + Nested schema for **properties**: * `branch` - (String) A branch from the repo, specify one of branch or tag only. * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z_.]{1,253}$/`. * `path` - (String) The path to the definition's YAML files. @@ -64,7 +64,7 @@ Nested scheme for **definitions**: * `tag` - (String) A tag from the repo, specify one of branch or tag only. * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z_]{1,253}$/`. * `tool` - (List) Reference to the repository tool in the parent toolchain. - Nested scheme for **tool**: + Nested schema for **tool**: * `id` - (String) ID of the repository tool instance in the parent toolchain. * Constraints: The maximum length is `36` characters. The minimum length is `36` characters. The value must match regular expression `/^[-0-9a-z]+$/`. * `url` - (Forces new resource, String) URL of the definition repository. @@ -79,7 +79,7 @@ Nested scheme for **definitions**: * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^[a-zA-Z0-9][-0-9a-zA-Z_. ]{1,251}[a-zA-Z0-9]$/`. * `properties` - (List) Tekton pipeline's environment properties. * Constraints: The maximum length is `1024` items. The minimum length is `0` items. -Nested scheme for **properties**: +Nested schema for **properties**: * `enum` - (List) Options for `single_select` property type. Only needed when using `single_select` property type. * Constraints: The list items must match regular expression `/^[-0-9a-zA-Z_.]{1,253}$/`. The maximum length is `256` items. The minimum length is `0` items. * `href` - (String) API URL for interacting with the property. @@ -94,7 +94,7 @@ Nested scheme for **properties**: * `value` - (String) Property value. Any string value is valid. * Constraints: The maximum length is `4096` characters. The minimum length is `0` characters. The value must match regular expression `/^.*$/`. * `resource_group` - (List) The resource group in which the pipeline was created. -Nested scheme for **resource_group**: +Nested schema for **resource_group**: * `id` - (String) ID. * Constraints: The maximum length is `64` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z_]+$/`. * `runs_url` - (String) URL for this pipeline showing the list of pipeline runs. @@ -102,14 +102,14 @@ Nested scheme for **resource_group**: * `status` - (String) Pipeline status. * Constraints: Allowable values are: `configured`, `configuring`. * `toolchain` - (List) Toolchain object containing references to the parent toolchain. -Nested scheme for **toolchain**: +Nested schema for **toolchain**: * `crn` - (String) The CRN for the toolchain that contains the Tekton pipeline. * 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}$/`. * `id` - (String) UUID. * Constraints: The maximum length is `36` characters. The minimum length is `36` characters. The value must match regular expression `/^[-0-9a-z]+$/`. * `triggers` - (List) Tekton pipeline triggers list. * Constraints: The maximum length is `1024` items. The minimum length is `0` items. -Nested scheme for **triggers**: +Nested schema for **triggers**: * `cron` - (String) Only needed for timer triggers. CRON expression that indicates when this trigger will activate. Maximum frequency is every 5 minutes. The string is based on UNIX crontab syntax: minute, hour, day of month, month, day of week. Example: The CRON expression 0 *_/2 * * * - translates to - every 2 hours. * Constraints: The maximum length is `253` characters. The minimum length is `5` characters. The value must match regular expression `/^[-0-9a-zA-Z,\\*\/ ]{5,253}$/`. * `enabled` - (Boolean) Flag to check if the trigger is enabled. @@ -131,7 +131,7 @@ Nested scheme for **triggers**: * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^([a-zA-Z0-9]{1,2}|[a-zA-Z0-9][0-9a-zA-Z-_.: \/\\(\\)\\[\\]]{1,251}[a-zA-Z0-9])$/`. * `properties` - (List) Optional trigger properties are used to override or supplement the pipeline properties when triggering a pipeline run. * Constraints: The maximum length is `1024` items. The minimum length is `0` items. - Nested scheme for **properties**: + Nested schema for **properties**: * `enum` - (List) Options for `single_select` property type. Only needed for `single_select` property type. * Constraints: The list items must match regular expression `/^[-0-9a-zA-Z_.]{1,253}$/`. The maximum length is `256` items. The minimum length is `0` items. * `href` - (String) API URL for interacting with the trigger property. @@ -146,7 +146,7 @@ Nested scheme for **triggers**: * `value` - (String) Property value. Any string value is valid. * Constraints: The maximum length is `4096` characters. The minimum length is `0` characters. The value must match regular expression `/^.*$/`. * `secret` - (List) Only needed for Generic Webhook trigger type. The secret is used to start the Generic Webhook trigger. - Nested scheme for **secret**: + Nested schema for **secret**: * `algorithm` - (String) Algorithm used for `digest_matches` secret type. Only needed for `digest_matches` secret type. * Constraints: Allowable values are: `md4`, `md5`, `sha1`, `sha256`, `sha384`, `sha512`, `sha512_224`, `sha512_256`, `ripemd160`. * `key_name` - (String) Secret name, not needed if type is `internal_validation`. @@ -158,9 +158,9 @@ Nested scheme for **triggers**: * `value` - (String) Secret value, not needed if secret type is `internal_validation`. * Constraints: The maximum length is `4096` characters. The minimum length is `0` characters. The value must match regular expression `/^.*$/`. * `source` - (List) Source repository for a Git trigger. Only required for Git triggers. The referenced repository URL must match the URL of a repository tool integration in the parent toolchain. Obtain the list of integrations from the toolchain API https://cloud.ibm.com/apidocs/toolchain#list-tools. - Nested scheme for **source**: + Nested schema for **source**: * `properties` - (List) Properties of the source, which define the URL of the repository and a branch or pattern. - Nested scheme for **properties**: + Nested schema for **properties**: * `blind_connection` - (Boolean) True if the repository server is not addressable on the public internet. IBM Cloud will not be able to validate the connection details you provide. * `branch` - (String) Name of a branch from the repo. Only one of branch, pattern, or filter should be specified. * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z_.]{1,253}$/`. @@ -169,7 +169,7 @@ Nested scheme for **triggers**: * `pattern` - (String) The pattern of Git branch or tag. You can specify a glob pattern such as '!test' or '*master' to match against multiple tags or branches in the repository.The glob pattern used must conform to Bash 4.3 specifications, see bash documentation for more info: https://www.gnu.org/software/bash/manual/bash.html#Pattern-Matching. Only one of branch, pattern, or filter should be specified. * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z_.:@=$&^\/\\?\\!\\*\\+\\[\\]\\(\\)\\{\\}\\|\\\\]*$/`. * `tool` - (List) Reference to the repository tool in the parent toolchain. - Nested scheme for **tool**: + Nested schema for **tool**: * `id` - (String) ID of the repository tool instance in the parent toolchain. * Constraints: The maximum length is `36` characters. The minimum length is `36` characters. The value must match regular expression `/^[-0-9a-z]+$/`. * `url` - (Forces new resource, String) URL of the repository to which the trigger is listening. @@ -185,7 +185,7 @@ Nested scheme for **triggers**: * `webhook_url` - (String) Webhook URL that can be used to trigger pipeline runs. * Constraints: The maximum length is `2048` characters. The minimum length is `10` characters. The value must match regular expression `/^http(s)?:\/\/([^\/?#]*)([^?#]*)(\\?([^#]*))?(#(.*))?$/`. * `worker` - (List) Details of the worker used to run the trigger. - Nested scheme for **worker**: + Nested schema for **worker**: * `id` - (String) ID of the worker. * Constraints: The maximum length is `36` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z]{1,36}$/`. * `name` - (String) Name of the worker. Computed based on the worker ID. diff --git a/website/docs/r/cd_tekton_pipeline_definition.html.markdown b/website/docs/r/cd_tekton_pipeline_definition.html.markdown index 49bb97727a..12d0be686d 100644 --- a/website/docs/r/cd_tekton_pipeline_definition.html.markdown +++ b/website/docs/r/cd_tekton_pipeline_definition.html.markdown @@ -37,9 +37,9 @@ Review the argument reference that you can specify for your resource. * `pipeline_id` - (Required, Forces new resource, String) The Tekton pipeline ID. * Constraints: The maximum length is `36` characters. The minimum length is `36` characters. The value must match regular expression `/^[-0-9a-z]+$/`. * `source` - (Required, List) Source repository containing the Tekton pipeline definition. -Nested scheme for **source**: +Nested schema for **source**: * `properties` - (Required, List) Properties of the source, which define the URL of the repository and a branch or tag. - Nested scheme for **properties**: + Nested schema for **properties**: * `branch` - (Optional, String) A branch from the repo, specify one of branch or tag only. * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z_.]{1,253}$/`. * `path` - (Required, String) The path to the definition's YAML files. @@ -47,7 +47,7 @@ Nested scheme for **source**: * `tag` - (Optional, String) A tag from the repo, specify one of branch or tag only. * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z_]{1,253}$/`. * `tool` - (Optional, List) Reference to the repository tool in the parent toolchain. - Nested scheme for **tool**: + Nested schema for **tool**: * `id` - (Computed, String) ID of the repository tool instance in the parent toolchain. * Constraints: The maximum length is `36` characters. The minimum length is `36` characters. The value must match regular expression `/^[-0-9a-z]+$/`. * `url` - (Required, Forces new resource, String) URL of the definition repository. diff --git a/website/docs/r/cd_tekton_pipeline_trigger.html.markdown b/website/docs/r/cd_tekton_pipeline_trigger.html.markdown index 5ef9cca975..0ac708932a 100644 --- a/website/docs/r/cd_tekton_pipeline_trigger.html.markdown +++ b/website/docs/r/cd_tekton_pipeline_trigger.html.markdown @@ -47,7 +47,7 @@ Review the argument reference that you can specify for your resource. * `pipeline_id` - (Required, Forces new resource, String) The Tekton pipeline ID. * Constraints: The maximum length is `36` characters. The minimum length is `36` characters. The value must match regular expression `/^[-0-9a-z]+$/`. * `secret` - (Optional, List) Only needed for Generic Webhook trigger type. The secret is used to start the Generic Webhook trigger. -Nested scheme for **secret**: +Nested schema for **secret**: * `algorithm` - (Optional, String) Algorithm used for `digest_matches` secret type. Only needed for `digest_matches` secret type. * Constraints: Allowable values are: `md4`, `md5`, `sha1`, `sha256`, `sha384`, `sha512`, `sha512_224`, `sha512_256`, `ripemd160`. * `key_name` - (Optional, String) Secret name, not needed if type is `internal_validation`. @@ -59,9 +59,9 @@ Nested scheme for **secret**: * `value` - (Optional, String) Secret value, not needed if secret type is `internal_validation`. * Constraints: The maximum length is `4096` characters. The minimum length is `0` characters. The value must match regular expression `/^.*$/`. * `source` - (Optional, List) Source repository for a Git trigger. Only required for Git triggers. The referenced repository URL must match the URL of a repository tool integration in the parent toolchain. Obtain the list of integrations from the toolchain API https://cloud.ibm.com/apidocs/toolchain#list-tools. -Nested scheme for **source**: +Nested schema for **source**: * `properties` - (Required, List) Properties of the source, which define the URL of the repository and a branch or pattern. - Nested scheme for **properties**: + Nested schema for **properties**: * `branch` - (Optional, String) Name of a branch from the repo. Only one of branch, pattern, or filter should be specified. * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z_.]{1,253}$/`. * `pattern` - (Optional, String) The pattern of Git branch or tag. You can specify a glob pattern such as '!test' or '*master' to match against multiple tags or branches in the repository.The glob pattern used must conform to Bash 4.3 specifications, see bash documentation for more info: https://www.gnu.org/software/bash/manual/bash.html#Pattern-Matching. Only one of branch, pattern, or filter should be specified. @@ -77,7 +77,7 @@ Nested scheme for **source**: * `type` - (Required, String) Trigger type. * Constraints: Allowable values are: `manual`, `scm`, `timer`, `generic`. * `worker` - (Optional, List) Specify the worker used to run the trigger. Use `worker: { id: 'public' }` to use the IBM Managed workers. The default is to inherit the worker set in the pipeline settings, which can also be explicitly set using `worker: { id: 'inherit' }`. -Nested scheme for **worker**: +Nested schema for **worker**: * `id` - (Required, String) ID of the worker. * Constraints: The maximum length is `253` characters. The minimum length is `1` character. The value must match regular expression `/^[-0-9a-zA-Z]{1,253}$/`. @@ -90,7 +90,7 @@ In addition to all argument references listed, you can access the following attr * Constraints: The maximum length is `2048` characters. The minimum length is `10` characters. The value must match regular expression `/^http(s)?:\/\/([^\/?#]*)([^?#]*)(\\?([^#]*))?(#(.*))?$/`. * `properties` - (List) Optional trigger properties are used to override or supplement the pipeline properties when triggering a pipeline run. * Constraints: The maximum length is `1024` items. The minimum length is `0` items. -Nested scheme for **properties**: +Nested schema for **properties**: * `enum` - (List) Options for `single_select` property type. Only needed for `single_select` property type. * Constraints: The list items must match regular expression `/^[-0-9a-zA-Z_.]{1,253}$/`. The maximum length is `256` items. The minimum length is `0` items. * `href` - (String) API URL for interacting with the trigger property.