Soru

Zorluk: OrtaAPI Development and Integration with Amazon API Gateway

A developer is designing a REST API in Amazon API Gateway that must start an AWS Step Functions state machine execution whenever a client sends a POST request. To minimize latency and avoid cold starts, the developer wants to configure a direct AWS service integration between API Gateway and Step Functions, without using an intermediate AWS Lambda function.

Which two configuration steps must the developer perform to successfully set up this integration? (Select TWO.)

  1. Configure the integration type as AWS Service, select Step Functions as the AWS service, and set the Action to StartExecution.Cevap
  2. Create an IAM role that permits the states:StartExecution action, and specify this role's ARN in the Execution Role field of the integration.Cevap
  3. C
    Configure the method to use Lambda Proxy integration and set the target integration URI directly to the Step Functions state machine ARN.
  4. D
    Configure a Cognito User Pool authorizer on the API method and select the Step Functions action permissions within the authorizer settings.
  5. E
    Package the AWS SDK within the client application and configure the API Gateway method to pass client-side IAM access keys to Step Functions using request header mapping.

Cevap

Configuring the integration type as AWS Service with Step Functions as the service and StartExecution as the action, and creating an IAM role that permits the states:StartExecution action and specifying its ARN in the integration settings.
To create a direct integration between Amazon API Gateway and AWS Step Functions, the developer must configure the integration type as an AWS Service. The target service is set to Step Functions, and the Action is set to StartExecution to invoke the state machine. Additionally, an IAM execution role containing permissions for states:StartExecution must be created and its ARN provided in the execution role field of the integration. This allows API Gateway to securely trigger the state machine on behalf of the client.

Adım Adım Çözüm

1
Select the integration type for the API method.
Configure the API method integration type to AWS Service.
Since the goal is to directly call Step Functions without an intermediate Lambda function, the developer must use the built-in AWS Service integration type.
2
Set the action details in the integration settings.
Choose Step Functions as the target service and set the Action to StartExecution.
This maps the incoming API request to the specific Step Functions API action required to trigger a state machine execution.
3
Configure the execution credentials.
Specify the ARN of an IAM execution role containing the required permissions in the Execution Role field.
API Gateway requires an execution role to authenticate and authorize the call to the Step Functions backend.

Anahtar Kavram

Direct AWS Service Integrations in Amazon API Gateway
Bu soruyu puanla