{
 "Description": "Integration Test for aws-apigateway-lambda",
 "Resources": {
  "testapigatewaylambdaLambdaFunctionServiceRole5CD2E9F7": {
   "Type": "AWS::IAM::Role",
   "Properties": {
    "AssumeRolePolicyDocument": {
     "Statement": [
      {
       "Action": "sts:AssumeRole",
       "Effect": "Allow",
       "Principal": {
        "Service": "lambda.amazonaws.com"
       }
      }
     ],
     "Version": "2012-10-17"
    },
    "Policies": [
     {
      "PolicyDocument": {
       "Statement": [
        {
         "Action": [
          "logs:CreateLogGroup",
          "logs:CreateLogStream",
          "logs:PutLogEvents"
         ],
         "Effect": "Allow",
         "Resource": {
          "Fn::Join": [
           "",
           [
            "arn:",
            {
             "Ref": "AWS::Partition"
            },
            ":logs:",
            {
             "Ref": "AWS::Region"
            },
            ":",
            {
             "Ref": "AWS::AccountId"
            },
            ":log-group:/aws/lambda/*"
           ]
          ]
         }
        }
       ],
       "Version": "2012-10-17"
      },
      "PolicyName": "LambdaFunctionServiceRolePolicy"
     }
    ]
   },
   "Metadata": {
    "guard": {
     "SuppressedRules": [
      "IAM_NO_INLINE_POLICY_CHECK"
     ]
    }
   }
  },
  "testapigatewaylambdaLambdaFunction18FF222F": {
   "Type": "AWS::Lambda::Function",
   "Properties": {
    "Code": {
     "ZipFile": "exports.handler = async (event) => { console.log(event); return {'statusCode': 200, 'body': ''}; }"
    },
    "Environment": {
     "Variables": {
      "AWS_NODEJS_CONNECTION_REUSE_ENABLED": "1"
     }
    },
    "Handler": "index.handler",
    "Role": {
     "Fn::GetAtt": [
      "testapigatewaylambdaLambdaFunctionServiceRole5CD2E9F7",
      "Arn"
     ]
    },
    "Runtime": "nodejs22.x",
    "TracingConfig": {
     "Mode": "Active"
    }
   },
   "DependsOn": [
    "testapigatewaylambdaLambdaFunctionServiceRole5CD2E9F7"
   ],
   "Metadata": {
    "cfn_nag": {
     "rules_to_suppress": [
      {
       "id": "W58",
       "reason": "Lambda functions has the required permission to write CloudWatch Logs. It uses custom policy instead of arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole with tighter permissions."
      },
      {
       "id": "W89",
       "reason": "This is not a rule for the general case, just for specific use cases/industries"
      },
      {
       "id": "W92",
       "reason": "Impossible for us to define the correct concurrency for clients"
      }
     ]
    }
   }
  },
  "testapigatewaylambdaLambdaFunctioninlinePolicyAddedToExecutionRole00FEF72FF": {
   "Type": "AWS::IAM::Policy",
   "Properties": {
    "PolicyDocument": {
     "Statement": [
      {
       "Action": [
        "xray:PutTelemetryRecords",
        "xray:PutTraceSegments"
       ],
       "Effect": "Allow",
       "Resource": "*"
      }
     ],
     "Version": "2012-10-17"
    },
    "PolicyName": "testapigatewaylambdaLambdaFunctioninlinePolicyAddedToExecutionRole00FEF72FF",
    "Roles": [
     {
      "Ref": "testapigatewaylambdaLambdaFunctionServiceRole5CD2E9F7"
     }
    ]
   }
  },
  "testapigatewaylambdaApiAccessLogGroupEB3253A2": {
   "Type": "AWS::Logs::LogGroup",
   "UpdateReplacePolicy": "Retain",
   "DeletionPolicy": "Retain",
   "Metadata": {
    "cfn_nag": {
     "rules_to_suppress": [
      {
       "id": "W86",
       "reason": "Retention period for CloudWatchLogs LogGroups are set to 'Never Expire' to preserve customer data indefinitely"
      },
      {
       "id": "W84",
       "reason": "By default CloudWatchLogs LogGroups data is encrypted using the CloudWatch server-side encryption keys (AWS Managed Keys)"
      }
     ]
    }
   }
  },
  "testapigatewaylambdaLambdaRestApiE957E944": {
   "Type": "AWS::ApiGateway::RestApi",
   "Properties": {
    "EndpointConfiguration": {
     "Types": [
      "EDGE"
     ]
    },
    "Name": "LambdaRestApi"
   }
  },
  "testapigatewaylambdaLambdaRestApiDeployment85334BB3a1765c45928980e423727978265730d1": {
   "Type": "AWS::ApiGateway::Deployment",
   "Properties": {
    "Description": "Automatically created by the RestApi construct",
    "RestApiId": {
     "Ref": "testapigatewaylambdaLambdaRestApiE957E944"
    }
   },
   "DependsOn": [
    "testapigatewaylambdaLambdaRestApiproxyANYF6150927",
    "testapigatewaylambdaLambdaRestApiproxy2C2C544E",
    "testapigatewaylambdaLambdaRestApiANY1FACA749"
   ],
   "Metadata": {
    "aws:cdk:do-not-refactor": true,
    "cfn_nag": {
     "rules_to_suppress": [
      {
       "id": "W45",
       "reason": "ApiGateway has AccessLogging enabled in AWS::ApiGateway::Stage resource, but cfn_nag checks for it in AWS::ApiGateway::Deployment resource"
      }
     ]
    }
   }
  },
  "testapigatewaylambdaLambdaRestApiDeploymentStageprod4EBF7247": {
   "Type": "AWS::ApiGateway::Stage",
   "Properties": {
    "AccessLogSetting": {
     "DestinationArn": {
      "Fn::GetAtt": [
       "testapigatewaylambdaApiAccessLogGroupEB3253A2",
       "Arn"
      ]
     },
     "Format": "{\"requestId\":\"$context.requestId\",\"ip\":\"$context.identity.sourceIp\",\"user\":\"$context.identity.user\",\"caller\":\"$context.identity.caller\",\"requestTime\":\"$context.requestTime\",\"httpMethod\":\"$context.httpMethod\",\"resourcePath\":\"$context.resourcePath\",\"status\":\"$context.status\",\"protocol\":\"$context.protocol\",\"responseLength\":\"$context.responseLength\"}"
    },
    "DeploymentId": {
     "Ref": "testapigatewaylambdaLambdaRestApiDeployment85334BB3a1765c45928980e423727978265730d1"
    },
    "MethodSettings": [
     {
      "DataTraceEnabled": false,
      "HttpMethod": "*",
      "LoggingLevel": "INFO",
      "ResourcePath": "/*"
     }
    ],
    "RestApiId": {
     "Ref": "testapigatewaylambdaLambdaRestApiE957E944"
    },
    "StageName": "prod",
    "TracingEnabled": true
   },
   "Metadata": {
    "guard": {
     "SuppressedRules": [
      "API_GW_CACHE_ENABLED_AND_ENCRYPTED"
     ]
    }
   }
  },
  "testapigatewaylambdaLambdaRestApiproxy2C2C544E": {
   "Type": "AWS::ApiGateway::Resource",
   "Properties": {
    "ParentId": {
     "Fn::GetAtt": [
      "testapigatewaylambdaLambdaRestApiE957E944",
      "RootResourceId"
     ]
    },
    "PathPart": "{proxy+}",
    "RestApiId": {
     "Ref": "testapigatewaylambdaLambdaRestApiE957E944"
    }
   }
  },
  "testapigatewaylambdaLambdaRestApiproxyANYApiPermissionapilamdeployFunctiontestapigatewaylambdaLambdaRestApiAF929C5FANYproxy83DC1CFF": {
   "Type": "AWS::Lambda::Permission",
   "Properties": {
    "Action": "lambda:InvokeFunction",
    "FunctionName": {
     "Fn::GetAtt": [
      "testapigatewaylambdaLambdaFunction18FF222F",
      "Arn"
     ]
    },
    "Principal": "apigateway.amazonaws.com",
    "SourceArn": {
     "Fn::Join": [
      "",
      [
       "arn:",
       {
        "Ref": "AWS::Partition"
       },
       ":execute-api:",
       {
        "Ref": "AWS::Region"
       },
       ":",
       {
        "Ref": "AWS::AccountId"
       },
       ":",
       {
        "Ref": "testapigatewaylambdaLambdaRestApiE957E944"
       },
       "/",
       {
        "Ref": "testapigatewaylambdaLambdaRestApiDeploymentStageprod4EBF7247"
       },
       "/*/*"
      ]
     ]
    }
   }
  },
  "testapigatewaylambdaLambdaRestApiproxyANYApiPermissionTestapilamdeployFunctiontestapigatewaylambdaLambdaRestApiAF929C5FANYproxy46D6E92A": {
   "Type": "AWS::Lambda::Permission",
   "Properties": {
    "Action": "lambda:InvokeFunction",
    "FunctionName": {
     "Fn::GetAtt": [
      "testapigatewaylambdaLambdaFunction18FF222F",
      "Arn"
     ]
    },
    "Principal": "apigateway.amazonaws.com",
    "SourceArn": {
     "Fn::Join": [
      "",
      [
       "arn:",
       {
        "Ref": "AWS::Partition"
       },
       ":execute-api:",
       {
        "Ref": "AWS::Region"
       },
       ":",
       {
        "Ref": "AWS::AccountId"
       },
       ":",
       {
        "Ref": "testapigatewaylambdaLambdaRestApiE957E944"
       },
       "/test-invoke-stage/*/*"
      ]
     ]
    }
   }
  },
  "testapigatewaylambdaLambdaRestApiproxyANYF6150927": {
   "Type": "AWS::ApiGateway::Method",
   "Properties": {
    "AuthorizationType": "AWS_IAM",
    "HttpMethod": "ANY",
    "Integration": {
     "IntegrationHttpMethod": "POST",
     "Type": "AWS_PROXY",
     "Uri": {
      "Fn::Join": [
       "",
       [
        "arn:",
        {
         "Ref": "AWS::Partition"
        },
        ":apigateway:",
        {
         "Ref": "AWS::Region"
        },
        ":lambda:path/2015-03-31/functions/",
        {
         "Fn::GetAtt": [
          "testapigatewaylambdaLambdaFunction18FF222F",
          "Arn"
         ]
        },
        "/invocations"
       ]
      ]
     }
    },
    "ResourceId": {
     "Ref": "testapigatewaylambdaLambdaRestApiproxy2C2C544E"
    },
    "RestApiId": {
     "Ref": "testapigatewaylambdaLambdaRestApiE957E944"
    }
   }
  },
  "testapigatewaylambdaLambdaRestApiANYApiPermissionapilamdeployFunctiontestapigatewaylambdaLambdaRestApiAF929C5FANY15383DB1": {
   "Type": "AWS::Lambda::Permission",
   "Properties": {
    "Action": "lambda:InvokeFunction",
    "FunctionName": {
     "Fn::GetAtt": [
      "testapigatewaylambdaLambdaFunction18FF222F",
      "Arn"
     ]
    },
    "Principal": "apigateway.amazonaws.com",
    "SourceArn": {
     "Fn::Join": [
      "",
      [
       "arn:",
       {
        "Ref": "AWS::Partition"
       },
       ":execute-api:",
       {
        "Ref": "AWS::Region"
       },
       ":",
       {
        "Ref": "AWS::AccountId"
       },
       ":",
       {
        "Ref": "testapigatewaylambdaLambdaRestApiE957E944"
       },
       "/",
       {
        "Ref": "testapigatewaylambdaLambdaRestApiDeploymentStageprod4EBF7247"
       },
       "/*/"
      ]
     ]
    }
   }
  },
  "testapigatewaylambdaLambdaRestApiANYApiPermissionTestapilamdeployFunctiontestapigatewaylambdaLambdaRestApiAF929C5FANYC3A64F38": {
   "Type": "AWS::Lambda::Permission",
   "Properties": {
    "Action": "lambda:InvokeFunction",
    "FunctionName": {
     "Fn::GetAtt": [
      "testapigatewaylambdaLambdaFunction18FF222F",
      "Arn"
     ]
    },
    "Principal": "apigateway.amazonaws.com",
    "SourceArn": {
     "Fn::Join": [
      "",
      [
       "arn:",
       {
        "Ref": "AWS::Partition"
       },
       ":execute-api:",
       {
        "Ref": "AWS::Region"
       },
       ":",
       {
        "Ref": "AWS::AccountId"
       },
       ":",
       {
        "Ref": "testapigatewaylambdaLambdaRestApiE957E944"
       },
       "/test-invoke-stage/*/"
      ]
     ]
    }
   }
  },
  "testapigatewaylambdaLambdaRestApiANY1FACA749": {
   "Type": "AWS::ApiGateway::Method",
   "Properties": {
    "AuthorizationType": "AWS_IAM",
    "HttpMethod": "ANY",
    "Integration": {
     "IntegrationHttpMethod": "POST",
     "Type": "AWS_PROXY",
     "Uri": {
      "Fn::Join": [
       "",
       [
        "arn:",
        {
         "Ref": "AWS::Partition"
        },
        ":apigateway:",
        {
         "Ref": "AWS::Region"
        },
        ":lambda:path/2015-03-31/functions/",
        {
         "Fn::GetAtt": [
          "testapigatewaylambdaLambdaFunction18FF222F",
          "Arn"
         ]
        },
        "/invocations"
       ]
      ]
     }
    },
    "ResourceId": {
     "Fn::GetAtt": [
      "testapigatewaylambdaLambdaRestApiE957E944",
      "RootResourceId"
     ]
    },
    "RestApiId": {
     "Ref": "testapigatewaylambdaLambdaRestApiE957E944"
    }
   }
  },
  "testapigatewaylambdaLambdaRestApiUsagePlan658131E3": {
   "Type": "AWS::ApiGateway::UsagePlan",
   "Properties": {
    "ApiStages": [
     {
      "ApiId": {
       "Ref": "testapigatewaylambdaLambdaRestApiE957E944"
      },
      "Stage": {
       "Ref": "testapigatewaylambdaLambdaRestApiDeploymentStageprod4EBF7247"
      },
      "Throttle": {}
     }
    ]
   }
  },
  "testapigatewaylambdaLambdaRestApiCloudWatchRole6D45E039": {
   "Type": "AWS::IAM::Role",
   "Properties": {
    "AssumeRolePolicyDocument": {
     "Statement": [
      {
       "Action": "sts:AssumeRole",
       "Effect": "Allow",
       "Principal": {
        "Service": "apigateway.amazonaws.com"
       }
      }
     ],
     "Version": "2012-10-17"
    },
    "Policies": [
     {
      "PolicyDocument": {
       "Statement": [
        {
         "Action": [
          "logs:CreateLogGroup",
          "logs:CreateLogStream",
          "logs:DescribeLogGroups",
          "logs:DescribeLogStreams",
          "logs:FilterLogEvents",
          "logs:GetLogEvents",
          "logs:PutLogEvents"
         ],
         "Effect": "Allow",
         "Resource": {
          "Fn::Join": [
           "",
           [
            "arn:",
            {
             "Ref": "AWS::Partition"
            },
            ":logs:",
            {
             "Ref": "AWS::Region"
            },
            ":",
            {
             "Ref": "AWS::AccountId"
            },
            ":*"
           ]
          ]
         }
        }
       ],
       "Version": "2012-10-17"
      },
      "PolicyName": "LambdaRestApiCloudWatchRolePolicy"
     }
    ]
   },
   "Metadata": {
    "guard": {
     "SuppressedRules": [
      "IAM_NO_INLINE_POLICY_CHECK"
     ]
    }
   }
  },
  "testapigatewaylambdaLambdaRestApiAccount0D88B6B8": {
   "Type": "AWS::ApiGateway::Account",
   "Properties": {
    "CloudWatchRoleArn": {
     "Fn::GetAtt": [
      "testapigatewaylambdaLambdaRestApiCloudWatchRole6D45E039",
      "Arn"
     ]
    }
   },
   "DependsOn": [
    "testapigatewaylambdaLambdaRestApiE957E944"
   ]
  }
 },
 "Outputs": {
  "testapigatewaylambdaLambdaRestApiEndpoint2EF0B753": {
   "Value": {
    "Fn::Join": [
     "",
     [
      "https://",
      {
       "Ref": "testapigatewaylambdaLambdaRestApiE957E944"
      },
      ".execute-api.",
      {
       "Ref": "AWS::Region"
      },
      ".",
      {
       "Ref": "AWS::URLSuffix"
      },
      "/",
      {
       "Ref": "testapigatewaylambdaLambdaRestApiDeploymentStageprod4EBF7247"
      },
      "/"
     ]
    ]
   }
  }
 },
 "Parameters": {
  "BootstrapVersion": {
   "Type": "AWS::SSM::Parameter::Value<String>",
   "Default": "/cdk-bootstrap/hnb659fds/version",
   "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
  }
 },
 "Rules": {
  "CheckBootstrapVersion": {
   "Assertions": [
    {
     "Assert": {
      "Fn::Not": [
       {
        "Fn::Contains": [
         [
          "1",
          "2",
          "3",
          "4",
          "5"
         ],
         {
          "Ref": "BootstrapVersion"
         }
        ]
       }
      ]
     },
     "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
    }
   ]
  }
 }
}