Skip to content
This repository has been archived by the owner on Apr 18, 2020. It is now read-only.

Commit

Permalink
Removed default for namespace variable
Browse files Browse the repository at this point in the history
  • Loading branch information
squidfunk committed Apr 1, 2018
1 parent 858e9b4 commit e82f1c8
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 10 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
terraform-aws-github-ci-0.4.1 (2017-04-01)

* Fixed #5: Removed default for namespace variable

terraform-aws-github-ci-0.4.0 (2017-03-30)

* Refactored complete code base into TypeScript
Expand Down
44 changes: 35 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,16 @@ repository and apply the configuration from the root folder with:

``` bash
terraform apply \
-var namespace=<namespace> \
-var github_owner=<owner> \
-var github_repository=<repository> \
-var github_oauth_token=<oauth-token> \
-var namespace=<unique-identifier>
-var github_oauth_token=<oauth-token>
```

All resources are prefixed with the value specified as `namespace`. If the S3
bucket name (see below) is not explicitly set, it's set to the given `namespace`
which means there must not already exist and S3 bucket with the same name.
which means there must not already exist an S3 bucket with the same name. This
is a common source of error.

Now, when you push to `master`, or create a pull request, CodeBuild will
automatically build the commit and report the status back to GitHub.
Expand All @@ -79,6 +80,7 @@ module "github_ci" {
source = "github.com/squidfunk/terraform-aws-github-ci"
version = "0.3.0"
namespace = "<namespace>"
github_owner = "<owner>"
github_repository = "<repository>"
github_oauth_token = "<oauth-token>"
Expand All @@ -102,6 +104,11 @@ The following variables can be configured:

### Required

#### `namespace`

- **Description**: AWS resource namespace/prefix (lowercase alphanumeric)
- **Default**: `none`

#### `github_owner`

- **Description**: GitHub repository owner
Expand All @@ -117,11 +124,6 @@ The following variables can be configured:
- **Description**: GitHub OAuth token for repository access
- **Default**: `none`

#### `namespace`

- **Description**: AWS resource namespace/prefix (lowercase alphanumeric)
- **Default**: `"github-ci"`

### Optional

#### `github_reporter`
Expand Down Expand Up @@ -154,6 +156,30 @@ The following variables can be configured:
- **Description**: S3 bucket to store status badge and artifacts
- **Default**: `"github-ci"` (equal to namespace)

### Outputs

The following outputs are exported:

#### `codebuild_service_role_name`

- **Description**: CodeBuild service role name

#### `codebuild_service_role_arn`

- **Description**: CodeBuild service role ARN

#### `codebuild_bucket`

- **Description**: CodeBuild artifacts bucket name

#### `codebuild_badge_url`

- **Description**: CodeBuild status badge URL

#### `codebuild_url`

- **Description**: CodeBuild project URL

### Default project

If you need more control over the CodeBuild project, you can pass the name of
Expand All @@ -169,7 +195,7 @@ resource "aws_codebuild_project" "codebuild" {
source {
type = "GITHUB"
location = "..."
location = "https://github.com/$${owner}/$${repository}.git"
auth {
type = "OAUTH"
Expand Down
1 change: 0 additions & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
# var.namespace
variable "namespace" {
description = "AWS resource namespace/prefix"
default = "github-ci"
}

# -----------------------------------------------------------------------------
Expand Down

0 comments on commit e82f1c8

Please sign in to comment.