API Gateway: AwsIntegration with Step Functions
- 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
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