Skip to content

Commit 8006a81

Browse files
committed
other(ssm-script docs): escape double quotes and refactor doc
1 parent 4422e93 commit 8006a81

File tree

2 files changed

+45
-25
lines changed

2 files changed

+45
-25
lines changed

examples/external-managed-ssm-secrets/README.md

Lines changed: 42 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,25 @@ Manually creating the SSM parameters that hold the configuration of your GitHub
66

77
## Prerequisites
88

9-
Create the following SSM parameters on the AWS console, or by using the following aws-cli commands, see example below. You can also use the script `ssm.sh`. First set the required values, next source the script before running terraform.
9+
To configure GitHub App credentials in AWS, you have two options:
10+
11+
### 1. Using the [`ssm.sh`](./ssm.sh) script
12+
13+
- Edit [`ssm.sh`](./ssm.sh) and set your values
14+
- Run: `source ssm.sh`
15+
- Then run your Terraform commands (`terraform plan` / `terraform apply`)
16+
17+
### 2. Create them manually via the AWS console (or the `aws-cli`)
18+
19+
- Create the following SSM parameters on the AWS console:
20+
21+
```
22+
/github-action-runners/app/github_app_id (Your GitHub App ID)
23+
/github-action-runners/app/github_app_key_base64 (Your GitHub App Private Key)
24+
/github-action-runners/app/github_app_webhook_secret (Your Installation ID)
25+
```
26+
27+
Example using AWS CLI:
1028

1129
```bash
1230
# GitHub App ID
@@ -28,7 +46,7 @@ Create the following SSM parameters on the AWS console, or by using the followin
2846
--type "SecureString"
2947
```
3048

31-
Then fill the `arn` and `name` values for each of these inside the [`github_app_ssm_parameters` variable](./variables.tf).
49+
- Fill the `arn` and `name` values for each of these inside the [`github_app_ssm_parameters` variable](./variables.tf).
3250

3351
## Usages
3452

@@ -57,43 +75,45 @@ terraform output -raw webhook_secret
5775
```
5876

5977
<!-- BEGIN_TF_DOCS -->
78+
6079
## Requirements
6180

62-
| Name | Version |
63-
|------|---------|
64-
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3.0 |
65-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | ~> 5.27 |
66-
| <a name="requirement_local"></a> [local](#requirement\_local) | ~> 2.0 |
67-
| <a name="requirement_random"></a> [random](#requirement\_random) | ~> 3.0 |
81+
| Name | Version |
82+
| ------------------------------------------------------------------------ | -------- |
83+
| <a name="requirement_terraform"></a> [terraform](#requirement_terraform) | >= 1.3.0 |
84+
| <a name="requirement_aws"></a> [aws](#requirement_aws) | ~> 5.27 |
85+
| <a name="requirement_local"></a> [local](#requirement_local) | ~> 2.0 |
86+
| <a name="requirement_random"></a> [random](#requirement_random) | ~> 3.0 |
6887

6988
## Providers
7089

7190
No providers.
7291

7392
## Modules
7493

75-
| Name | Source | Version |
76-
|------|--------|---------|
77-
| <a name="module_base"></a> [base](#module\_base) | ../base | n/a |
78-
| <a name="module_runners"></a> [runners](#module\_runners) | ../../ | n/a |
94+
| Name | Source | Version |
95+
| -------------------------------------------------------- | ------- | ------- |
96+
| <a name="module_base"></a> [base](#module_base) | ../base | n/a |
97+
| <a name="module_runners"></a> [runners](#module_runners) | ../../ | n/a |
7998

8099
## Resources
81100

82101
No resources.
83102

84103
## Inputs
85104

86-
| Name | Description | Type | Default | Required |
87-
|------|-------------|------|---------|:--------:|
88-
| <a name="input_aws_region"></a> [aws\_region](#input\_aws\_region) | AWS region. | `string` | `"eu-west-1"` | no |
89-
| <a name="input_environment"></a> [environment](#input\_environment) | Environment name, used as prefix. | `string` | `null` | no |
90-
| <a name="input_github_app_ssm_parameters"></a> [github\_app\_ssm\_parameters](#input\_github\_app\_ssm\_parameters) | SSM parameters details for the GitHub App, that you've created manually on AWS. | <pre>object({<br/> key_base64 = optional(object({<br/> arn = string<br/> name = string<br/> }))<br/> id = optional(object({<br/> arn = string<br/> name = string<br/> }))<br/> webhook_secret = optional(object({<br/> arn = string<br/> name = string<br/> }))<br/> })</pre> | `{}` | no |
105+
| Name | Description | Type | Default | Required |
106+
| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- | :------: |
107+
| <a name="input_aws_region"></a> [aws_region](#input_aws_region) | AWS region. | `string` | `"eu-west-1"` | no |
108+
| <a name="input_environment"></a> [environment](#input_environment) | Environment name, used as prefix. | `string` | `null` | no |
109+
| <a name="input_github_app_ssm_parameters"></a> [github_app_ssm_parameters](#input_github_app_ssm_parameters) | SSM parameters details for the GitHub App, that you've created manually on AWS. | <pre>object({<br/> key_base64 = optional(object({<br/> arn = string<br/> name = string<br/> }))<br/> id = optional(object({<br/> arn = string<br/> name = string<br/> }))<br/> webhook_secret = optional(object({<br/> arn = string<br/> name = string<br/> }))<br/> })</pre> | `{}` | no |
91110

92111
## Outputs
93112

94-
| Name | Description |
95-
|------|-------------|
96-
| <a name="output_note"></a> [note](#output\_note) | n/a |
97-
| <a name="output_runners"></a> [runners](#output\_runners) | n/a |
98-
| <a name="output_webhook_endpoint"></a> [webhook\_endpoint](#output\_webhook\_endpoint) | n/a |
113+
| Name | Description |
114+
| ----------------------------------------------------------------------------------- | ----------- |
115+
| <a name="output_note"></a> [note](#output_note) | n/a |
116+
| <a name="output_runners"></a> [runners](#output_runners) | n/a |
117+
| <a name="output_webhook_endpoint"></a> [webhook_endpoint](#output_webhook_endpoint) | n/a |
118+
99119
<!-- END_TF_DOCS -->

examples/external-managed-ssm-secrets/ssm.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ github_app_key_base64_ssm=$(aws ssm get-parameter --name "${SSM_PATH}/github_app
5959
github_app_webhook_secret_ssm=$(aws ssm get-parameter --name "${SSM_PATH}/github_app_webhook_secret" --query 'Parameter.{arn:ARN,name:Name}' --output json)
6060

6161
export TF_VAR_github_app_ssm_parameters="{
62-
"id": `echo $github_app_id_ssm`,
63-
"key_base64": `echo $github_app_key_base64_ssm`,
64-
"webhook_secret": `echo $github_app_webhook_secret_ssm`
62+
\"id\": `echo $github_app_id_ssm`,
63+
\"key_base64\": `echo $github_app_key_base64_ssm`,
64+
\"webhook_secret\": `echo $github_app_webhook_secret_ssm`
6565
}"
6666

6767
export TF_VAR_environment=external-ssm

0 commit comments

Comments
 (0)