LogGroupProps Struct
Properties for a LogGroup.
Example
const repository = new ecr.Repository(this, 'TestRepository', {
repositoryName: 'test-agent-runtime',
});
const agentRuntimeArtifact = agentcore.AgentRuntimeArtifact.fromEcrRepository(repository, 'v1.0.0');
// Use a /aws/vendedlogs/ log group for same-account delivery without explicit resource policy
const logGroup = new logs.LogGroup(this, 'RuntimeLogGroup', {
logGroupName: '/aws/vendedlogs/bedrock-agentcore/my-runtime',
});
new agentcore.Runtime(this, 'test-runtime', {
runtimeName: 'test_runtime',
agentRuntimeArtifact: agentRuntimeArtifact,
tracingEnabled: true,
loggingConfigs: [
{
logType: agentcore.LogType.APPLICATION_LOGS,
destination: agentcore.LoggingDestination.cloudWatchLogs(logGroup),
},
],
manageDeliveryResourcePolicy: false,
});
Properties
dataProtectionPolicyDataProtectionPolicydata_protection_policyDataProtectionPolicydataProtectionPolicyDataProtectionPolicyDataProtectionPolicyDataProtectionPolicyDataProtectionPolicyDataProtectionPolicy= no data protection policy#deletionProtectionEnabledbooleandeletion_protection_enabledbooldeletionProtectionEnabledBooleanDeletionProtectionEnabledboolDeletionProtectionEnabled*bool= false#When enabled, deletion protection blocks all deletion operations until it is explicitly disabled.
encryptionKeyIKeyRefencryption_keyIKeyRefencryptionKeyIKeyRefEncryptionKeyIKeyRefEncryptionKeyIKeyRef= Server-side encryption managed b…#default
Default: Server-side encryption managed by the CloudWatch Logs service
fieldIndexPoliciesFieldIndexPolicy[]field_index_policiestyping.List[FieldIndexPolicy]fieldIndexPoliciesList<FieldIndexPolicy>FieldIndexPoliciesFieldIndexPolicy[]FieldIndexPolicies*[]FieldIndexPolicy= no field index policies for this…#default
Default: no field index policies for this log group.
logGroupClassLogGroupClasslog_group_classLogGroupClasslogGroupClassLogGroupClassLogGroupClassLogGroupClassLogGroupClassLogGroupClass= LogGroupClass.STANDARD#notes
INFREQUENT_ACCESS class provides customers a cost-effective way to consolidate logs which supports querying using Logs Insights. The logGroupClass property cannot be changed once the log group is created.
DELIVERY class is used to deliver logs to a destination such as Amazon S3 or Amazon Data Firehose (for example, Lambda vended logs). A Delivery log group forwards events to a destination instead of storing them, so it does not support retention, dataProtectionPolicy, or fieldIndexPolicies; setting any of these together with LogGroupClass.DELIVERY results in a synthesis-time error.
logGroupNamestringlog_group_namestrlogGroupNameStringLogGroupNamestringLogGroupName*string= Automatically generated#removalPolicyRemovalPolicyremoval_policyRemovalPolicyremovalPolicyRemovalPolicyRemovalPolicyRemovalPolicyRemovalPolicyRemovalPolicy= RemovalPolicy.Retain#Normally you want to retain the log group so you can diagnose issues from logs even after a deployment that no longer includes the log group. In that case, use the normal date-based retention policy to age out your logs.
retentionRetentionDaysretentionRetentionDaysretentionRetentionDaysRetentionRetentionDaysRetentionRetentionDays= RetentionDays.TWO_YEARS#To retain all logs, set this value to RetentionDays.INFINITE.