Skip to content

Commit

Permalink
fix: update provider, auto run depends on (#495)
Browse files Browse the repository at this point in the history
  • Loading branch information
huayuenh authored Oct 14, 2024
1 parent 1986a29 commit 6719614
Show file tree
Hide file tree
Showing 13 changed files with 43 additions and 18 deletions.
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ statement instead the previous block.
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0.0 |
| <a name="requirement_ibm"></a> [ibm](#requirement\_ibm) | =1.67.1 |
| <a name="requirement_ibm"></a> [ibm](#requirement\_ibm) | =1.70.0 |
| <a name="requirement_null"></a> [null](#requirement\_null) | = 3.2.2 |
| <a name="requirement_random"></a> [random](#requirement\_random) | = 3.6.2 |

Expand All @@ -74,16 +74,16 @@ statement instead the previous block.

| Name | Type |
|------|------|
| [ibm_cd_tekton_pipeline_trigger.ci_pipeline_webhook](https://registry.terraform.io/providers/IBM-Cloud/ibm/1.67.1/docs/resources/cd_tekton_pipeline_trigger) | resource |
| [ibm_cd_tekton_pipeline_trigger_property.ci_pipeline_webhook_branch_property](https://registry.terraform.io/providers/IBM-Cloud/ibm/1.67.1/docs/resources/cd_tekton_pipeline_trigger_property) | resource |
| [ibm_cd_tekton_pipeline_trigger_property.ci_pipeline_webhook_name_property](https://registry.terraform.io/providers/IBM-Cloud/ibm/1.67.1/docs/resources/cd_tekton_pipeline_trigger_property) | resource |
| [ibm_cd_tekton_pipeline_trigger_property.ci_pipeline_webhook_repo_url_property](https://registry.terraform.io/providers/IBM-Cloud/ibm/1.67.1/docs/resources/cd_tekton_pipeline_trigger_property) | resource |
| [ibm_cr_namespace.cr_namespace](https://registry.terraform.io/providers/IBM-Cloud/ibm/1.67.1/docs/resources/cr_namespace) | resource |
| [ibm_resource_instance.cd_instance](https://registry.terraform.io/providers/IBM-Cloud/ibm/1.67.1/docs/resources/resource_instance) | resource |
| [ibm_cd_tekton_pipeline_trigger.ci_pipeline_webhook](https://registry.terraform.io/providers/IBM-Cloud/ibm/1.70.0/docs/resources/cd_tekton_pipeline_trigger) | resource |
| [ibm_cd_tekton_pipeline_trigger_property.ci_pipeline_webhook_branch_property](https://registry.terraform.io/providers/IBM-Cloud/ibm/1.70.0/docs/resources/cd_tekton_pipeline_trigger_property) | resource |
| [ibm_cd_tekton_pipeline_trigger_property.ci_pipeline_webhook_name_property](https://registry.terraform.io/providers/IBM-Cloud/ibm/1.70.0/docs/resources/cd_tekton_pipeline_trigger_property) | resource |
| [ibm_cd_tekton_pipeline_trigger_property.ci_pipeline_webhook_repo_url_property](https://registry.terraform.io/providers/IBM-Cloud/ibm/1.70.0/docs/resources/cd_tekton_pipeline_trigger_property) | resource |
| [ibm_cr_namespace.cr_namespace](https://registry.terraform.io/providers/IBM-Cloud/ibm/1.70.0/docs/resources/cr_namespace) | resource |
| [ibm_resource_instance.cd_instance](https://registry.terraform.io/providers/IBM-Cloud/ibm/1.70.0/docs/resources/resource_instance) | resource |
| [null_resource.ci_pipeline_run](https://registry.terraform.io/providers/hashicorp/null/3.2.2/docs/resources/resource) | resource |
| [random_string.resource_suffix](https://registry.terraform.io/providers/hashicorp/random/3.6.2/docs/resources/string) | resource |
| [random_string.webhook_secret](https://registry.terraform.io/providers/hashicorp/random/3.6.2/docs/resources/string) | resource |
| [ibm_resource_group.resource_group](https://registry.terraform.io/providers/IBM-Cloud/ibm/1.67.1/docs/data-sources/resource_group) | data source |
| [ibm_resource_group.resource_group](https://registry.terraform.io/providers/IBM-Cloud/ibm/1.70.0/docs/data-sources/resource_group) | data source |

### Inputs

Expand Down Expand Up @@ -589,6 +589,7 @@ statement instead the previous block.
| <a name="input_toolchain_region"></a> [toolchain\_region](#input\_toolchain\_region) | The region identifier that will be used, by default, for all resource creation and service instance lookup. | `string` | `"us-south"` | no |
| <a name="input_toolchain_resource_group"></a> [toolchain\_resource\_group](#input\_toolchain\_resource\_group) | The resource group that will be used, by default, for all resource creation and service instance lookups. This can be overridden on a per resource/service basis. | `string` | `"Default"` | no |
| <a name="input_use_app_repo_for_cd_deploy"></a> [use\_app\_repo\_for\_cd\_deploy](#input\_use\_app\_repo\_for\_cd\_deploy) | Set to `true` to use the CI sample application repository as the deployment repository in the CD pipeline. This will be set in the pipeline config integration. | `bool` | `false` | no |
| <a name="input_worker_id"></a> [worker\_id](#input\_worker\_id) | The identifier for the pipeline worker. Applies to the CI, CD and CC pipelines. | `string` | `"public"` | no |

### Outputs

Expand Down
13 changes: 9 additions & 4 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ module "devsecops_ci_toolchain" {
pr_pipeline_branch = (var.ci_compliance_pipeline_pr_branch == "") ? var.compliance_pipeline_branch : var.ci_compliance_pipeline_pr_branch
ci_pipeline_git_tag = (var.ci_pipeline_git_tag == "") ? var.pipeline_git_tag : var.ci_pipeline_git_tag
pr_pipeline_git_tag = (var.pr_pipeline_git_tag == "") ? var.pipeline_git_tag : var.pr_pipeline_git_tag
worker_id = var.worker_id

#SECRET PROVIDERS
enable_key_protect = (local.ci_enable_key_protect == "true") ? true : false
Expand Down Expand Up @@ -466,6 +467,7 @@ module "devsecops_cd_toolchain" {
toolchain_resource_group = (var.cd_toolchain_resource_group == "") ? var.toolchain_resource_group : var.cd_toolchain_resource_group
pipeline_branch = (var.cd_compliance_pipeline_branch == "") ? var.compliance_pipeline_branch : var.cd_compliance_pipeline_branch
pipeline_git_tag = (var.cd_pipeline_git_tag == "") ? var.pipeline_git_tag : var.cd_pipeline_git_tag
worker_id = var.worker_id

#SECRET PROVIDERS
enable_key_protect = (local.cd_enable_key_protect == "true") ? true : false
Expand Down Expand Up @@ -680,6 +682,7 @@ module "devsecops_cc_toolchain" {
authorization_policy_creation = (var.cc_authorization_policy_creation == "") ? var.authorization_policy_creation : var.cc_authorization_policy_creation
pipeline_branch = (var.cc_compliance_pipeline_branch == "") ? var.compliance_pipeline_branch : var.cc_compliance_pipeline_branch
pipeline_git_tag = (var.cc_pipeline_git_tag == "") ? var.pipeline_git_tag : var.cc_pipeline_git_tag
worker_id = var.worker_id

#SECRET PROVIDERS
enable_key_protect = (local.cc_enable_key_protect == "true") ? true : false
Expand Down Expand Up @@ -860,9 +863,10 @@ module "devsecops_cc_toolchain" {

# Random string for webhook token
resource "random_string" "webhook_secret" {
length = 48
special = false
upper = false
depends_on = [module.devsecops_ci_toolchain[0].ci_pipeline_id, module.devsecops_ci_toolchain[0].app_repo_url]
length = 48
special = false
upper = false
}

# Create webhook for CI pipeline
Expand Down Expand Up @@ -919,7 +923,8 @@ resource "null_resource" "ci_pipeline_run" {
count = (var.autostart) ? 1 : 0
depends_on = [
ibm_cd_tekton_pipeline_trigger.ci_pipeline_webhook,
ibm_cd_tekton_pipeline_trigger_property.ci_pipeline_webhook_branch_property
ibm_cd_tekton_pipeline_trigger_property.ci_pipeline_webhook_branch_property,
ibm_cd_tekton_pipeline_trigger_property.ci_pipeline_webhook_repo_url_property
]
triggers = {
always_run = timestamp()
Expand Down
2 changes: 1 addition & 1 deletion prereqs/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ terraform {
required_providers {
ibm = {
source = "IBM-Cloud/ibm"
version = "= 1.67.1"
version = "=1.70.0"
}

external = {
Expand Down
3 changes: 2 additions & 1 deletion solutions/code-engine/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ statement instead the previous block.
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0.0 |
| <a name="requirement_ibm"></a> [ibm](#requirement\_ibm) | =1.67.1 |
| <a name="requirement_ibm"></a> [ibm](#requirement\_ibm) | =1.70.0 |

### Modules

Expand Down Expand Up @@ -570,6 +570,7 @@ No resources.
| <a name="input_toolchain_region"></a> [toolchain\_region](#input\_toolchain\_region) | The region identifier that will be used, by default, for all resource creation and service instance lookup. This can be overridden on a per resource/service basis. | `string` | `"us-south"` | no |
| <a name="input_toolchain_resource_group"></a> [toolchain\_resource\_group](#input\_toolchain\_resource\_group) | The resource group that will be used, by default, for all resource creation and service instance lookups. This can be overridden on a per resource/service basis. | `string` | `"Default"` | no |
| <a name="input_use_app_repo_for_cd_deploy"></a> [use\_app\_repo\_for\_cd\_deploy](#input\_use\_app\_repo\_for\_cd\_deploy) | Set to `true` to use the CI sample application repository as the deployment repository in the CD pipeline. This will be set in the pipeline config integration. | `bool` | `true` | no |
| <a name="input_worker_id"></a> [worker\_id](#input\_worker\_id) | The identifier for the pipeline worker. Applies to the CI, CD and CC pipelines. | `string` | `"public"` | no |

### Outputs

Expand Down
1 change: 1 addition & 0 deletions solutions/code-engine/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ module "devsecops_da" {
toolchain_resource_group = var.toolchain_resource_group
toolchain_region = var.toolchain_region
use_app_repo_for_cd_deploy = var.use_app_repo_for_cd_deploy
worker_id = var.worker_id
cc_app_group = var.cc_app_group
cc_app_repo_auth_type = var.cc_app_repo_auth_type
cc_app_repo_branch = var.cc_app_repo_branch
Expand Down
5 changes: 5 additions & 0 deletions solutions/code-engine/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -936,6 +936,11 @@ variable "toolchain_resource_group" {
default = "Default"
}

variable "worker_id" {
type = string
default = "public"
description = "The identifier for the pipeline worker. Applies to the CI, CD and CC pipelines."
}

########################################################
##### START OF CC VARIABLES ##############
Expand Down
2 changes: 1 addition & 1 deletion solutions/code-engine/version.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
ibm = {
source = "IBM-Cloud/ibm"
version = "=1.67.1"
version = "=1.70.0"
}
}
}
3 changes: 2 additions & 1 deletion solutions/kubernetes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ statement instead the previous block.
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0.0 |
| <a name="requirement_ibm"></a> [ibm](#requirement\_ibm) | =1.67.1 |
| <a name="requirement_ibm"></a> [ibm](#requirement\_ibm) | =1.70.0 |

### Modules

Expand Down Expand Up @@ -570,6 +570,7 @@ No resources.
| <a name="input_toolchain_region"></a> [toolchain\_region](#input\_toolchain\_region) | The region identifier that will be used, by default, for all resource creation and service instance lookup. This can be overridden on a per resource/service basis. | `string` | `"us-south"` | no |
| <a name="input_toolchain_resource_group"></a> [toolchain\_resource\_group](#input\_toolchain\_resource\_group) | The resource group that will be used, by default, for all resource creation and service instance lookups. This can be overridden on a per resource/service basis. | `string` | `"Default"` | no |
| <a name="input_use_app_repo_for_cd_deploy"></a> [use\_app\_repo\_for\_cd\_deploy](#input\_use\_app\_repo\_for\_cd\_deploy) | Set to `true` to use the CI sample application repository as the deployment repository in the CD pipeline. This will be set in the pipeline config integration. | `bool` | `false` | no |
| <a name="input_worker_id"></a> [worker\_id](#input\_worker\_id) | The identifier for the pipeline worker. Applies to the CI, CD and CC pipelines. | `string` | `"public"` | no |

### Outputs

Expand Down
1 change: 1 addition & 0 deletions solutions/kubernetes/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ module "devsecops_da" {
toolchain_name = var.toolchain_name
toolchain_resource_group = var.toolchain_resource_group
toolchain_region = var.toolchain_region
worker_id = var.worker_id
use_app_repo_for_cd_deploy = var.use_app_repo_for_cd_deploy
cc_app_group = var.cc_app_group
cc_app_repo_auth_type = var.cc_app_repo_auth_type
Expand Down
5 changes: 5 additions & 0 deletions solutions/kubernetes/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -936,6 +936,11 @@ variable "toolchain_resource_group" {
default = "Default"
}

variable "worker_id" {
type = string
default = "public"
description = "The identifier for the pipeline worker. Applies to the CI, CD and CC pipelines."
}

########################################################
##### START OF CC VARIABLES ##############
Expand Down
2 changes: 1 addition & 1 deletion solutions/kubernetes/version.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
ibm = {
source = "IBM-Cloud/ibm"
version = "=1.67.1"
version = "=1.70.0"
}
}
}
5 changes: 5 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -942,6 +942,11 @@ variable "toolchain_resource_group" {
default = "Default"
}

variable "worker_id" {
type = string
default = "public"
description = "The identifier for the pipeline worker. Applies to the CI, CD and CC pipelines."
}

########################################################
##### START OF CC VARIABLES ##############
Expand Down
2 changes: 1 addition & 1 deletion version.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
ibm = {
source = "IBM-Cloud/ibm"
version = "=1.67.1"
version = "=1.70.0"
}

random = {
Expand Down

0 comments on commit 6719614

Please sign in to comment.