CreateHTTPIntegration creates new HTTP integration for API Gateway, returns integration ID
(apiGatewayID string, targetEndpoint string)
| 327 | |
| 328 | // CreateHTTPIntegration creates new HTTP integration for API Gateway, returns integration ID |
| 329 | func (c *Client) CreateHTTPIntegration(apiGatewayID string, targetEndpoint string) (string, error) { |
| 330 | integrationResponse, err := c.APIGatewayV2().CreateIntegration(&apigatewayv2.CreateIntegrationInput{ |
| 331 | ApiId: &apiGatewayID, |
| 332 | IntegrationType: aws.String("HTTP_PROXY"), |
| 333 | IntegrationUri: &targetEndpoint, |
| 334 | PayloadFormatVersion: aws.String("1.0"), |
| 335 | IntegrationMethod: aws.String("ANY"), |
| 336 | }) |
| 337 | if err != nil { |
| 338 | return "", errors.Wrap(err, fmt.Sprintf("failed to create api gateway integration for endpoint %s in api gateway %s", targetEndpoint, apiGatewayID)) |
| 339 | } |
| 340 | return *integrationResponse.IntegrationId, nil |
| 341 | } |
| 342 | |
| 343 | // DeleteIntegration deletes an integration from API Gateway |
| 344 | func (c *Client) DeleteIntegration(apiGatewayID string, integrationID string) error { |
nothing calls this directly
no test coverage detected