@@ -30,6 +30,10 @@ in just a few steps, in any technology.
30
30
- [ Makes.nix format] ( #makesnix-format )
31
31
- [ Caching] ( #caching )
32
32
- [ cache] ( #cache )
33
+ - [ Secrets] ( #secrets )
34
+ - [ secrets] ( #secrets )
35
+ - [ aws] ( #aws )
36
+ - [ fromEnv] ( #fromenv )
33
37
- [ Formatters] ( #formatters )
34
38
- [ formatBash] ( #formatbash )
35
39
- [ formatMarkdown] ( #formatmarkdown )
@@ -445,6 +449,103 @@ Example `makes.nix`:
445
449
}
446
450
```
447
451
452
+ ## Secrets
453
+
454
+ Managing secrets is critical for application security.
455
+
456
+ The following functions are secure
457
+ and allow you to re-use secrets
458
+ across different [ Makes] [ MAKES ] components.
459
+
460
+ ### secrets
461
+
462
+ #### aws
463
+
464
+ Secrets for authenticating into [ Amazon Web Services (AWS)] [ AWS ] .
465
+
466
+ ##### fromEnv
467
+
468
+ Load [ AWS] [ AWS ] secrets from [ Environment Variables] [ ENV_VAR ] .
469
+
470
+ Attributes:
471
+
472
+ - self (` attrsOf awsFromEnvType ` ): Optional.
473
+ Defaults to ` { } ` .
474
+
475
+ Custom Types:
476
+
477
+ - awsFromEnvType (` submodule ` ):
478
+
479
+ - accessKeyId (` str ` ): Optional.
480
+ Name of the [ environment variable] [ ENV_VAR ]
481
+ that stores the value of the [ AWS] [ AWS ] Access Key Id.
482
+ Defaults to ` "AWS_ACCESS_KEY_ID" ` .
483
+
484
+ - defaultRegion (` str ` ): Optional.
485
+ Name of the [ environment variable] [ ENV_VAR ]
486
+ that stores the value of the [ AWS] [ AWS ] Default Region.
487
+ Defaults to ` "us-east-1" ` .
488
+
489
+ - secretAccessKey (` str ` ): Optional.
490
+ Name of the [ environment variable] [ ENV_VAR ]
491
+ that stores the value of the [ AWS] [ AWS ] Secret Access Key.
492
+ Defaults to ` "AWS_SECRET_ACCESS_KEY" ` .
493
+
494
+ - sessionToken (` str ` ): Optional.
495
+ Name of the [ environment variable] [ ENV_VAR ]
496
+ that stores the value of the [ AWS] [ AWS ] Session Token.
497
+ Defaults to ` "AWS_SESSION_TOKEN" ` .
498
+
499
+ Always available outputs:
500
+
501
+ - ` /secrets/aws/fromEnv/__default__ ` :
502
+ - accessKeyId: "AWS_ACCESS_KEY_ID";
503
+ - defaultRegion: "us-east-1";
504
+ - secretAccessKey: "AWS_SECRET_ACCESS_KEY";
505
+ - sessionToken: "AWS_SESSION_TOKEN";
506
+
507
+ Example ` makes.nix ` :
508
+
509
+ ``` nix
510
+ { outputs
511
+ , ...
512
+ }:
513
+ {
514
+ secrets = {
515
+ aws = {
516
+ fromEnv = {
517
+ makesDev = {
518
+ accessKeyId = "MAKES_DEV_AWS_ACCESS_KEY_ID";
519
+ secretAccessKey = "MAKES_DEV_AWS_SECRET_ACCESS_KEY";
520
+ };
521
+ makesProd = {
522
+ accessKeyId = "MAKES_PROD_AWS_ACCESS_KEY_ID";
523
+ secretAccessKey = "MAKES_PROD_AWS_SECRET_ACCESS_KEY";
524
+ };
525
+ };
526
+ };
527
+ };
528
+ lintTerraform = {
529
+ modules = {
530
+ moduleDev = {
531
+ authentication = [
532
+ outputs."/secrets/aws/fromEnv/makesDev"
533
+ ];
534
+ src = "/my/module1";
535
+ version = "0.12";
536
+ };
537
+ moduleProd = {
538
+ authentication = [
539
+ outputs."/secrets/aws/fromEnv/makesProd"
540
+ ];
541
+ src = "/my/module2";
542
+ version = "0.12";
543
+ };
544
+ };
545
+ };
546
+ }
547
+ ```
548
+
448
549
## Formatters
449
550
450
551
Formatters help your code be consistent, beautiful and more maintainable.
@@ -803,19 +904,14 @@ Attributes:
803
904
Custom Types:
804
905
805
906
- moduleType (` submodule ` ):
907
+ - authentication (` listOf package ` ): Optional.
908
+ [ Makes Secrets] [ MAKES_SECRETS ] to use (if required by your module).
909
+ Defaults to ` [ ] ` .
806
910
- src (` str ` ):
807
911
Path to the [ Terraform] [ TERRAFORM ] module.
808
912
- version (` str ` ):
809
913
[ Terraform] [ TERRAFORM ] version your module is built with.
810
914
811
- Required environment variables:
812
-
813
- - If your [ Terraform] [ TERRAFORM ] module uses the AWS provider:
814
- - ` AWS_ACCESS_KEY_ID `
815
- - ` AWS_DEFAULT_REGION `
816
- - ` AWS_SECRET_ACCESS_KEY `
817
- - ` AWS_SESSION_TOKEN ` : Required only if the AWS credentials are temporary.
818
-
819
915
Example ` makes.nix ` :
820
916
821
917
``` nix
@@ -835,15 +931,7 @@ Example `makes.nix`:
835
931
}
836
932
```
837
933
838
- Example invocation:
839
-
840
- ``` bash
841
- $ AWS_ACCESS_KEY_ID=123 \
842
- AWS_DEFAULT_REGION=us-east-1 \
843
- AWS_SECRET_ACCESS_KEY=123 \
844
- AWS_SESSION_TOKEN=123 \
845
- m . /lintTerraform
846
- ```
934
+ Example invocation: ` $ m . /lintTerraform `
847
935
848
936
### lintWithLizard
849
937
@@ -1579,6 +1667,9 @@ $ m . /example
1579
1667
- [APACHE_MAVEN]: https://maven.apache.org/
1580
1668
[Apache Maven][APACHE_MAVEN]
1581
1669
1670
+ - [AWS]: https://aws.amazon.com/
1671
+ [Amazon Web Services (AWS)][AWS]
1672
+
1582
1673
- [BASH]: https://www.gnu.org/software/bash/
1583
1674
[Bash][BASH]
1584
1675
@@ -1609,6 +1700,9 @@ $ m . /example
1609
1700
- [DOCTOC]: https://github.com/thlorenz/doctoc
1610
1701
[DocToc][DOCTOC]
1611
1702
1703
+ - [ENV_VAR]: https://en.wikipedia.org/wiki/Environment_variable
1704
+ [Environment Variable][ENV_VAR]
1705
+
1612
1706
- [FLUID_ATTACKS]: https://fluidattacks.com
1613
1707
[Fluid Attacks][FLUID_ATTACKS]
1614
1708
@@ -1663,6 +1757,9 @@ $ m . /example
1663
1757
- [MAKES_RELEASES]: https://github.com/fluidattacks/makes/releases
1664
1758
[Makes Releases][MAKES_RELEASES]
1665
1759
1760
+ - [MAKES_SECRETS]: #secrets
1761
+ [Makes Secrets][MAKES_SECRETS]
1762
+
1666
1763
- [MARKDOWN_LINT]: https://github.com/markdownlint/markdownlint
1667
1764
[Markdown lint tool][MARKDOWN_LINT]
1668
1765
0 commit comments