diff --git a/README.md b/README.md index d6a1ce4..59eeba2 100644 --- a/README.md +++ b/README.md @@ -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"] diff --git a/examples/addition-iam-policies/README.md b/examples/addition-iam-policies/README.md new file mode 100644 index 0000000..ae1b692 --- /dev/null +++ b/examples/addition-iam-policies/README.md @@ -0,0 +1,75 @@ + +---- +## 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 | +|------|-------------|------|---------|:--------:| +| [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 | +| [name](#input\_name) | Name used as a prefix for all resources in this module | `string` | n/a | yes | +| [source\_location](#input\_source\_location) | Your source code repo location, for example https://github.com/my/repo.git | `string` | n/a | yes | +| [subnet\_ids](#input\_subnet\_ids) | The list of Subnet IDs for AWS Codebuild to launch ephemeral EC2 instances in. | `list(string)` | n/a | yes | +| [vpc\_id](#input\_vpc\_id) | The VPC ID for AWS Codebuild to launch ephemeral instances in. | `string` | n/a | yes | + +---- +### Modules + +| Name | Source | Version | +|------|--------|---------| +| [runners](#module\_runners) | ../../ | n/a | + +---- +### Outputs + +No outputs. + +---- +### Providers + +| Name | Version | +|------|---------| +| [aws](#provider\_aws) | >= 4.9 | + +---- +### Requirements + +| Name | Version | +|------|---------| +| [terraform](#requirement\_terraform) | >= 0.14.0 | +| [aws](#requirement\_aws) | >= 4.9 | +| [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 | + +---- + \ No newline at end of file diff --git a/examples/basic/README.md b/examples/basic/README.md index b7ecfe5..61e6879 100644 --- a/examples/basic/README.md +++ b/examples/basic/README.md @@ -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"] diff --git a/examples/basic/main.tf b/examples/basic/main.tf index 68280d0..199945f 100644 --- a/examples/basic/main.tf +++ b/examples/basic/main.tf @@ -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"] diff --git a/examples/multiple-runners/README.md b/examples/multiple-runners/README.md new file mode 100644 index 0000000..3fc1819 --- /dev/null +++ b/examples/multiple-runners/README.md @@ -0,0 +1,66 @@ + +---- +## 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 | +|------|-------------|------|---------|:--------:| +| [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 | +| [source\_locations](#input\_source\_locations) | Map of source locations to use when creating runners |
map(object({|
source_location = string
source_name = string
}))
{| no | +| [subnet\_ids](#input\_subnet\_ids) | The list of Subnet IDs for AWS Codebuild to launch ephemeral EC2 instances in. | `list(string)` | n/a | yes | +| [vpc\_id](#input\_vpc\_id) | The VPC ID for AWS Codebuild to launch ephemeral instances in. | `string` | n/a | yes | + +---- +### Modules + +| Name | Source | Version | +|------|--------|---------| +| [runners](#module\_runners) | ../../ | n/a | + +---- +### Outputs + +No outputs. + +---- +### Providers + +No providers. + +---- +### Requirements + +| Name | Version | +|------|---------| +| [terraform](#requirement\_terraform) | >= 0.14.0 | +| [aws](#requirement\_aws) | >= 4.9 | +| [http](#requirement\_http) | 3.0.1 | + +---- +### Resources + +No resources. + +---- + \ No newline at end of file
"example-1": {
"source_location": "https://github.com/my-org/example-1.git",
"source_name": "example-1"
},
"example-2": {
"source_location": "https://github.com/my-org/example-2.git",
"source_name": "example-2"
}
}