Skip to content

Commit 9cd40c7

Browse files
author
Sumeet Badyal
committed
Remove apiEndpoint and other comments
1 parent c47bb7e commit 9cd40c7

File tree

4 files changed

+14
-27
lines changed

4 files changed

+14
-27
lines changed

packages/@aws-cdk/aws-stepfunctions-tasks/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,6 @@ const restApi = new apigateway.RestApi(stack, 'MyRestApi');
229229

230230
const invokeJob = new tasks.ApiGatewayInvoke(stack, 'Invoke APIGW', {
231231
api: restApi,
232-
apiEndpoint: restApi.restApiId,
233232
stageName: 'prod',
234233
method: ApiGatewayMethodType.GET,
235234
});

packages/@aws-cdk/aws-stepfunctions-tasks/lib/apigateway/invoke.ts

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,6 @@ export interface ApiGatewayInvokeProps extends sfn.TaskStateBaseProps {
1313
/** API to call */
1414
readonly api: apigateway.IRestApi;
1515

16-
/**
17-
* hostname of an API Gateway URL
18-
* @example {ApiId}.execute-api.{region}.amazonaws.com
19-
*/
20-
readonly apiEndpoint: string;
21-
2216
/** Http method for the API */
2317
readonly method: HttpMethod;
2418

@@ -37,7 +31,7 @@ export interface ApiGatewayInvokeProps extends sfn.TaskStateBaseProps {
3731

3832
/**
3933
* Name of the stage where the API is deployed to in API Gateway
40-
* @default - Required for REST and $default for HTTP
34+
* @default - Required for REST and $default for HTTP which acts as a catch-all for requests that don’t match any other routes
4135
*/
4236
readonly stageName?: string;
4337

@@ -69,7 +63,7 @@ export interface ApiGatewayInvokeProps extends sfn.TaskStateBaseProps {
6963

7064
/**
7165
* Authentication methods
72-
* @default - NO_AUTH
66+
* @default AuthType.NO_AUTH
7367
*/
7468
readonly authType?: AuthType;
7569

@@ -104,8 +98,6 @@ export class ApiGatewayInvoke extends sfn.TaskStateBase {
10498

10599
/**
106100
* Provides the API Gateway Invoke service integration task configuration
107-
*/
108-
/**
109101
* @internal
110102
*/
111103
protected _renderTask(): any {
@@ -125,13 +117,13 @@ export class ApiGatewayInvoke extends sfn.TaskStateBase {
125117
}
126118

127119
/**
128-
* Gets the "execute-api" ARN
129-
* @returns The "execute-api" ARN.
130-
* @default "*" returns the execute API ARN for all methods/resources in
131-
* this API.
120+
* Gets the resource to attatched to the ExecuteAPI:Invoke
121+
* @returns resource.
122+
* @default "*" returns the execute API ARN for all methods/resources in this API.
132123
* @param method The method (default `*`)
133124
* @param path The resource path. Must start with '/' (default `*`)
134125
* @param stage The stage (default `*`)
126+
* @example {ApiId}/{stage}/{method}/{path}
135127
*/
136128
get arnForExecuteApi() {
137129
return this.props.api.arnForExecuteApi(this.props.method, this.props.path, this.props.stageName);
@@ -204,7 +196,6 @@ export enum HttpMethod {
204196

205197
/**
206198
* The authentication method used to call the endpoint
207-
* @default NO_AUTH
208199
*/
209200
export enum AuthType {
210201
/** Call the API direclty with no authorization method */

packages/@aws-cdk/aws-stepfunctions-tasks/test/apigateway/integ.invoke.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,29 @@ import { ApiGatewayInvoke, AuthType, HttpMethod } from '../../lib';
88
* Stack verification steps:
99
* * aws stepfunctions start-execution --state-machine-arn <deployed state machine arn> : should return execution arn
1010
* * aws stepfunctions describe-execution --execution-arn <exection-arn generated before> : should return status as SUCCEEDED and a query-execution-id
11-
* * aws apigateway test-invoke-method --rest-api-id <value> --resource-id <value> --http-method <value>: should return the same response as the state machine
11+
* * aws apigateway test-invoke-method --rest-api-id <value> --resource-id <value> --http-method <value>: should return the same response body and status as in the task succeeded/failed execution
1212
*/
1313
const app = new cdk.App();
1414
const stack = new cdk.Stack(app, 'aws-stepfunctions-tasks-apigateway-invoke-integ');
1515
const restApi = new apigateway.RestApi(stack, 'MyRestApi');
1616

17-
const hello = new apigateway.LambdaIntegration(new lambda.Function(stack, 'Hello', {
18-
runtime: lambda.Runtime.NODEJS_10_X,
19-
handler: 'index.handler',
20-
code: lambda.Code.inline(`exports.handler = ${helloCode}`),
21-
}));
22-
2317
function helloCode(_event: any, _context: any, callback: any) {
2418
return callback(undefined, {
2519
statusCode: 200,
2620
body: 'hello, world!',
2721
});
2822
}
23+
24+
const hello = new apigateway.LambdaIntegration(new lambda.Function(stack, 'Hello', {
25+
runtime: lambda.Runtime.NODEJS_10_X,
26+
handler: 'index.handler',
27+
code: lambda.Code.inline(`exports.handler = ${helloCode}`),
28+
}));
29+
2930
restApi.root.addMethod('ANY', hello);
3031

3132
const invokeJob = new ApiGatewayInvoke(stack, 'Invoke APIGW', {
3233
api: restApi,
33-
apiEndpoint: restApi.restApiId,
3434
stageName: 'prod',
3535
method: HttpMethod.GET,
3636
authType: AuthType.IAM_ROLE,

packages/@aws-cdk/aws-stepfunctions-tasks/test/apigateway/invoke.test.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ describe('Invoke API', () => {
1313
// WHEN
1414
const task = new ApiGatewayInvoke(stack, 'Invoke', {
1515
api: restApi,
16-
apiEndpoint: restApi.restApiId,
1716
method: HttpMethod.GET,
1817
stageName: '$default',
1918
path: 'path',
@@ -74,7 +73,6 @@ describe('Invoke API', () => {
7473
const task = new ApiGatewayInvoke(stack, 'Invoke', {
7574
integrationPattern: sfn.IntegrationPattern.WAIT_FOR_TASK_TOKEN,
7675
api: restApi,
77-
apiEndpoint: restApi.restApiId,
7876
method: HttpMethod.GET,
7977
headers: taskToken,
8078
stageName: '$default',
@@ -134,7 +132,6 @@ describe('Invoke API', () => {
134132
new ApiGatewayInvoke(stack, 'Invoke', {
135133
integrationPattern: sfn.IntegrationPattern.WAIT_FOR_TASK_TOKEN,
136134
api: restApi,
137-
apiEndpoint: restApi.restApiId,
138135
method: HttpMethod.GET,
139136
authType: AuthType.RESOURCE_POLICY,
140137
});

0 commit comments

Comments
 (0)