1. How to create an AWS CloudWatch Log Group?


    To create an AWS CloudWatch Log Group, we can use the LogGroup resource from the aws.cloudwatch package in Pulumi.

    Below is a sample program that creates a CloudWatch Log Group named "my-log-group" with a retention period of 14 days. The retentionInDays property sets the number of days you want to retain log events in the specified log group.

    import * as pulumi from "@pulumi/pulumi"; import * as aws from "@pulumi/aws"; const logGroup = new aws.cloudwatch.LogGroup("my-log-group", { name: "my-log-group", retentionInDays: 14, });

    You can check the documentation for this resource here.