Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Gateway: Invoke #457

Open
thantos opened this issue Aug 30, 2022 · 1 comment
Open

API Gateway: Invoke #457

thantos opened this issue Aug 30, 2022 · 1 comment

Comments

@thantos
Copy link
Collaborator

thantos commented Aug 30, 2022

Add API Gateway Invoke to Step Functions, App Sync, Lambda, and Event Bridge.

const api = new API(stack, "api");
const api2 = API.fromApi(stack, "api", "arn/uri")

const method = new AwsMethod(...);

and invoke

api(method, path, { body, headers, queryString });
api(stage, method, path, { body, headers, queryString });

method({ body, headers, queryString });
method(stage, { body, headers, queryString });

also support helpers for connections (#443)

api.connections.post(connectionId, data);
@thantos
Copy link
Collaborator Author

thantos commented Aug 30, 2022

Event Bridge contract

https://docs.aws.amazon.com/cdk/api/v1/docs/@aws-cdk_aws-events-targets.ApiGateway.html

    path: '/*/test',
    method: 'GET',
    stage:  'prod',
    pathParameterValues: ['path-value'],
    headerParameters: {
      Header1: 'header1',
    },
    queryStringParameters: {
      QueryParam1: 'query-param-1',
    },
    deadLetterQueue: dlq
bus.all().map((event) => ({  body, path, headers })).pipe(api);

Sfn contract

https://docs.aws.amazon.com/step-functions/latest/dg/connect-api-gateway.html

        "ApiEndpoint": "example.execute-api.us-east-1.amazonaws.com",
        "Method": "GET", 
        "Headers": { 
            "key": ["value1", "value2"] 
        },
        "Stage": "prod",
        "Path": "bills",
        "QueryParameters": {
            "billId": ["123456"]
        },
        "RequestBody": {},
        "AuthType": "NO_AUTH"

Lambda

???

App Sync

???

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants