Skip to content

Commit

Permalink
align functionality with documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
mrchops1024 committed Jan 9, 2025
1 parent c11ceba commit 1a924df
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ logging:
categories:
- Credentials
firehose:
fileExtension: json.gz
fileExtension: .json.gz
enable: true
dynamicPartitioning: dynamic-partitioning/log-filters.json
replaceLogDestinationArn: replaceLogDestinationArn
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ logging:
categories:
- Credentials
firehose:
fileExtension: json.gz
fileExtension: .json.gz
enable: true
replaceLogDestinationArn: arn:aws:logs:us-east-1:111111111111:destination/log-destination
dynamicPartitioning: dynamic-partitioning/log-filters.json
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1091,9 +1091,9 @@ export interface ICloudWatchLogsExclusionConfig {
* @example
* ```
* logging:
* - cloudwatchLogs:
* - firehose:
* - fileExtension: undefined | 'json.gz'
* cloudwatchLogs:
* firehose:
* fileExtension: undefined | '.json.gz'
*
* ```
*/
Expand All @@ -1106,7 +1106,7 @@ export interface ICloudWatchFirehoseConfig {
*
* @example
* ```
* - fileExtension: 'json.gz'
* fileExtension: '.json.gz'
* ```
*
*/
Expand Down Expand Up @@ -1167,6 +1167,8 @@ export interface ICloudWatchFirehoseConfig {
* deploymentTargets:
* organizationalUnits:
* - Root
* firehose:
* fileExtension: .json.gz
* ```
*
*/
Expand Down Expand Up @@ -1233,6 +1235,10 @@ export interface ICloudWatchLogsConfig {
* CloudWatch Log data protection configuration
*/
readonly dataProtection?: ICloudWatchDataProtectionConfig;
/**
* CloudWatch Firehose configuration
*/
readonly firehose?: ICloudWatchFirehoseConfig
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,6 @@ export class GlobalConfigValidator {
this.validateS3ConfigDeploymentTargetOUs(values, ouIdNames, errors);
this.validateS3ConfigDeploymentTargetAccounts(values, accountNames, errors);

//
// Validate File Extensions
//
this.validateFileExtensions(values);

//
// Validate region by region deploy order doesn't conflict with enabledRegions
//
Expand Down Expand Up @@ -1298,21 +1293,6 @@ export class GlobalConfigValidator {
}
}

/**
* Function to validate file extensions for firehose
* @param values
*/
private validateFileExtensions(values: GlobalConfig) {
if (!values.logging.cloudwatchLogs?.firehose?.fileExtension) {
return;
}
const fileExtension = values.logging.cloudwatchLogs?.firehose?.fileExtension;
if (fileExtension.startsWith('.')) {
const logger = createLogger(['global-config-validator-file-extension']);
logger.warn(`Found file extension ${fileExtension} that starts with a dot.`);
}
}

/**
* Function to validate that if region by region deployment is activated that
* the deploy order is correctly setup.
Expand Down

0 comments on commit 1a924df

Please sign in to comment.