[{"data":1,"prerenderedAt":42},["ShallowReactive",2],{"snippet-apigateway-secrets-manager-integration-mapping-template":3},{"id":4,"title":5,"contributors":6,"description":8,"extension":9,"gitHub":10,"introBox":13,"languages":24,"meta":26,"resources":27,"services":28,"snippets":31,"stem":38,"tags":39,"type":40,"__hash__":41},"snippets\u002Fsnippets\u002Fapigateway-secrets-manager-integration-mapping-template.json","Mapping template for API Gateway with Secrets Manager integration",[7],"content\u002Fcontributors\u002Fpallavi-bhat.json","Provides a mapping template for API Gateway and Secrets Manager integration","json",{"template":11},{"repoURL":12},"https:\u002F\u002Fgithub.com\u002Faws-samples\u002Fserverless-snippets\u002Ftree\u002Fmain\u002Fapigateway-secrets-manager-integration-mapping-template",{"headline":14,"text":15},"How it works",[16,17,18,19,20,21,22,23],"This snippet can be used to retrieve the secrets from Secrets Manager.","When creating the integration, ensure to have the below configuration to use the mapping template:","1. In Action type select Use action name and provide the Action Name as GetSecretValue.","2. Add the following headers in the integration headers: ","X-Amz-Target: 'secretsmanager.GetSecretValue'","Content-Type: 'application\u002Fx-amz-json-1.1'","3. Provide IAM role with appropriate permission to perform GetSecretValue action on the secret resource","4. Select the integration HTTP method as 'POST'",[25],"vtl",{},null,[29,30],"apigw","secretsmanager",[32,35],{"title":33,"language":25,"code":34},"Use the following mapping template which will fetch the SecretId from the input request body (secret_name) and pass it in the GetSecretValue API call as required in the API call:","#set($allParams = $input.params())\n{\n  \"SecretId\": \"$input.path('$.secret_name')\"\n}",{"title":36,"language":25,"code":37},"The following payload can be used for testing this set up:","{\n    \"secret_name\":\"&#60;secret name that is configured&#62;\"\n}\n","snippets\u002Fapigateway-secrets-manager-integration-mapping-template",[],"Integration","_fzNjeVqKoWfCAwyAy5ZGPj2zIoHgGUPzQRcFpjSnyc",1792578863883]