aws / aws/aws-cdk

API Gateway: AwsIntegration with Step Functions

Open
#1,465 11 comments 0 reactions 0 assignees View on GitHub
@aws-cdk/aws-apigateway effort/medium feature-request feature/service-integration p2
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
2d 3h
Merged PRs (30d)
83

Description

Came up as a question on Gitter:

> Hi I am new to CDK and trying to "Create a Step Functions API Using API Gateway" using java as follows

```ts
RestApi api = new RestApi(this, "api");
AwsIntegrationProps awsIntegrationProps = AwsIntegrationProps.builder().withService("Step Functions")
.withAction("StartExecution").build();

AwsIntegration awsIntegration = new AwsIntegration(awsIntegrationProps);
Resource resource = api.getRoot().addResource("execution");
resource.addMethod("POST", awsIntegration);
```

> But i am getting Error "Role ARN must be specified for AWS integrations (Service: AmazonApiGateway; Status Code: 400; Error Code: BadRequestException; Request ID: fa2f7fc8-0d5c-11e9-b2bf-ab94b16eea0c)"
> How do i specify Execution Role ? Ref aws doc https://docs.aws.amazon.com/step-functions/latest/dg/tutorial-api-gateway.html

AWS integrations apparently always need a Role. The correct solution is to pass a RoleARN under the `options` key, but this is is validation plus a hint that we could have done locally.

Even better, we should make it as easy as on other L2 constructs to construct this required role (by doing so implicitly). We should also look into a way to set up the right permissions automatically.

Contributor guide

Open the contributing guide

Research direction

Start with the AwsIntegration entry point and the options passed to addMethod, using the Java example in the issue to trace how the execution role is supplied. Done means AWS integrations validate a missing role with a useful hint, and the required role and permissions can be set up implicitly where appropriate.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, java, typescript
Domain
api, cloud
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.