Skip to content

Commit 1f9b5bc

Browse files
authored
Update README.yaml wiht AI (#38)
* chore: Update README.yaml wiht AI * Update README.yaml
1 parent ad52fd9 commit 1f9b5bc

File tree

7 files changed

+243
-235
lines changed

7 files changed

+243
-235
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ aws-assumed-role/
77
*.iml
88
.direnv
99
.envrc
10+
.cache
11+
.atmos
1012

1113
# Compiled and auto-generated files
1214
# Note that the leading "**/" appears necessary for Docker even if not for Git

AGENTS.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Repository Guidelines
2+
3+
## Project Structure & Module Organization
4+
- `src/`: Terraform component (`main.tf`, `variables.tf`, `outputs.tf`, `providers.tf`, `versions.tf`, `context.tf`). This is the source of truth.
5+
- `test/`: Go Terratest suite using Atmos fixtures (`component_test.go`, `fixtures/`, `test_suite.yaml`). Tests deploy/destroy real AWS resources.
6+
- `README.yaml`: Source for the generated `README.md` (via atmos + terraform-docs).
7+
- `.github/`: CI/CD, Renovate/Dependabot, labels, and automerge settings.
8+
- `docs/`: Project docs (if any). Keep lightweight and current.
9+
10+
## Build, Test, and Development Commands
11+
- To install atmos read this docs https://github.com/cloudposse/atmos
12+
- `atmos docs generate readme`: Regenerate `README.md` from `README.yaml` and terraform source.
13+
- `atmos docs generate readme-simple`: Regenerate `src/README.md` from `README.yaml` and terraform source.
14+
- `atmos test run`: Run Terratest suite in `test/` (uses Atmos fixtures; creates and destroys AWS resources).
15+
- Pre-commit locally: `pre-commit install && pre-commit run -a` (runs `terraform_fmt`, `terraform_docs`, `tflint`).
16+
- TFLint plugin setup: `tflint --init` (uses `.tflint.hcl`).
17+
18+
## Coding Style & Naming Conventions
19+
- Indentation: Terraform 2 spaces; YAML/Markdown 2 spaces.
20+
- Terraform: prefer lower_snake_case for variables/locals; keep resources/data sources descriptive and aligned with Cloud Posse null-label patterns.
21+
- Lint/format: `terraform fmt -recursive`, TFLint rules per `.tflint.hcl`. Do not commit formatting or lint violations.
22+
23+
## Testing Guidelines
24+
- Framework: Go Terratest with `github.com/cloudposse/test-helpers` and `atmos` fixtures.
25+
- Location/naming: put tests in `test/` and name files `*_test.go`. Add scenarios under `test/fixtures/stacks/catalog/usecase/`.
26+
- Run: `atmos test run`. Ensure AWS credentials are configured; tests may incur AWS costs and will clean up after themselves.
27+
28+
## Commit & Pull Request Guidelines
29+
- Commits: follow Conventional Commits (e.g., `feat:`, `fix:`, `chore(deps):`, `docs:`). Keep messages concise and scoped.
30+
- PRs: include a clear description, linked issues, and any behavioral changes. Update `README.yaml` when inputs/outputs change and run `atmos docs generate readme`.
31+
- CI: ensure pre-commit, TFLint, and tests pass. Avoid unrelated changes in the same PR.
32+
33+
## Security & Configuration Tips
34+
- Never commit secrets. Configure AWS credentials/role assumption externally; the provider setup in `src/providers.tf` supports role assumption via the `iam_roles` module.
35+
- Global quotas must be applied in `us-east-1`; place in the `gbl` stack and set `region: us-east-1` in `vars`.

Makefile

Lines changed: 0 additions & 8 deletions
This file was deleted.

README.md

Lines changed: 126 additions & 78 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.yaml

Lines changed: 20 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -3,44 +3,40 @@ name: "aws-philips-labs-github-runners"
33
github_repo: "cloudposse-terraform-components/aws-philips-labs-github-runners"
44
# Short description of this project
55
description: |-
6-
This component is responsible for provisioning the surrounding infrastructure for the github runners.
6+
This component provisions the surrounding infrastructure for GitHub self-hosted runners.
77
88
## Prerequisites
99
10-
- Github App installed on the organization
10+
- GitHub App installed on the organization
1111
- For more details see
12-
[Philips Lab's Setting up a Github App](https://github.com/philips-labs/terraform-aws-github-runner/tree/main#setup-github-app-part-1)
12+
[Philips Lab's Setting up a GitHub App](https://github.com/philips-labs/terraform-aws-github-runner/tree/main#setup-github-app-part-1)
1313
- Ensure you create a **PRIVATE KEY** and store it in SSM, **NOT** to be confused with a **Client Secret**. Private
1414
Keys are created in the GitHub App Configuration and scrolling to the bottom.
15-
- Github App ID and private key stored in SSM under `/pl-github-runners/id` (or the value of
15+
- GitHub App ID and private key stored in SSM under `/pl-github-runners/id` (or the value of
1616
`var.github_app_id_ssm_path`)
17-
- Github App Private Key stored in SSM (base64 encoded) under `/pl-github-runners/key` (or the value of
17+
- GitHub App Private Key stored in SSM (base64 encoded) under `/pl-github-runners/key` (or the value of
1818
`var.github_app_key_ssm_path`)
1919
20-
## Usage
21-
20+
usage: |-
2221
**Stack Level**: Regional
23-
2422
Here's an example snippet for how to use this component.
25-
2623
```yaml
2724
components:
2825
terraform:
2926
philips-labs-github-runners:
3027
vars:
3128
enabled: true
3229
```
33-
3430
The following will create
35-
31+
3632
- An API Gateway
3733
- Lambdas
3834
- SQS Queue
3935
- EC2 Launch Template instances
40-
36+
4137
The API Gateway is registered as a webhook within the GitHub app. Which scales up or down, via lambdas, the EC2 Launch
4238
Template by the number of messages in the SQS queue.
43-
39+
4440
![Architecture](https://github.com/philips-labs/terraform-aws-github-runner/blob/main/docs/component-overview.svg)
4541
4642
## Modules
@@ -49,15 +45,15 @@ description: |-
4945
5046
This is a fork of https://github.com/philips-labs/terraform-aws-github-runner/tree/main/modules/webhook-github-app.
5147
52-
We customized it until this PR is resolved as it does not update the github app webhook until this is merged.
48+
We customized it until this PR is resolved as it does not update the GitHub App webhook until this is merged.
5349
5450
- https://github.com/philips-labs/terraform-aws-github-runner/pull/3625
5551
56-
This module also requires an environment variable
52+
This module also requires an environment variable:
5753
58-
- `GH_TOKEN` - a github token be set
54+
- `GH_TOKEN` a GitHub token must be set
5955
60-
This module also requires the `gh` cli to be installed. Your Dockerfile can be updated to include the following to
56+
This module also requires the `gh` CLI to be installed. Your Dockerfile can be updated to include the following to
6157
install it:
6258
6359
```dockerfile
@@ -68,96 +64,12 @@ description: |-
6864
gh="${GH_CLI_VERSION}-*"
6965
```
7066
71-
By default, we leave this disabled, as it requires a github token to be set. You can enable it by setting
72-
`var.enable_update_github_app_webhook` to `true`. When enabled, it will update the github app webhook to point to the
67+
By default, we leave this disabled, as it requires a GitHub token to be set. You can enable it by setting
68+
`var.enable_update_github_app_webhook` to `true`. When enabled, it will update the GitHub App webhook to point to the
7369
API Gateway. This can occur if the API Gateway is deleted and recreated.
7470
75-
When disabled, you will need to manually update the github app webhook to point to the API Gateway. This is output by
71+
When disabled, you will need to manually update the GitHub App webhook to point to the API Gateway. This is output by
7672
the component, and available via the `webhook` output under `endpoint`.
77-
78-
<!-- prettier-ignore-start -->
79-
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
80-
## Requirements
81-
82-
| Name | Version |
83-
|------|---------|
84-
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0.0 |
85-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.9.0 |
86-
| <a name="requirement_local"></a> [local](#requirement\_local) | >= 2.4.0 |
87-
| <a name="requirement_random"></a> [random](#requirement\_random) | >= 3.0 |
88-
89-
## Providers
90-
91-
| Name | Version |
92-
|------|---------|
93-
| <a name="provider_random"></a> [random](#provider\_random) | >= 3.0 |
94-
95-
## Modules
96-
97-
| Name | Source | Version |
98-
|------|--------|---------|
99-
| <a name="module_github_runner"></a> [github\_runner](#module\_github\_runner) | philips-labs/github-runner/aws | 5.4.2 |
100-
| <a name="module_iam_roles"></a> [iam\_roles](#module\_iam\_roles) | ../account-map/modules/iam-roles | n/a |
101-
| <a name="module_module_artifact"></a> [module\_artifact](#module\_module\_artifact) | cloudposse/module-artifact/external | 0.8.0 |
102-
| <a name="module_store_read"></a> [store\_read](#module\_store\_read) | cloudposse/ssm-parameter-store/aws | 0.11.0 |
103-
| <a name="module_this"></a> [this](#module\_this) | cloudposse/label/null | 0.25.0 |
104-
| <a name="module_vpc"></a> [vpc](#module\_vpc) | cloudposse/stack-config/yaml//modules/remote-state | 1.5.0 |
105-
| <a name="module_webhook_github_app"></a> [webhook\_github\_app](#module\_webhook\_github\_app) | philips-labs/github-runner/aws//modules/webhook-github-app | 5.4.2 |
106-
107-
## Resources
108-
109-
| Name | Type |
110-
|------|------|
111-
| [random_id.webhook_secret](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/id) | resource |
112-
113-
## Inputs
114-
115-
| Name | Description | Type | Default | Required |
116-
|------|-------------|------|---------|:--------:|
117-
| <a name="input_additional_tag_map"></a> [additional\_tag\_map](#input\_additional\_tag\_map) | Additional key-value pairs to add to each map in `tags_as_list_of_maps`. Not added to `tags` or `id`.<br>This is for some rare cases where resources want additional configuration of tags<br>and therefore take a list of maps with tag key, value, and additional configuration. | `map(string)` | `{}` | no |
118-
| <a name="input_attributes"></a> [attributes](#input\_attributes) | ID element. Additional attributes (e.g. `workers` or `cluster`) to add to `id`,<br>in the order they appear in the list. New attributes are appended to the<br>end of the list. The elements of the list are joined by the `delimiter`<br>and treated as a single ID element. | `list(string)` | `[]` | no |
119-
| <a name="input_context"></a> [context](#input\_context) | Single object for setting entire context at once.<br>See description of individual variables for details.<br>Leave string and numeric variables as `null` to use default value.<br>Individual variable settings (non-null) override settings in context object,<br>except for attributes, tags, and additional\_tag\_map, which are merged. | `any` | <pre>{<br> "additional_tag_map": {},<br> "attributes": [],<br> "delimiter": null,<br> "descriptor_formats": {},<br> "enabled": true,<br> "environment": null,<br> "id_length_limit": null,<br> "label_key_case": null,<br> "label_order": [],<br> "label_value_case": null,<br> "labels_as_tags": [<br> "unset"<br> ],<br> "name": null,<br> "namespace": null,<br> "regex_replace_chars": null,<br> "stage": null,<br> "tags": {},<br> "tenant": null<br>}</pre> | no |
120-
| <a name="input_create_service_linked_role_spot"></a> [create\_service\_linked\_role\_spot](#input\_create\_service\_linked\_role\_spot) | (optional) create the service linked role for spot instances that is required by the scale-up lambda. | `bool` | `true` | no |
121-
| <a name="input_delimiter"></a> [delimiter](#input\_delimiter) | Delimiter to be used between ID elements.<br>Defaults to `-` (hyphen). Set to `""` to use no delimiter at all. | `string` | `null` | no |
122-
| <a name="input_descriptor_formats"></a> [descriptor\_formats](#input\_descriptor\_formats) | Describe additional descriptors to be output in the `descriptors` output map.<br>Map of maps. Keys are names of descriptors. Values are maps of the form<br>`{<br> format = string<br> labels = list(string)<br>}`<br>(Type is `any` so the map values can later be enhanced to provide additional options.)<br>`format` is a Terraform format string to be passed to the `format()` function.<br>`labels` is a list of labels, in order, to pass to `format()` function.<br>Label values will be normalized before being passed to `format()` so they will be<br>identical to how they appear in `id`.<br>Default is `{}` (`descriptors` output will be empty). | `any` | `{}` | no |
123-
| <a name="input_enable_update_github_app_webhook"></a> [enable\_update\_github\_app\_webhook](#input\_enable\_update\_github\_app\_webhook) | Enable updating the github app webhook | `bool` | `false` | no |
124-
| <a name="input_enabled"></a> [enabled](#input\_enabled) | Set to false to prevent the module from creating any resources | `bool` | `null` | no |
125-
| <a name="input_environment"></a> [environment](#input\_environment) | ID element. Usually used for region e.g. 'uw2', 'us-west-2', OR role 'prod', 'staging', 'dev', 'UAT' | `string` | `null` | no |
126-
| <a name="input_github_app_id_ssm_path"></a> [github\_app\_id\_ssm\_path](#input\_github\_app\_id\_ssm\_path) | Path to the github app id in SSM | `string` | `"/pl-github-runners/id"` | no |
127-
| <a name="input_github_app_key_ssm_path"></a> [github\_app\_key\_ssm\_path](#input\_github\_app\_key\_ssm\_path) | Path to the github key in SSM | `string` | `"/pl-github-runners/key"` | no |
128-
| <a name="input_id_length_limit"></a> [id\_length\_limit](#input\_id\_length\_limit) | Limit `id` to this many characters (minimum 6).<br>Set to `0` for unlimited length.<br>Set to `null` for keep the existing setting, which defaults to `0`.<br>Does not affect `id_full`. | `number` | `null` | no |
129-
| <a name="input_instance_target_capacity_type"></a> [instance\_target\_capacity\_type](#input\_instance\_target\_capacity\_type) | Default lifecycle used for runner instances, can be either `spot` or `on-demand`. | `string` | `"spot"` | no |
130-
| <a name="input_label_key_case"></a> [label\_key\_case](#input\_label\_key\_case) | Controls the letter case of the `tags` keys (label names) for tags generated by this module.<br>Does not affect keys of tags passed in via the `tags` input.<br>Possible values: `lower`, `title`, `upper`.<br>Default value: `title`. | `string` | `null` | no |
131-
| <a name="input_label_order"></a> [label\_order](#input\_label\_order) | The order in which the labels (ID elements) appear in the `id`.<br>Defaults to ["namespace", "environment", "stage", "name", "attributes"].<br>You can omit any of the 6 labels ("tenant" is the 6th), but at least one must be present. | `list(string)` | `null` | no |
132-
| <a name="input_label_value_case"></a> [label\_value\_case](#input\_label\_value\_case) | Controls the letter case of ID elements (labels) as included in `id`,<br>set as tag values, and output by this module individually.<br>Does not affect values of tags passed in via the `tags` input.<br>Possible values: `lower`, `title`, `upper` and `none` (no transformation).<br>Set this to `title` and set `delimiter` to `""` to yield Pascal Case IDs.<br>Default value: `lower`. | `string` | `null` | no |
133-
| <a name="input_labels_as_tags"></a> [labels\_as\_tags](#input\_labels\_as\_tags) | Set of labels (ID elements) to include as tags in the `tags` output.<br>Default is to include all labels.<br>Tags with empty values will not be included in the `tags` output.<br>Set to `[]` to suppress all generated tags.<br>**Notes:**<br> The value of the `name` tag, if included, will be the `id`, not the `name`.<br> Unlike other `null-label` inputs, the initial setting of `labels_as_tags` cannot be<br> changed in later chained modules. Attempts to change it will be silently ignored. | `set(string)` | <pre>[<br> "default"<br>]</pre> | no |
134-
| <a name="input_name"></a> [name](#input\_name) | ID element. Usually the component or solution name, e.g. 'app' or 'jenkins'.<br>This is the only ID element not also included as a `tag`.<br>The "name" tag is set to the full `id` string. There is no tag with the value of the `name` input. | `string` | `null` | no |
135-
| <a name="input_namespace"></a> [namespace](#input\_namespace) | ID element. Usually an abbreviation of your organization name, e.g. 'eg' or 'cp', to help ensure generated IDs are globally unique | `string` | `null` | no |
136-
| <a name="input_regex_replace_chars"></a> [regex\_replace\_chars](#input\_regex\_replace\_chars) | Terraform regular expression (regex) string.<br>Characters matching the regex will be removed from the ID elements.<br>If not set, `"/[^a-zA-Z0-9-]/"` is used to remove all characters other than hyphens, letters and digits. | `string` | `null` | no |
137-
| <a name="input_region"></a> [region](#input\_region) | AWS region | `string` | n/a | yes |
138-
| <a name="input_release_version"></a> [release\_version](#input\_release\_version) | Version of the application | `string` | `"v5.4.0"` | no |
139-
| <a name="input_runner_extra_labels"></a> [runner\_extra\_labels](#input\_runner\_extra\_labels) | Extra (custom) labels for the runners (GitHub). Labels checks on the webhook can be enforced by setting `enable_workflow_job_labels_check`. GitHub read-only labels should not be provided. | `list(string)` | <pre>[<br> "default"<br>]</pre> | no |
140-
| <a name="input_scale_up_reserved_concurrent_executions"></a> [scale\_up\_reserved\_concurrent\_executions](#input\_scale\_up\_reserved\_concurrent\_executions) | Amount of reserved concurrent executions for the scale-up lambda function. A value of 0 disables lambda from being triggered and -1 removes any concurrency limitations. | `number` | `-1` | no |
141-
| <a name="input_ssm_paths"></a> [ssm\_paths](#input\_ssm\_paths) | The root path used in SSM to store configuration and secrets. | <pre>object({<br> root = optional(string, "github-action-runners")<br> app = optional(string, "app")<br> runners = optional(string, "runners")<br> use_prefix = optional(bool, true)<br> })</pre> | `{}` | no |
142-
| <a name="input_stage"></a> [stage](#input\_stage) | ID element. Usually used to indicate role, e.g. 'prod', 'staging', 'source', 'build', 'test', 'deploy', 'release' | `string` | `null` | no |
143-
| <a name="input_tags"></a> [tags](#input\_tags) | Additional tags (e.g. `{'BusinessUnit': 'XYZ'}`).<br>Neither the tag keys nor the tag values will be modified by this module. | `map(string)` | `{}` | no |
144-
| <a name="input_tenant"></a> [tenant](#input\_tenant) | ID element \_(Rarely used, not included by default)\_. A customer identifier, indicating who this instance of a resource is for | `string` | `null` | no |
145-
146-
## Outputs
147-
148-
| Name | Description |
149-
|------|-------------|
150-
| <a name="output_github_runners"></a> [github\_runners](#output\_github\_runners) | Information about the GitHub runners. |
151-
| <a name="output_queues"></a> [queues](#output\_queues) | Information about the GitHub runner queues. Such as `build_queue_arn` the ARN of the SQS queue to use for the build queue. |
152-
| <a name="output_ssm_parameters"></a> [ssm\_parameters](#output\_ssm\_parameters) | Information about the SSM parameters to use to register the runner. |
153-
| <a name="output_webhook"></a> [webhook](#output\_webhook) | Information about the webhook to use to register the runner. |
154-
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
155-
<!-- prettier-ignore-end -->
156-
157-
## References
158-
159-
- [cloudposse/terraform-aws-components](https://github.com/cloudposse/terraform-aws-components/tree/main/modules/ecs) -
160-
Cloud Posse's upstream component
16173
tags:
16274
- component/philips-labs-github-runners
16375
- layer/github
@@ -167,6 +79,10 @@ categories:
16779
- component/philips-labs-github-runners
16880
- layer/github
16981
- provider/aws
82+
references:
83+
- name: cloudposse-terraform-components
84+
description: "Cloud Posse's upstream component"
85+
url: https://github.com/orgs/cloudposse-terraform-components/repositories
17086
# License of this project
17187
license: "APACHE2"
17288
# Badges to display

atmos.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Atmos Configuration — powered by https://atmos.tools
2+
#
3+
# This configuration enables centralized, DRY, and consistent project scaffolding using Atmos.
4+
#
5+
# Included features:
6+
# - Organizational custom commands: https://atmos.tools/core-concepts/custom-commands
7+
# - Automated README generation: https://atmos.tools/cli/commands/docs/generate
8+
#
9+
# Import shared configuration used by all modules
10+
import:
11+
- https://raw.githubusercontent.com/cloudposse-terraform-components/.github/refs/heads/main/.github/atmos/terraform-component.yaml

0 commit comments

Comments
 (0)