CloudTrail

Implementation details for API cloudtrail

Coverage Overview

CloudTrail is supported by LocalStack only in the pro image.

AvailabilityTesting*
OperationImplementedImageInternal Test SuiteExternal Test SuiteTerraform ValidatedAWS ValidatedSnapshot TestedDetails
AddTags✔️pro✔️✔️
CancelQuery
CreateChannel
CreateEventDataStore
CreateTrail✔️pro✔️✔️✔️✔️✔️Show Tests
DeleteChannel
DeleteEventDataStore
DeleteResourcePolicy
DeleteTrail✔️pro✔️✔️✔️✔️✔️Show Tests
DeregisterOrganizationDelegatedAdmin
DescribeQuery
DescribeTrails✔️pro✔️✔️✔️✔️✔️Show Tests
DisableFederation
EnableFederation
GetChannel
GetEventDataStore
GetEventSelectors✔️pro✔️✔️
GetImport
GetInsightSelectors✔️pro✔️
GetQueryResults
GetResourcePolicy
GetTrail✔️pro✔️✔️✔️✔️Show Tests
GetTrailStatus✔️pro✔️✔️✔️✔️✔️Show Tests
ListChannels
ListEventDataStores
ListImportFailures
ListImports
ListInsightsMetricData
ListPublicKeys
ListQueries
ListTags✔️pro✔️✔️✔️✔️✔️Show Tests
ListTrails✔️pro✔️✔️✔️✔️Show Tests
LookupEvents✔️pro✔️✔️✔️Show Tests
PutEventSelectors✔️pro✔️✔️✔️✔️✔️Show Tests
PutInsightSelectors✔️pro✔️✔️
PutResourcePolicy
RegisterOrganizationDelegatedAdmin
RemoveTags✔️pro✔️✔️
RestoreEventDataStore
StartEventDataStoreIngestion
StartImport
StartLogging✔️pro✔️✔️✔️✔️✔️Show Tests
StartQuery
StopEventDataStoreIngestion
StopImport
StopLogging✔️pro✔️✔️✔️✔️✔️Show Tests
UpdateChannel
UpdateEventDataStore
UpdateTrail✔️pro✔️✔️✔️✔️✔️Show Tests

Terminology

  • Internal Test Suite: tested by LocalStack's internal integration test suite
  • External Test Suite: covered by an external integration test suite, that runs against LocalStack
  • Terraform Validated: operation tested with Terraform
  • AWS Validated: the integration test that includes this operation call was validated against AWS
  • Snapshot Tested: the operation is part of a snapshot parity test, which verifies the responses by LocalStack and AWS are the same

Testing Details

This section gives an overview about the internal integration test suite and the specific test cases that recorded the API call.

How to read the test details?

For each operation we put up a list of the related integration test cases.
Those operation calls have been recorded during the execution of the outlined test cases. Some calls might be internal, i.e., they are not explicitly called in the test, but are triggered implicitly by the LocalStack framework.

  • Parameters: The tests are ordered by the parameters used, which are highlighted in bold.
  • Test Details: LocalStack Community or LocalStack Pro indicates where the test originates. For each test you see:
    • test name
    • status code returned (which is the expected one for the test case)
    • information about validation:
      • AWS validated the test is validated against AWS, meaning it run successfully against real AWS as well
      • Snapshot Tested this is a snapshot parity test, meaning the responses are validated against AWS


CreateTrail

Parameters: CloudWatchLogsLogGroupArn, CloudWatchLogsRoleArn, EnableLogFileValidation, IncludeGlobalServiceEvents, IsMultiRegionTrail, Name, S3BucketName, TagsList
  • LocalStack Pro
    • test_cdk_trail_cw_logs LocalStack Pro: tests/aws/services/cloudtrail/test_cloudtrail.py::TestCloudTrail::test_cdk_trail_cw_logs HTTP Status Code: 200 AWS validated
Parameters: EnableLogFileValidation, IncludeGlobalServiceEvents, IsMultiRegionTrail, Name, S3BucketName
  • LocalStack Pro
    • test_curl_from_client LocalStack Pro: tests/aws/scenario/ec2_acm_pca/test_ec2_acm_pca.py::TestEC2ACMPCA::test_curl_from_client HTTP Status Code: 200 AWS validated
Parameters: IncludeGlobalServiceEvents, IsMultiRegionTrail, Name, S3BucketName, TagsList
  • LocalStack Pro
    • test_cloud_trail_deploy LocalStack Pro: tests/aws/services/cloudformation/resources/test_cloudtrail.py::test_cloud_trail_deploy HTTP Status Code: 200 AWS validated Snapshot Tested
Parameters: Name, S3BucketName
  • LocalStack Pro
    • test_create_trail LocalStack Pro: tests/aws/services/cloudtrail/test_cloudtrail.py::TestCloudTrail::test_create_trail HTTP Status Code: 200 AWS validated Snapshot Tested
    • test_get_trail_status_of_not_started LocalStack Pro: tests/aws/services/cloudtrail/test_cloudtrail.py::TestCloudTrail::test_get_trail_status_of_not_started HTTP Status Code: 200 AWS validated Snapshot Tested
    • test_get_trail_status_of_started LocalStack Pro: tests/aws/services/cloudtrail/test_cloudtrail.py::TestCloudTrail::test_get_trail_status_of_started HTTP Status Code: 200 AWS validated Snapshot Tested
    • test_get_trail_status_of_started_and_stopped LocalStack Pro: tests/aws/services/cloudtrail/test_cloudtrail.py::TestCloudTrail::test_get_trail_status_of_started_and_stopped HTTP Status Code: 200 AWS validated Snapshot Tested
    • test_no_logging_if_no_startup LocalStack Pro: tests/aws/services/cloudtrail/test_cloudtrail.py::TestCloudTrail::test_no_logging_if_no_startup HTTP Status Code: 200
    • test_start_stop_updates LocalStack Pro: tests/aws/services/cloudtrail/test_cloudtrail.py::TestCloudTrail::test_start_stop_updates HTTP Status Code: 200
    • test_trail_operations_with_arn LocalStack Pro: tests/aws/services/cloudtrail/test_cloudtrail.py::TestCloudTrail::test_trail_operations_with_arn HTTP Status Code: 200 AWS validated Snapshot Tested
    • test_wrong_arn_for_trail_ops LocalStack Pro: tests/aws/services/cloudtrail/test_cloudtrail.py::TestCloudTrail::test_wrong_arn_for_trail_ops HTTP Status Code: 200 AWS validated Snapshot Tested
    • test_invalid_config LocalStack Pro: tests/aws/services/cloudtrail/test_cloudtrail.py::TestCloudTrail::test_invalid_config HTTP Status Code: 400 (InvalidTrailNameException) AWS validated Snapshot Tested
    • test_invalid_config LocalStack Pro: tests/aws/services/cloudtrail/test_cloudtrail.py::TestCloudTrail::test_invalid_config HTTP Status Code: 400 (S3BucketDoesNotExistException) AWS validated Snapshot Tested
Parameters: Name, S3BucketName, S3KeyPrefix
  • LocalStack Pro
    • test_create_misc_resources LocalStack Pro: tests/aws/services/cloudformation/test_api.py::TestAPI::test_create_misc_resources HTTP Status Code: 200 AWS validated Snapshot Tested
    • test_trail_s3_key_prefix LocalStack Pro: tests/aws/services/cloudtrail/test_cloudtrail.py::TestCloudTrail::test_trail_s3_key_prefix HTTP Status Code: 200 AWS validated Snapshot Tested

DeleteTrail

Parameters: Name
  • LocalStack Pro
    • test_curl_from_client LocalStack Pro: tests/aws/scenario/ec2_acm_pca/test_ec2_acm_pca.py::TestEC2ACMPCA::test_curl_from_client HTTP Status Code: 200 AWS validated
    • test_cloud_trail_deploy LocalStack Pro: tests/aws/services/cloudformation/resources/test_cloudtrail.py::test_cloud_trail_deploy HTTP Status Code: 200 AWS validated Snapshot Tested
    • test_create_misc_resources LocalStack Pro: tests/aws/services/cloudformation/test_api.py::TestAPI::test_create_misc_resources HTTP Status Code: 200 AWS validated Snapshot Tested
    • test_cdk_trail_cw_logs LocalStack Pro: tests/aws/services/cloudtrail/test_cloudtrail.py::TestCloudTrail::test_cdk_trail_cw_logs HTTP Status Code: 200 AWS validated
    • test_create_trail LocalStack Pro: tests/aws/services/cloudtrail/test_cloudtrail.py::TestCloudTrail::test_create_trail HTTP Status Code: 200 AWS validated Snapshot Tested
    • test_get_trail_status_of_not_started LocalStack Pro: tests/aws/services/cloudtrail/test_cloudtrail.py::TestCloudTrail::test_get_trail_status_of_not_started HTTP Status Code: 200 AWS validated Snapshot Tested
    • test_get_trail_status_of_started LocalStack Pro: tests/aws/services/cloudtrail/test_cloudtrail.py::TestCloudTrail::test_get_trail_status_of_started HTTP Status Code: 200 AWS validated Snapshot Tested
    • test_get_trail_status_of_started_and_stopped LocalStack Pro: tests/aws/services/cloudtrail/test_cloudtrail.py::TestCloudTrail::test_get_trail_status_of_started_and_stopped HTTP Status Code: 200 AWS validated Snapshot Tested
    • test_no_logging_if_no_startup LocalStack Pro: tests/aws/services/cloudtrail/test_cloudtrail.py::TestCloudTrail::test_no_logging_if_no_startup HTTP Status Code: 200
    • test_start_stop_updates LocalStack Pro: tests/aws/services/cloudtrail/test_cloudtrail.py::TestCloudTrail::test_start_stop_updates HTTP Status Code: 200
    • test_trail_operations_with_arn LocalStack Pro: tests/aws/services/cloudtrail/test_cloudtrail.py::TestCloudTrail::test_trail_operations_with_arn HTTP Status Code: 200 AWS validated Snapshot Tested
    • test_trail_s3_key_prefix LocalStack Pro: tests/aws/services/cloudtrail/test_cloudtrail.py::TestCloudTrail::test_trail_s3_key_prefix HTTP Status Code: 200 AWS validated Snapshot Tested
    • test_wrong_arn_for_trail_ops LocalStack Pro: tests/aws/services/cloudtrail/test_cloudtrail.py::TestCloudTrail::test_wrong_arn_for_trail_ops HTTP Status Code: 200 AWS validated Snapshot Tested
    • test_create_trail LocalStack Pro: tests/aws/services/cloudtrail/test_cloudtrail.py::TestCloudTrail::test_create_trail HTTP Status Code: 400 (TrailNotFoundException) AWS validated Snapshot Tested
    • test_get_trail_status_of_not_started LocalStack Pro: tests/aws/services/cloudtrail/test_cloudtrail.py::TestCloudTrail::test_get_trail_status_of_not_started HTTP Status Code: 400 (TrailNotFoundException) AWS validated Snapshot Tested
    • test_get_trail_status_of_started LocalStack Pro: tests/aws/services/cloudtrail/test_cloudtrail.py::TestCloudTrail::test_get_trail_status_of_started HTTP Status Code: 400 (TrailNotFoundException) AWS validated Snapshot Tested
    • test_get_trail_status_of_started_and_stopped LocalStack Pro: tests/aws/services/cloudtrail/test_cloudtrail.py::TestCloudTrail::test_get_trail_status_of_started_and_stopped HTTP Status Code: 400 (TrailNotFoundException) AWS validated Snapshot Tested
    • test_start_stop_updates LocalStack Pro: tests/aws/services/cloudtrail/test_cloudtrail.py::TestCloudTrail::test_start_stop_updates HTTP Status Code: 400 (TrailNotFoundException)
    • test_trail_operations_with_arn LocalStack Pro: tests/aws/services/cloudtrail/test_cloudtrail.py::TestCloudTrail::test_trail_operations_with_arn HTTP Status Code: 400 (TrailNotFoundException) AWS validated Snapshot Tested

DescribeTrails

Parameters: - (without any parameters)
  • LocalStack Pro
    • test_cdk_trail_cw_logs LocalStack Pro: tests/aws/services/cloudtrail/test_cloudtrail.py::TestCloudTrail::test_cdk_trail_cw_logs HTTP Status Code: 200 AWS validated
    • test_create_trail LocalStack Pro: tests/aws/services/cloudtrail/test_cloudtrail.py::TestCloudTrail::test_create_trail HTTP Status Code: 200 AWS validated Snapshot Tested
    • test_no_logging_if_no_startup LocalStack Pro: tests/aws/services/cloudtrail/test_cloudtrail.py::TestCloudTrail::test_no_logging_if_no_startup HTTP Status Code: 200

GetTrail

Parameters: Name
  • LocalStack Pro
    • test_cloud_trail_deploy LocalStack Pro: tests/aws/services/cloudformation/resources/test_cloudtrail.py::test_cloud_trail_deploy HTTP Status Code: 200 AWS validated Snapshot Tested
    • test_create_trail LocalStack Pro: tests/aws/services/cloudtrail/test_cloudtrail.py::TestCloudTrail::test_create_trail HTTP Status Code: 200 AWS validated Snapshot Tested
    • test_trail_operations_with_arn LocalStack Pro: tests/aws/services/cloudtrail/test_cloudtrail.py::TestCloudTrail::test_trail_operations_with_arn HTTP Status Code: 200 AWS validated Snapshot Tested

GetTrailStatus

Parameters: Name
  • LocalStack Pro
    • test_get_trail_status_of_not_started LocalStack Pro: tests/aws/services/cloudtrail/test_cloudtrail.py::TestCloudTrail::test_get_trail_status_of_not_started HTTP Status Code: 200 AWS validated Snapshot Tested
    • test_get_trail_status_of_started LocalStack Pro: tests/aws/services/cloudtrail/test_cloudtrail.py::TestCloudTrail::test_get_trail_status_of_started HTTP Status Code: 200 AWS validated Snapshot Tested
    • test_get_trail_status_of_started_and_stopped LocalStack Pro: tests/aws/services/cloudtrail/test_cloudtrail.py::TestCloudTrail::test_get_trail_status_of_started_and_stopped HTTP Status Code: 200 AWS validated Snapshot Tested
    • test_start_stop_updates LocalStack Pro: tests/aws/services/cloudtrail/test_cloudtrail.py::TestCloudTrail::test_start_stop_updates HTTP Status Code: 200
    • test_trail_operations_with_arn LocalStack Pro: tests/aws/services/cloudtrail/test_cloudtrail.py::TestCloudTrail::test_trail_operations_with_arn HTTP Status Code: 200 AWS validated Snapshot Tested
    • test_wrong_arn_for_trail_ops LocalStack Pro: tests/aws/services/cloudtrail/test_cloudtrail.py::TestCloudTrail::test_wrong_arn_for_trail_ops HTTP Status Code: 400 (TrailNotFoundException) AWS validated Snapshot Tested
    • test_wrong_arn_for_trail_ops LocalStack Pro: tests/aws/services/cloudtrail/test_cloudtrail.py::TestCloudTrail::test_wrong_arn_for_trail_ops HTTP Status Code: 400 (CloudTrailARNInvalidException) AWS validated Snapshot Tested
    • test_wrong_arn_for_trail_ops LocalStack Pro: tests/aws/services/cloudtrail/test_cloudtrail.py::TestCloudTrail::test_wrong_arn_for_trail_ops HTTP Status Code: 400 (InvalidTrailNameException) AWS validated Snapshot Tested

ListTags

Parameters: ResourceIdList
  • LocalStack Pro
    • test_cloud_trail_deploy LocalStack Pro: tests/aws/services/cloudformation/resources/test_cloudtrail.py::test_cloud_trail_deploy HTTP Status Code: 200 AWS validated Snapshot Tested
    • test_cdk_trail_cw_logs LocalStack Pro: tests/aws/services/cloudtrail/test_cloudtrail.py::TestCloudTrail::test_cdk_trail_cw_logs HTTP Status Code: 200 AWS validated

ListTrails

Parameters: - (without any parameters)
  • LocalStack Pro
    • test_create_misc_resources LocalStack Pro: tests/aws/services/cloudformation/test_api.py::TestAPI::test_create_misc_resources HTTP Status Code: 200 AWS validated Snapshot Tested
    • test_create_trail LocalStack Pro: tests/aws/services/cloudtrail/test_cloudtrail.py::TestCloudTrail::test_create_trail HTTP Status Code: 200 AWS validated Snapshot Tested
    • test_no_logging_if_no_startup LocalStack Pro: tests/aws/services/cloudtrail/test_cloudtrail.py::TestCloudTrail::test_no_logging_if_no_startup HTTP Status Code: 200

LookupEvents

Parameters: - (without any parameters)
  • LocalStack Pro
    • test_filter_lookup_attributes LocalStack Pro: tests/aws/services/cloudtrail/test_cloudtrail.py::TestCloudTrail::test_filter_lookup_attributes HTTP Status Code: 200 AWS validated Snapshot Tested
    • test_filter_lookup_attributes_invalid LocalStack Pro: tests/aws/services/cloudtrail/test_cloudtrail.py::TestCloudTrail::test_filter_lookup_attributes_invalid HTTP Status Code: 200 AWS validated Snapshot Tested
Parameters: LookupAttributes
  • LocalStack Pro
    • test_filter_lookup_attributes_invalid LocalStack Pro: tests/aws/services/cloudtrail/test_cloudtrail.py::TestCloudTrail::test_filter_lookup_attributes_invalid HTTP Status Code: 400 (InvalidLookupAttributesException) AWS validated Snapshot Tested
Parameters: LookupAttributes, StartTime
  • LocalStack Pro
    • test_filter_lookup_attributes LocalStack Pro: tests/aws/services/cloudtrail/test_cloudtrail.py::TestCloudTrail::test_filter_lookup_attributes HTTP Status Code: 200 AWS validated Snapshot Tested
    • test_record_events LocalStack Pro: tests/aws/services/cloudtrail/test_cloudtrail.py::TestCloudTrail::test_record_events HTTP Status Code: 200 AWS validated Snapshot Tested

PutEventSelectors

Parameters: EventSelectors, TrailName
  • LocalStack Pro
    • test_curl_from_client LocalStack Pro: tests/aws/scenario/ec2_acm_pca/test_ec2_acm_pca.py::TestEC2ACMPCA::test_curl_from_client HTTP Status Code: 200 AWS validated
    • test_create_misc_resources LocalStack Pro: tests/aws/services/cloudformation/test_api.py::TestAPI::test_create_misc_resources HTTP Status Code: 200 AWS validated Snapshot Tested
    • test_cdk_trail_cw_logs LocalStack Pro: tests/aws/services/cloudtrail/test_cloudtrail.py::TestCloudTrail::test_cdk_trail_cw_logs HTTP Status Code: 200 AWS validated

StartLogging

Parameters: Name
  • LocalStack Pro
    • test_curl_from_client LocalStack Pro: tests/aws/scenario/ec2_acm_pca/test_ec2_acm_pca.py::TestEC2ACMPCA::test_curl_from_client HTTP Status Code: 200 AWS validated
    • test_cloud_trail_deploy LocalStack Pro: tests/aws/services/cloudformation/resources/test_cloudtrail.py::test_cloud_trail_deploy HTTP Status Code: 200 AWS validated Snapshot Tested
    • test_cdk_trail_cw_logs LocalStack Pro: tests/aws/services/cloudtrail/test_cloudtrail.py::TestCloudTrail::test_cdk_trail_cw_logs HTTP Status Code: 200 AWS validated
    • test_create_trail LocalStack Pro: tests/aws/services/cloudtrail/test_cloudtrail.py::TestCloudTrail::test_create_trail HTTP Status Code: 200 AWS validated Snapshot Tested
    • test_get_trail_status_of_started LocalStack Pro: tests/aws/services/cloudtrail/test_cloudtrail.py::TestCloudTrail::test_get_trail_status_of_started HTTP Status Code: 200 AWS validated Snapshot Tested
    • test_get_trail_status_of_started_and_stopped LocalStack Pro: tests/aws/services/cloudtrail/test_cloudtrail.py::TestCloudTrail::test_get_trail_status_of_started_and_stopped HTTP Status Code: 200 AWS validated Snapshot Tested
    • test_start_stop_updates LocalStack Pro: tests/aws/services/cloudtrail/test_cloudtrail.py::TestCloudTrail::test_start_stop_updates HTTP Status Code: 200
    • test_trail_operations_with_arn LocalStack Pro: tests/aws/services/cloudtrail/test_cloudtrail.py::TestCloudTrail::test_trail_operations_with_arn HTTP Status Code: 200 AWS validated Snapshot Tested

StopLogging

Parameters: Name
  • LocalStack Pro
    • test_create_trail LocalStack Pro: tests/aws/services/cloudtrail/test_cloudtrail.py::TestCloudTrail::test_create_trail HTTP Status Code: 200 AWS validated Snapshot Tested
    • test_get_trail_status_of_started_and_stopped LocalStack Pro: tests/aws/services/cloudtrail/test_cloudtrail.py::TestCloudTrail::test_get_trail_status_of_started_and_stopped HTTP Status Code: 200 AWS validated Snapshot Tested
    • test_start_stop_updates LocalStack Pro: tests/aws/services/cloudtrail/test_cloudtrail.py::TestCloudTrail::test_start_stop_updates HTTP Status Code: 200
    • test_trail_operations_with_arn LocalStack Pro: tests/aws/services/cloudtrail/test_cloudtrail.py::TestCloudTrail::test_trail_operations_with_arn HTTP Status Code: 200 AWS validated Snapshot Tested

UpdateTrail

Parameters: Name, S3BucketName
  • LocalStack Pro
    • test_create_trail LocalStack Pro: tests/aws/services/cloudtrail/test_cloudtrail.py::TestCloudTrail::test_create_trail HTTP Status Code: 200 AWS validated Snapshot Tested
    • test_trail_operations_with_arn LocalStack Pro: tests/aws/services/cloudtrail/test_cloudtrail.py::TestCloudTrail::test_trail_operations_with_arn HTTP Status Code: 200 AWS validated Snapshot Tested