Centralized Logging: Implementation Guide
Centralized Logging: Implementation Guide
Implementation Guide
Centralized Logging Implementation Guide
Amazon's trademarks and trade dress may not be used in connection with any product or service that is not
Amazon's, in any manner that is likely to cause confusion among customers, or in any manner that disparages or
discredits Amazon. All other trademarks not owned by Amazon are the property of their respective owners, who may
or may not be affiliated with, connected to, or sponsored by Amazon.
Centralized Logging Implementation Guide
Table of Contents
Welcome ........................................................................................................................................... 1
Cost .................................................................................................................................................. 2
Cost estimate example ............................................................................................................... 2
Architecture overview ......................................................................................................................... 4
Log ingestion ............................................................................................................................. 4
Log indexing .............................................................................................................................. 6
Visualization .............................................................................................................................. 6
Security ............................................................................................................................................ 8
OpenSearch Service in Amazon VPC ............................................................................................. 8
Amazon Cognito ........................................................................................................................ 8
Access Policy ............................................................................................................................. 9
Considerations ................................................................................................................................. 10
Custom sizing .......................................................................................................................... 10
Scalability ................................................................................................................................ 10
Deployment options ................................................................................................................. 10
Sample logs ..................................................................................................................... 10
Logging across accounts and Regions ................................................................................. 11
Solution updates ...................................................................................................................... 11
Regional deployments ............................................................................................................... 11
Templates ........................................................................................................................................ 12
Automated deployment .................................................................................................................... 13
Deployment overview ............................................................................................................... 13
Step 1. Launch the stack ........................................................................................................... 13
Step 2. (Optional) Configure the Kibana dashboard ...................................................................... 16
Create an index ................................................................................................................ 16
Import dashboard ............................................................................................................ 17
Step 3. (Optional) Launch the demo stack in your spoke accounts or spoke Regions ........................... 18
Additional resources ......................................................................................................................... 20
Sample logs ..................................................................................................................................... 21
Sample logs Apache web server ................................................................................................. 21
Accessing Jumpbox ........................................................................................................................... 22
Adding custom CloudWatch Logs ....................................................................................................... 23
Adding social identity providers ......................................................................................................... 24
Troubleshooting ............................................................................................................................... 26
Common Errors ........................................................................................................................ 26
Validation error with the AWS CloudFormation primary template ........................................... 26
Error in creating a CloudWatch Logs subscription filter .......................................................... 27
CloudWatch Logs group already exists ................................................................................ 27
Invalid Region parameter entered in the primary template .................................................... 28
An Amazon VPC limit error ................................................................................................ 28
An AWS CloudFormation nested stack stays in a REVIEW_IN_PROGRESS status ......................... 29
Migrate your solution data ................................................................................................................ 30
Uninstall the solution ....................................................................................................................... 31
Using the AWS Management Console ......................................................................................... 31
Using AWS Command Line Interface ........................................................................................... 31
Deleting the Amazon S3 buckets ................................................................................................ 31
Deleting the CloudWatch Logs ................................................................................................... 32
Operational metrics .......................................................................................................................... 33
Source code ..................................................................................................................................... 34
Revisions ......................................................................................................................................... 35
Contributors .................................................................................................................................... 36
Notices ............................................................................................................................................ 37
iii
Centralized Logging Implementation Guide
The Centralized Logging solution collects, analyzes, and displays Amazon CloudWatch Logs in a single
dashboard. Amazon Web Services (AWS) services generate log data, such as audit logs for access,
configuration changes, and billing events. In addition to AWS log data, web servers, applications, and
operating systems all generate log files in various formats. Consolidating, managing, and analyzing these
different log files is challenging to customers.
This solution contains a suite of infrastructure services that deploy a centralized logging solution.
You can collect Amazon CloudWatch Logs from multiple accounts and AWS Regions. It uses Amazon
OpenSearch Service (successor to Amazon Elasticsearch Service) and Kibana, an analytics and
visualization platform that is integrated with Amazon OpenSearch Service, to create a unified view of all
the log events. In combination with other AWS managed services, this solution provides customers with a
turnkey environment to begin logging and analyzing your AWS environment and applications.
This solution also includes a demo AWS CloudFormation template that deploys sample logs, which you
can use for testing purposes. We recommend deploying this optional template so that you can test how
the solution works with sample logs generated by the demo resources.
The information in this guide assumes basic familiarity of web, application, and operating system log
formats. Working knowledge of Amazon OpenSearch Service and Kibana for creating and customizing
your own dashboards and visualizations, is recommended.
This implementation guide describes architectural considerations and configuration steps for deploying
the Centralized Logging solution in the AWS Cloud. It includes links to CloudFormation templates that
launch, configure, and run the AWS compute, network, storage, and other services required to deploy
this solution on AWS, using AWS best practices for security and availability.
The guide is intended for IT infrastructure architects, administrators, and DevOps professionals who have
practical experience architecting in the AWS Cloud.
1
Centralized Logging Implementation Guide
Cost estimate example
Cost
You are responsible for the cost of the AWS services used while running this solution. As of June 2021,
the cost for running this solution using a small Amazon OpenSearch Service cluster size, and assuming
an average record size of 5 KB at a rate of 1 records/second for Amazon Kinesis Data Firehose and 1
shard provisioned for Amazon Kinesis Data Streams, with default settings in the US East (N. Virginia)
Region is approximately $832.08/month. A detailed breakdown of this cost estimate is provided in the
following tables.
Small $806.40
Medium $3,477.46
Large $6,696.00
The following example cost estimate uses a small Amazon OpenSearch Service cluster size as the basis
for calculation and assumes an average record size of 5 KB at a rate of 1 record/second. To determine the
cost estimate using different Amazon OpenSearch Service cluster sizes, replace the Total Cost amount
with the cost for the corresponding cluster size.
Note
The cost for running this solution is a formula based on size of your log records and the rate at
which this data is being sent to the Kinesis Data and Delivery Streams. Transfer costs between
Regions using CloudWatch destinations are not accounted for in this cost estimate
2
Centralized Logging Implementation Guide
Cost estimate example
Total: $832.08
This cost estimate does not reflect variable, usage-driven charges incurred from Amazon CloudWatch,
AWS CloudTrail, and AWS Lambda. The two most significant cost contributors for this solution are Kinesis
Data Firehose and Kinesis Data Streams. For information on Kinesis Data Firehose pricing and sample
scenarios, refer to the Amazon Kinesis Data Firehose pricing page. For information on Kinesis Data
Streams pricing and sample scenarios, refer to the Amazon Kinesis Data Streams pricing page. Prices
are subject to change. For full details, refer to the pricing webpage for each AWS service used in this
solution.
3
Centralized Logging Implementation Guide
Log ingestion
Architecture overview
Deploying this solution with the default parameters builds the following environment in the AWS Cloud.
The Centralized Logging solution contains the following components: log ingestion, log indexing, and
visualization.
Note
Deploy the AWS CloudFormation template in the AWS account where you intend to store your
log data.
Log ingestion
For the log ingestion component, the AWS CloudFormation template deploys Amazon CloudWatch Logs
destinations in the primary account.
4
Centralized Logging Implementation Guide
Log ingestion
1. This solution uses the CloudWatch Logs destination capability for log streaming. CloudWatch Logs
destinations are created with the required permissions in each of the selected Regions in your
primary account. After the destinations are created with the necessary permissions, you can configure
CloudWatch Logs subscription filters for log groups to be streamed to the centralized logging account.
For information about creating custom CloudWatch Logs, refer to Adding custom CloudWatch
Logs (p. 23).
Note
You can control the spoke streams that will log events to the primary account using the
Spoke Account and Spoke Region parameters. These parameters can be updated at any time
after installation to add/remove accounts and Regions.
2. An optional demo AWS CloudFormation template can be deployed to generate sample CloudWatch
Logs for AWS CloudTrail, Amazon Virtual Private Cloud (Amazon VPC) flow logs, and an Amazon
Elastic Compute Cloud (Amazon EC2) web server. For information about the sample logs, refer to
Sample logs (p. 21). The demo template configures each of these log groups with the needed
subscription filters to stream log events to the CloudWatch Logs destination in the centralized logging
account, as shown in Figure 2.
Important
Since the sample logs Apache web server is publicly accessible, we do not recommend
deploying the demo AWS CloudFormation template in a production environment.
5
Centralized Logging Implementation Guide
Log indexing
Log indexing
For the log indexing component, the AWS CloudFormation template deploys Amazon Kinesis Data
Streams, AWS Lambda functions, Amazon Kinesis Data Firehose, and Amazon OpenSearch Service, as
shown in Figure 3.
1. A centralized Kinesis Data Streams is provisioned to index log events on the centralized Amazon
OpenSearch Service domain. The CloudWatch Logs destinations created to stream log events, have
Kinesis Data Streams as their target.
2. Once the log events stream to Kinesis Data Streams, the service invokes an AWS Lambda function to
transform each log event to an Amazon OpenSearch Service document, which is then put in Kinesis
Data Firehose.
3. Kinesis Data Firehose indexes the documents on the Amazon OpenSearch Service domain.
4. Kinesis Data Firehose logs errors in CloudWatch and delivers the records to Amazon Simple Storage
Service (Amazon S3) for low-cost storage.
Note
You can monitor Kinesis Data Firehose as it sends custom CloudWatch Logs containing
detailed monitoring data for each delivery stream.
Visualization
This solution provides data visualization and exploration support using Amazon OpenSearch Service
and Kibana. An Amazon OpenSearch Service domain is created inside an Amazon VPC, preventing public
access to the Kibana dashboard. Access to the Kibana dashboard is secured using a VPC security group
and an AWS Identity and Access Management (IAM) role.
6
Centralized Logging Implementation Guide
Visualization
This solution optionally launches a Microsoft Windows Jumpbox Server that can be used to access the
Amazon OpenSearch Service cluster and Kibana dashboard. An administrator account is configured
to provide the permission to access the Kibana dashboard. This solution uses an Amazon Cognito user
pool and an identity pool for authentication and authorization. For additional information about this
solution’s security, refer to Security (p. 8).
7
Centralized Logging Implementation Guide
OpenSearch Service in Amazon VPC
Security
When you build systems on AWS infrastructure, security responsibilities are shared between you and
AWS. This shared model can reduce your operational burden as AWS operates, manages, and controls
the components from the host operating system and virtualization layer down to the physical security of
the facilities in which the services operate. For more information about security on AWS, visit AWS Cloud
Security.
Amazon Cognito
Amazon OpenSearch Service uses Amazon Cognito to provide secure access (username and password)
to Kibana. An admin user is created in a Cognito user pool as part of the solution’s deployment. Access
8
Centralized Logging Implementation Guide
Access Policy
to the Amazon OpenSearch Service domain is restricted to authorized users using an Amazon Cognito
identity pool. To activate federated access for social identify providers, refer to Adding social identity
providers (p. 24). For information about enabling multi-factor authentication (MFA) to a user pool,
refer to Adding Multi-Factor Authentication (MFA) to a User Pool in the Amazon Cognito Developer Guide.
Access policy
The Centralized Logging solution creates an Amazon OpenSearch Service domain with an access policy
that restricts access to two roles:
• Kinesis Data Firehose role: to allow Kinesis Data Firehose to index documents in the Amazon
OpenSearch Service domain.
• Authenticated users role: to allow authorized users to view indexed data on the Kibana dashboard.
9
Centralized Logging Implementation Guide
Custom sizing
Design considerations
Custom sizing
This solution offers three preset Amazon OpenSearch Service cluster sizes to help support your
anticipated log traffic:
• Small:
• 3 dedicated primary nodes; c5.large.search instance type
• 4 data nodes; r5.large.search instance type
• Medium:
• 3 dedicated primary nodes; c5.large.search instance type
• 6 data nodes; r5.2xlarge.search instance type
• Large:
• 3 dedicated primary nodes; c5.large.search instance type
• 6 data nodes; r5.4xlarge.search instance type
Scalability
You can modify your cluster’s instance count and type directly in Amazon OpenSearch Service to
accommodate your changing environment and requirements, without having to reconfigure the
solution’s architecture or manage backend resources. As a best practice, we recommend that you monitor
your cluster’s performance metrics, which can help you update the cluster size for future business needs.
Refer to the Amazon OpenSearch Service FAQs for information about Amazon OpenSearch Service
clusters.
Deployment options
This solution offers the following deployment options:
1. Deploy the primary template into your AWS account without enabling sample logs; toggle the Sample
Log parameter to No.
2. Deploy the primary template into your AWS account with sample logs activated, which sets up a single
region within the primary account for generating demo data; toggle the Sample Log parameter to
Yes.
3. Deploy the primary template into your AWS account and deploy the demo template into spoke
accounts or spoke Regions to test the multi-account, multi-Region set up; enter the necessary
information in the primary template’s Spoke Accounts and Spoke Regions parameters.
Sample logs
This solution provides sample logs you can use for testing purposes. You can activate these sample logs
from the AWS CloudFormation template, under the Sample Logs parameter. You can either activate this
parameter during initial deployment, or post-deployment, when you update the stack. When activated,
10
Centralized Logging Implementation Guide
Logging across accounts and Regions
the AWS CloudFormation template launches the centralized-logging-demo nested stack. For
additional information about sample logs, refer to Sample logs (p. 21).
Important
Since the sample logs Apache web server is publicly accessible, we do not recommend deploying
the demo AWS CloudFormation template in a production environment.
You can update these parameters, adding or removing Spoke Accounts or Spoke Regions, at any
time post-deployment by updating the stack. Refer to Adding custom CloudWatch Logs (p. 23) for
additional information about adding custom CloudWatch Logs.
Note
The latest version of this solution no longer requires you to install a separate spoke template
in your secondary AWS accounts for multi-account usage. You can assign spoke accounts and
spoke Regions from the primary template’s parameters; and run the command mentioned in the
output section of the template from the spoke accounts or Regions.
Solution updates
If you are using a previous version of this solution (v3.x or earlier), we recommend deploying the latest
version of the AWS CloudFormation template as a new stack. You can migrate your existing solution’s
data to the new version by following the migration steps in Migrate your solution data (p. 30). After
you have migrated your data, we recommend uninstalling the previous version to save on costs. Refer to
Uninstall the solution (p. 31) for instructions to uninstall the primary AWS CloudFormation template.
Regional deployments
This solution uses Amazon Cognito which is available in specific AWS Regions only. You must launch this
solution’s primary template in a Region that supports Amazon Cognito. (For the most current service
availability by Region, refer to the AWS Regional Services List.
11
Centralized Logging Implementation Guide
12
Centralized Logging Implementation Guide
Deployment overview
Automated deployment
Before you launch the solution, review the architecture, configuration and other considerations in this
guide. Follow the step-by-step instructions in this section to configure and deploy the solution into your
account.
Deployment overview
Before deploying, review the available Deployment options (p. 10). Use the following steps to deploy this
solution on AWS. For detailed instructions, follow the links for each step.
Step 3. (Optional) Launch the demo stack in your spoke accounts or spoke Regions (p. 18)
• Create sample resources that allow you to test the solution using a sample Kibana dashboard.
1. Sign in to the AWS Management Console and use the button below to launch the centralized-
logging-primary AWS CloudFormation template.
13
Centralized Logging Implementation Guide
Step 1. Launch the stack
Alternatively, you can download the template as a starting point for your own implementation.
2. The template launches in the US East (N. Virginia) Region by default. To launch the solution in a
different AWS Region, use the Region selector in the console navigation bar.
3. On the Create stack page, verify that the correct template URL is in the Amazon S3 URL text box
and choose Next.
4. On the Specify stack details page, assign a name to your solution stack. For information
about naming character limitations, refer to IAM and STS Limits in the AWS Identity and Access
Management User Guide.
5. Under Parameters, review the parameters for this solution template and modify them as necessary.
This solution uses the following default values.
14
Centralized Logging Implementation Guide
Step 1. Launch the stack
For example,us-east-1,us-
east-2
Key pair for jumpbox <Optional input> If you chose yes for Jumpbox
Deployment, provide the
existing key pair for Windows
Jumpbox Server. Verify that
you have access to the key pair.
6. Choose Next.
7. On the Configure stack options page, choose Next.
8. On the Review page, review and confirm the settings. Check the box acknowledging that the
template will create AWS Identity and Access Management (IAM) resources.
9. Choose Create stack to deploy the stack.
You can view the status of the stack in the AWS CloudFormation Console in the Status column. You
should receive a CREATE_COMPLETE status in approximately 30 minutes.
To view details for the stack resources, choose the Outputs tab. The following table describes the
solution’s outputs.
Key Description
Destination Subscription Command This command can be run in the Spoke Accounts
and Spoke Regions for streaming logs to the
centralized account.
Note
This solution deploys an AWS Lambda function, solution-helper, which runs only during
initial configuration or when resources are updated or deleted. You can view the solution-
helper function in the AWS Lambda console. Do not delete this function, as it is needed to
manage associated resources.
Once the primary stack deployment completes, you will receive two emails:
• One email contains the temporary credentials for the Amazon Cognito user pool user created during
deployment.
• The second email provides the Amazon Simple Notification Service (Amazon SNS) subscription
information required to receive alerts on AWS Lambda failures. Ensure that you Confirm Subscription.
15
Centralized Logging Implementation Guide
Step 2. (Optional) Configure the Kibana dashboard
After the Centralized Logging solution is deployed, you will receive a verification email with a user name
and password to access the Kibana dashboard. Use the following steps to set up a Windows Jumpbox
Server, sign in to Kibana, add an Amazon OpenSearch Service index, and import the solution’s sample
dashboard.
Before you can begin, you must launch a Windows Jumpbox Server inside the public subnet for the
solution’s Amazon VPC. For information about accessing your Windows Jumpbox Server, refer to
Accessing Jumpbox (p. 22).
1. Use remote desktop protocol (RDP) to sign in to the Windows Jumpbox Server.
2. Sign in to the AWS CloudFormation console and select this solution’s primary stack.
3. Select the Outputs tab and copy the KibanaURL link for the Kibana dashboard.
4. In your Windows Jumpbox Server, enter the KibanaURL in a web browser. We recommend using either
Mozilla Firefox or Google Chrome.
5. Sign in to the Kibana dashboard with the user name and password from your verification email. Note
that you will be prompted to change the password when you sign in for the first time.
Create an index
1. From your Kibana dashboard, select Connect to your Elasticsearch index.
2. From Create index pattern, in the Index pattern field, enter cwl-* as shown in Figure 6. The
message box underneath should change confirming that there are matching indices.
16
Centralized Logging Implementation Guide
Import dashboard
Import dashboard
1. Download the dashboard configuration file (dashboard.ndjson) from this solution’s Amazon S3
bucket. You will use this file to configure your first dashboard.
2. On your Kibana dashboard, choose Saved Objects from the left menu pane.
3. From the Saved Objects page, choose Import and select the dashboard.ndjson file.
• Adjust the data time period by choosing the clock icon in the upper-right corner of the screen.
• Adjust the interval for the data refresh rate by choosing the Auto-refresh option.
17
Centralized Logging Implementation Guide
Step 3. (Optional) Launch the demo stack
in your spoke accounts or spoke Regions
Explore and experiment with the dashboard settings. You can interact with the Apache server to view the
events passed to the dashboard metrics. For example, to confirm that error logs are getting logged and
visualized on the dashboard, you can request a webpage that doesn’t exist to verify the 404 error count
increases. The visualization displays various information, such as the top 10 rejected source IP addresses.
You can create and save additional visualizations based on the data that is relevant to your application.
For more information, refer to the Kibana User Guide.
1. In your spoke account, or from a spoke Region, sign in to the AWS Management Console and use the
button below to launch the centralized-logging-demo AWS CloudFormation template.
Alternatively, you can download the template as a starting point for your own implementation.
2. The template launches in the US East (N. Virginia) Region by default. To launch the solution in a
different AWS Region, use the Region selector in the console navigation bar.
3. On the Create stack page, verify that the correct template URL is in the Amazon S3 URL text box
and choose Next.
4. On the Specify stack details page, assign a name to your solution stack. For information
about naming character limitations, refer to IAM and STS Limits in the AWS Identity and Access
Management User Guide.
18
Centralized Logging Implementation Guide
Step 3. (Optional) Launch the demo stack
in your spoke accounts or spoke Regions
5. Under Parameters, review the parameter for this demo template and update as necessary.
CloudWatch Logs Destination <Requires input> Enter the ARN for the
ARN CloudWatch Logs destination
that was created in the primary
account. This value can be
identified in the primary
template’s Output tab from
the Destination Subscription
Command output.
6. Choose Next.
7. On the Options page, choose Next.
8. On the Review page, review and confirm the settings. Check the box acknowledging that the
template will create AWS Identity and Access Management (IAM) resources.
9. Choose Create to deploy the stack.
You can view the status of the stack in the AWS CloudFormation console in the Status column. You
should receive a CREATE_COMPLETE status in approximately five minutes.
19
Centralized Logging Implementation Guide
Additional resources
AWS services
Additional documentation
20
Centralized Logging Implementation Guide
Sample logs Apache web server
Sample logs
The Centralized Logging solution includes a centralized-logging-demo AWS CloudFormation
template that deploys sample logs you can use for testing purposes. This demo template launches an
Amazon Elastic Compute Cloud (Amazon EC2) instance with a reference Apache server that hosts a
simple web application in an Amazon Virtual Private Cloud (Amazon VPC). During initial launch, the
Amazon CloudWatch Logs agent is automatically installed on the instance, which is used to direct raw
log data to Amazon CloudWatch.
VPC Flow Logs are activated in the VPC to capture information about IP traffic to, from, and within
the network. Customers can use this example to activate VPC Flow Logs in other VPCs; this data is
automatically published to a log group in Amazon CloudWatch Logs.
The demo template activates AWS CloudTrail and creates a trail for the account. It also creates an
Amazon Simple Storage Service (Amazon S3) bucket to store CloudTrail logs, which are automatically
delivered to Amazon CloudWatch.
The demo template also configures the sample log groups with CloudWatch subscription filters to
stream log events to the centralized account.
This demo template can be automatically deployed when you activate the Sample Logs parameters in
the primary solution template.
21
Centralized Logging Implementation Guide
Accessing Jumpbox
This solution launches an Amazon OpenSearch Service domain inside an Amazon VPC. To access and
view the Kibana dashboard, a Windows Jumpbox Server (bastion host) in a public subnet must be set up
in the same VPC as the Amazon OpenSearch Service domain.
This solution can automatically deploy a Windows Jumpbox Server if you set the Jumpbox Deploy
parameter to Yes when you launch the stack (p. 13). Optionally, you can launch your own Windows
Jumpbox Server. Once your Windows Jumpbox Server is running, you can take the following steps to
connect to it using your remote desktop protocol (RDP):
22
Centralized Logging Implementation Guide
23
Centralized Logging Implementation Guide
https://<your-user-pool-domain>
• In the Authorized Redirect URIs, enter your user pool domain with the /oauth2/idpresponse
endpoint.
https://<your-user-pool-domain>/oauth2/idpresponse
5. Choose Create.
6. Record the OAuth client ID and client secret for use in the next steps.
7. Choose OK.
Take the following steps to configure an Amazon Cognito user pool social identity provider:
1. Sign in to the Amazon Cognito console and choose Manage User Pools.
2. Choose the user pool created by the solution.
3. On the left menu bar, choose Identity providers and choose a social identity provider, for example,
Google.
4. Enter the OAuth client ID and client secret.
5. Enter the names of the scopes that you want to authorize, for example, email and choose Enable.
6. Choose App client settings from the navigation bar and select Google as one of the Enabled Identity
Providers for your user pool app. Choose Save changes.
7. On the Attribute mapping tab, add mappings for email, as follows:
a. Select the check box to choose the Google attribute name, which is an email address.
b. Choose the destination user pool attribute from the drop-down list, which is listed as an email
address.
c. Choose Save changes.
d. Choose Go to summary.
24
Centralized Logging Implementation Guide
To add more social identity providers, refer to Adding Social Identity Providers to a User Pool in the
Amazon Cognito Developer Guide.
25
Centralized Logging Implementation Guide
Common Errors
Troubleshooting
The Centralized Logging solution logs error, warning, informational, and debugging messages for the
solution’s AWS Lambda functions. To choose the type of messages to log, find the applicable function
in the Lambda console and change the LOG_LEVEL environment variable to the applicable type of
message.
Level Description
Common Errors
Validation error with the AWS CloudFormation
primary template
Error
A Template validation error occurs before you deploy the primary stack.
Resolution
Verify that you are deploying the stack in an AWS Region that supports Amazon Cognito.
26
Centralized Logging Implementation Guide
Error in creating a CloudWatch Logs subscription filter
Resolution
This error is due to an access policy inappropriately set on the CloudWatch Logs destination. Take the
following steps to update the access policy:
1. Review the access policy for CloudWatch Logs destination in the primary account and verify that it
lists the spoke account as the principal by running the following command:
2. If the spoke account is not listed as the principal, update the primary stack Spoke Account parameter
with the secondary account id.
Resolution
This issue occurs when the Amazon CloudWatch Logs with same identifier already exists in the account.
To resolve this error, either delete the existing CW Log Group or change the name of the erroneous log
group in the template and then redeploy the stack.
27
Centralized Logging Implementation Guide
Invalid Region parameter entered in the primary template
Resolution
This issue occurs when the provided value for a Region parameter is not valid. To resolve this issue,
update the Spoke Regions parameter in the primary stack with the correct Region names (us-east-1,
eu-west-2, etc.). Run the following CLI command to get a list of Regions that are used in your account.
Resolution
This solution creates a new Amazon VPC containing an Amazon OpenSearch Service domain. This issue
occurs when you reach your VPC limit per Region in your AWS account. Either delete an existing VPC or
increase the VPC limit in the target Region.
28
Centralized Logging Implementation Guide
An AWS CloudFormation nested stack
stays in a REVIEW_IN_PROGRESS status
Resolution
Delete the change set nested stack. Ensure that the nested stack with demo resources is in
CREATE_COMPLETE state.
29
Centralized Logging Implementation Guide
1. Deploy the new version of the primary AWS CloudFormation template in the same account and AWS
Region as your current primary stack.
2. Use a snapshot to migrate the indexed data on your Amazon OpenSearch Service domain.
3. After the migration is complete, delete the old AWS CloudFormation stack to stop incurring charges.
30
Centralized Logging Implementation Guide
Using the AWS Management Console
Amazon Simple Storage Service (Amazon S3) buckets and Amazon CloudWatch Logs created by this
solution are retained. These resources must be deleted manually. Specifically, the following resources are
retained:
If you deleted the stack, you can still retrieve the data that is indexed on the Amazon OpenSearch
Service domain by locating the <stack-name>-clbucket-* CloudWatch Logs S3 bucket in the Amazon S3
console. This S3 bucket contains the indexed data and can be used to recreate indexed documents on
Amazon OpenSearch Service.
31
Centralized Logging Implementation Guide
Deleting the CloudWatch Logs
delete the S3 buckets if you do not need to retain the data. Use the following steps to delete the
Amazon S3 buckets.
Repeat the steps until you have deleted all the <stack-name> S3 buckets.
Alternatively, you can configure the AWS CloudFormation template to delete the Amazon S3
buckets automatically. Before deleting the stack, change the deletion behavior in the AWS
CloudFormation DeletionPolicy attribute.
Repeat the steps until you have deleted all the solution log groups.
32
Centralized Logging Implementation Guide
AWS owns the data gathered though this survey. Data collection is subject to the AWS Privacy Policy. To
opt out of this feature, modify the AWS CloudFormation template mapping section from:
"Mappings": {
"CLMap": {
"Metric": {
"SendAnonymousMetric": "Yes"
}
}
}
to:
"Mappings": {
"CLMap": {
"Metric": {
"SendAnonymousMetric": "No"
}
}
}
33
Centralized Logging Implementation Guide
Source code
Visit our GitHub repository to download the templates and scripts for this solution, and to share your
customizations with others.
34
Centralized Logging Implementation Guide
Revisions
Date Change
35
Centralized Logging Implementation Guide
Contributors
• Garvit Singh
36
Centralized Logging Implementation Guide
Notices
Customers are responsible for making their own independent assessment of the information in this
document. This document: (a) is for informational purposes only, (b) represents AWS current product
offerings and practices, which are subject to change without notice, and (c) does not create any
commitments or assurances from AWS and its affiliates, suppliers or licensors. AWS products or services
are provided “as is” without warranties, representations, or conditions of any kind, whether express or
implied. AWS responsibilities and liabilities to its customers are controlled by AWS agreements, and this
document is not part of, nor does it modify, any agreement between AWS and its customers.
Centralized Logging is licensed under the terms of the of the Apache License Version 2.0 available at The
Apache Software Foundation.
37