

# Monitoring AWS TNB
Monitoring

Monitoring is an important part of maintaining the reliability, availability, and performance of AWS TNB and your other AWS solutions. AWS provides AWS CloudTrail to watch AWS TNB, report when something is wrong, and take automatic actions when appropriate.

Use CloudTrail to capture detailed information about the calls made to AWS APIs. You can store these calls as log files in Amazon S3. You can use these CloudTrail logs to determine such information as which call was made, the source IP address where the call came from, who made the call, and when the call was made.

The CloudTrail logs contain information about the calls to API actions for AWS TNB. They also contain information for calls to API actions from services such as Amazon EC2 and Amazon EBS.

# Logging AWS Telco Network Builder API calls using AWS CloudTrail
CloudTrail logs

AWS Telco Network Builder is integrated with [AWS CloudTrail](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-user-guide.html), a service that provides a record of actions taken by a user, role, or an AWS service. CloudTrail captures all API calls for AWS TNB as events. The calls captured include calls from the AWS TNB console and code calls to the AWS TNB API operations. Using the information collected by CloudTrail, you can determine the request that was made to AWS TNB, the IP address from which the request was made, when it was made, and additional details.

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 user or user credentials.
+ Whether the request was made on behalf of an IAM Identity Center user.
+ Whether the request was made with temporary security credentials for a role or federated user.
+ Whether the request was made by another AWS service.

CloudTrail is active in your AWS account when you create the account and you automatically have access to the CloudTrail **Event history**. The CloudTrail **Event history** provides a viewable, searchable, downloadable, and immutable record of the past 90 days of recorded management events in an AWS Region. For more information, see [Working with CloudTrail Event history](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/view-cloudtrail-events.html) in the *AWS CloudTrail User Guide*. There are no CloudTrail charges for viewing the **Event history**.

For an ongoing record of events in your AWS account past 90 days, create a trail or a [CloudTrail Lake](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-lake.html) event data store.

**CloudTrail trails**  
A *trail* enables CloudTrail to deliver log files to an Amazon S3 bucket. All trails created using the AWS Management Console are multi-Region. You can create a single-Region or a multi-Region trail by using the AWS CLI. Creating a multi-Region trail is recommended because you capture activity in all AWS Regions in your account. If you create a single-Region trail, you can view only the events logged in the trail's AWS Region. For more information about trails, see [Creating a trail for your AWS account](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-create-and-update-a-trail.html) and [Creating a trail for an organization](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-trail-organization.html) in the *AWS CloudTrail User Guide*.  
You can deliver one copy of your ongoing management events to your Amazon S3 bucket at no charge from CloudTrail by creating a trail, however, there are Amazon S3 storage charges. For more information about CloudTrail pricing, see [AWS CloudTrail Pricing](https://aws.amazon.com/cloudtrail/pricing/). For information about Amazon S3 pricing, see [Amazon S3 Pricing](https://aws.amazon.com/s3/pricing/).

**CloudTrail Lake event data stores**  
*CloudTrail Lake* lets you run SQL-based queries on your events. CloudTrail Lake converts existing events in row-based JSON format to [ Apache ORC](https://orc.apache.org/) format. ORC is a columnar storage format that is optimized for fast retrieval of data. Events are aggregated into *event data stores*, which are immutable collections of events based on criteria that you select by applying [advanced event selectors](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-lake-concepts.html#adv-event-selectors). The selectors that you apply to an event data store control which events persist and are available for you to query. For more information about CloudTrail Lake, see [Working with AWS CloudTrail Lake](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-lake.html) in the *AWS CloudTrail User Guide*.  
CloudTrail Lake event data stores and queries incur costs. When you create an event data store, you choose the [pricing option](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-lake-manage-costs.html#cloudtrail-lake-manage-costs-pricing-option) you want to use for the event data store. The pricing option determines the cost for ingesting and storing events, and the default and maximum retention period for the event data store. For more information about CloudTrail pricing, see [AWS CloudTrail Pricing](https://aws.amazon.com/cloudtrail/pricing/).

## AWS TNB event examples


An event represents a single request from any source and includes information about the requested API operation, the date and time of the operation, request parameters, and so on. CloudTrail log files aren't an ordered stack trace of the public API calls, so events don't appear in any specific order.

The following example shows a CloudTrail event that demonstrates the `CreateSolFunctionPackage` operation.

```
{
    "eventVersion": "1.08",
    "userIdentity": {
        "type": "AssumedRole",
        "principalId": "AIDACKCEVSQ6C2EXAMPLE:example",
        "arn": "arn:aws:sts::111222333444:assumed-role/example/user",
        "accountId": "111222333444",
        "accessKeyId": "AKIAIOSFODNN7EXAMPLE",
        "sessionContext": {
            "sessionIssuer": {
                "type": "Role",
                "principalId": "AIDACKCEVSQ6C2EXAMPLE",
                "arn": "arn:aws:iam::111222333444:role/example",
                "accountId": "111222333444",
                "userName": "example"
            },
            "webIdFederationData": {},
            "attributes": {
                "creationDate": "2023-02-02T01:42:39Z",
                "mfaAuthenticated": "false"
            }
        }
    },
    "eventTime": "2023-02-02T01:43:17Z",
    "eventSource": "tnb.amazonaws.com",
    "eventName": "CreateSolFunctionPackage",
    "awsRegion": "us-east-1",
    "sourceIPAddress": "XXX.XXX.XXX.XXX",
    "userAgent": "userAgent",
    "requestParameters": null,
    "responseElements": {
        "vnfPkgArn": "arn:aws:tnb:us-east-1:111222333444:function-package/fp-12345678abcEXAMPLE",
        "id": "fp-12345678abcEXAMPLE",
        "operationalState": "DISABLED",
        "usageState": "NOT_IN_USE",
        "onboardingState": "CREATED"
    },
    "requestID": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111",
    "eventID": "a1b2c3d4-5678-90ab-cdef-EXAMPLE22222",
    "readOnly": false,
    "eventType": "AwsApiCall",
    "managementEvent": true,
    "recipientAccountId": "111222333444",
    "eventCategory": "Management"
}
```

For information about CloudTrail record contents, see [CloudTrail record contents](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-event-reference-record-contents.html) in the *AWS CloudTrail User Guide*.

# AWS TNB deployment tasks
Deployment tasks

Understand the deployment tasks to effectively monitor deployments and take action faster.

The following table lists the AWS TNB deployment tasks:


| Task name for deployments started before March 7, 2024 | Task name for deployments started on and after March 7, 2024 | Task description | 
| --- | --- | --- | 
| AppInstallation | ClusterPluginInstall | Installs the Multus plugin on the Amazon EKS cluster. | 
| AppUpdate | *no change in name* | Updates the network functions that are already installed in a network instance. | 
| *-* | ClusterPluginUninstall | Uninstalls the plugins on the Amazon EKS cluster. | 
| ClusterStorageClassConfiguration | *no change in name* | Configures the storage class (CSI driver) on an Amazon EKS cluster. | 
| FunctionDeletion | *no change in name* | Deletes network functions from AWS TNB resources. | 
| FunctionInstantiation | FunctionInstall | Deploys network functions using HELM. | 
| FunctionUninstallation | FunctionUninstall | Uninstalls the network function from an Amazon EKS cluster. | 
| HookExecution | *no change in name* | Executes lifecycle hooks as defined in the NSD. | 
| InfrastructureCancellation | *no change in name* | Cancels a network service. | 
| InfrastructureInstantation | *no change in name* | Provisions AWS resources on behalf of the user. | 
| InfrastructureTermination | *no change in name* | Deprovisions AWS resources invoked through AWS TNB. | 
| *-* | InfrastructureUpdate | Updates the AWS resources provisioned on behalf of the user. | 
| InventoryDeregistration | *no change in name* | Deregisters AWS resources from AWS TNB. | 
| *-* | InventoryRegistration | Registers the AWS resources in AWS TNB. | 
| KubernetesClusterConfiguration | ClusterConfiguration | Configures the Kubernetes cluster and adds additional IAM roles to the Amazon EKS AuthMap as defined in the NSD. | 
| NetworkServiceFinalization | *no change in name* | Finalizes the network service and provides a success or failure status update. | 
| NetworkServiceInstantiation | *no change in name* | Initializes the network service. | 
| SelfManagedNodesConfiguration | *no change in name* | Bootstraps self-managed nodes with Amazon EKS and Kubernetes control plane. | 
| *-* | ValidateNetworkServiceUpdate | Runs the validations before updating a network instance. | 