Logging AWS App Monetization API calls using AWS CloudTrail
AWS App Monetization is integrated with AWS CloudTrail, a service that provides a record of actions
taken by a user, role, or an AWS service in AWS App Monetization. CloudTrail records the AWS App Monetization API calls
that you make with AWS credentials as events. Calls that manage apps, plans, metrics,
one-time prices, subscriptions, and payment registration are recorded as management events.
The per-request runtime calls PutEvent, PutAwsServiceEvent, and
GetEntitlementDecision are data events on the
AWS::AppMonetization::App resource type. CloudTrail doesn't log data events by
default. To record them, add the AWS::AppMonetization::App resource type to a
trail or event data store with advanced event selectors. Additional charges apply for data
events. The hosted checkout and billing portal pages that
your end users open with a session link don't use AWS credentials and aren't recorded in
CloudTrail. If you create a trail, you can enable continuous delivery of CloudTrail events to an Amazon S3
bucket, including events for AWS App Monetization. If you don't configure a trail, you can still view
the most recent management events in the CloudTrail console in Event
history. Using the information collected by CloudTrail, you can
determine the request that was made to AWS App Monetization, the IP address from which the request
was made, who made the request, when it was made, and additional details.
To learn more about CloudTrail, see the AWS CloudTrail User Guide.
AWS App Monetization information in CloudTrail
CloudTrail is enabled on your AWS account when you create the account. When activity occurs in AWS App Monetization, management events are recorded along with other AWS service events in Event history. You can view, search, and download recent management events in your AWS account. For more information, see Viewing events with CloudTrail Event history.
For an ongoing record of events in your AWS account, including events for AWS App Monetization, create a trail. A trail enables CloudTrail to deliver log files to an Amazon S3 bucket. By default, when you create a trail in the console, the trail applies to all AWS Regions. The trail logs events from all Regions in the AWS partition and delivers the log files to the Amazon S3 bucket that you specify. Additionally, you can configure other AWS services to further analyze and act upon the event data collected in CloudTrail logs. For more information, see the following:
CloudTrail records every other AWS App Monetization action as a management event. The AWS App Monetization API Reference
documents each action. Calls to the CreateApp, CreatePlan, PublishDraft,
CreateAppPaymentRegistration, and DeleteApp actions generate
entries in the CloudTrail log files.
Every event or log entry contains information about who generated the request. The identity information helps you determine the following:
-
Whether the request was made with root or AWS Identity and Access Management (IAM) user credentials.
-
Whether the request was made with temporary security credentials for a role or federated user.
-
Whether the request was made by another AWS service.
For more information, see the CloudTrail userIdentity element.
Understanding AWS App Monetization log file entries
A trail is a configuration that enables delivery of events as log files to an Amazon S3 bucket that you specify. CloudTrail log files contain one or more log entries. An event represents a single request from any source and includes information about the requested action, the date and time of the action, request parameters, and so on. CloudTrail log files aren't an ordered stack trace of the public API calls, so they don't appear in any specific order.
The following example shows a CloudTrail log entry that demonstrates the
CreatePlan action. The request parameters show the plan definition the caller
sent. The response elements show the plan ID and ARN that AWS App Monetization assigned. Fields
that can hold personal or confidential data, such as a plan description or a seller's tax registration
number on CreateAppPaymentRegistration, are replaced with
HIDDEN_DUE_TO_SECURITY_REASONS in the event.
{ "eventVersion": "1.09", "userIdentity": { "type": "AssumedRole", "principalId": "AROA123456789EXAMPLE:dev-user", "arn": "arn:aws:sts::111122223333:assumed-role/AppDeveloperRole/dev-user", "accountId": "111122223333", "accessKeyId": "ASIAEXAMPLEKEYID" }, "eventTime": "2026-11-08T02:14:36Z", "eventSource": "appmonetization.amazonaws.com", "eventName": "CreatePlan", "awsRegion": "us-east-2", "sourceIPAddress": "10.0.0.1", "userAgent": "aws-sdk-java/2.31.0", "requestParameters": { "appId": "01a1EXAMPLEAPPID7f3e2b1c", "clientToken": "6b0d7c4e-EXAMPLE-TOKEN", "definition": { "name": "Pro", "description": "HIDDEN_DUE_TO_SECURITY_REASONS", "billingCycle": "MONTHLY", "subscriptionPrice": {"amount": "20.00", "currencyCode": "USD"} } }, "responseElements": { "plan": { "appId": "01a1EXAMPLEAPPID7f3e2b1c", "planId": "01a1EXAMPLEPLANID9c8d7e6f", "definition": { "name": "Pro", "description": "HIDDEN_DUE_TO_SECURITY_REASONS", "billingCycle": "MONTHLY", "subscriptionPrice": {"amount": "20.00", "currencyCode": "USD"} }, "arn": "arn:aws:appmonetization:us-east-2:111122223333:apps/01a1EXAMPLEAPPID7f3e2b1c/plans/01a1EXAMPLEPLANID9c8d7e6f" } }, "requestID": "9e590f53-EXAMPLE-REQUEST-ID", "eventID": "c41c465f-EXAMPLE-EVENT-ID", "readOnly": false, "eventType": "AwsApiCall", "managementEvent": true, "recipientAccountId": "111122223333" }
The following fields in the example are the ones that you use most often:
userIdentity-- the principal that made the request, including its account and the role session.eventSourceandeventName-- the service and the action that was called.requestParameters-- the input that the caller sent.responseElements-- the output that AWS App Monetization returned, with sensitive fields replaced.