CloudWatch · Operations

LogGroup

Manage log groups, retention, encryption, and tags.

Generic driverUniform lifecycle
Scope
Regional
Spec fields
5
Outputs
7
Lookup
Supported

Resource definition

What this resource looks like

This is the CUE shape a Praxis template uses to declare a LogGroup. The resource key is local to the template; metadata.name supplies its stable Praxis identity.

CUE example
resources: logs: {
  apiVersion: "praxis.io/alpha"
  kind: "LogGroup"
  metadata: {name: "/praxis/payments", labels: {}}
  spec: {
    region: "us-west-2"
    retentionInDays: 30
    tags: environment: "prod"
  }
}
Complete examples in the repository

Desired state

Configuration

The spec block accepts 5 fields. 2 are required by the schema; fields with defaults can be omitted.

regionRequired

Region.

string
String
logGroupClassOptional

Log Group Class.

"STANDARD" | "INFREQUENT_ACCESS" | *"STANDARD"
EnumDefault "STANDARD"
retentionInDaysOptional

Retention In Days.

1 | 3 | 5 | 7 | 14 | 30 | 60 | 90 | 120 | 150 |
Integer
kmsKeyIdOptional

Kms Key ID.

string
String
tagsRequired

Tags.

[string]: string
Map

Observed values

Outputs

Praxis records these values after observation. A dependent resource can read one with ${resources.<name>.outputs.<field>}.

arnString
logGroupNameString
logGroupClassString
retentionInDaysInteger
kmsKeyIdString · optional
creationTimeInteger
storedBytesInteger

Read without ownership

Data-source lookup

A data block reads an existing LogGroup and exposes its outputs without storing lifecycle state. The generic filter surface accepts id, name, and tag; supported combinations depend on the AWS identity used by this resource.

CUE data source
data: existing: {
  kind: "LogGroup"
  region: "us-west-2"
  filter: {
    name: "replace-with-provider-name"
  }
}
Documented selectorsidnameid/name + tag

Understand data sources and filters →

Adopt existing infrastructure

Import

Import persists Praxis state for an existing AWS resource. For this kind, supply: Log group name and region. The example starts in observed mode so Praxis reports drift without correcting it.

CLI
praxis import LogGroup \
  --id <provider-identifier> \
  --region us-west-2 \
  --account production \
  --observe

Choose managed or observed ownership →

Canonical contract

Complete CUE schema

The field guide above is derived from this definition. The schema remains the source of truth for accepted values, defaults, validation constraints, and outputs in the current alpha revision.

Show the complete schema
schemas/aws/cloudwatch/log_group.cue
package cloudwatch

#LogGroup: {
	apiVersion: "praxis.io/alpha"
	kind:       "LogGroup"

	metadata: {
		name: string & =~"^[.\\-_/#A-Za-z0-9]{1,512}$"
		labels: [string]: string
	}

	spec: {
		region:           string
		logGroupClass:    "STANDARD" | "INFREQUENT_ACCESS" | *"STANDARD"
		retentionInDays?: 1 | 3 | 5 | 7 | 14 | 30 | 60 | 90 | 120 | 150 |
			180 | 365 | 400 | 545 | 731 | 1096 | 1827 | 2192 |
				2557 | 2922 | 3288 | 3653
		kmsKeyId?: string
		tags: [string]: string
	}

	outputs?: {
		arn:             string
		logGroupName:    string
		logGroupClass:   string
		retentionInDays: int
		kmsKeyId?:       string
		creationTime:    int
		storedBytes:     int
	}
}

View this schema on GitHub →