QuestionQ7

Deployment

A developer uses AWS CloudFormation to deploy an Amazon API Gateway API and an AWS Step Functions state machine. The state machine must reference the API Gateway API after the CloudFormation template is deployed. The developer needs a solution that uses the state machine to reference the API Gateway endpoint.

Which solution will meet these requirements MOST cost-effectively?

  • A Configure the CloudFormation template to reference the API endpoint in the DefinitionSubstitutions property for the AWS::StepFunctions::StateMachine resource.
  • B Configure the CloudFormation template to store the API endpoint in an environment variable for the AWS::StepFunctions::StateMachine resource. Configure the state machine to reference the environment variable.
  • C Configure the CloudFormation template to store the API endpoint in a standard AWS::SecretsManager::Secret resource. Configure the state machine to reference the resource.
  • D Configure the CloudFormation template to store the API endpoint in a standard AWS::AppConfig::ConfigurationProfile resource. Configure the state machine to reference the resource.
Explanation

The DefinitionSubstitutions property in CloudFormation's AWS::StepFunctions::StateMachine resource enables dynamic parameter substitution into the state machine definition at deployment time. This native feature allows the state machine to reference the API Gateway endpoint without hardcoding values, making it cost-effective because it uses CloudFormation's built-in capabilities. Environment variables (B) are not supported on Step Functions; Secrets Manager (C) and AppConfig (D) add unnecessary cost for this use case.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!