Skip to content

Commit 632f575

Browse files
add troubleshooting details (#31)
* add troubleshooting details * update Readme
1 parent 0599243 commit 632f575

File tree

1 file changed

+33
-2
lines changed

1 file changed

+33
-2
lines changed

README.md

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,23 @@ Environment:
121121

122122
When your function initializes, each of the four environmet variables (`SECRET`, `ACCESS_KEY`, `DB_URL`, and `NR_KEY`) will return values from their respective SSM paths.
123123

124-
```
124+
```javascript
125+
// node
125126
process.env.SECRET; // 1A2B3C4D5E6F
126127
process.env.ACCESS_KEY; // G7H8I9J0K1L2
127128
process.env.DB_URL; // mysql2://u:p@host:3306
128129
process.env.NR_KEY; // z6y5x4w3v2u1
129130
```
130131

132+
```ruby
133+
# ruby
134+
env["SECRET"]; ## 1A2B3C4D5E6F
135+
env["ACCESS_KEY"]; ## G7H8I9J0K1L2
136+
env["DB_URL"]; ## mysql2://u:p@host:3306
137+
env["NR_KEY"]; ## z6y5x4w3v2u1
138+
```
139+
140+
131141
Here are a few details about the internal implementation on how Crypteia works:
132142

133143
1. When accessing a single parameter path via `x-crypteia-ssm:` the environment variable name available to your runtime is used as is. No part of the parameter path effects the resulting name.
@@ -170,6 +180,28 @@ Please use AWS' [Restricting access to Systems Manager parameters using IAM poli
170180
}
171181
```
172182

183+
#### Troubleshooting
184+
185+
Crypteia has very verbose logging which enabled by creating an environment variable:
186+
187+
```ruby
188+
CRYPTEIA_DEBUG: true
189+
```
190+
191+
Example of logs:
192+
193+
```log
194+
195+
{"All":"all","ErrorMessage":"","_aws":{"CloudWatchMetrics":[{"Dimensions":[["All","lib"]],"Metrics":[{"Name":"initialized","Unit":"Count"}],"Namespace":"Crypteia"}],"Timestamp":1670424178585},"initialized":1,"lib":"lib"}
196+
{"All":"all","ErrorMessage":"","_aws":{"CloudWatchMetrics":[{"Dimensions":[["All","main"]],"Metrics":[{"Name":"initialized","Unit":"Count"}],"Namespace":"Crypteia"}],"Timestamp":1670424178590},"initialized":1,"main":"main"}
197+
{"All":"all","ErrorMessage":"","_aws":{"CloudWatchMetrics":[{"Dimensions":[["All","main"]],"Metrics":[{"Name":"fetched","Unit":"Count"}],"Namespace":"Crypteia"}],"Timestamp":1670424178831},"fetched":1,"main":"main"}
198+
{"All":"all","ErrorMessage":"","_aws":{"CloudWatchMetrics":[{"Dimensions":[["All","lib"]],"Metrics":[{"Name":"initialized","Unit":"Count"}],"Namespace":"Crypteia"}],"Timestamp":1670424178892},"initialized":1,"lib":"lib"}
199+
{"All":"all","ErrorMessage":"","_aws":{"CloudWatchMetrics":[{"Dimensions":[["All","lib"]],"Metrics":[{"Name":"is_env_file","Unit":"Count"}],"Namespace":"Crypteia"}],"Timestamp":1670424179575},"is_env_file":1,"lib":"lib"}
200+
{"All":"all","ErrorMessage":"","_aws":{"CloudWatchMetrics":[{"Dimensions":[["All","lib"]],"Metrics":[{"Name":"read_env_file","Unit":"Count"}],"Namespace":"Crypteia"}],"Timestamp":1670424179575},"lib":"lib","read_env_file":1}
201+
{"All":"all","ErrorMessage":"","_aws":{"CloudWatchMetrics":[{"Dimensions":[["All","lib"]],"Metrics":[{"Name":"delete_file","Unit":"Count"}],"Namespace":"Crypteia"}],"Timestamp":1670424179575},"delete_file":1,"lib":"lib"}
202+
203+
```
204+
173205
## Development
174206

175207
This project is built for [GitHub Codespcaes](https://github.com/features/codespaces) using the [Development Container](https://containers.dev) specification. Even though Codespaces may not be available to everyone, this project's containers are easy to work for anyone with any editor.
@@ -219,4 +251,3 @@ devcontainer exec --workspace-folder . ./bin/test-local
219251
```
220252

221253
![Showing Sublime Text on a Mac using the Dev Container CLI to run Crypteia tests.](/images/readme-devcontainer-cli-sublime.png)
222-

0 commit comments

Comments
 (0)