github.com/mweagle/Sparta@v1.15.0/docs/reference/apigateway/request_params/index.html (about)

     1  <!DOCTYPE html>
     2  <html lang="en" class="js csstransforms3d">
     3    <head>
     4      <meta charset="utf-8">
     5      <meta name="viewport" content="width=device-width, initial-scale=1.0">
     6      <meta name="generator" content="Hugo 0.69.2" />
     7      <meta name="description" content="Sparta - AWS Lambda Microservices">
     8  <meta name="author" content="Matt Weagle">
     9  
    10      <link rel="icon" href="/images/favicon.png" type="image/png">
    11  
    12      <title>Request Parameters :: Sparta - AWS Lambda Microservices</title>
    13  
    14      
    15      <link href="/css/nucleus.css?1588464710" rel="stylesheet">
    16      <link href="/css/fontawesome-all.min.css?1588464710" rel="stylesheet">
    17      <link href="/css/hybrid.css?1588464710" rel="stylesheet">
    18      <link href="/css/featherlight.min.css?1588464710" rel="stylesheet">
    19      <link href="/css/perfect-scrollbar.min.css?1588464710" rel="stylesheet">
    20      <link href="/css/auto-complete.css?1588464710" rel="stylesheet">
    21      <link href="/css/theme.css?1588464710" rel="stylesheet">
    22      <link href="/css/hugo-theme.css?1588464710" rel="stylesheet">
    23      
    24        <link href="/css/theme-sparta.css?1588464710" rel="stylesheet">
    25      
    26  
    27      <script src="/js/jquery-3.3.1.min.js?1588464710"></script>
    28      
    29      <link href="/css/vs.css?1588464710" rel="stylesheet">
    30      <script src="/js/highlight.pack.js?1588464710"></script>
    31      <script>hljs.initHighlightingOnLoad();</script>
    32      
    33  
    34      <style>
    35        :root #header + #content > #left > #rlblock_left{
    36            display:none !important;
    37        }
    38        
    39      </style>
    40      
    41  <style type="text/css">
    42  pre {
    43      padding: 2px;
    44  }
    45  </style>
    46  
    47  
    48    </head>
    49    <body class="" data-url="/reference/apigateway/request_params/">
    50      <nav id="sidebar" class="">
    51  
    52  
    53  
    54    <div id="header-wrapper">
    55      <div id="header">
    56        <a href="/"><img src="/images/SpartaLogoNoDomain.png" height="50%" width="50%"/></a>
    57      </div>
    58      
    59          <div class="searchbox">
    60      <label for="search-by"><i class="fas fa-search"></i></label>
    61      <input data-search-input id="search-by" type="search" placeholder="Search...">
    62      <span data-search-clear=""><i class="fas fa-times"></i></span>
    63  </div>
    64  
    65  <script type="text/javascript" src="/js/lunr.min.js?1588464710"></script>
    66  <script type="text/javascript" src="/js/auto-complete.js?1588464710"></script>
    67  <script type="text/javascript">
    68      
    69          var baseurl = "\/";
    70      
    71  </script>
    72  <script type="text/javascript" src="/js/search.js?1588464710"></script>
    73  
    74      
    75    </div>
    76  
    77      <div class="highlightable">
    78      <ul class="topics">
    79  
    80          
    81            
    82            
    83  
    84  
    85   
    86    
    87      
    88      <li data-nav-id="/getting_started/" title="Getting Started" class="dd-item 
    89          
    90          
    91          
    92          ">
    93        <a href="/getting_started/">
    94            Getting Started
    95            
    96        </a>
    97        
    98                
    99      </li>
   100    
   101   
   102  
   103            
   104            
   105  
   106  
   107   
   108    
   109      
   110      <li data-nav-id="/example_service/" title="Example Service" class="dd-item 
   111          
   112          
   113          
   114          ">
   115        <a href="/example_service/">
   116            Example Service
   117            
   118        </a>
   119        
   120        
   121          <ul>
   122            
   123            
   124            
   125            
   126          
   127            
   128              
   129              
   130  
   131  
   132   
   133    
   134      
   135        <li data-nav-id="/example_service/step1/" title="Overview" class="dd-item ">
   136          <a href="/example_service/step1/">
   137          Overview
   138          
   139          </a>
   140      </li>
   141       
   142    
   143   
   144  
   145              
   146            
   147              
   148              
   149  
   150  
   151   
   152    
   153      
   154        <li data-nav-id="/example_service/step2/" title="Details" class="dd-item ">
   155          <a href="/example_service/step2/">
   156          Details
   157          
   158          </a>
   159      </li>
   160       
   161    
   162   
   163  
   164              
   165            
   166          
   167          </ul>
   168                
   169      </li>
   170    
   171   
   172  
   173            
   174            
   175  
   176  
   177   
   178    
   179      
   180      <li data-nav-id="/concepts/" title="Concepts" class="dd-item 
   181          
   182          
   183          
   184          ">
   185        <a href="/concepts/">
   186            Concepts
   187            
   188        </a>
   189        
   190                
   191      </li>
   192    
   193   
   194  
   195            
   196            
   197  
   198  
   199   
   200    
   201      
   202      <li data-nav-id="/reference/" title="Reference" class="dd-item 
   203          parent
   204          
   205          
   206          ">
   207        <a href="/reference/">
   208            Reference
   209            
   210        </a>
   211        
   212        
   213          <ul>
   214            
   215            
   216              
   217            
   218            
   219            
   220          
   221            
   222              
   223              
   224  
   225  
   226   
   227    
   228      
   229      <li data-nav-id="/reference/apigateway/" title="" class="dd-item 
   230          parent
   231          
   232          
   233          ">
   234        <a href="/reference/apigateway/">
   235            <b>API Gateway</b>
   236            
   237        </a>
   238        
   239        
   240          <ul>
   241            
   242            
   243            
   244            
   245          
   246            
   247              
   248              
   249  
   250  
   251   
   252    
   253      
   254        <li data-nav-id="/reference/apigateway/echo_event/" title="Echo" class="dd-item ">
   255          <a href="/reference/apigateway/echo_event/">
   256          Echo
   257          
   258          </a>
   259      </li>
   260       
   261    
   262   
   263  
   264              
   265            
   266              
   267              
   268  
   269  
   270   
   271    
   272      
   273        <li data-nav-id="/reference/apigateway/request_params/" title="Request Parameters" class="dd-item active">
   274          <a href="/reference/apigateway/request_params/">
   275          Request Parameters
   276          
   277          </a>
   278      </li>
   279       
   280    
   281   
   282  
   283              
   284            
   285              
   286              
   287  
   288  
   289   
   290    
   291      
   292        <li data-nav-id="/reference/apigateway/context/" title="Request Context" class="dd-item ">
   293          <a href="/reference/apigateway/context/">
   294          Request Context
   295          
   296          </a>
   297      </li>
   298       
   299    
   300   
   301  
   302              
   303            
   304              
   305              
   306  
   307  
   308   
   309    
   310      
   311        <li data-nav-id="/reference/apigateway/cors/" title="CORS" class="dd-item ">
   312          <a href="/reference/apigateway/cors/">
   313          CORS
   314          
   315          </a>
   316      </li>
   317       
   318    
   319   
   320  
   321              
   322            
   323              
   324              
   325  
   326  
   327   
   328    
   329      
   330        <li data-nav-id="/reference/apigateway/slack/" title="Slack SlashCommand" class="dd-item ">
   331          <a href="/reference/apigateway/slack/">
   332          Slack SlashCommand
   333          
   334          </a>
   335      </li>
   336       
   337    
   338   
   339  
   340              
   341            
   342              
   343              
   344  
   345  
   346   
   347    
   348      
   349        <li data-nav-id="/reference/apigateway/s3site/" title="S3 Sites with CORS" class="dd-item ">
   350          <a href="/reference/apigateway/s3site/">
   351          S3 Sites with CORS
   352          
   353          </a>
   354      </li>
   355       
   356    
   357   
   358  
   359              
   360            
   361          
   362          </ul>
   363                
   364      </li>
   365    
   366   
   367  
   368              
   369            
   370              
   371              
   372  
   373  
   374   
   375    
   376      
   377      <li data-nav-id="/reference/apiv2gateway/" title="" class="dd-item 
   378          
   379          
   380          
   381          ">
   382        <a href="/reference/apiv2gateway/">
   383            <b>API V2 Gateway</b>
   384            
   385        </a>
   386        
   387                
   388      </li>
   389    
   390   
   391  
   392              
   393            
   394              
   395              
   396  
   397  
   398   
   399    
   400      
   401      <li data-nav-id="/reference/eventsources/" title="" class="dd-item 
   402          
   403          
   404          
   405          ">
   406        <a href="/reference/eventsources/">
   407            <b>Event Sources</b>
   408            
   409        </a>
   410        
   411        
   412          <ul>
   413            
   414            
   415            
   416            
   417          
   418            
   419              
   420              
   421  
   422  
   423   
   424    
   425      
   426        <li data-nav-id="/reference/eventsources/codecommit/" title="CodeCommit" class="dd-item ">
   427          <a href="/reference/eventsources/codecommit/">
   428          CodeCommit
   429          
   430          </a>
   431      </li>
   432       
   433    
   434   
   435  
   436              
   437            
   438              
   439              
   440  
   441  
   442   
   443    
   444      
   445        <li data-nav-id="/reference/eventsources/cloudformation/" title="CloudFormation" class="dd-item ">
   446          <a href="/reference/eventsources/cloudformation/">
   447          CloudFormation
   448          
   449          </a>
   450      </li>
   451       
   452    
   453   
   454  
   455              
   456            
   457              
   458              
   459  
   460  
   461   
   462    
   463      
   464        <li data-nav-id="/reference/eventsources/cloudwatchevents/" title="CloudWatch Events" class="dd-item ">
   465          <a href="/reference/eventsources/cloudwatchevents/">
   466          CloudWatch Events
   467          
   468          </a>
   469      </li>
   470       
   471    
   472   
   473  
   474              
   475            
   476              
   477              
   478  
   479  
   480   
   481    
   482      
   483        <li data-nav-id="/reference/eventsources/cloudwatchlogs/" title="CloudWatch Logs" class="dd-item ">
   484          <a href="/reference/eventsources/cloudwatchlogs/">
   485          CloudWatch Logs
   486          
   487          </a>
   488      </li>
   489       
   490    
   491   
   492  
   493              
   494            
   495              
   496              
   497  
   498  
   499   
   500    
   501      
   502        <li data-nav-id="/reference/eventsources/cognito/" title="Cognito" class="dd-item ">
   503          <a href="/reference/eventsources/cognito/">
   504          Cognito
   505          
   506          </a>
   507      </li>
   508       
   509    
   510   
   511  
   512              
   513            
   514              
   515              
   516  
   517  
   518   
   519    
   520      
   521        <li data-nav-id="/reference/eventsources/dynamodb/" title="DynamoDB" class="dd-item ">
   522          <a href="/reference/eventsources/dynamodb/">
   523          DynamoDB
   524          
   525          </a>
   526      </li>
   527       
   528    
   529   
   530  
   531              
   532            
   533              
   534              
   535  
   536  
   537   
   538    
   539      
   540        <li data-nav-id="/reference/eventsources/kinesis/" title="Kinesis" class="dd-item ">
   541          <a href="/reference/eventsources/kinesis/">
   542          Kinesis
   543          
   544          </a>
   545      </li>
   546       
   547    
   548   
   549  
   550              
   551            
   552              
   553              
   554  
   555  
   556   
   557    
   558      
   559        <li data-nav-id="/reference/eventsources/s3/" title="S3" class="dd-item ">
   560          <a href="/reference/eventsources/s3/">
   561          S3
   562          
   563          </a>
   564      </li>
   565       
   566    
   567   
   568  
   569              
   570            
   571              
   572              
   573  
   574  
   575   
   576    
   577      
   578        <li data-nav-id="/reference/eventsources/ses/" title="SES" class="dd-item ">
   579          <a href="/reference/eventsources/ses/">
   580          SES
   581          
   582          </a>
   583      </li>
   584       
   585    
   586   
   587  
   588              
   589            
   590              
   591              
   592  
   593  
   594   
   595    
   596      
   597        <li data-nav-id="/reference/eventsources/sns/" title="SNS" class="dd-item ">
   598          <a href="/reference/eventsources/sns/">
   599          SNS
   600          
   601          </a>
   602      </li>
   603       
   604    
   605   
   606  
   607              
   608            
   609              
   610              
   611  
   612  
   613   
   614    
   615      
   616        <li data-nav-id="/reference/eventsources/sqs/" title="SQS" class="dd-item ">
   617          <a href="/reference/eventsources/sqs/">
   618          SQS
   619          
   620          </a>
   621      </li>
   622       
   623    
   624   
   625  
   626              
   627            
   628          
   629          </ul>
   630                
   631      </li>
   632    
   633   
   634  
   635              
   636            
   637              
   638              
   639  
   640  
   641   
   642    
   643      
   644      <li data-nav-id="/reference/archetypes/" title="" class="dd-item 
   645          
   646          
   647          
   648          ">
   649        <a href="/reference/archetypes/">
   650            <b>Archetype Constructors</b>
   651            
   652        </a>
   653        
   654        
   655          <ul>
   656            
   657            
   658            
   659            
   660          
   661            
   662              
   663              
   664  
   665  
   666   
   667    
   668      
   669        <li data-nav-id="/reference/archetypes/event_bridge/" title="Event Bridge" class="dd-item ">
   670          <a href="/reference/archetypes/event_bridge/">
   671          Event Bridge
   672          
   673          </a>
   674      </li>
   675       
   676    
   677   
   678  
   679              
   680            
   681              
   682              
   683  
   684  
   685   
   686    
   687      
   688        <li data-nav-id="/reference/archetypes/codecommit/" title="CodeCommit" class="dd-item ">
   689          <a href="/reference/archetypes/codecommit/">
   690          CodeCommit
   691          
   692          </a>
   693      </li>
   694       
   695    
   696   
   697  
   698              
   699            
   700              
   701              
   702  
   703  
   704   
   705    
   706      
   707        <li data-nav-id="/reference/archetypes/cloudwatch/" title="CloudWatch" class="dd-item ">
   708          <a href="/reference/archetypes/cloudwatch/">
   709          CloudWatch
   710          
   711          </a>
   712      </li>
   713       
   714    
   715   
   716  
   717              
   718            
   719              
   720              
   721  
   722  
   723   
   724    
   725      
   726        <li data-nav-id="/reference/archetypes/dynamodb/" title="DynamoDB" class="dd-item ">
   727          <a href="/reference/archetypes/dynamodb/">
   728          DynamoDB
   729          
   730          </a>
   731      </li>
   732       
   733    
   734   
   735  
   736              
   737            
   738              
   739              
   740  
   741  
   742   
   743    
   744      
   745        <li data-nav-id="/reference/archetypes/kinesis/" title="Kinesis" class="dd-item ">
   746          <a href="/reference/archetypes/kinesis/">
   747          Kinesis
   748          
   749          </a>
   750      </li>
   751       
   752    
   753   
   754  
   755              
   756            
   757              
   758              
   759  
   760  
   761   
   762    
   763      
   764        <li data-nav-id="/reference/archetypes/kinesis_firehose/" title="Kinesis Firehose" class="dd-item ">
   765          <a href="/reference/archetypes/kinesis_firehose/">
   766          Kinesis Firehose
   767          
   768          </a>
   769      </li>
   770       
   771    
   772   
   773  
   774              
   775            
   776              
   777              
   778  
   779  
   780   
   781    
   782      
   783        <li data-nav-id="/reference/archetypes/rest/" title="REST Service" class="dd-item ">
   784          <a href="/reference/archetypes/rest/">
   785          REST Service
   786          
   787          </a>
   788      </li>
   789       
   790    
   791   
   792  
   793              
   794            
   795              
   796              
   797  
   798  
   799   
   800    
   801      
   802        <li data-nav-id="/reference/archetypes/s3/" title="S3" class="dd-item ">
   803          <a href="/reference/archetypes/s3/">
   804          S3
   805          
   806          </a>
   807      </li>
   808       
   809    
   810   
   811  
   812              
   813            
   814              
   815              
   816  
   817  
   818   
   819    
   820      
   821        <li data-nav-id="/reference/archetypes/sns/" title="SNS" class="dd-item ">
   822          <a href="/reference/archetypes/sns/">
   823          SNS
   824          
   825          </a>
   826      </li>
   827       
   828    
   829   
   830  
   831              
   832            
   833          
   834          </ul>
   835                
   836      </li>
   837    
   838   
   839  
   840              
   841            
   842              
   843              
   844  
   845  
   846   
   847    
   848      
   849      <li data-nav-id="/reference/decorators/" title="" class="dd-item 
   850          
   851          
   852          
   853          ">
   854        <a href="/reference/decorators/">
   855            <b>Build-Time Decorators</b>
   856            
   857        </a>
   858        
   859        
   860          <ul>
   861            
   862            
   863            
   864            
   865          
   866            
   867              
   868              
   869  
   870  
   871   
   872    
   873      
   874        <li data-nav-id="/reference/decorators/application_load_balancer/" title="Application Load Balancer" class="dd-item ">
   875          <a href="/reference/decorators/application_load_balancer/">
   876          Application Load Balancer
   877          
   878          </a>
   879      </li>
   880       
   881    
   882   
   883  
   884              
   885            
   886              
   887              
   888  
   889  
   890   
   891    
   892      
   893        <li data-nav-id="/reference/decorators/cloudmap/" title="CloudMap Service Discovery" class="dd-item ">
   894          <a href="/reference/decorators/cloudmap/">
   895          CloudMap Service Discovery
   896          
   897          </a>
   898      </li>
   899       
   900    
   901   
   902  
   903              
   904            
   905              
   906              
   907  
   908  
   909   
   910    
   911      
   912        <li data-nav-id="/reference/decorators/cloudfront_distribution/" title="CloudFront Distribution" class="dd-item ">
   913          <a href="/reference/decorators/cloudfront_distribution/">
   914          CloudFront Distribution
   915          
   916          </a>
   917      </li>
   918       
   919    
   920   
   921  
   922              
   923            
   924              
   925              
   926  
   927  
   928   
   929    
   930      
   931        <li data-nav-id="/reference/decorators/lambda_versioning/" title="Lambda Versioning Decorator" class="dd-item ">
   932          <a href="/reference/decorators/lambda_versioning/">
   933          Lambda Versioning Decorator
   934          
   935          </a>
   936      </li>
   937       
   938    
   939   
   940  
   941              
   942            
   943              
   944              
   945  
   946  
   947   
   948    
   949      
   950        <li data-nav-id="/reference/decorators/publish_outputs/" title="Publishing Outputs" class="dd-item ">
   951          <a href="/reference/decorators/publish_outputs/">
   952          Publishing Outputs
   953          
   954          </a>
   955      </li>
   956       
   957    
   958   
   959  
   960              
   961            
   962              
   963              
   964  
   965  
   966   
   967    
   968      
   969        <li data-nav-id="/reference/decorators/s3_artifact_publisher/" title="S3 Artifact Publisher" class="dd-item ">
   970          <a href="/reference/decorators/s3_artifact_publisher/">
   971          S3 Artifact Publisher
   972          
   973          </a>
   974      </li>
   975       
   976    
   977   
   978  
   979              
   980            
   981              
   982              
   983  
   984  
   985   
   986    
   987      
   988        <li data-nav-id="/reference/decorators/dynamic_infrastructure/" title="Dynamic Infrastructure" class="dd-item ">
   989          <a href="/reference/decorators/dynamic_infrastructure/">
   990          Dynamic Infrastructure
   991          
   992          </a>
   993      </li>
   994       
   995    
   996   
   997  
   998              
   999            
  1000          
  1001          </ul>
  1002                
  1003      </li>
  1004    
  1005   
  1006  
  1007              
  1008            
  1009              
  1010              
  1011  
  1012  
  1013   
  1014    
  1015      
  1016      <li data-nav-id="/reference/interceptors/" title="" class="dd-item 
  1017          
  1018          
  1019          
  1020          ">
  1021        <a href="/reference/interceptors/">
  1022            <b>Runtime Interceptors</b>
  1023            
  1024        </a>
  1025        
  1026        
  1027          <ul>
  1028            
  1029            
  1030            
  1031            
  1032          
  1033            
  1034              
  1035              
  1036  
  1037  
  1038   
  1039    
  1040      
  1041        <li data-nav-id="/reference/interceptors/xray_interceptor/" title="XRayInterceptor" class="dd-item ">
  1042          <a href="/reference/interceptors/xray_interceptor/">
  1043          XRayInterceptor
  1044          
  1045          </a>
  1046      </li>
  1047       
  1048    
  1049   
  1050  
  1051              
  1052            
  1053          
  1054          </ul>
  1055                
  1056      </li>
  1057    
  1058   
  1059  
  1060              
  1061            
  1062              
  1063              
  1064  
  1065  
  1066   
  1067    
  1068      
  1069      <li data-nav-id="/reference/cli_options/" title="" class="dd-item 
  1070          
  1071          
  1072          
  1073          ">
  1074        <a href="/reference/cli_options/">
  1075            <b>Command Line Options</b>
  1076            
  1077        </a>
  1078        
  1079                
  1080      </li>
  1081    
  1082   
  1083  
  1084              
  1085            
  1086              
  1087              
  1088  
  1089  
  1090   
  1091    
  1092      
  1093      <li data-nav-id="/reference/application/" title="" class="dd-item 
  1094          
  1095          
  1096          
  1097          ">
  1098        <a href="/reference/application/">
  1099            <b>Application Customization</b>
  1100            
  1101        </a>
  1102        
  1103        
  1104          <ul>
  1105            
  1106            
  1107            
  1108            
  1109          
  1110            
  1111              
  1112              
  1113  
  1114  
  1115   
  1116    
  1117      
  1118        <li data-nav-id="/reference/application/custom_commands/" title="Custom Commands" class="dd-item ">
  1119          <a href="/reference/application/custom_commands/">
  1120          Custom Commands
  1121          
  1122          </a>
  1123      </li>
  1124       
  1125    
  1126   
  1127  
  1128              
  1129            
  1130              
  1131              
  1132  
  1133  
  1134   
  1135    
  1136      
  1137        <li data-nav-id="/reference/application/custom_flags/" title="Custom Flags" class="dd-item ">
  1138          <a href="/reference/application/custom_flags/">
  1139          Custom Flags
  1140          
  1141          </a>
  1142      </li>
  1143       
  1144    
  1145   
  1146  
  1147              
  1148            
  1149              
  1150              
  1151  
  1152  
  1153   
  1154    
  1155      
  1156        <li data-nav-id="/reference/application/environments/" title="Managing Environments" class="dd-item ">
  1157          <a href="/reference/application/environments/">
  1158          Managing Environments
  1159          
  1160          </a>
  1161      </li>
  1162       
  1163    
  1164   
  1165  
  1166              
  1167            
  1168              
  1169              
  1170  
  1171  
  1172   
  1173    
  1174      
  1175        <li data-nav-id="/reference/application/custom_lambda_resources/" title="CloudFormation Resources" class="dd-item ">
  1176          <a href="/reference/application/custom_lambda_resources/">
  1177          CloudFormation Resources
  1178          
  1179          </a>
  1180      </li>
  1181       
  1182    
  1183   
  1184  
  1185              
  1186            
  1187              
  1188              
  1189  
  1190  
  1191   
  1192    
  1193      
  1194        <li data-nav-id="/reference/application/custom_resources/" title="Custom Resources" class="dd-item ">
  1195          <a href="/reference/application/custom_resources/">
  1196          Custom Resources
  1197          
  1198          </a>
  1199      </li>
  1200       
  1201    
  1202   
  1203  
  1204              
  1205            
  1206          
  1207          </ul>
  1208                
  1209      </li>
  1210    
  1211   
  1212  
  1213              
  1214            
  1215              
  1216              
  1217  
  1218  
  1219   
  1220    
  1221      
  1222      <li data-nav-id="/reference/step/" title="" class="dd-item 
  1223          
  1224          
  1225          
  1226          ">
  1227        <a href="/reference/step/">
  1228            <b>Step Functions</b>
  1229            
  1230        </a>
  1231        
  1232        
  1233          <ul>
  1234            
  1235            
  1236              
  1237            
  1238            
  1239            
  1240          
  1241            
  1242              
  1243              
  1244  
  1245  
  1246   
  1247    
  1248      
  1249        <li data-nav-id="/reference/step/lambda/" title="Lambda" class="dd-item ">
  1250          <a href="/reference/step/lambda/">
  1251          Lambda
  1252          
  1253          </a>
  1254      </li>
  1255       
  1256    
  1257   
  1258  
  1259              
  1260            
  1261              
  1262              
  1263  
  1264  
  1265   
  1266    
  1267      
  1268        <li data-nav-id="/reference/step/fargate/" title="Fargate" class="dd-item ">
  1269          <a href="/reference/step/fargate/">
  1270          Fargate
  1271          
  1272          </a>
  1273      </li>
  1274       
  1275    
  1276   
  1277  
  1278              
  1279            
  1280              
  1281              
  1282  
  1283  
  1284   
  1285    
  1286      
  1287      <li data-nav-id="/reference/step/services/" title="" class="dd-item 
  1288          
  1289          
  1290          
  1291          ">
  1292        <a href="/reference/step/services/">
  1293            <b>Service Integrations</b>
  1294            
  1295        </a>
  1296        
  1297        
  1298          <ul>
  1299            
  1300            
  1301            
  1302            
  1303          
  1304            
  1305              
  1306              
  1307  
  1308  
  1309   
  1310    
  1311      
  1312        <li data-nav-id="/reference/step/services/dynamodb/" title="Amazon DynamoDb" class="dd-item ">
  1313          <a href="/reference/step/services/dynamodb/">
  1314          Amazon DynamoDb
  1315          
  1316          </a>
  1317      </li>
  1318       
  1319    
  1320   
  1321  
  1322              
  1323            
  1324              
  1325              
  1326  
  1327  
  1328   
  1329    
  1330      
  1331        <li data-nav-id="/reference/step/services/sagemaker/" title="Amazon SageMaker" class="dd-item ">
  1332          <a href="/reference/step/services/sagemaker/">
  1333          Amazon SageMaker
  1334          
  1335          </a>
  1336      </li>
  1337       
  1338    
  1339   
  1340  
  1341              
  1342            
  1343              
  1344              
  1345  
  1346  
  1347   
  1348    
  1349      
  1350        <li data-nav-id="/reference/step/services/sns/" title="Amazon SNS" class="dd-item ">
  1351          <a href="/reference/step/services/sns/">
  1352          Amazon SNS
  1353          
  1354          </a>
  1355      </li>
  1356       
  1357    
  1358   
  1359  
  1360              
  1361            
  1362              
  1363              
  1364  
  1365  
  1366   
  1367    
  1368      
  1369        <li data-nav-id="/reference/step/services/sqs/" title="Amazon SQS" class="dd-item ">
  1370          <a href="/reference/step/services/sqs/">
  1371          Amazon SQS
  1372          
  1373          </a>
  1374      </li>
  1375       
  1376    
  1377   
  1378  
  1379              
  1380            
  1381              
  1382              
  1383  
  1384  
  1385   
  1386    
  1387      
  1388        <li data-nav-id="/reference/step/services/batch/" title="AWS Batch" class="dd-item ">
  1389          <a href="/reference/step/services/batch/">
  1390          AWS Batch
  1391          
  1392          </a>
  1393      </li>
  1394       
  1395    
  1396   
  1397  
  1398              
  1399            
  1400              
  1401              
  1402  
  1403  
  1404   
  1405    
  1406      
  1407        <li data-nav-id="/reference/step/services/fargate/" title="AWS Fargate" class="dd-item ">
  1408          <a href="/reference/step/services/fargate/">
  1409          AWS Fargate
  1410          
  1411          </a>
  1412      </li>
  1413       
  1414    
  1415   
  1416  
  1417              
  1418            
  1419              
  1420              
  1421  
  1422  
  1423   
  1424    
  1425      
  1426        <li data-nav-id="/reference/step/services/glue/" title="AWS Glue" class="dd-item ">
  1427          <a href="/reference/step/services/glue/">
  1428          AWS Glue
  1429          
  1430          </a>
  1431      </li>
  1432       
  1433    
  1434   
  1435  
  1436              
  1437            
  1438          
  1439          </ul>
  1440                
  1441      </li>
  1442    
  1443   
  1444  
  1445              
  1446            
  1447          
  1448          </ul>
  1449                
  1450      </li>
  1451    
  1452   
  1453  
  1454              
  1455            
  1456              
  1457              
  1458  
  1459  
  1460   
  1461    
  1462      
  1463        <li data-nav-id="/reference/discovery/" title="Discovery Service" class="dd-item ">
  1464          <a href="/reference/discovery/">
  1465          Discovery Service
  1466          
  1467          </a>
  1468      </li>
  1469       
  1470    
  1471   
  1472  
  1473              
  1474            
  1475              
  1476              
  1477  
  1478  
  1479   
  1480    
  1481      
  1482        <li data-nav-id="/reference/docker/" title="Docker" class="dd-item ">
  1483          <a href="/reference/docker/">
  1484          Docker
  1485          
  1486          </a>
  1487      </li>
  1488       
  1489    
  1490   
  1491  
  1492              
  1493            
  1494              
  1495              
  1496  
  1497  
  1498   
  1499    
  1500      
  1501        <li data-nav-id="/reference/hybrid_topologies/" title="Hybrid Topologies" class="dd-item ">
  1502          <a href="/reference/hybrid_topologies/">
  1503          Hybrid Topologies
  1504          
  1505          </a>
  1506      </li>
  1507       
  1508    
  1509   
  1510  
  1511              
  1512            
  1513              
  1514              
  1515  
  1516  
  1517   
  1518    
  1519      
  1520      <li data-nav-id="/reference/operations/" title="" class="dd-item 
  1521          
  1522          
  1523          
  1524          ">
  1525        <a href="/reference/operations/">
  1526            <b>Operations</b>
  1527            
  1528        </a>
  1529        
  1530        
  1531          <ul>
  1532            
  1533            
  1534            
  1535            
  1536          
  1537            
  1538              
  1539              
  1540  
  1541  
  1542   
  1543    
  1544      
  1545        <li data-nav-id="/reference/operations/magefile/" title="Magefiles" class="dd-item ">
  1546          <a href="/reference/operations/magefile/">
  1547          Magefiles
  1548          
  1549          </a>
  1550      </li>
  1551       
  1552    
  1553   
  1554  
  1555              
  1556            
  1557              
  1558              
  1559  
  1560  
  1561   
  1562    
  1563      
  1564        <li data-nav-id="/reference/operations/cloudwatch_alarms/" title="CloudWatch Alarms" class="dd-item ">
  1565          <a href="/reference/operations/cloudwatch_alarms/">
  1566          CloudWatch Alarms
  1567          
  1568          </a>
  1569      </li>
  1570       
  1571    
  1572   
  1573  
  1574              
  1575            
  1576              
  1577              
  1578  
  1579  
  1580   
  1581    
  1582      
  1583        <li data-nav-id="/reference/operations/cloudwatch_dashboard/" title="CloudWatch Dashboard" class="dd-item ">
  1584          <a href="/reference/operations/cloudwatch_dashboard/">
  1585          CloudWatch Dashboard
  1586          
  1587          </a>
  1588      </li>
  1589       
  1590    
  1591   
  1592  
  1593              
  1594            
  1595              
  1596              
  1597  
  1598  
  1599   
  1600    
  1601      
  1602        <li data-nav-id="/reference/operations/codedeploy_service_update/" title="CodeDeploy Service Update" class="dd-item ">
  1603          <a href="/reference/operations/codedeploy_service_update/">
  1604          CodeDeploy Service Update
  1605          
  1606          </a>
  1607      </li>
  1608       
  1609    
  1610   
  1611  
  1612              
  1613            
  1614              
  1615              
  1616  
  1617  
  1618   
  1619    
  1620      
  1621        <li data-nav-id="/reference/operations/cicd/" title="CI/CD" class="dd-item ">
  1622          <a href="/reference/operations/cicd/">
  1623          CI/CD
  1624          
  1625          </a>
  1626      </li>
  1627       
  1628    
  1629   
  1630  
  1631              
  1632            
  1633              
  1634              
  1635  
  1636  
  1637   
  1638    
  1639      
  1640        <li data-nav-id="/reference/operations/deployment_strategies/" title="Deployment Strategies" class="dd-item ">
  1641          <a href="/reference/operations/deployment_strategies/">
  1642          Deployment Strategies
  1643          
  1644          </a>
  1645      </li>
  1646       
  1647    
  1648   
  1649  
  1650              
  1651            
  1652              
  1653              
  1654  
  1655  
  1656   
  1657    
  1658      
  1659        <li data-nav-id="/reference/operations/metrics_publisher/" title="Metrics Publisher" class="dd-item ">
  1660          <a href="/reference/operations/metrics_publisher/">
  1661          Metrics Publisher
  1662          
  1663          </a>
  1664      </li>
  1665       
  1666    
  1667   
  1668  
  1669              
  1670            
  1671              
  1672              
  1673  
  1674  
  1675   
  1676    
  1677      
  1678        <li data-nav-id="/reference/operations/profiling/" title="Profiling" class="dd-item ">
  1679          <a href="/reference/operations/profiling/">
  1680          Profiling
  1681          
  1682          </a>
  1683      </li>
  1684       
  1685    
  1686   
  1687  
  1688              
  1689            
  1690          
  1691          </ul>
  1692                
  1693      </li>
  1694    
  1695   
  1696  
  1697              
  1698            
  1699              
  1700              
  1701  
  1702  
  1703   
  1704    
  1705      
  1706        <li data-nav-id="/reference/testing/" title="Testing" class="dd-item ">
  1707          <a href="/reference/testing/">
  1708          Testing
  1709          
  1710          </a>
  1711      </li>
  1712       
  1713    
  1714   
  1715  
  1716              
  1717            
  1718              
  1719              
  1720  
  1721  
  1722   
  1723    
  1724      
  1725        <li data-nav-id="/reference/supporting_packages/" title="Supporting Packages" class="dd-item ">
  1726          <a href="/reference/supporting_packages/">
  1727          Supporting Packages
  1728          
  1729          </a>
  1730      </li>
  1731       
  1732    
  1733   
  1734  
  1735              
  1736            
  1737              
  1738              
  1739  
  1740  
  1741   
  1742    
  1743      
  1744        <li data-nav-id="/reference/limitations/" title="Limitations" class="dd-item ">
  1745          <a href="/reference/limitations/">
  1746          Limitations
  1747          
  1748          </a>
  1749      </li>
  1750       
  1751    
  1752   
  1753  
  1754              
  1755            
  1756              
  1757              
  1758  
  1759  
  1760   
  1761    
  1762      
  1763        <li data-nav-id="/reference/faq/" title="FAQ" class="dd-item ">
  1764          <a href="/reference/faq/">
  1765          FAQ
  1766          
  1767          </a>
  1768      </li>
  1769       
  1770    
  1771   
  1772  
  1773              
  1774            
  1775          
  1776          </ul>
  1777                
  1778      </li>
  1779    
  1780   
  1781  
  1782            
  1783            
  1784  
  1785  
  1786   
  1787    
  1788      
  1789      <li data-nav-id="/presentations/" title="Presentations" class="dd-item 
  1790          
  1791          
  1792          
  1793          ">
  1794        <a href="/presentations/">
  1795            Presentations
  1796            
  1797        </a>
  1798        
  1799                
  1800      </li>
  1801    
  1802   
  1803  
  1804            
  1805            
  1806  
  1807  
  1808   
  1809    
  1810      
  1811      <li data-nav-id="/meta/" title="Meta" class="dd-item 
  1812          
  1813          
  1814          
  1815          ">
  1816        <a href="/meta/">
  1817            Meta
  1818            
  1819        </a>
  1820        
  1821                
  1822      </li>
  1823    
  1824   
  1825  
  1826            
  1827            
  1828  
  1829  
  1830   
  1831    
  1832      
  1833      <li data-nav-id="/credits/" title="Credits" class="dd-item 
  1834          
  1835          
  1836          
  1837          ">
  1838        <a href="/credits/">
  1839            Credits
  1840            
  1841        </a>
  1842        
  1843                
  1844      </li>
  1845    
  1846   
  1847  
  1848            
  1849           
  1850      </ul>
  1851  
  1852      
  1853      
  1854        <section id="shortcuts">
  1855          <h3>More</h3>
  1856          <ul>
  1857            
  1858                <li> 
  1859                    <a class="padding" href="https://github.com/mweagle/Sparta"><i class='fab fa-fw fa-github'></i> Github repo</a>
  1860                </li>
  1861            
  1862                <li> 
  1863                    <a class="padding" href="https://github.com/mweagle?utf8=%E2%9C%93&amp;tab=repositories&amp;q=Sparta&amp;type=&amp;language="><i class='fas fa-fw fa-camera'></i> Showcases</a>
  1864                </li>
  1865            
  1866                <li> 
  1867                    <a class="padding" href="https://github.com/mweagle/Sparta/blob/master/CHANGES.md"><i class='fas fa-fw fa-signal'></i> Release History</a>
  1868                </li>
  1869            
  1870          </ul>
  1871        </section>
  1872      
  1873  
  1874      
  1875      <section id="footer">
  1876        
  1877    Build: <a target="_blank" href="https://github.com/mweagle/Sparta/commit/46463572">46463572</a><p/>
  1878    Date: 2020-05-02T17:11:50-07:00
  1879  
  1880  
  1881  <p>Built with <a href="https://github.com/matcornic/hugo-theme-learn"><i class="fas fa-heart"></i></a> from <a href="http://getgrav.org">Grav</a> and <a href="http://gohugo.io/">Hugo</a></p>
  1882  
  1883      </section>
  1884    </div>
  1885  </nav>
  1886  
  1887  
  1888  
  1889  
  1890  
  1891          <section id="body">
  1892          <div id="overlay"></div>
  1893          <div class="padding highlightable">
  1894                
  1895                <div>
  1896                  <div id="top-bar">
  1897                  
  1898                    
  1899                    
  1900                    
  1901                    <div id="top-github-link">
  1902                      <a class="github-link" title='Edit this page' href="https://github.com/mweagle/Sparta/tree/docs/content/reference/apigateway/request_params.md" target="blank">
  1903                        <i class="fas fa-code-branch"></i>
  1904                        <span id="top-github-link-text">Edit this page</span>
  1905                      </a>
  1906                    </div>
  1907                    
  1908                  
  1909                  
  1910                  <div id="breadcrumbs" itemscope="" itemtype="http://data-vocabulary.org/Breadcrumb">
  1911                      <span id="sidebar-toggle-span">
  1912                          <a href="#" id="sidebar-toggle" data-sidebar-toggle="">
  1913                            <i class="fas fa-bars"></i>
  1914                          </a>
  1915                      </span>
  1916                    
  1917                    <span id="toc-menu"><i class="fas fa-list-alt"></i></span>
  1918                    
  1919                    <span class="links">
  1920                   
  1921                   
  1922                      
  1923            
  1924            
  1925              
  1926              
  1927            
  1928            
  1929              
  1930              
  1931            
  1932            
  1933              
  1934              
  1935            
  1936            
  1937              <a href='/'></a> > <a href='/reference/'>Reference</a> > <a href='/reference/apigateway/'></a> > Request Parameters
  1938            
  1939           
  1940            
  1941           
  1942            
  1943           
  1944            
  1945          
  1946                   
  1947                    </span>
  1948                  </div>
  1949                  
  1950                      <div class="progress">
  1951      <div class="wrapper">
  1952  <nav id="TableOfContents">
  1953    <ul>
  1954      <li><a href="#lambda-definition">Lambda Definition</a></li>
  1955      <li><a href="#api-gateway">API Gateway</a></li>
  1956      <li><a href="#lambda-binding">Lambda Binding</a></li>
  1957      <li><a href="#resources">Resources</a></li>
  1958      <li><a href="#whitelist-input">Whitelist Input</a></li>
  1959      <li><a href="#provision">Provision</a></li>
  1960      <li><a href="#verify">Verify</a></li>
  1961      <li><a href="#cleanup">Cleanup</a></li>
  1962      <li><a href="#conclusion">Conclusion</a></li>
  1963    </ul>
  1964  </nav>
  1965      </div>
  1966  </div>
  1967  
  1968                  
  1969                </div>
  1970              </div>
  1971              
  1972          <div id="head-tags">
  1973          
  1974          </div>
  1975          
  1976          <div id="body-inner">
  1977            
  1978              <h1>
  1979                
  1980                Request Parameters
  1981              </h1>
  1982            
  1983  
  1984          
  1985  
  1986  
  1987  
  1988  <h1 id="request-parameters">Request Parameters</h1>
  1989  <p>This example demonstrates how to accept client request params supplied as HTTP query params and return an expiring S3 URL to access content.
  1990  The source for this is the <a href="https://github.com/mweagle/SpartaImager/blob/master/application.go#L149">s3ItemInfo</a>
  1991  function defined as part of the  <a href="https://github.com/mweagle/SpartaApplication">SpartaApplication</a>.</p>
  1992  <h2 id="lambda-definition">Lambda Definition</h2>
  1993  <p>Our function will accept two params:</p>
  1994  <ul>
  1995  <li><code>bucketName</code> : The S3 bucket name storing the asset</li>
  1996  <li><code>keyName</code> : The S3 item key</li>
  1997  </ul>
  1998  <p>Those params will be passed as part of the URL query string.  The function will fetch the item metadata, generate an expiring URL for public S3 access, and return a JSON response body with the item data.</p>
  1999  <p>Because <a href="https://github.com/mweagle/SpartaImager/blob/master/application.go#L149">s3ItemInfo</a> is expected to be invoked by the API Gateway, we&rsquo;ll use the AWS Lambda Go type in the function signature:</p>
  2000  <div class="highlight"><pre style="background-color:#fff;-moz-tab-size:2;-o-tab-size:2;tab-size:2"><code class="language-go" data-lang="go"><span style="color:#00f">import</span> (
  2001    spartaAPIGateway <span style="color:#a31515">&#34;github.com/mweagle/Sparta/aws/apigateway&#34;</span>
  2002    spartaEvents <span style="color:#a31515">&#34;github.com/mweagle/Sparta/aws/events&#34;</span>
  2003  )
  2004  
  2005  <span style="color:#00f">func</span> s3ItemInfo(ctx context.Context,
  2006    apigRequest spartaEvents.APIGatewayRequest) (*spartaAPIGateway.Response, <span style="color:#2b91af">error</span>) {
  2007    logger, _ := ctx.Value(sparta.ContextKeyLogger).(*logrus.Logger)
  2008    lambdaContext, _ := awsLambdaContext.FromContext(ctx)
  2009  
  2010    logger.WithFields(logrus.Fields{
  2011      <span style="color:#a31515">&#34;RequestID&#34;</span>: lambdaContext.AwsRequestID,
  2012    }).Info(<span style="color:#a31515">&#34;Request received&#34;</span>)
  2013  
  2014    getObjectInput := &amp;s3.GetObjectInput{
  2015      Bucket: aws.String(apigRequest.QueryParams[<span style="color:#a31515">&#34;bucketName&#34;</span>]),
  2016      Key:    aws.String(apigRequest.QueryParams[<span style="color:#a31515">&#34;keyName&#34;</span>]),
  2017    }
  2018  
  2019    awsSession := spartaAWS.NewSession(logger)
  2020    svc := s3.New(awsSession)
  2021    result, err := svc.GetObject(getObjectInput)
  2022    <span style="color:#00f">if</span> <span style="color:#00f">nil</span> != err {
  2023      <span style="color:#00f">return</span> <span style="color:#00f">nil</span>, err
  2024    }
  2025    presignedReq, _ := svc.GetObjectRequest(getObjectInput)
  2026    url, err := presignedReq.Presign(5 * time.Minute)
  2027    <span style="color:#00f">if</span> <span style="color:#00f">nil</span> != err {
  2028      <span style="color:#00f">return</span> <span style="color:#00f">nil</span>, err
  2029    }
  2030    <span style="color:#00f">return</span> spartaAPIGateway.NewResponse(http.StatusOK,
  2031      &amp;itemInfoResponse{
  2032        S3:  result,
  2033        URL: url,
  2034      }), <span style="color:#00f">nil</span>
  2035  }
  2036  </code></pre></div><p>The <a href="https://godoc.org/github.com/mweagle/Sparta/aws/events#APIGatewayRequest">sparta.APIGatewayRequest</a> fields
  2037  correspond to the Integration Response Mapping template discussed in the <a href="/reference/apigateway/echo_event">previous example</a>
  2038  (see the full mapping template <a href="/reference/apigateway">here</a>.</p>
  2039  <p>Once the event is unmarshaled, we can use it to fetch the S3 item info:</p>
  2040  <div class="highlight"><pre style="background-color:#fff;-moz-tab-size:2;-o-tab-size:2;tab-size:2"><code class="language-go" data-lang="go">getObjectInput := &amp;s3.GetObjectInput{
  2041    Bucket: aws.String(lambdaEvent.QueryParams[<span style="color:#a31515">&#34;bucketName&#34;</span>]),
  2042    Key:    aws.String(lambdaEvent.QueryParams[<span style="color:#a31515">&#34;keyName&#34;</span>]),
  2043  }
  2044  </code></pre></div><p>Assuming there are no errors (including the case where the item does not exist), the
  2045  remainder of the function fetches the data, generates a presigned URL, and returns a JSON response whose
  2046  shape matches the Sparta default <a href="https://docs.aws.amazon.com/apigateway/latest/developerguide/models-mappings.html">mapping templates</a>:</p>
  2047  <div class="highlight"><pre style="background-color:#fff;-moz-tab-size:2;-o-tab-size:2;tab-size:2"><code class="language-go" data-lang="go">awsSession := spartaAWS.NewSession(logger)
  2048  svc := s3.New(awsSession)
  2049  result, err := svc.GetObject(getObjectInput)
  2050  <span style="color:#00f">if</span> <span style="color:#00f">nil</span> != err {
  2051    <span style="color:#00f">return</span> <span style="color:#00f">nil</span>, err
  2052  }
  2053  presignedReq, _ := svc.GetObjectRequest(getObjectInput)
  2054  url, err := presignedReq.Presign(5 * time.Minute)
  2055  <span style="color:#00f">if</span> <span style="color:#00f">nil</span> != err {
  2056    <span style="color:#00f">return</span> <span style="color:#00f">nil</span>, err
  2057  }
  2058  <span style="color:#00f">return</span> spartaAPIGateway.NewResponse(http.StatusOK,
  2059    &amp;itemInfoResponse{
  2060      S3:  result,
  2061      URL: url,
  2062    }), <span style="color:#00f">nil</span>
  2063  </code></pre></div><h2 id="api-gateway">API Gateway</h2>
  2064  <p>The next step is to create a new <a href="https://godoc.org/github.com/mweagle/Sparta#API">API</a> instance via <code>sparta.NewAPIGateway()</code></p>
  2065  <div class="highlight"><pre style="background-color:#fff;-moz-tab-size:2;-o-tab-size:2;tab-size:2"><code class="language-go" data-lang="go">apiStage := sparta.NewStage(<span style="color:#a31515">&#34;v1&#34;</span>)
  2066  apiGateway := sparta.NewAPIGateway(<span style="color:#a31515">&#34;SpartaImagerAPI&#34;</span>, apiStage)
  2067  </code></pre></div><h2 id="lambda-binding">Lambda Binding</h2>
  2068  <p>Next we create an <code>sparta.LambdaAWSInfo</code> struct that references the <code>s3ItemInfo</code> function:</p>
  2069  <div class="highlight"><pre style="background-color:#fff;-moz-tab-size:2;-o-tab-size:2;tab-size:2"><code class="language-go" data-lang="go"><span style="color:#00f">var</span> iamDynamicRole = sparta.IAMRoleDefinition{}
  2070  iamDynamicRole.Privileges = append(iamDynamicRole.Privileges,
  2071    sparta.IAMRolePrivilege{
  2072      Actions:  []<span style="color:#2b91af">string</span>{<span style="color:#a31515">&#34;s3:GetObject&#34;</span>},
  2073      Resource: resourceArn,
  2074    })
  2075  s3ItemInfoLambdaFn, _ := sparta.NewAWSLambda(sparta.LambdaName(s3ItemInfo),
  2076    s3ItemInfo,
  2077    iamDynamicRole)
  2078  s3ItemInfoOptions.Options = &amp;sparta.LambdaFunctionOptions{
  2079    Description: <span style="color:#a31515">&#34;Get information about an item in S3 via querystring params&#34;</span>,
  2080    MemorySize:  128,
  2081    Timeout:     10,
  2082  }
  2083  </code></pre></div><p>A few items to note here:</p>
  2084  <ul>
  2085  <li>We&rsquo;re providing a custom <code>LambdaFunctionOptions</code> in case the request to S3 to get item metadata exceeds the default 3 second timeout.</li>
  2086  <li>We also add a custom <code>iamDynamicRole.Privileges</code> entry to the <code>Privileges</code> slice that authorizes the lambda function to <em>only</em> access objects in a single bucket (<em>resourceArn</em>).
  2087  <ul>
  2088  <li>This bucket ARN is externally created and the ARN provided to this code.</li>
  2089  <li>While the API will accept any <em>bucketName</em> value, it is only authorized to access a single bucket.</li>
  2090  </ul>
  2091  </li>
  2092  </ul>
  2093  <h2 id="resources">Resources</h2>
  2094  <p>The next step is to associate a URL path with the <code>sparta.LambdaAWSInfo</code> struct that represents the <code>s3ItemInfo</code> function. This will be the relative path component used to reference our lambda function via the API Gateway.</p>
  2095  <div class="highlight"><pre style="background-color:#fff;-moz-tab-size:2;-o-tab-size:2;tab-size:2"><code class="language-go" data-lang="go">apiGatewayResource, _ := api.NewResource(<span style="color:#a31515">&#34;/info&#34;</span>, s3ItemInfoLambdaFn)
  2096  method, err := apiGatewayResource.NewMethod(<span style="color:#a31515">&#34;GET&#34;</span>, http.StatusOK)
  2097  <span style="color:#00f">if</span> err != <span style="color:#00f">nil</span> {
  2098    <span style="color:#00f">return</span> <span style="color:#00f">nil</span>, err
  2099  }
  2100  </code></pre></div><h2 id="whitelist-input">Whitelist Input</h2>
  2101  <p>The final step is to add the whitelisted parameters to the Method definition.</p>
  2102  <div class="highlight"><pre style="background-color:#fff;-moz-tab-size:2;-o-tab-size:2;tab-size:2"><code class="language-go" data-lang="go"><span style="color:#008000">// Whitelist query string params
  2103  </span><span style="color:#008000"></span>method.Parameters[<span style="color:#a31515">&#34;method.request.querystring.keyName&#34;</span>] = <span style="color:#00f">true</span>
  2104  method.Parameters[<span style="color:#a31515">&#34;method.request.querystring.bucketName&#34;</span>] = <span style="color:#00f">true</span>
  2105  </code></pre></div><p>Note that the keynames in the <code>method.Parameters</code> map must be of the form: <strong>method.request.{location}.{name}</strong> where location is one of:</p>
  2106  <ul>
  2107  <li><code>querystring</code></li>
  2108  <li><code>path</code></li>
  2109  <li><code>header</code></li>
  2110  </ul>
  2111  <p>See the <a href="http://docs.aws.amazon.com/apigateway/api-reference/resource/method/#requestParameters">REST documentation</a> for more information.</p>
  2112  <h2 id="provision">Provision</h2>
  2113  <p>With everything configured, let&rsquo;s provision the stack:</p>
  2114  <pre><code class="language-nohighlight" data-lang="nohighlight">go run application.go --level debug provision --s3Bucket $S3_BUCKET
  2115  </code></pre><p>and check the results.</p>
  2116  <h2 id="verify">Verify</h2>
  2117  <p>As this Sparta application includes an API Gateway definition, the stack <code>Outputs</code> includes the API Gateway URL:</p>
  2118  <div class="highlight"><pre style="background-color:#fff;-moz-tab-size:2;-o-tab-size:2;tab-size:2"><code class="language-text" data-lang="text">INFO[0243] Stack Outputs ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
  2119  INFO[0243]     APIGatewayURL                             Description=&#34;API Gateway URL&#34; Value=&#34;https://xccmsl98p1.execute-api.us-west-2.amazonaws.com/v1&#34;
  2120  INFO[0243] Stack provisioned                             CreationTime=&#34;2018-12-11 14:56:41.051 +0000 UTC&#34; StackId=&#34;arn:aws:cloudformation:us-west-2:123412341234:stack/SpartaImager-mweagle/f7b7d3e0-fd54-11e8-9064-0aa3372404a6&#34; StackName=SpartaImager-mweagle
  2121  INFO[0243] ════════════════════════════════════════════════
  2122  </code></pre></div><p>Let&rsquo;s fetch an item we know exists:</p>
  2123  <pre><code class="language-nohighlight" data-lang="nohighlight">$ curl -vs &quot;https://xccmsl98p1.execute-api.us-west-2.amazonaws.com/v1/info?keyName=twitterAvatar.jpg&amp;bucketName=weagle-public&quot;
  2124  
  2125  *   Trying 13.32.254.241...
  2126  * TCP_NODELAY set
  2127  * Connected to xccmsl98p1.execute-api.us-west-2.amazonaws.com (13.32.254.241) port 443 (#0)
  2128  * ALPN, offering h2
  2129  * ALPN, offering http/1.1
  2130  * Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
  2131  * successfully set certificate verify locations:
  2132  *   CAfile: /etc/ssl/cert.pem
  2133    CApath: none
  2134  * TLSv1.2 (OUT), TLS handshake, Client hello (1):
  2135  * TLSv1.2 (IN), TLS handshake, Server hello (2):
  2136  * TLSv1.2 (IN), TLS handshake, Certificate (11):
  2137  * TLSv1.2 (IN), TLS handshake, Server key exchange (12):
  2138  * TLSv1.2 (IN), TLS handshake, Server finished (14):
  2139  * TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
  2140  * TLSv1.2 (OUT), TLS change cipher, Client hello (1):
  2141  * TLSv1.2 (OUT), TLS handshake, Finished (20):
  2142  * TLSv1.2 (IN), TLS change cipher, Client hello (1):
  2143  * TLSv1.2 (IN), TLS handshake, Finished (20):
  2144  * SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
  2145  * ALPN, server accepted to use h2
  2146  * Server certificate:
  2147  *  subject: CN=*.execute-api.us-west-2.amazonaws.com
  2148  *  start date: Oct  9 00:00:00 2018 GMT
  2149  *  expire date: Oct  9 12:00:00 2019 GMT
  2150  *  subjectAltName: host &quot;xccmsl98p1.execute-api.us-west-2.amazonaws.com&quot; matched cert's &quot;*.execute-api.us-west-2.amazonaws.com&quot;
  2151  *  issuer: C=US; O=Amazon; OU=Server CA 1B; CN=Amazon
  2152  *  SSL certificate verify ok.
  2153  * Using HTTP2, server supports multi-use
  2154  * Connection state changed (HTTP/2 confirmed)
  2155  * Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
  2156  * Using Stream ID: 1 (easy handle 0x7ff68b802c00)
  2157  &gt; GET /v1/info?keyName=twitterAvatar.jpg&amp;bucketName=weagle-public HTTP/2
  2158  &gt; Host: xccmsl98p1.execute-api.us-west-2.amazonaws.com
  2159  &gt; User-Agent: curl/7.54.0
  2160  &gt; Accept: */*
  2161  &gt;
  2162  * Connection state changed (MAX_CONCURRENT_STREAMS updated)!
  2163  &lt; HTTP/2 200
  2164  &lt; content-type: application/json
  2165  &lt; content-length: 1539
  2166  &lt; date: Tue, 11 Dec 2018 15:08:56 GMT
  2167  &lt; x-amzn-requestid: aded8786-fd56-11e8-836c-dff86eb3938d
  2168  &lt; access-control-allow-origin: *
  2169  &lt; access-control-allow-headers: Content-Type,X-Amz-Date,Authorization,X-Api-Key
  2170  &lt; x-amz-apigw-id: Rv3pRH8jPHcFTfA=
  2171  &lt; access-control-allow-methods: *
  2172  &lt; x-amzn-trace-id: Root=1-5c0fd308-f576dae00848eb44535a5c70;Sampled=0
  2173  &lt; x-cache: Miss from cloudfront
  2174  &lt; via: 1.1 8ddadd1ab84a7f1bef108d6a72eccf06.cloudfront.net (CloudFront)
  2175  &lt; x-amz-cf-id: OO01Dua9x5dHyXr-arKJ3LKu2ahbPYv5ESqUg2lAhlzLJDQTLVyW_A==
  2176  &lt;
  2177  {&quot;S3&quot;:{&quot;AcceptRanges&quot;:&quot;bytes&quot;,&quot;Body&quot;:{},&quot;CacheControl&quot;:null,&quot;ContentDisposition&quot;:null,&quot;ContentEncoding&quot;:null,&quot;ContentLanguage&quot;:null,&quot;ContentLength&quot;:613560,&quot;ContentRange&quot;:null,&quot;ContentType&quot;:&quot;image/jpeg&quot;,&quot;DeleteMarker&quot;:null,&quot;ETag&quot;:&quot;\&quot;7250a1802a5e2f94532b9ee38429a3fd\&quot;&quot;,&quot;Expiration&quot;:null,&quot;Expires&quot;:null,&quot;LastModified&quot;:&quot;2018-03-14T14:55:19Z&quot;,&quot;Metadata&quot;:{},&quot;MissingMeta&quot;:null,&quot;ObjectLockLegalHoldStatus&quot;:null,&quot;ObjectLockMode&quot;:null,&quot;ObjectLockRetainUntilDate&quot;:null,&quot;PartsCount&quot;:null,&quot;ReplicationStatus&quot;:null,&quot;RequestCharged&quot;:null,&quot;Restore&quot;:null,&quot;SSECustomerAlgorithm&quot;:null,&quot;SSECustomerKeyMD5&quot;:null,&quot;SSEKMSKeyId&quot;:null,&quot;ServerSideEncryption&quot;:null,&quot;StorageClass&quot;:null,&quot;TagCount&quot;:null,&quot;VersionId&quot;:null,&quot;WebsiteRedirectLocation&quot;:null},&quot;URL&quot;:&quot;https://weagle-public.s3.us-west-2.amazonaws.com/twitterAvatar.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&amp;X-Amz-Credential=ASIAQMUWTUUFF65WLRLE%2F20181211%2Fus-west-2%2Fs3%2Faws4_request&amp;X-Amz-Date=20181211T150856Z&amp;X-Amz-Expires=300&amp;X-Amz-Security-Token=FQoGZXIvYXdzEIH%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaDMMVITmbkwrrxznAHCL9AaUQwfC%2F%2F6go%2FKBZigDuI4BLLwJzqiwhquTZ9TR1oxVKOAA0h6WzWUEfjjOjZK56SFk3cIJ%2FjKIBmImKpTIGyN7fn48s6N51RFFxra2Mamrp1pDqEcP4VswnJH8C5Q7ZfmltJDiFqLbd4FCQdgoGT228Ls49Uo24EyT%2B%2BTL%2Fl0sKTVYtI1MbGSK%2B%2BKZ6rpPEsyR%2FTuIdeDvA1P%2BRlMEyvr0NhO7Wpf7ZZMs3taNcUMQDRmARyIgAp87ziwIavUTaPqbgpGNqJ6XAO%2Byf3y0g9JurYj44HrwpLWmuF5g%2B%2FtLv8VikzqD8GuWARJuo%2BPlH54KmcMrbXBpLq9sZl2Io3KO%2F4AU%3D&amp;X-Amz-SignedHeaders=host&amp;X-Amz-Signature=88976d33d4cdefff02265e1f40e4d18005231672f1a6e41ad12733f0ce97e91b&quot;}
  2178  </code></pre><p>Pretty printing the response body:</p>
  2179  <div class="highlight"><pre style="background-color:#fff;-moz-tab-size:2;-o-tab-size:2;tab-size:2"><code class="language-json" data-lang="json">{
  2180      &#34;S3&#34;: {
  2181          &#34;AcceptRanges&#34;: <span style="color:#a31515">&#34;bytes&#34;</span>,
  2182          &#34;Body&#34;: {},
  2183          &#34;CacheControl&#34;: <span style="color:#00f">null</span>,
  2184          &#34;ContentDisposition&#34;: <span style="color:#00f">null</span>,
  2185          &#34;ContentEncoding&#34;: <span style="color:#00f">null</span>,
  2186          &#34;ContentLanguage&#34;: <span style="color:#00f">null</span>,
  2187          &#34;ContentLength&#34;: 613560,
  2188          &#34;ContentRange&#34;: <span style="color:#00f">null</span>,
  2189          &#34;ContentType&#34;: <span style="color:#a31515">&#34;image/jpeg&#34;</span>,
  2190          &#34;DeleteMarker&#34;: <span style="color:#00f">null</span>,
  2191          &#34;ETag&#34;: <span style="color:#a31515">&#34;\&#34;7250a1802a5e2f94532b9ee38429a3fd\&#34;&#34;</span>,
  2192          &#34;Expiration&#34;: <span style="color:#00f">null</span>,
  2193          &#34;Expires&#34;: <span style="color:#00f">null</span>,
  2194          &#34;LastModified&#34;: <span style="color:#a31515">&#34;2018-03-14T14:55:19Z&#34;</span>,
  2195          &#34;Metadata&#34;: {},
  2196          &#34;MissingMeta&#34;: <span style="color:#00f">null</span>,
  2197          &#34;ObjectLockLegalHoldStatus&#34;: <span style="color:#00f">null</span>,
  2198          &#34;ObjectLockMode&#34;: <span style="color:#00f">null</span>,
  2199          &#34;ObjectLockRetainUntilDate&#34;: <span style="color:#00f">null</span>,
  2200          &#34;PartsCount&#34;: <span style="color:#00f">null</span>,
  2201          &#34;ReplicationStatus&#34;: <span style="color:#00f">null</span>,
  2202          &#34;RequestCharged&#34;: <span style="color:#00f">null</span>,
  2203          &#34;Restore&#34;: <span style="color:#00f">null</span>,
  2204          &#34;SSECustomerAlgorithm&#34;: <span style="color:#00f">null</span>,
  2205          &#34;SSECustomerKeyMD5&#34;: <span style="color:#00f">null</span>,
  2206          &#34;SSEKMSKeyId&#34;: <span style="color:#00f">null</span>,
  2207          &#34;ServerSideEncryption&#34;: <span style="color:#00f">null</span>,
  2208          &#34;StorageClass&#34;: <span style="color:#00f">null</span>,
  2209          &#34;TagCount&#34;: <span style="color:#00f">null</span>,
  2210          &#34;VersionId&#34;: <span style="color:#00f">null</span>,
  2211          &#34;WebsiteRedirectLocation&#34;: <span style="color:#00f">null</span>
  2212      },
  2213      &#34;URL&#34;: <span style="color:#a31515">&#34;https://weagle-public.s3.us-west-2.amazonaws.com/twitterAvatar.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&amp;X-Amz-Credential=ASIAQMUWTUUFF65WLRLE%2F20181211%2Fus-west-2%2Fs3%2Faws4_request&amp;X-Amz-Date=20181211T150856Z&amp;X-Amz-Expires=300&amp;X-Amz-Security-Token=FQoGZXIvYXdzEIH%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaDMMVITmbkwrrxznAHCL9AaUQwfC%2F%2F6go%2FKBZigDuI4BLLwJzqiwhquTZ9TR1oxVKOAA0h6WzWUEfjjOjZK56SFk3cIJ%2FjKIBmImKpTIGyN7fn48s6N51RFFxra2Mamrp1pDqEcP4VswnJH8C5Q7ZfmltJDiFqLbd4FCQdgoGT228Ls49Uo24EyT%2B%2BTL%2Fl0sKTVYtI1MbGSK%2B%2BKZ6rpPEsyR%2FTuIdeDvA1P%2BRlMEyvr0NhO7Wpf7ZZMs3taNcUMQDRmARyIgAp87ziwIavUTaPqbgpGNqJ6XAO%2Byf3y0g9JurYj44HrwpLWmuF5g%2B%2FtLv8VikzqD8GuWARJuo%2BPlH54KmcMrbXBpLq9sZl2Io3KO%2F4AU%3D&amp;X-Amz-SignedHeaders=host&amp;X-Amz-Signature=88976d33d4cdefff02265e1f40e4d18005231672f1a6e41ad12733f0ce97e91b&#34;</span>
  2214  }
  2215  </code></pre></div><p>What about an item that we know doesn&rsquo;t exist, but is in the bucket our lambda function has privileges to access:</p>
  2216  <div class="highlight"><pre style="background-color:#fff;-moz-tab-size:2;-o-tab-size:2;tab-size:2"><code class="language-text" data-lang="text">$ curl -vs &#34;https://xccmsl98p1.execute-api.us-west-2.amazonaws.com/v1/info?keyName=NOT_HERE.jpg&amp;bucketName=weagle-public&#34;
  2217  
  2218  *   Trying 13.32.254.241...
  2219  * TCP_NODELAY set
  2220  * Connected to xccmsl98p1.execute-api.us-west-2.amazonaws.com (13.32.254.241) port 443 (#0)
  2221  * ALPN, offering h2
  2222  * ALPN, offering http/1.1
  2223  * Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
  2224  * successfully set certificate verify locations:
  2225  *   CAfile: /etc/ssl/cert.pem
  2226    CApath: none
  2227  * TLSv1.2 (OUT), TLS handshake, Client hello (1):
  2228  * TLSv1.2 (IN), TLS handshake, Server hello (2):
  2229  * TLSv1.2 (IN), TLS handshake, Certificate (11):
  2230  * TLSv1.2 (IN), TLS handshake, Server key exchange (12):
  2231  * TLSv1.2 (IN), TLS handshake, Server finished (14):
  2232  * TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
  2233  * TLSv1.2 (OUT), TLS change cipher, Client hello (1):
  2234  * TLSv1.2 (OUT), TLS handshake, Finished (20):
  2235  * TLSv1.2 (IN), TLS change cipher, Client hello (1):
  2236  * TLSv1.2 (IN), TLS handshake, Finished (20):
  2237  * SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
  2238  * ALPN, server accepted to use h2
  2239  * Server certificate:
  2240  *  subject: CN=*.execute-api.us-west-2.amazonaws.com
  2241  *  start date: Oct  9 00:00:00 2018 GMT
  2242  *  expire date: Oct  9 12:00:00 2019 GMT
  2243  *  subjectAltName: host &#34;xccmsl98p1.execute-api.us-west-2.amazonaws.com&#34; matched cert&#39;s &#34;*.execute-api.us-west-2.amazonaws.com&#34;
  2244  *  issuer: C=US; O=Amazon; OU=Server CA 1B; CN=Amazon
  2245  *  SSL certificate verify ok.
  2246  * Using HTTP2, server supports multi-use
  2247  * Connection state changed (HTTP/2 confirmed)
  2248  * Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
  2249  * Using Stream ID: 1 (easy handle 0x7f9e4f00b600)
  2250  &gt; GET /v1/info?keyName=twitterAvatarArgh.jpg&amp;bucketName=weagle HTTP/2
  2251  &gt; Host: xccmsl98p1.execute-api.us-west-2.amazonaws.com
  2252  &gt; User-Agent: curl/7.54.0
  2253  &gt; Accept: */*
  2254  &gt;
  2255  * Connection state changed (MAX_CONCURRENT_STREAMS updated)!
  2256  &lt; HTTP/2 404
  2257  &lt; content-type: application/json
  2258  &lt; content-length: 177
  2259  &lt; date: Tue, 11 Dec 2018 15:21:18 GMT
  2260  &lt; x-amzn-requestid: 675edef9-fd58-11e8-ae45-3fac75041f4d
  2261  &lt; access-control-allow-origin: *
  2262  &lt; access-control-allow-headers: Content-Type,X-Amz-Date,Authorization,X-Api-Key
  2263  &lt; x-amz-apigw-id: Rv5dAETkvHcFvYg=
  2264  &lt; access-control-allow-methods: *
  2265  &lt; x-amzn-trace-id: Root=1-5c0fd5ec-1d8bba64519f71126c12b4d6;Sampled=0
  2266  &lt; x-cache: Error from cloudfront
  2267  &lt; via: 1.1 4c4ed81695980f3c6829b9fd229bd0f8.cloudfront.net (CloudFront)
  2268  &lt; x-amz-cf-id: ZT5R4BUSAkZpT46s_wCjBImHsM3w6mHFlYG0lnfwONSkPCgxzOQ_lQ==
  2269  &lt;
  2270  {&#34;error&#34;:&#34;AccessDenied: Access Denied\n\tstatus code: 403, request id: A10C69E17E4C9D00, host id: pAnhP+tg9rDh0yP5FJyC8bSnj1GJJjJvAFXwiluW4yHnVvt5EvkvkpKA4UzjJmCoFyI8hGST6YE=&#34;}
  2271  * Connection #0 to host xccmsl98p1.execute-api.us-west-2.amazonaws.com left intact
  2272  </code></pre></div><p>And finally, what if we try to access a bucket that our lambda function isn&rsquo;t authorized to access:</p>
  2273  <div class="highlight"><pre style="background-color:#fff;-moz-tab-size:2;-o-tab-size:2;tab-size:2"><code class="language-text" data-lang="text">$ curl -vs &#34;https://xccmsl98p1.execute-api.us-west-2.amazonaws.com/v1/info?keyName=NOT_HERE.jpg&amp;bucketName=VERY_PRIVATE_BUCKET&#34;
  2274  
  2275  *   Trying 13.32.254.241...
  2276  * TCP_NODELAY set
  2277  * Connected to xccmsl98p1.execute-api.us-west-2.amazonaws.com (13.32.254.241) port 443 (#0)
  2278  * ALPN, offering h2
  2279  * ALPN, offering http/1.1
  2280  * Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
  2281  * successfully set certificate verify locations:
  2282  *   CAfile: /etc/ssl/cert.pem
  2283    CApath: none
  2284  * TLSv1.2 (OUT), TLS handshake, Client hello (1):
  2285  * TLSv1.2 (IN), TLS handshake, Server hello (2):
  2286  * TLSv1.2 (IN), TLS handshake, Certificate (11):
  2287  * TLSv1.2 (IN), TLS handshake, Server key exchange (12):
  2288  * TLSv1.2 (IN), TLS handshake, Server finished (14):
  2289  * TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
  2290  * TLSv1.2 (OUT), TLS change cipher, Client hello (1):
  2291  * TLSv1.2 (OUT), TLS handshake, Finished (20):
  2292  * TLSv1.2 (IN), TLS change cipher, Client hello (1):
  2293  * TLSv1.2 (IN), TLS handshake, Finished (20):
  2294  * SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
  2295  * ALPN, server accepted to use h2
  2296  * Server certificate:
  2297  *  subject: CN=*.execute-api.us-west-2.amazonaws.com
  2298  *  start date: Oct  9 00:00:00 2018 GMT
  2299  *  expire date: Oct  9 12:00:00 2019 GMT
  2300  *  subjectAltName: host &#34;xccmsl98p1.execute-api.us-west-2.amazonaws.com&#34; matched cert&#39;s &#34;*.execute-api.us-west-2.amazonaws.com&#34;
  2301  *  issuer: C=US; O=Amazon; OU=Server CA 1B; CN=Amazon
  2302  *  SSL certificate verify ok.
  2303  * Using HTTP2, server supports multi-use
  2304  * Connection state changed (HTTP/2 confirmed)
  2305  * Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
  2306  * Using Stream ID: 1 (easy handle 0x7f9e4f00b600)
  2307  &gt; GET /v1/info?keyName=twitterAvatarArgh.jpg&amp;bucketName=weagle HTTP/2
  2308  &gt; Host: xccmsl98p1.execute-api.us-west-2.amazonaws.com
  2309  &gt; User-Agent: curl/7.54.0
  2310  &gt; Accept: */*
  2311  &gt;
  2312  * Connection state changed (MAX_CONCURRENT_STREAMS updated)!
  2313  &lt; HTTP/2 404
  2314  &lt; content-type: application/json
  2315  &lt; content-length: 177
  2316  &lt; date: Tue, 11 Dec 2018 15:21:18 GMT
  2317  &lt; x-amzn-requestid: 675edef9-fd58-11e8-ae45-3fac75041f4d
  2318  &lt; access-control-allow-origin: *
  2319  &lt; access-control-allow-headers: Content-Type,X-Amz-Date,Authorization,X-Api-Key
  2320  &lt; x-amz-apigw-id: Rv5dAETkvHcFvYg=
  2321  &lt; access-control-allow-methods: *
  2322  &lt; x-amzn-trace-id: Root=1-5c0fd5ec-1d8bba64519f71126c12b4d6;Sampled=0
  2323  &lt; x-cache: Error from cloudfront
  2324  &lt; via: 1.1 4c4ed81695980f3c6829b9fd229bd0f8.cloudfront.net (CloudFront)
  2325  &lt; x-amz-cf-id: ZT5R4BUSAkZpT46s_wCjBImHsM3w6mHFlYG0lnfwONSkPCgxzOQ_lQ==
  2326  &lt;
  2327  {&#34;error&#34;:&#34;AccessDenied: Access Denied\n\tstatus code: 403, request id: A10C69E17E4C9D00, host id: pAnhP+tg9rDh0yP5FJyC8bSnj1GJJjJvAFXwiluW4yHnVvt5EvkvkpKA4UzjJmCoFyI8hGST6YE=&#34;}
  2328  * Connection #0 to host xccmsl98p1.execute-api.us-west-2.amazonaws.com left intact
  2329  </code></pre></div><h2 id="cleanup">Cleanup</h2>
  2330  <p>Before moving on, remember to decommission the service via:</p>
  2331  <pre><code class="language-nohighlight" data-lang="nohighlight">go run application.go delete
  2332  </code></pre><h2 id="conclusion">Conclusion</h2>
  2333  <p>With this example we&rsquo;ve walked through a simple example that whitelists user input, uses IAM Roles to
  2334  limit what S3 buckets a lambda function may access, and returns an <em>application/json</em> response to the caller.</p>
  2335  
  2336  
  2337  <footer class="footline">
  2338  	
  2339  </footer>
  2340  
  2341  
  2342  </div> 
  2343  
  2344  
  2345  </div>
  2346  
  2347  <div id="navigation">
  2348  
  2349  
  2350  
  2351  
  2352  
  2353  
  2354      
  2355          
  2356          
  2357      
  2358      
  2359  
  2360          
  2361          
  2362              
  2363          
  2364          
  2365  
  2366          
  2367              
  2368  
  2369  
  2370      
  2371          
  2372              
  2373              
  2374          
  2375      
  2376      
  2377  
  2378          
  2379          
  2380          
  2381  
  2382          
  2383  
  2384  
  2385          
  2386              
  2387  
  2388  
  2389      
  2390          
  2391      
  2392      
  2393  
  2394          
  2395          
  2396          
  2397  
  2398          
  2399              
  2400  
  2401  
  2402      
  2403          
  2404      
  2405      
  2406  
  2407          
  2408          
  2409          
  2410  
  2411          
  2412  
  2413  
  2414          
  2415              
  2416  
  2417  
  2418      
  2419          
  2420      
  2421      
  2422  
  2423          
  2424          
  2425          
  2426  
  2427          
  2428  
  2429  
  2430          
  2431  
  2432  
  2433          
  2434              
  2435  
  2436  
  2437      
  2438          
  2439      
  2440      
  2441  
  2442          
  2443          
  2444          
  2445  
  2446          
  2447  
  2448  
  2449          
  2450              
  2451  
  2452  
  2453      
  2454          
  2455          
  2456      
  2457      
  2458  
  2459          
  2460          
  2461              
  2462          
  2463          
  2464  
  2465          
  2466              
  2467  
  2468  
  2469      
  2470          
  2471          
  2472      
  2473      
  2474  
  2475          
  2476          
  2477          
  2478  
  2479          
  2480              
  2481  
  2482  
  2483      
  2484          
  2485              
  2486              
  2487          
  2488      
  2489      
  2490  
  2491          
  2492          
  2493          
  2494  
  2495          
  2496  
  2497  
  2498          
  2499              
  2500  
  2501  
  2502      
  2503          
  2504          
  2505      
  2506      
  2507  
  2508          
  2509          
  2510          
  2511  
  2512          
  2513  
  2514  
  2515          
  2516              
  2517  
  2518  
  2519      
  2520          
  2521              
  2522              
  2523          
  2524      
  2525      
  2526  
  2527          
  2528          
  2529          
  2530  
  2531          
  2532  
  2533  
  2534          
  2535              
  2536  
  2537  
  2538      
  2539          
  2540      
  2541      
  2542  
  2543          
  2544          
  2545          
  2546  
  2547          
  2548  
  2549  
  2550          
  2551              
  2552  
  2553  
  2554      
  2555          
  2556      
  2557      
  2558  
  2559          
  2560          
  2561          
  2562  
  2563          
  2564  
  2565  
  2566          
  2567              
  2568  
  2569  
  2570      
  2571          
  2572      
  2573      
  2574  
  2575          
  2576          
  2577          
  2578  
  2579          
  2580  
  2581  
  2582          
  2583  
  2584  
  2585          
  2586              
  2587  
  2588  
  2589      
  2590          
  2591      
  2592      
  2593  
  2594          
  2595          
  2596          
  2597  
  2598          
  2599  
  2600  
  2601          
  2602              
  2603  
  2604  
  2605      
  2606          
  2607      
  2608      
  2609  
  2610          
  2611          
  2612          
  2613  
  2614          
  2615              
  2616  
  2617  
  2618      
  2619          
  2620      
  2621      
  2622  
  2623          
  2624          
  2625          
  2626  
  2627          
  2628  
  2629  
  2630          
  2631              
  2632  
  2633  
  2634      
  2635          
  2636      
  2637      
  2638  
  2639          
  2640          
  2641          
  2642  
  2643          
  2644  
  2645  
  2646          
  2647              
  2648  
  2649  
  2650      
  2651          
  2652      
  2653      
  2654  
  2655          
  2656          
  2657          
  2658  
  2659          
  2660  
  2661  
  2662          
  2663              
  2664  
  2665  
  2666      
  2667          
  2668      
  2669      
  2670  
  2671          
  2672          
  2673          
  2674  
  2675          
  2676  
  2677  
  2678          
  2679              
  2680  
  2681  
  2682      
  2683          
  2684      
  2685      
  2686  
  2687          
  2688          
  2689          
  2690  
  2691          
  2692  
  2693  
  2694          
  2695              
  2696  
  2697  
  2698      
  2699          
  2700      
  2701      
  2702  
  2703          
  2704          
  2705          
  2706  
  2707          
  2708  
  2709  
  2710          
  2711              
  2712  
  2713  
  2714      
  2715          
  2716      
  2717      
  2718  
  2719          
  2720          
  2721          
  2722  
  2723          
  2724  
  2725  
  2726          
  2727              
  2728  
  2729  
  2730      
  2731          
  2732      
  2733      
  2734  
  2735          
  2736          
  2737          
  2738  
  2739          
  2740  
  2741  
  2742          
  2743              
  2744  
  2745  
  2746      
  2747          
  2748      
  2749      
  2750  
  2751          
  2752          
  2753          
  2754  
  2755          
  2756  
  2757  
  2758          
  2759              
  2760  
  2761  
  2762      
  2763          
  2764      
  2765      
  2766  
  2767          
  2768          
  2769          
  2770  
  2771          
  2772  
  2773  
  2774          
  2775              
  2776  
  2777  
  2778      
  2779          
  2780      
  2781      
  2782  
  2783          
  2784          
  2785          
  2786  
  2787          
  2788  
  2789  
  2790          
  2791  
  2792  
  2793          
  2794              
  2795  
  2796  
  2797      
  2798          
  2799      
  2800      
  2801  
  2802          
  2803          
  2804          
  2805  
  2806          
  2807              
  2808  
  2809  
  2810      
  2811          
  2812      
  2813      
  2814  
  2815          
  2816          
  2817          
  2818  
  2819          
  2820  
  2821  
  2822          
  2823              
  2824  
  2825  
  2826      
  2827          
  2828      
  2829      
  2830  
  2831          
  2832          
  2833          
  2834  
  2835          
  2836  
  2837  
  2838          
  2839              
  2840  
  2841  
  2842      
  2843          
  2844      
  2845      
  2846  
  2847          
  2848          
  2849          
  2850  
  2851          
  2852  
  2853  
  2854          
  2855              
  2856  
  2857  
  2858      
  2859          
  2860      
  2861      
  2862  
  2863          
  2864          
  2865          
  2866  
  2867          
  2868  
  2869  
  2870          
  2871              
  2872  
  2873  
  2874      
  2875          
  2876      
  2877      
  2878  
  2879          
  2880          
  2881          
  2882  
  2883          
  2884  
  2885  
  2886          
  2887              
  2888  
  2889  
  2890      
  2891          
  2892      
  2893      
  2894  
  2895          
  2896          
  2897          
  2898  
  2899          
  2900  
  2901  
  2902          
  2903              
  2904  
  2905  
  2906      
  2907          
  2908      
  2909      
  2910  
  2911          
  2912          
  2913          
  2914  
  2915          
  2916  
  2917  
  2918          
  2919              
  2920  
  2921  
  2922      
  2923          
  2924      
  2925      
  2926  
  2927          
  2928          
  2929          
  2930  
  2931          
  2932  
  2933  
  2934          
  2935              
  2936  
  2937  
  2938      
  2939          
  2940      
  2941      
  2942  
  2943          
  2944          
  2945          
  2946  
  2947          
  2948  
  2949  
  2950          
  2951  
  2952  
  2953          
  2954              
  2955  
  2956  
  2957      
  2958          
  2959      
  2960      
  2961  
  2962          
  2963          
  2964          
  2965  
  2966          
  2967              
  2968  
  2969  
  2970      
  2971          
  2972      
  2973      
  2974  
  2975          
  2976          
  2977          
  2978  
  2979          
  2980  
  2981  
  2982          
  2983              
  2984  
  2985  
  2986      
  2987          
  2988      
  2989      
  2990  
  2991          
  2992          
  2993          
  2994  
  2995          
  2996  
  2997  
  2998          
  2999              
  3000  
  3001  
  3002      
  3003          
  3004      
  3005      
  3006  
  3007          
  3008          
  3009          
  3010  
  3011          
  3012  
  3013  
  3014          
  3015              
  3016  
  3017  
  3018      
  3019          
  3020      
  3021      
  3022  
  3023          
  3024          
  3025          
  3026  
  3027          
  3028  
  3029  
  3030          
  3031              
  3032  
  3033  
  3034      
  3035          
  3036      
  3037      
  3038  
  3039          
  3040          
  3041          
  3042  
  3043          
  3044  
  3045  
  3046          
  3047              
  3048  
  3049  
  3050      
  3051          
  3052      
  3053      
  3054  
  3055          
  3056          
  3057          
  3058  
  3059          
  3060  
  3061  
  3062          
  3063              
  3064  
  3065  
  3066      
  3067          
  3068      
  3069      
  3070  
  3071          
  3072          
  3073          
  3074  
  3075          
  3076  
  3077  
  3078          
  3079  
  3080  
  3081          
  3082              
  3083  
  3084  
  3085      
  3086          
  3087      
  3088      
  3089  
  3090          
  3091          
  3092          
  3093  
  3094          
  3095              
  3096  
  3097  
  3098      
  3099          
  3100      
  3101      
  3102  
  3103          
  3104          
  3105          
  3106  
  3107          
  3108  
  3109  
  3110          
  3111  
  3112  
  3113          
  3114              
  3115  
  3116  
  3117      
  3118          
  3119      
  3120      
  3121  
  3122          
  3123          
  3124          
  3125  
  3126          
  3127  
  3128  
  3129          
  3130              
  3131  
  3132  
  3133      
  3134          
  3135      
  3136      
  3137  
  3138          
  3139          
  3140          
  3141  
  3142          
  3143              
  3144  
  3145  
  3146      
  3147          
  3148      
  3149      
  3150  
  3151          
  3152          
  3153          
  3154  
  3155          
  3156  
  3157  
  3158          
  3159              
  3160  
  3161  
  3162      
  3163          
  3164      
  3165      
  3166  
  3167          
  3168          
  3169          
  3170  
  3171          
  3172  
  3173  
  3174          
  3175              
  3176  
  3177  
  3178      
  3179          
  3180      
  3181      
  3182  
  3183          
  3184          
  3185          
  3186  
  3187          
  3188  
  3189  
  3190          
  3191              
  3192  
  3193  
  3194      
  3195          
  3196      
  3197      
  3198  
  3199          
  3200          
  3201          
  3202  
  3203          
  3204  
  3205  
  3206          
  3207              
  3208  
  3209  
  3210      
  3211          
  3212      
  3213      
  3214  
  3215          
  3216          
  3217          
  3218  
  3219          
  3220  
  3221  
  3222          
  3223  
  3224  
  3225          
  3226              
  3227  
  3228  
  3229      
  3230          
  3231      
  3232      
  3233  
  3234          
  3235          
  3236              
  3237          
  3238          
  3239  
  3240          
  3241              
  3242  
  3243  
  3244      
  3245          
  3246      
  3247      
  3248  
  3249          
  3250          
  3251          
  3252  
  3253          
  3254  
  3255  
  3256          
  3257              
  3258  
  3259  
  3260      
  3261          
  3262      
  3263      
  3264  
  3265          
  3266          
  3267          
  3268  
  3269          
  3270  
  3271  
  3272          
  3273              
  3274  
  3275  
  3276      
  3277          
  3278      
  3279      
  3280  
  3281          
  3282          
  3283          
  3284  
  3285          
  3286              
  3287  
  3288  
  3289      
  3290          
  3291      
  3292      
  3293  
  3294          
  3295          
  3296          
  3297  
  3298          
  3299  
  3300  
  3301          
  3302              
  3303  
  3304  
  3305      
  3306          
  3307      
  3308      
  3309  
  3310          
  3311          
  3312          
  3313  
  3314          
  3315  
  3316  
  3317          
  3318              
  3319  
  3320  
  3321      
  3322          
  3323      
  3324      
  3325  
  3326          
  3327          
  3328          
  3329  
  3330          
  3331  
  3332  
  3333          
  3334              
  3335  
  3336  
  3337      
  3338          
  3339      
  3340      
  3341  
  3342          
  3343          
  3344          
  3345  
  3346          
  3347  
  3348  
  3349          
  3350              
  3351  
  3352  
  3353      
  3354          
  3355      
  3356      
  3357  
  3358          
  3359          
  3360          
  3361  
  3362          
  3363  
  3364  
  3365          
  3366              
  3367  
  3368  
  3369      
  3370          
  3371      
  3372      
  3373  
  3374          
  3375          
  3376          
  3377  
  3378          
  3379  
  3380  
  3381          
  3382              
  3383  
  3384  
  3385      
  3386          
  3387      
  3388      
  3389  
  3390          
  3391          
  3392          
  3393  
  3394          
  3395  
  3396  
  3397          
  3398  
  3399  
  3400          
  3401  
  3402  
  3403          
  3404              
  3405  
  3406  
  3407      
  3408          
  3409      
  3410      
  3411  
  3412          
  3413          
  3414          
  3415  
  3416          
  3417  
  3418  
  3419          
  3420              
  3421  
  3422  
  3423      
  3424          
  3425      
  3426      
  3427  
  3428          
  3429          
  3430          
  3431  
  3432          
  3433  
  3434  
  3435          
  3436              
  3437  
  3438  
  3439      
  3440          
  3441      
  3442      
  3443  
  3444          
  3445          
  3446          
  3447  
  3448          
  3449  
  3450  
  3451          
  3452              
  3453  
  3454  
  3455      
  3456          
  3457      
  3458      
  3459  
  3460          
  3461          
  3462          
  3463  
  3464          
  3465              
  3466  
  3467  
  3468      
  3469          
  3470      
  3471      
  3472  
  3473          
  3474          
  3475          
  3476  
  3477          
  3478  
  3479  
  3480          
  3481              
  3482  
  3483  
  3484      
  3485          
  3486      
  3487      
  3488  
  3489          
  3490          
  3491          
  3492  
  3493          
  3494  
  3495  
  3496          
  3497              
  3498  
  3499  
  3500      
  3501          
  3502      
  3503      
  3504  
  3505          
  3506          
  3507          
  3508  
  3509          
  3510  
  3511  
  3512          
  3513              
  3514  
  3515  
  3516      
  3517          
  3518      
  3519      
  3520  
  3521          
  3522          
  3523          
  3524  
  3525          
  3526  
  3527  
  3528          
  3529              
  3530  
  3531  
  3532      
  3533          
  3534      
  3535      
  3536  
  3537          
  3538          
  3539          
  3540  
  3541          
  3542  
  3543  
  3544          
  3545              
  3546  
  3547  
  3548      
  3549          
  3550      
  3551      
  3552  
  3553          
  3554          
  3555          
  3556  
  3557          
  3558  
  3559  
  3560          
  3561              
  3562  
  3563  
  3564      
  3565          
  3566      
  3567      
  3568  
  3569          
  3570          
  3571          
  3572  
  3573          
  3574  
  3575  
  3576          
  3577              
  3578  
  3579  
  3580      
  3581          
  3582      
  3583      
  3584  
  3585          
  3586          
  3587          
  3588  
  3589          
  3590  
  3591  
  3592          
  3593  
  3594  
  3595          
  3596              
  3597  
  3598  
  3599      
  3600          
  3601      
  3602      
  3603  
  3604          
  3605          
  3606          
  3607  
  3608          
  3609  
  3610  
  3611          
  3612              
  3613  
  3614  
  3615      
  3616          
  3617      
  3618      
  3619  
  3620          
  3621          
  3622          
  3623  
  3624          
  3625  
  3626  
  3627          
  3628              
  3629  
  3630  
  3631      
  3632          
  3633      
  3634      
  3635  
  3636          
  3637          
  3638          
  3639  
  3640          
  3641  
  3642  
  3643          
  3644              
  3645  
  3646  
  3647      
  3648          
  3649      
  3650      
  3651  
  3652          
  3653          
  3654          
  3655  
  3656          
  3657  
  3658  
  3659          
  3660  
  3661  
  3662          
  3663              
  3664  
  3665  
  3666      
  3667          
  3668      
  3669      
  3670  
  3671          
  3672          
  3673          
  3674  
  3675          
  3676  
  3677  
  3678          
  3679              
  3680  
  3681  
  3682      
  3683          
  3684      
  3685      
  3686  
  3687          
  3688          
  3689          
  3690  
  3691          
  3692  
  3693  
  3694          
  3695              
  3696  
  3697  
  3698      
  3699          
  3700      
  3701      
  3702  
  3703          
  3704          
  3705          
  3706  
  3707          
  3708  
  3709  
  3710          
  3711  
  3712  
  3713  
  3714  
  3715  
  3716  
  3717  
  3718  
  3719  
  3720  <a class="nav nav-prev" href="/reference/apigateway/echo_event/" title="Echo"> <i class="fa fa-chevron-left"></i></a>
  3721  
  3722  
  3723  <a class="nav nav-next" href="/reference/apigateway/context/" title="Request Context" style="margin-right: 0px;"><i class="fa fa-chevron-right"></i></a>
  3724  
  3725  
  3726  </div>
  3727  
  3728  </section>
  3729  
  3730  <div style="left: -1000px; overflow: scroll; position: absolute; top: -1000px; border: none; box-sizing: content-box; height: 200px; margin: 0px; padding: 0px; width: 200px;">
  3731  <div style="border: none; box-sizing: content-box; height: 200px; margin: 0px; padding: 0px; width: 200px;"></div>
  3732  </div>
  3733  <script src="/js/clipboard.min.js?1588464710"></script>
  3734  <script src="/js/perfect-scrollbar.min.js?1588464710"></script>
  3735  <script src="/js/perfect-scrollbar.jquery.min.js?1588464710"></script>
  3736  <script src="/js/jquery.sticky.js?1588464710"></script>
  3737  <script src="/js/featherlight.min.js?1588464710"></script>
  3738  <script src="/js/html5shiv-printshiv.min.js?1588464710"></script>
  3739  <script src="/js/modernizr.custom-3.6.0.js?1588464710"></script>
  3740  <script src="/js/learn.js?1588464710"></script>
  3741  <script src="/js/hugo-learn.js?1588464710"></script>
  3742  
  3743  <link href="/mermaid/mermaid.css?1588464710" rel="stylesheet" />
  3744  <script src="/mermaid/mermaid.js?1588464710"></script>
  3745  <script>
  3746  mermaid.initialize({ startOnLoad: true });
  3747  </script>
  3748  
  3749  <script async src="https://www.googletagmanager.com/gtag/js?id=UA-70794971-2"></script>
  3750  <script>
  3751    window.dataLayer = window.dataLayer || [];
  3752    function gtag(){dataLayer.push(arguments);}
  3753    gtag('js', new Date());
  3754  
  3755    gtag('config', 'UA-70794971-2');
  3756  </script>
  3757  </body>
  3758  </html>
  3759