Skip to content

Commit

Permalink
fix: Update basic example
Browse files Browse the repository at this point in the history
  • Loading branch information
baolsen committed Dec 5, 2024
1 parent 521d525 commit e939c08
Show file tree
Hide file tree
Showing 5 changed files with 156 additions and 9 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,13 @@ module "github_runner" {
# Required parameters
############################
source_location = "https://github.com/my-org/my-repo.git"
github_personal_access_token = "example"
# Naming for all created resources
name = "github-runner-codebuild-test"
source_location = "https://github.com/my-org/my-repo.git"
# Optional parameters
############################
github_personal_access_token = "example"
vpc_id = "vpc-0ffaabbcc1122"
subnet_ids = ["subnet-0123", "subnet-0456"]
Expand Down
75 changes: 75 additions & 0 deletions examples/addition-iam-policies/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<!-- BEGIN_TF_DOCS -->
----
## main.tf
```hcl
module "runners" {
source = "../../"
name = "${var.name}-github-runner"
source_location = var.source_location
github_personal_access_token_ssm_parameter = var.github_personal_access_token_ssm_parameter
vpc_id = var.vpc_id
subnet_ids = var.subnet_ids
iam_role_policies = {
"allow_secrets_manager" = aws_iam_policy.secrets_manager.arn,
"s3_managed_policy" = "arn:aws:iam::aws:policy/AmazonS3FullAccess",
}
}
```
----

## Documentation

----
### Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_github_personal_access_token_ssm_parameter"></a> [github\_personal\_access\_token\_ssm\_parameter](#input\_github\_personal\_access\_token\_ssm\_parameter) | The GitHub personal access token to use for accessing the repository | `string` | n/a | yes |
| <a name="input_name"></a> [name](#input\_name) | Name used as a prefix for all resources in this module | `string` | n/a | yes |
| <a name="input_source_location"></a> [source\_location](#input\_source\_location) | Your source code repo location, for example https://github.com/my/repo.git | `string` | n/a | yes |
| <a name="input_subnet_ids"></a> [subnet\_ids](#input\_subnet\_ids) | The list of Subnet IDs for AWS Codebuild to launch ephemeral EC2 instances in. | `list(string)` | n/a | yes |
| <a name="input_vpc_id"></a> [vpc\_id](#input\_vpc\_id) | The VPC ID for AWS Codebuild to launch ephemeral instances in. | `string` | n/a | yes |

----
### Modules

| Name | Source | Version |
|------|--------|---------|
| <a name="module_runners"></a> [runners](#module\_runners) | ../../ | n/a |

----
### Outputs

No outputs.

----
### Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.9 |

----
### Requirements

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.14.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.9 |
| <a name="requirement_http"></a> [http](#requirement\_http) | 3.0.1 |

----
### Resources

| Name | Type |
|------|------|
| [aws_iam_policy.secrets_manager](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_policy) | resource |
| [aws_caller_identity.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) | data source |
| [aws_iam_policy_document.secrets_manager](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |
| [aws_region.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/region) | data source |

----
<!-- END_TF_DOCS -->
8 changes: 5 additions & 3 deletions examples/basic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ module "github_runner" {
# Required parameters
############################
source_location = "https://github.com/my-org/my-repo.git"
github_personal_access_token = "example"
# Naming for all created resources
name = "github-runner-codebuild-test"
source_location = "https://github.com/my-org/my-repo.git"
# Optional parameters
############################
github_personal_access_token = "example"
vpc_id = "vpc-0ffaabbcc1122"
subnet_ids = ["subnet-0123", "subnet-0456"]
Expand Down
8 changes: 5 additions & 3 deletions examples/basic/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ module "github_runner" {

# Required parameters
############################
source_location = "https://github.com/my-org/my-repo.git"
github_personal_access_token = "example"

# Naming for all created resources
name = "github-runner-codebuild-test"
source_location = "https://github.com/my-org/my-repo.git"

# Optional parameters
############################
github_personal_access_token = "example"

vpc_id = "vpc-0ffaabbcc1122"
subnet_ids = ["subnet-0123", "subnet-0456"]
Expand Down
66 changes: 66 additions & 0 deletions examples/multiple-runners/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<!-- BEGIN_TF_DOCS -->
----
## main.tf
```hcl
module "runners" {
for_each = var.source_locations
source = "../../"
name = "${each.value.source_name}-github-runner"
source_location = each.value.source_location
github_personal_access_token_ssm_parameter = var.github_personal_access_token_ssm_parameter
vpc_id = var.vpc_id
subnet_ids = var.subnet_ids
}
```
----

## Documentation

----
### Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_github_personal_access_token_ssm_parameter"></a> [github\_personal\_access\_token\_ssm\_parameter](#input\_github\_personal\_access\_token\_ssm\_parameter) | The GitHub personal access token to use for accessing the repository | `string` | n/a | yes |
| <a name="input_source_locations"></a> [source\_locations](#input\_source\_locations) | Map of source locations to use when creating runners | <pre>map(object({<br> source_location = string<br> source_name = string<br> }))</pre> | <pre>{<br> "example-1": {<br> "source_location": "https://github.com/my-org/example-1.git",<br> "source_name": "example-1"<br> },<br> "example-2": {<br> "source_location": "https://github.com/my-org/example-2.git",<br> "source_name": "example-2"<br> }<br>}</pre> | no |
| <a name="input_subnet_ids"></a> [subnet\_ids](#input\_subnet\_ids) | The list of Subnet IDs for AWS Codebuild to launch ephemeral EC2 instances in. | `list(string)` | n/a | yes |
| <a name="input_vpc_id"></a> [vpc\_id](#input\_vpc\_id) | The VPC ID for AWS Codebuild to launch ephemeral instances in. | `string` | n/a | yes |

----
### Modules

| Name | Source | Version |
|------|--------|---------|
| <a name="module_runners"></a> [runners](#module\_runners) | ../../ | n/a |

----
### Outputs

No outputs.

----
### Providers

No providers.

----
### Requirements

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.14.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.9 |
| <a name="requirement_http"></a> [http](#requirement\_http) | 3.0.1 |

----
### Resources

No resources.

----
<!-- END_TF_DOCS -->

0 comments on commit e939c08

Please sign in to comment.