0
0
AWScloud~20 mins

API deployment and stages in AWS - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
API Deployment Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
service_behavior
intermediate
2:00remaining
Understanding API Gateway Stage Variables

What is the effect of changing a stage variable in an AWS API Gateway stage?

AIt only affects the API Gateway console display, not the actual API behavior.
BIt requires redeploying the API for the changes to take effect.
CIt immediately updates the deployed API behavior for that stage without redeploying.
DIt deletes the current stage and creates a new one with the updated variables.
Attempts:
2 left
💡 Hint

Think about how stage variables are designed to allow quick configuration changes.

Architecture
intermediate
2:00remaining
Best Practice for Multiple API Environments

You want to maintain separate development, testing, and production environments for your API using AWS API Gateway. Which approach best supports this?

AUse one API and switch stage variables to simulate different environments.
BUse a single API with multiple stages named dev, test, and prod.
CCreate separate APIs for dev, test, and prod environments.
DDeploy the API only once and use query parameters to differentiate environments.
Attempts:
2 left
💡 Hint

Consider how API Gateway stages are designed to represent different deployment environments.

Configuration
advanced
2:30remaining
Deploying API Gateway with CloudFormation

Given the following CloudFormation snippet, what will be the result after deployment?

Resources:
  MyApi:
    Type: AWS::ApiGateway::RestApi
    Properties:
      Name: "MyTestApi"
  MyDeployment:
    Type: AWS::ApiGateway::Deployment
    Properties:
      RestApiId: !Ref MyApi
      StageName: prod
    DependsOn: MyApi
AWS
Resources:
  MyApi:
    Type: AWS::ApiGateway::RestApi
    Properties:
      Name: "MyTestApi"
  MyDeployment:
    Type: AWS::ApiGateway::Deployment
    Properties:
      RestApiId: !Ref MyApi
      StageName: prod
    DependsOn: MyApi
AAn API named 'MyTestApi' is created with a deployment to a stage named 'prod'.
BThe deployment will fail because StageName is not allowed in AWS::ApiGateway::Deployment.
CThe API is created but no deployment or stage is created automatically.
DThe deployment creates a stage named 'prod' but the API is not created due to missing properties.
Attempts:
2 left
💡 Hint

Check the AWS CloudFormation documentation for AWS::ApiGateway::Deployment properties.

security
advanced
2:30remaining
Securing API Gateway Stages with IAM

You want to restrict access to a specific API Gateway stage so only users with a certain IAM role can invoke it. Which method achieves this?

AUse stage variables to specify allowed IAM roles for the stage.
BSet up a Lambda authorizer that checks the IAM role before allowing access.
CConfigure API Gateway method request to require an API key linked to the IAM role.
DAttach a resource policy to the API Gateway stage allowing only the IAM role's ARN.
Attempts:
2 left
💡 Hint

Think about how resource policies control access at the API Gateway level.

Best Practice
expert
3:00remaining
Managing API Gateway Deployments for Frequent Updates

Your team deploys API Gateway updates multiple times daily. You want to automate deployments and keep track of versions without overwriting previous deployments. Which approach is best?

ACreate a new deployment resource with a unique description or timestamp each time and deploy to a fixed stage.
BReuse the same deployment resource and update the stage to point to it each time.
CManually delete old deployments before creating new ones to avoid clutter.
DDeploy only once and use stage variables to toggle features instead of redeploying.
Attempts:
2 left
💡 Hint

Consider how AWS API Gateway treats deployments as immutable snapshots.