Amazon CloudWatch Operations: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
No edit summary
 
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
=External=
=External=
* [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-reference-cloudwatch.html Amazon CloudWatch Resource Types Reference]


=Internal=
=Internal=
Line 7: Line 8:
=Create a Log Group=
=Create a Log Group=


  awslogs-group
==Create a Log Group with AWS CLI==
 
  aws logs create-log-group
 
==Create a Log Group with Amazon Console==


CloudWatch -> Logs -> Actions -> Create Log Group
CloudWatch -> Logs -> Actions -> Create Log Group
==Create a Log Group with CloudFormation==
===AWS::Logs::LogGroup===
{{External|[https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-loggroup.html AWS::Logs::LogGroup]}}
The CloudFormation declaration for a [[Amazon_CloudWatch_Concepts#Log_Group|log group]].
Resources:
  MyServiceLogGroup:
    Type: AWS::Logs::LogGroup
    Properties:
      LogGroupName: ''log-group-name''
      RetentionInDays: ''number-of-days-as-integer''
=Delete a Log Group=
aws logs delete-log-group  --log-group-name <''log-group-name''>
aws logs delete-log-group --log-group-name API-Gateway-Execution-Logs_4jq63m67p8/v18


=View Logs=
=View Logs=


CloudWatch -> Log Groups -> <''log-group-name''> -> <''log-stream-name''>
CloudWatch -> Log Groups -> <''log-group-name''> -> <''log-stream-name''>

Latest revision as of 05:45, 8 April 2019

External

Internal

Create a Log Group

Create a Log Group with AWS CLI

aws logs create-log-group

Create a Log Group with Amazon Console

CloudWatch -> Logs -> Actions -> Create Log Group

Create a Log Group with CloudFormation

AWS::Logs::LogGroup

AWS::Logs::LogGroup

The CloudFormation declaration for a log group.

Resources:
  MyServiceLogGroup:
    Type: AWS::Logs::LogGroup
    Properties:
      LogGroupName: log-group-name
      RetentionInDays: number-of-days-as-integer

Delete a Log Group

aws logs delete-log-group  --log-group-name <log-group-name>
aws logs delete-log-group --log-group-name API-Gateway-Execution-Logs_4jq63m67p8/v18

View Logs

CloudWatch -> Log Groups -> <log-group-name> -> <log-stream-name>