awslabs / aws-bootstrap-kit

Apache License 2.0
104 stars 22 forks source link

Prevent concurrent Org call #24

Closed flochaz closed 3 years ago

flochaz commented 3 years ago

Context

Organizations APIs can't be called in parallel. This PR enforce sequentiality of calls.

Tests

Units

 PASS  test/secure-root-user.test.ts
 PASS  test/cross-account-dns-delegator.test.ts
 PASS  test/account.test.ts
 PASS  test/aws-organizations-stack.test.ts (61.835 s)
---------------------------------------------------|---------|----------|---------|---------|---------------------
File                                               | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s   
---------------------------------------------------|---------|----------|---------|---------|---------------------
All files                                          |   96.16 |    78.57 |   97.62 |   96.14 |                     
 lib                                               |   97.75 |    75.41 |      96 |   97.75 |                     
  account-provider.ts                              |     100 |      100 |     100 |     100 |                     
  account.ts                                       |   96.15 |    83.33 |     100 |   96.15 | 185                 
  aws-config-recorder.ts                           |     100 |      100 |     100 |     100 |                     
  aws-organizations-stack.ts                       |   93.48 |    69.57 |      80 |   93.48 | 132,140,163         
  dns.ts                                           |    96.3 |       70 |     100 |    96.3 | 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 |       75 |     100 |     100 | 78                  
  validate-email.ts                                |     100 |    83.33 |     100 |     100 | 47                  
 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 |    85.71 |     100 |     100 |                     
  index.ts                                         |     100 |    85.71 |     100 |     100 | 75-78               
---------------------------------------------------|---------|----------|---------|---------|---------------------

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

Integ

rm -rf node_modules package-lock.json && npm install && npm run build && npm run cdk  synth -- --profile main-admin  && npm run cdk  deploy --  -a ./cdk.out/assembly-AWSBootstrapKit-LandingZone-PipelineStack-Prod --profile main-admin
...
Prod-orgStack: creating CloudFormation changeset...
[██▏·······················································] (1/27)

 ✅  AWSBootstrapKitLandingZonePipelineStackProdorgStackF5B27334 (Prod-orgStack)

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