{
 "Description": "Integration Test for aws-apigateway-sagemakerendpoint",
 "Resources": {
  "testapigatewaysagemakerendpointdefaultApiAccessLogGroupAD5E1ADF": {
   "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)"
      }
     ]
    }
   }
  },
  "testapigatewaysagemakerendpointdefaultRestApi7D1DA11B": {
   "Type": "AWS::ApiGateway::RestApi",
   "Properties": {
    "EndpointConfiguration": {
     "Types": [
      "EDGE"
     ]
    },
    "Name": "RestApi"
   }
  },
  "testapigatewaysagemakerendpointdefaultRestApiDeployment04BFEB63ab5dc870083af2a47a41af0f4ee69fff": {
   "Type": "AWS::ApiGateway::Deployment",
   "Properties": {
    "Description": "Automatically created by the RestApi construct",
    "RestApiId": {
     "Ref": "testapigatewaysagemakerendpointdefaultRestApi7D1DA11B"
    }
   },
   "DependsOn": [
    "testapigatewaysagemakerendpointdefaultRestApiuseridGETB3BB79AA",
    "testapigatewaysagemakerendpointdefaultRestApiuserid9952BA11",
    "testapigatewaysagemakerendpointdefaultRestApirequestvalidator1A23C251"
   ],
   "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"
      }
     ]
    }
   }
  },
  "testapigatewaysagemakerendpointdefaultRestApiDeploymentStageprodFD1743A7": {
   "Type": "AWS::ApiGateway::Stage",
   "Properties": {
    "AccessLogSetting": {
     "DestinationArn": {
      "Fn::GetAtt": [
       "testapigatewaysagemakerendpointdefaultApiAccessLogGroupAD5E1ADF",
       "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": "testapigatewaysagemakerendpointdefaultRestApiDeployment04BFEB63ab5dc870083af2a47a41af0f4ee69fff"
    },
    "MethodSettings": [
     {
      "DataTraceEnabled": false,
      "HttpMethod": "*",
      "LoggingLevel": "INFO",
      "ResourcePath": "/*"
     }
    ],
    "RestApiId": {
     "Ref": "testapigatewaysagemakerendpointdefaultRestApi7D1DA11B"
    },
    "StageName": "prod",
    "TracingEnabled": true
   },
   "Metadata": {
    "guard": {
     "SuppressedRules": [
      "API_GW_CACHE_ENABLED_AND_ENCRYPTED"
     ]
    }
   }
  },
  "testapigatewaysagemakerendpointdefaultRestApiuserid9952BA11": {
   "Type": "AWS::ApiGateway::Resource",
   "Properties": {
    "ParentId": {
     "Fn::GetAtt": [
      "testapigatewaysagemakerendpointdefaultRestApi7D1DA11B",
      "RootResourceId"
     ]
    },
    "PathPart": "{user_id}",
    "RestApiId": {
     "Ref": "testapigatewaysagemakerendpointdefaultRestApi7D1DA11B"
    }
   }
  },
  "testapigatewaysagemakerendpointdefaultRestApiuseridGETB3BB79AA": {
   "Type": "AWS::ApiGateway::Method",
   "Properties": {
    "AuthorizationType": "AWS_IAM",
    "HttpMethod": "GET",
    "Integration": {
     "Credentials": {
      "Fn::GetAtt": [
       "testapigatewaysagemakerendpointdefaultapigatewayrole8EA61BE4",
       "Arn"
      ]
     },
     "IntegrationHttpMethod": "POST",
     "IntegrationResponses": [
      {
       "StatusCode": "200"
      },
      {
       "SelectionPattern": "5\\d{2}",
       "StatusCode": "500"
      },
      {
       "SelectionPattern": "4\\d{2}",
       "StatusCode": "400"
      }
     ],
     "PassthroughBehavior": "NEVER",
     "RequestParameters": {
      "integration.request.header.Content-Type": "'application/json'"
     },
     "RequestTemplates": {
      "application/json": "{\n    \"instances\": [\n#set( $user_id = $input.params(\"user_id\") )\n#set( $items = $input.params(\"items\") )\n#foreach( $item in $items.split(\",\") )\n    {\"in0\": [$user_id], \"in1\": [$item]}#if( $foreach.hasNext ),#end\n    $esc.newline\n#end\n    ]\n}",
      "text/plain": "{\n    \"instances\": [\n#set( $user_id = $input.params(\"user_id\") )\n#set( $items = $input.params(\"items\") )\n#foreach( $item in $items.split(\",\") )\n    {\"in0\": [$user_id], \"in1\": [$item]}#if( $foreach.hasNext ),#end\n    $esc.newline\n#end\n    ]\n}"
     },
     "Type": "AWS",
     "Uri": {
      "Fn::Join": [
       "",
       [
        "arn:",
        {
         "Ref": "AWS::Partition"
        },
        ":apigateway:",
        {
         "Ref": "AWS::Region"
        },
        ":runtime.sagemaker:path/endpoints/my-endpoint/invocations"
       ]
      ]
     }
    },
    "MethodResponses": [
     {
      "StatusCode": "200"
     },
     {
      "StatusCode": "500"
     },
     {
      "StatusCode": "400"
     }
    ],
    "RequestValidatorId": {
     "Ref": "testapigatewaysagemakerendpointdefaultRestApirequestvalidator1A23C251"
    },
    "ResourceId": {
     "Ref": "testapigatewaysagemakerendpointdefaultRestApiuserid9952BA11"
    },
    "RestApiId": {
     "Ref": "testapigatewaysagemakerendpointdefaultRestApi7D1DA11B"
    }
   }
  },
  "testapigatewaysagemakerendpointdefaultRestApiUsagePlan7C5B0716": {
   "Type": "AWS::ApiGateway::UsagePlan",
   "Properties": {
    "ApiStages": [
     {
      "ApiId": {
       "Ref": "testapigatewaysagemakerendpointdefaultRestApi7D1DA11B"
      },
      "Stage": {
       "Ref": "testapigatewaysagemakerendpointdefaultRestApiDeploymentStageprodFD1743A7"
      },
      "Throttle": {}
     }
    ]
   }
  },
  "testapigatewaysagemakerendpointdefaultRestApirequestvalidator1A23C251": {
   "Type": "AWS::ApiGateway::RequestValidator",
   "Properties": {
    "Name": "request-param-validator",
    "RestApiId": {
     "Ref": "testapigatewaysagemakerendpointdefaultRestApi7D1DA11B"
    },
    "ValidateRequestParameters": true
   }
  },
  "testapigatewaysagemakerendpointdefaultLambdaRestApiCloudWatchRole56EE67C8": {
   "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"
     ]
    }
   }
  },
  "testapigatewaysagemakerendpointdefaultLambdaRestApiAccount6B3C7FDD": {
   "Type": "AWS::ApiGateway::Account",
   "Properties": {
    "CloudWatchRoleArn": {
     "Fn::GetAtt": [
      "testapigatewaysagemakerendpointdefaultLambdaRestApiCloudWatchRole56EE67C8",
      "Arn"
     ]
    }
   },
   "DependsOn": [
    "testapigatewaysagemakerendpointdefaultRestApi7D1DA11B"
   ]
  },
  "testapigatewaysagemakerendpointdefaultapigatewayrole8EA61BE4": {
   "Type": "AWS::IAM::Role",
   "Properties": {
    "AssumeRolePolicyDocument": {
     "Statement": [
      {
       "Action": "sts:AssumeRole",
       "Effect": "Allow",
       "Principal": {
        "Service": "apigateway.amazonaws.com"
       }
      }
     ],
     "Version": "2012-10-17"
    }
   },
   "Metadata": {
    "guard": {
     "SuppressedRules": [
      "IAM_NO_INLINE_POLICY_CHECK"
     ]
    }
   }
  },
  "testapigatewaysagemakerendpointdefaultInvokeEndpointPolicyB835D2B2": {
   "Type": "AWS::IAM::Policy",
   "Properties": {
    "PolicyDocument": {
     "Statement": [
      {
       "Action": "sagemaker:InvokeEndpoint",
       "Effect": "Allow",
       "Resource": {
        "Fn::Join": [
         "",
         [
          "arn:",
          {
           "Ref": "AWS::Partition"
          },
          ":sagemaker:",
          {
           "Ref": "AWS::Region"
          },
          ":",
          {
           "Ref": "AWS::AccountId"
          },
          ":endpoint/my-endpoint"
         ]
        ]
       }
      }
     ],
     "Version": "2012-10-17"
    },
    "PolicyName": "testapigatewaysagemakerendpointdefaultInvokeEndpointPolicyB835D2B2",
    "Roles": [
     {
      "Ref": "testapigatewaysagemakerendpointdefaultapigatewayrole8EA61BE4"
     }
    ]
   }
  }
 },
 "Outputs": {
  "testapigatewaysagemakerendpointdefaultRestApiEndpoint1EFF6760": {
   "Value": {
    "Fn::Join": [
     "",
     [
      "https://",
      {
       "Ref": "testapigatewaysagemakerendpointdefaultRestApi7D1DA11B"
      },
      ".execute-api.",
      {
       "Ref": "AWS::Region"
      },
      ".",
      {
       "Ref": "AWS::URLSuffix"
      },
      "/",
      {
       "Ref": "testapigatewaysagemakerendpointdefaultRestApiDeploymentStageprodFD1743A7"
      },
      "/"
     ]
    ]
   }
  }
 },
 "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."
    }
   ]
  }
 }
}