Skip to content

Commit 1c61c19

Browse files
bcoddensBartcloudpossebot
authored
Integrated the changes from dome9 (#86)
* Integrated the cahnges from dome9 * Auto Format * Fix after review * Fixes after review * Description added * Auto Format * Rephrased * Auto Format * Changed to make the description more clear * Auto Format Co-authored-by: Bart <[email protected]> Co-authored-by: cloudpossebot <[email protected]>
1 parent f06ed4b commit 1c61c19

File tree

4 files changed

+33
-0
lines changed

4 files changed

+33
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ Available targets:
236236
| privileged\_mode | (Optional) If set to true, enables running the Docker daemon inside a Docker container on the CodeBuild instance. Used when building Docker images | `bool` | `false` | no |
237237
| regex\_replace\_chars | Regex to replace chars with empty string in `namespace`, `environment`, `stage` and `name`.<br>If not set, `"/[^a-zA-Z0-9-]/"` is used to remove all characters other than hyphens, letters and digits. | `string` | `null` | no |
238238
| report\_build\_status | Set to true to report the status of a build's start and finish to your source provider. This option is only valid when the source\_type is BITBUCKET or GITHUB | `bool` | `false` | no |
239+
| secondary\_sources | (Optional) secondary source for the codebuild project in addition to the primary location | <pre>list(object(<br> {<br> git_clone_depth = number<br> location = string<br> source_identifier = string<br> type = string<br> fetch_submodules = bool<br> insecure_ssl = bool<br> report_build_status = bool<br> }))</pre> | `[]` | no |
239240
| source\_credential\_auth\_type | The type of authentication used to connect to a GitHub, GitHub Enterprise, or Bitbucket repository. | `string` | `"PERSONAL_ACCESS_TOKEN"` | no |
240241
| source\_credential\_server\_type | The source provider used for this project. | `string` | `"GITHUB"` | no |
241242
| source\_credential\_token | For GitHub or GitHub Enterprise, this is the personal access token. For Bitbucket, this is the app password. | `string` | `""` | no |

docs/terraform.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
| privileged\_mode | (Optional) If set to true, enables running the Docker daemon inside a Docker container on the CodeBuild instance. Used when building Docker images | `bool` | `false` | no |
8080
| regex\_replace\_chars | Regex to replace chars with empty string in `namespace`, `environment`, `stage` and `name`.<br>If not set, `"/[^a-zA-Z0-9-]/"` is used to remove all characters other than hyphens, letters and digits. | `string` | `null` | no |
8181
| report\_build\_status | Set to true to report the status of a build's start and finish to your source provider. This option is only valid when the source\_type is BITBUCKET or GITHUB | `bool` | `false` | no |
82+
| secondary\_sources | (Optional) secondary source for the codebuild project in addition to the primary location | <pre>list(object(<br> {<br> git_clone_depth = number<br> location = string<br> source_identifier = string<br> type = string<br> fetch_submodules = bool<br> insecure_ssl = bool<br> report_build_status = bool<br> }))</pre> | `[]` | no |
8283
| source\_credential\_auth\_type | The type of authentication used to connect to a GitHub, GitHub Enterprise, or Bitbucket repository. | `string` | `"PERSONAL_ACCESS_TOKEN"` | no |
8384
| source\_credential\_server\_type | The source provider used for this project. | `string` | `"GITHUB"` | no |
8485
| source\_credential\_token | For GitHub or GitHub Enterprise, this is the personal access token. For Bitbucket, this is the app password. | `string` | `""` | no |

main.tf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,22 @@ resource "aws_codebuild_project" "default" {
367367
}
368368
}
369369

370+
dynamic "secondary_sources" {
371+
for_each = var.secondary_sources
372+
content {
373+
git_clone_depth = secondary_source.value.git_clone_depth
374+
location = secondary_source.value.location
375+
source_identifier = secondary_source.value.source_identifier
376+
type = secondary_source.value.type
377+
insecure_ssl = secondary_source.value.insecure_ssl
378+
report_build_status = secondary_source.value.report_build_status
379+
380+
git_submodules_config {
381+
fetch_submodules = secondary_source.value.fetch_submodules
382+
}
383+
}
384+
}
385+
370386
dynamic "vpc_config" {
371387
for_each = length(var.vpc_config) > 0 ? [""] : []
372388
content {

variables.tf

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,21 @@ variable "image_tag" {
108108
description = "(Optional) Docker image tag in the ECR repository, e.g. 'latest'. Used as CodeBuild ENV variable when building Docker images. For more info: http://docs.aws.amazon.com/codebuild/latest/userguide/sample-docker.html"
109109
}
110110

111+
variable "secondary_sources" {
112+
type = list(object(
113+
{
114+
git_clone_depth = number
115+
location = string
116+
source_identifier = string
117+
type = string
118+
fetch_submodules = bool
119+
insecure_ssl = bool
120+
report_build_status = bool
121+
}))
122+
default = []
123+
description = "(Optional) secondary source for the codebuild project in addition to the primary location"
124+
}
125+
111126
variable "source_type" {
112127
type = string
113128
default = "CODEPIPELINE"

0 commit comments

Comments
 (0)