View a markdown version of this page

AWSSupportRemediator-EnableApiGatewayXRayTracing - Amazon Systems Manager Automation Runbook Reference
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

AWSSupportRemediator-EnableApiGatewayXRayTracing

Description

Enables active tracing with Amazon X-Ray for the specified Amazon API Gateway stage.

This automation remediates findings identified by Amazon Well-Architected Agent. It remediates findings from Amazon Security Hub CSPM control API Gateway REST API stages should have Amazon X-Ray tracing enabled.

If the AWSServiceRoleForAPIGateway service-linked role does not exist in the account, API Gateway creates it automatically when active tracing is enabled. For more information about service-linked roles for API Gateway, see Using Service-Linked Roles for API Gateway.

If the API Gateway stage does not exist or active tracing with X-Ray is already enabled, the automation completes successfully without making changes.

Enabling active tracing might incur additional X-Ray charges. For more information about pricing, see X-Ray pricing.

Important considerations
  • You are responsible for reviewing automation actions before they run.

  • This automation might cause stack drift if the resource is part of an Amazon CloudFormation stack.

  • Access to AWSSupportRemediator-* runbooks requires an active Business Support+, Enterprise Support, or Unified Operations Support plan. For more information, see Compare Amazon Web Services Support Plans on the Amazon website.

Document type

Automation

Owner

Amazon

Platforms

Linux, macOS, Windows

Parameters

  • AutomationAssumeRole

    Type: String

    Description: (Optional) The Amazon Resource Name (ARN) of the Amazon Identity and Access Management (IAM) role that allows Systems Manager Automation to perform the actions on your behalf. If no role is specified, Systems Manager Automation uses the permissions of the user that starts this runbook.

  • RestApiId

    Type: String

    Description: (Required) The identifier of the API Gateway REST API that contains the stage.

  • StageName

    Type: String

    Description: (Required) The name of the API Gateway stage on which to enable X-Ray tracing.

Required IAM permissions

The AutomationAssumeRole parameter requires the following actions to use the runbook successfully.

  • apigateway:GET

  • apigateway:PATCH

Document Steps
  1. validateApiGateway - Validates whether the API Gateway stage exists and whether active tracing with X-Ray is already enabled.

  2. branchOnChangeRequired - Branches on whether the API Gateway stage requires modification.

  3. enableTracing - Enables active tracing with X-Ray for the API Gateway stage by patching the tracingEnabled property to true.

Outputs
  • validateApiGateway.ChangeRequired: Whether the API Gateway stage requires a change.

  • validateApiGateway.InitialTracingEnabledSetting: The value of the stage's tracingEnabled property before execution.

  • validateApiGateway.ValidationMessage: A message describing the validation result.