Skip to content

Commit a319622

Browse files
authored
Added Authentication Support for Private Repositories (Bitbucket, Github) (#53)
* add private repo auth, log config, git depth, sub module support * lint * force detach policy * solve issue #48 mandatory namespace and stage * added secret manager access * Solved: #56 Support of Other AWS CodeBuild Containers * Example: Bitbucket * added extra permissions input for service account * resolve conflicts * resolve conflicts * resolve conflicts * resolve conflicts * resolve conflicts * resolve conflicts * resolve conflicts * resolve conflicts * resolve conflicts * resolve conflicts * resolve conflicts * changed logtracker * rebuild README.md * update repo chatops and rebuild readme
1 parent 1e66cb4 commit a319622

File tree

16 files changed

+1407
-100
lines changed

16 files changed

+1407
-100
lines changed

.github/CODEOWNERS

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
11
# Use this file to define individuals or teams that are responsible for code in a repository.
22
# Read more: <https://help.github.com/articles/about-codeowners/>
3+
#
4+
# Order is important: the last matching pattern takes the most precedence
35

4-
* @cloudposse/engineering
6+
# These owners will be the default owners for everything
7+
* @cloudposse/engineering @cloudposse/contributors
8+
9+
# Cloud Posse must review any changes to Makefiles
10+
**/Makefile @cloudposse/engineering
11+
**/Makefile.* @cloudposse/engineering
12+
13+
# Cloud Posse must review any changes to GitHub actions
14+
.github/* @cloudposse/engineering

README.md

Lines changed: 69 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -143,50 +143,79 @@ Available targets:
143143
lint Lint terraform code
144144
145145
```
146+
## Requirements
147+
148+
| Name | Version |
149+
|------|---------|
150+
| terraform | ~> 0.12.0 |
151+
| aws | ~> 2.0 |
152+
| local | ~> 1.2 |
153+
| null | ~> 2.0 |
154+
| random | ~> 2.1 |
155+
| template | ~> 2.0 |
156+
157+
## Providers
158+
159+
| Name | Version |
160+
|------|---------|
161+
| aws | ~> 2.0 |
162+
| random | ~> 2.1 |
163+
146164
## Inputs
147165

148166
| Name | Description | Type | Default | Required |
149-
|------|-------------|:----:|:-----:|:-----:|
150-
| artifact_type | The build output artifact's type. Valid values for this parameter are: CODEPIPELINE, NO_ARTIFACTS or S3 | string | `CODEPIPELINE` | no |
151-
| attributes | Additional attributes (e.g. `policy` or `role`) | list(string) | `<list>` | no |
152-
| aws_account_id | (Optional) AWS Account ID. Used as CodeBuild ENV variable when building Docker images. For more info: http://docs.aws.amazon.com/codebuild/latest/userguide/sample-docker.html | string | `` | no |
153-
| aws_region | (Optional) AWS Region, e.g. us-east-1. Used as CodeBuild ENV variable when building Docker images. For more info: http://docs.aws.amazon.com/codebuild/latest/userguide/sample-docker.html | string | `` | no |
154-
| badge_enabled | Generates a publicly-accessible URL for the projects build badge. Available as badge_url attribute when enabled | bool | `false` | no |
155-
| build_compute_type | Instance type of the build instance | string | `BUILD_GENERAL1_SMALL` | no |
156-
| build_image | Docker image for build environment, e.g. 'aws/codebuild/standard:2.0' or 'aws/codebuild/eb-nodejs-6.10.0-amazonlinux-64:4.0.0'. For more info: http://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref.html | string | `aws/codebuild/standard:2.0` | no |
157-
| build_timeout | How long in minutes, from 5 to 480 (8 hours), for AWS CodeBuild to wait until timing out any related build that does not get marked as completed | string | `60` | no |
158-
| build_type | The type of build environment, e.g. 'LINUX_CONTAINER' or 'WINDOWS_CONTAINER' | string | `LINUX_CONTAINER` | no |
159-
| buildspec | Optional buildspec declaration to use for building the project | string | `` | no |
160-
| cache_bucket_suffix_enabled | The cache bucket generates a random 13 character string to generate a unique bucket name. If set to false it uses terraform-null-label's id value. It only works when cache_type is 'S3 | bool | `true` | no |
161-
| cache_expiration_days | How many days should the build cache be kept. It only works when cache_type is 'S3' | string | `7` | no |
162-
| cache_type | The type of storage that will be used for the AWS CodeBuild project cache. Valid values: NO_CACHE, LOCAL, and S3. Defaults to NO_CACHE. If cache_type is S3, it will create an S3 bucket for storing codebuild cache inside | string | `NO_CACHE` | no |
163-
| delimiter | Delimiter to be used between `name`, `namespace`, `stage`, etc. | string | `-` | no |
164-
| enabled | A boolean to enable/disable resource creation | bool | `true` | no |
165-
| environment_variables | A list of maps, that contain both the key 'name' and the key 'value' to be used as additional environment variables for the build | object | `<list>` | no |
166-
| github_token | (Optional) GitHub auth token environment variable (`GITHUB_TOKEN`) | string | `` | no |
167-
| image_repo_name | (Optional) ECR repository name to store the Docker image built by this module. Used as CodeBuild ENV variable when building Docker images. For more info: http://docs.aws.amazon.com/codebuild/latest/userguide/sample-docker.html | string | `UNSET` | no |
168-
| image_tag | (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 | string | `latest` | no |
169-
| local_cache_modes | Specifies settings that AWS CodeBuild uses to store and reuse build dependencies. Valid values: LOCAL_SOURCE_CACHE, LOCAL_DOCKER_LAYER_CACHE, and LOCAL_CUSTOM_CACHE | list(string) | `<list>` | no |
170-
| name | Solution name, e.g. 'app' or 'jenkins' | string | - | yes |
171-
| namespace | Namespace, which could be your organization name, e.g. 'eg' or 'cp' | string | `` | no |
172-
| 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 |
173-
| 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 |
174-
| source_location | The location of the source code from git or s3 | string | `` | no |
175-
| source_type | The type of repository that contains the source code to be built. Valid values for this parameter are: CODECOMMIT, CODEPIPELINE, GITHUB, GITHUB_ENTERPRISE, BITBUCKET or S3 | string | `CODEPIPELINE` | no |
176-
| stage | Stage, e.g. 'prod', 'staging', 'dev', or 'test' | string | `` | no |
177-
| tags | Additional tags (e.g. `map('BusinessUnit', 'XYZ')` | map(string) | `<map>` | no |
167+
|------|-------------|------|---------|:--------:|
168+
| artifact\_type | The build output artifact's type. Valid values for this parameter are: CODEPIPELINE, NO\_ARTIFACTS or S3 | `string` | `"CODEPIPELINE"` | no |
169+
| attributes | Additional attributes (e.g. `policy` or `role`) | `list(string)` | `[]` | no |
170+
| aws\_account\_id | (Optional) AWS Account ID. Used as CodeBuild ENV variable when building Docker images. For more info: http://docs.aws.amazon.com/codebuild/latest/userguide/sample-docker.html | `string` | `""` | no |
171+
| aws\_region | (Optional) AWS Region, e.g. us-east-1. Used as CodeBuild ENV variable when building Docker images. For more info: http://docs.aws.amazon.com/codebuild/latest/userguide/sample-docker.html | `string` | `""` | no |
172+
| badge\_enabled | Generates a publicly-accessible URL for the projects build badge. Available as badge\_url attribute when enabled | `bool` | `false` | no |
173+
| build\_compute\_type | Instance type of the build instance | `string` | `"BUILD_GENERAL1_SMALL"` | no |
174+
| build\_image | Docker image for build environment, e.g. 'aws/codebuild/standard:2.0' or 'aws/codebuild/eb-nodejs-6.10.0-amazonlinux-64:4.0.0'. For more info: http://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref.html | `string` | `"aws/codebuild/standard:2.0"` | no |
175+
| build\_timeout | How long in minutes, from 5 to 480 (8 hours), for AWS CodeBuild to wait until timing out any related build that does not get marked as completed | `number` | `60` | no |
176+
| build\_type | The type of build environment, e.g. 'LINUX\_CONTAINER' or 'WINDOWS\_CONTAINER' | `string` | `"LINUX_CONTAINER"` | no |
177+
| buildspec | Optional buildspec declaration to use for building the project | `string` | `""` | no |
178+
| cache\_bucket\_suffix\_enabled | The cache bucket generates a random 13 character string to generate a unique bucket name. If set to false it uses terraform-null-label's id value. It only works when cache\_type is 'S3 | `bool` | `true` | no |
179+
| cache\_expiration\_days | How many days should the build cache be kept. It only works when cache\_type is 'S3' | `number` | `7` | no |
180+
| cache\_type | The type of storage that will be used for the AWS CodeBuild project cache. Valid values: NO\_CACHE, LOCAL, and S3. Defaults to NO\_CACHE. If cache\_type is S3, it will create an S3 bucket for storing codebuild cache inside | `string` | `"NO_CACHE"` | no |
181+
| delimiter | Delimiter to be used between `name`, `namespace`, `stage`, etc. | `string` | `"-"` | no |
182+
| enabled | A boolean to enable/disable resource creation | `bool` | `true` | no |
183+
| environment\_variables | A list of maps, that contain both the key 'name' and the key 'value' to be used as additional environment variables for the build | <pre>list(object(<br> {<br> name = string<br> value = string<br> }))</pre> | <pre>[<br> {<br> "name": "NO_ADDITIONAL_BUILD_VARS",<br> "value": "TRUE"<br> }<br>]</pre> | no |
184+
| extra\_permissions | List of action strings which will be added to IAM service account permissions. | `list` | `[]` | no |
185+
| fetch\_git\_submodules | If set to true, fetches Git submodules for the AWS CodeBuild build project. | `bool` | `false` | no |
186+
| git\_clone\_depth | Truncate git history to this many commits. | `number` | `null` | no |
187+
| github\_token | (Optional) GitHub auth token environment variable (`GITHUB_TOKEN`) | `string` | `""` | no |
188+
| image\_repo\_name | (Optional) ECR repository name to store the Docker image built by this module. Used as CodeBuild ENV variable when building Docker images. For more info: http://docs.aws.amazon.com/codebuild/latest/userguide/sample-docker.html | `string` | `"UNSET"` | no |
189+
| image\_tag | (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 | `string` | `"latest"` | no |
190+
| local\_cache\_modes | Specifies settings that AWS CodeBuild uses to store and reuse build dependencies. Valid values: LOCAL\_SOURCE\_CACHE, LOCAL\_DOCKER\_LAYER\_CACHE, and LOCAL\_CUSTOM\_CACHE | `list(string)` | `[]` | no |
191+
| logs\_config | Configuration for the builds to store log data to CloudWatch or S3. | `any` | `{}` | no |
192+
| name | Solution name, e.g. 'app' or 'jenkins' | `string` | n/a | yes |
193+
| namespace | Namespace, which could be your organization name, e.g. 'eg' or 'cp' | `string` | `""` | no |
194+
| private\_repository | Set to true to login into private repository with credentials supplied in source\_credential variable. | `bool` | `false` | no |
195+
| 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 |
196+
| 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 |
197+
| source\_credential\_auth\_type | The type of authentication used to connect to a GitHub, GitHub Enterprise, or Bitbucket repository. | `string` | `"PERSONAL_ACCESS_TOKEN"` | no |
198+
| source\_credential\_server\_type | The source provider used for this project. | `string` | `"GITHUB"` | no |
199+
| source\_credential\_token | For GitHub or GitHub Enterprise, this is the personal access token. For Bitbucket, this is the app password. | `string` | `""` | no |
200+
| source\_credential\_user\_name | The Bitbucket username when the authType is BASIC\_AUTH. This parameter is not valid for other types of source providers or connections. | `string` | `""` | no |
201+
| source\_location | The location of the source code from git or s3 | `string` | `""` | no |
202+
| source\_type | The type of repository that contains the source code to be built. Valid values for this parameter are: CODECOMMIT, CODEPIPELINE, GITHUB, GITHUB\_ENTERPRISE, BITBUCKET or S3 | `string` | `"CODEPIPELINE"` | no |
203+
| source\_version | A version of the build input to be built for this project. If not specified, the latest version is used. | `string` | `""` | no |
204+
| stage | Stage, e.g. 'prod', 'staging', 'dev', or 'test' | `string` | `""` | no |
205+
| tags | Additional tags (e.g. `map('BusinessUnit', 'XYZ')` | `map(string)` | `{}` | no |
206+
| vpc\_config | Configuration for the builds to run inside a VPC. | `any` | `{}` | no |
178207

179208
## Outputs
180209

181210
| Name | Description |
182211
|------|-------------|
183-
| badge_url | The URL of the build badge when badge_enabled is enabled |
184-
| cache_bucket_arn | Cache S3 bucket ARN |
185-
| cache_bucket_name | Cache S3 bucket name |
186-
| project_id | Project ID |
187-
| project_name | Project name |
188-
| role_arn | IAM Role ARN |
189-
| role_id | IAM Role ID |
212+
| badge\_url | The URL of the build badge when badge\_enabled is enabled |
213+
| cache\_bucket\_arn | Cache S3 bucket ARN |
214+
| cache\_bucket\_name | Cache S3 bucket name |
215+
| project\_id | Project ID |
216+
| project\_name | Project name |
217+
| role\_arn | IAM Role ARN |
218+
| role\_id | IAM Role ID |
190219

191220

192221

@@ -332,8 +361,8 @@ Check out [our other projects][github], [follow us on twitter][twitter], [apply
332361

333362
### Contributors
334363

335-
| [![Erik Osterman][osterman_avatar]][osterman_homepage]<br/>[Erik Osterman][osterman_homepage] | [![Igor Rodionov][goruha_avatar]][goruha_homepage]<br/>[Igor Rodionov][goruha_homepage] | [![Andriy Knysh][aknysh_avatar]][aknysh_homepage]<br/>[Andriy Knysh][aknysh_homepage] | [![Jamie Nelson][Jamie-BitfFlight_avatar]][Jamie-BitfFlight_homepage]<br/>[Jamie Nelson][Jamie-BitfFlight_homepage] | [![Sarkis Varozian][sarkis_avatar]][sarkis_homepage]<br/>[Sarkis Varozian][sarkis_homepage] |
336-
|---|---|---|---|---|
364+
| [![Erik Osterman][osterman_avatar]][osterman_homepage]<br/>[Erik Osterman][osterman_homepage] | [![Igor Rodionov][goruha_avatar]][goruha_homepage]<br/>[Igor Rodionov][goruha_homepage] | [![Andriy Knysh][aknysh_avatar]][aknysh_homepage]<br/>[Andriy Knysh][aknysh_homepage] | [![Jamie Nelson][Jamie-BitfFlight_avatar]][Jamie-BitfFlight_homepage]<br/>[Jamie Nelson][Jamie-BitfFlight_homepage] | [![Sarkis Varozian][sarkis_avatar]][sarkis_homepage]<br/>[Sarkis Varozian][sarkis_homepage] | [![Bircan Bilici][brcnblc_avatar]][brcnblc_homepage]<br/>[Bircan Bilici][brcnblc_homepage] |
365+
|---|---|---|---|---|---|
337366

338367
[osterman_homepage]: https://github.com/osterman
339368
[osterman_avatar]: https://img.cloudposse.com/150x150/https://github.com/osterman.png
@@ -345,6 +374,8 @@ Check out [our other projects][github], [follow us on twitter][twitter], [apply
345374
[Jamie-BitfFlight_avatar]: https://img.cloudposse.com/150x150/https://github.com/Jamie-BitfFlight.png
346375
[sarkis_homepage]: https://github.com/sarkis
347376
[sarkis_avatar]: https://img.cloudposse.com/150x150/https://github.com/sarkis.png
377+
[brcnblc_homepage]: https://github.com/brcnblc
378+
[brcnblc_avatar]: https://img.cloudposse.com/150x150/https://github.com/brcnblc.png
348379

349380
[![README Footer][readme_footer_img]][readme_footer_link]
350381
[![Beacon][beacon]][website]

README.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,5 @@ contributors:
8181
github: Jamie-BitfFlight
8282
- name: Sarkis Varozian
8383
github: sarkis
84+
- name: Bircan Bilici
85+
github: brcnblc

0 commit comments

Comments
 (0)