API Gateway: AwsIntegration with Step Functions
See original GitHub issueCame 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
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.
Issue Analytics
- State:
- Created 5 years ago
- Comments:11 (1 by maintainers)
Top GitHub Comments
I did it via L1 API.
@Awlsring Sorry. I couldn’t show the raw code because it’s for work. So, I made some abstract code. It might be broken. I hope this could help you.