awslabs / aws-bootstrap-kit

Apache License 2.0
104 stars 22 forks source link

Tag accounts #17

Closed flochaz closed 3 years ago

flochaz commented 3 years ago

In order to support future use cases such as Organizations and Account import we can't keep relying on Account. name to manage the bootstrap kit logic. Therefore this PR add account tagging to replace it.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Unit tests

---------------------------------------------------|---------|----------|---------|---------|---------------------
File                                               | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s   
---------------------------------------------------|---------|----------|---------|---------|---------------------
All files                                          |   95.98 |    77.97 |    97.5 |   95.95 |                     
 lib                                               |   97.61 |    75.44 |   95.65 |   97.61 |                     
  account-provider.ts                              |     100 |      100 |     100 |     100 |                     
  account.ts                                       |      96 |    83.33 |     100 |      96 | 183                 
  aws-config-recorder.ts                           |     100 |      100 |     100 |     100 |                     
  aws-organizations-stack.ts                       |      94 |    69.57 |      80 |      94 | 134,142,165         
  dns.ts                                           |   95.45 |     62.5 |     100 |   95.45 | 65                  
  index.ts                                         |     100 |      100 |     100 |     100 |                     
  organization-trail.ts                            |     100 |       50 |     100 |     100 | 145                 
  organization.ts                                  |     100 |      100 |     100 |     100 |                     
  organizational-unit.ts                           |     100 |      100 |     100 |     100 |                     
  secure-root-user.ts                              |     100 |      100 |     100 |     100 |                     
  validate-email-provider.ts                       |     100 |      100 |     100 |     100 |                     
  validate-email.ts                                |     100 |    83.33 |     100 |     100 | 46                  
 lib/account-handler                               |   94.74 |    88.46 |     100 |   94.44 |                     
  index.ts                                         |   94.74 |    88.46 |     100 |   94.44 | 57,62               
 lib/dns                                           |     100 |       50 |     100 |     100 |                     
  cross-account-dns-delegator.ts                   |     100 |      100 |     100 |     100 |                     
  cross-account-zone-delegation-record-provider.ts |     100 |       50 |     100 |     100 | 61                  
  cross-account-zone-delegation-record.ts          |     100 |       50 |     100 |     100 | 22-23               
 lib/dns/delegation-record-handler                 |   86.54 |    78.95 |     100 |   86.54 |                     
  index.ts                                         |   86.54 |    78.95 |     100 |   86.54 | 114,173-184,250-251 
 lib/validate-email-handler                        |     100 |       80 |     100 |     100 |                     
  index.ts                                         |     100 |       80 |     100 |     100 | 61-71               
---------------------------------------------------|---------|----------|---------|---------|---------------------

Test Suites: 8 passed, 8 total
Tests:       26 passed, 26 total
Snapshots:   0 total
Time:        25.37 s
Ran all test suites.

Integ tests

See https://github.com/aws-samples/aws-bootstrap-kit-examples/pull/24