Skip to content

Commit

Permalink
Integrated the changes from dome9 (#86)
Browse files Browse the repository at this point in the history
* 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 <bart@atmire.com>
Co-authored-by: cloudpossebot <11232728+cloudpossebot@users.noreply.github.com>
  • Loading branch information
3 people authored Mar 16, 2021
1 parent f06ed4b commit 1c61c19
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ Available targets:
| 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 |
| 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 |
| 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 |
| 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 |
| source\_credential\_auth\_type | The type of authentication used to connect to a GitHub, GitHub Enterprise, or Bitbucket repository. | `string` | `"PERSONAL_ACCESS_TOKEN"` | no |
| source\_credential\_server\_type | The source provider used for this project. | `string` | `"GITHUB"` | no |
| source\_credential\_token | For GitHub or GitHub Enterprise, this is the personal access token. For Bitbucket, this is the app password. | `string` | `""` | no |
Expand Down
1 change: 1 addition & 0 deletions docs/terraform.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
| 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 |
| 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 |
| 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 |
| 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 |
| source\_credential\_auth\_type | The type of authentication used to connect to a GitHub, GitHub Enterprise, or Bitbucket repository. | `string` | `"PERSONAL_ACCESS_TOKEN"` | no |
| source\_credential\_server\_type | The source provider used for this project. | `string` | `"GITHUB"` | no |
| source\_credential\_token | For GitHub or GitHub Enterprise, this is the personal access token. For Bitbucket, this is the app password. | `string` | `""` | no |
Expand Down
16 changes: 16 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,22 @@ resource "aws_codebuild_project" "default" {
}
}

dynamic "secondary_sources" {
for_each = var.secondary_sources
content {
git_clone_depth = secondary_source.value.git_clone_depth
location = secondary_source.value.location
source_identifier = secondary_source.value.source_identifier
type = secondary_source.value.type
insecure_ssl = secondary_source.value.insecure_ssl
report_build_status = secondary_source.value.report_build_status

git_submodules_config {
fetch_submodules = secondary_source.value.fetch_submodules
}
}
}

dynamic "vpc_config" {
for_each = length(var.vpc_config) > 0 ? [""] : []
content {
Expand Down
15 changes: 15 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,21 @@ variable "image_tag" {
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"
}

variable "secondary_sources" {
type = list(object(
{
git_clone_depth = number
location = string
source_identifier = string
type = string
fetch_submodules = bool
insecure_ssl = bool
report_build_status = bool
}))
default = []
description = "(Optional) secondary source for the codebuild project in addition to the primary location"
}

variable "source_type" {
type = string
default = "CODEPIPELINE"
Expand Down

0 comments on commit 1c61c19

Please sign in to comment.