Skip to content

Commit

Permalink
Merge branch 'master' into wordpress-6-4-3
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelwittig authored Feb 6, 2024
2 parents cfdba99 + 9be1665 commit 1cbedce
Show file tree
Hide file tree
Showing 14 changed files with 28 additions and 57 deletions.
3 changes: 0 additions & 3 deletions .github/FUNDING.yml

This file was deleted.

10 changes: 5 additions & 5 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ jobs:
runs-on: ['hyperenv', 'medium']
steps:
- uses: 'actions/checkout@v4'
- uses: 'actions/setup-python@v4'
- uses: 'actions/setup-python@v5'
with:
python-version: '3.8'
python-version: '3.12'
- name: yamlllint
run: |
pip install yamllint==1.27.1
pip install yamllint==1.33.0
yamllint .
- name: cfn-lint
run: |
pip install cfn-lint==0.79.11
cfn-lint -i W2001 W4002 W6001 W8003 E3026 E2520 -t '**/*.yaml'
pip install cfn-lint==0.85.0
cfn-lint -i W2001 W3045 W4002 W6001 W8003 E3026 -t '**/*.yaml'
- name: license
run: |
find . -type f -name '*.yaml' -not -name '.readthedocs.yaml' | while read file; do set -ex && grep -q 'LICENSE-2.0' "$file"; done;
13 changes: 5 additions & 8 deletions ecs/cluster-cost-optimized.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1183,8 +1183,7 @@ Resources:
Properties:
Code:
ZipFile: |
'use strict';
const { AutoScalingClient, ExecutePolicyCommand } = require("@aws-sdk/client-auto-scaling");
const { AutoScalingClient, ExecutePolicyCommand } = require('@aws-sdk/client-auto-scaling');
const autoscaling = new AutoScalingClient({apiVersion: '2011-01-01'});
const sp = process.env.SCALING_POLICY_NAME;
exports.handler = async function(event, context) {
Expand All @@ -1195,7 +1194,7 @@ Resources:
Handler: 'index.handler'
MemorySize: 128
Role: !GetAtt 'ScaleUpLambdaRole.Arn'
Runtime: 'nodejs18.x'
Runtime: 'nodejs20.x'
Timeout: 60
Environment:
Variables:
Expand Down Expand Up @@ -1308,13 +1307,11 @@ Resources:
Properties:
Code:
ZipFile: |
'use strict';
const AWS = require('aws-sdk');
const { ECSClient, UpdateContainerInstancesStateCommand, ListTasksCommand, ListContainerInstancesCommand } = require("@aws-sdk/client-ecs");
const { ECSClient, UpdateContainerInstancesStateCommand, ListTasksCommand, ListContainerInstancesCommand } = require('@aws-sdk/client-ecs');
const ecs = new ECSClient({apiVersion: '2014-11-13'});
const { SQSClient, SendMessageCommand } = require("@aws-sdk/client-sqs");
const sqs = new SQSClient({apiVersion: '2012-11-05'});
const { AutoScalingClient, CompleteLifecycleActionCommand, RecordLifecycleActionHeartbeatCommand } = require("@aws-sdk/client-auto-scaling");
const { AutoScalingClient, CompleteLifecycleActionCommand, RecordLifecycleActionHeartbeatCommand } = require('@aws-sdk/client-auto-scaling');
const asg = new AutoScalingClient({apiVersion: '2011-01-01'});
const cluster = process.env.CLUSTER;
const queueUrl = process.env.QUEUE_URL;
Expand Down Expand Up @@ -1398,7 +1395,7 @@ Resources:
Handler: 'index.handler'
MemorySize: 128
Role: !GetAtt 'DrainInstanceLambdaRole.Arn'
Runtime: 'nodejs18.x'
Runtime: 'nodejs20.x'
Timeout: 30
Environment:
Variables:
Expand Down
14 changes: 6 additions & 8 deletions ecs/cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1239,10 +1239,9 @@ Resources:
Properties:
Code:
ZipFile: !Sub |
'use strict';
const { ECSClient, ListContainerInstancesCommand, DescribeContainerInstancesCommand } = require("@aws-sdk/client-ecs");
const { ECSClient, ListContainerInstancesCommand, DescribeContainerInstancesCommand } = require('@aws-sdk/client-ecs');
const ecs = new ECSClient({apiVersion: '2014-11-13'});
const { CloudWatchClient, PutMetricDataCommand } = require("@aws-sdk/client-cloudwatch");
const { CloudWatchClient, PutMetricDataCommand } = require('@aws-sdk/client-cloudwatch');
const cloudwatch = new CloudWatchClient({apiVersion: '2010-08-01'});
const CONTAINER_MAX_CPU = ${ContainerMaxCPU};
const CONTAINER_MAX_MEMORY = ${ContainerMaxMemory};
Expand Down Expand Up @@ -1307,7 +1306,7 @@ Resources:
Handler: 'index.handler'
MemorySize: 128
Role: !GetAtt 'SchedulableContainersLambdaRole.Arn'
Runtime: 'nodejs18.x'
Runtime: 'nodejs20.x'
Timeout: 60
SchedulableContainersLogGroup:
Type: 'AWS::Logs::LogGroup'
Expand Down Expand Up @@ -1417,12 +1416,11 @@ Resources:
Properties:
Code:
ZipFile: |
'use strict';
const { ECSClient, ListContainerInstancesCommand, UpdateContainerInstancesStateCommand, ListTasksCommand } = require("@aws-sdk/client-ecs");
const { ECSClient, ListContainerInstancesCommand, UpdateContainerInstancesStateCommand, ListTasksCommand } = require('@aws-sdk/client-ecs');
const ecs = new ECSClient({apiVersion: '2014-11-13'});
const { SQSClient, SendMessageCommand } = require("@aws-sdk/client-sqs");
const sqs = new SQSClient({apiVersion: '2012-11-05'});
const { AutoScalingClient, CompleteLifecycleActionCommand, RecordLifecycleActionHeartbeatCommand } = require("@aws-sdk/client-auto-scaling");
const { AutoScalingClient, CompleteLifecycleActionCommand, RecordLifecycleActionHeartbeatCommand } = require('@aws-sdk/client-auto-scaling');
const asg = new AutoScalingClient({apiVersion: '2011-01-01'});
const cluster = process.env.CLUSTER;
const queueUrl = process.env.QUEUE_URL;
Expand Down Expand Up @@ -1506,7 +1504,7 @@ Resources:
Handler: 'index.handler'
MemorySize: 128
Role: !GetAtt 'DrainInstanceLambdaRole.Arn'
Runtime: 'nodejs18.x'
Runtime: 'nodejs20.x'
Timeout: 30
Environment:
Variables:
Expand Down
2 changes: 1 addition & 1 deletion jenkins/jenkins2-ha-agents.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1015,7 +1015,7 @@ Resources:
install:
packages:
rpm:
jenkins: 'https://ftp-chi.osuosl.org/pub/jenkins/redhat-stable/jenkins-2.426.2-1.1.noarch.rpm'
jenkins: 'https://ftp-chi.osuosl.org/pub/jenkins/redhat-stable/jenkins-2.426.3-1.1.noarch.rpm'
files:
'/etc/cfn/cfn-hup.conf':
content: !Sub |
Expand Down
2 changes: 1 addition & 1 deletion jenkins/jenkins2-ha.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -906,7 +906,7 @@ Resources:
install:
packages:
rpm:
jenkins: 'https://ftp-chi.osuosl.org/pub/jenkins/redhat-stable/jenkins-2.426.2-1.1.noarch.rpm'
jenkins: 'https://ftp-chi.osuosl.org/pub/jenkins/redhat-stable/jenkins-2.426.3-1.1.noarch.rpm'
files:
'/etc/cfn/cfn-hup.conf':
content: !Sub |
Expand Down
10 changes: 1 addition & 9 deletions operations/alb-access-logs-anonymizer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,19 +109,16 @@ Resources:
const { S3Client, GetObjectCommand, HeadObjectCommand, DeleteObjectCommand } = require('@aws-sdk/client-s3');
const { Upload } = require('@aws-sdk/lib-storage');
const s3 = new S3Client({apiVersion: '2006-03-01'});
function anonymizeIPv4Address(str) {
const s = str.split('.');
s[3] = '0';
return s.join('.');
}
function anonymizeIPv6Address(str) {
const s = str.split(':').slice(0, 2);
s.push(':');
return s.join(':');
}
function anonymizeIpAddress(str) {
const s = str.split(':');
const address = s.slice(0, -1).join(':');
Expand All @@ -134,7 +131,6 @@ Resources:
return str;
}
}
function transformLine(line) {
if (line.trim() === '') {
return line;
Expand All @@ -143,7 +139,6 @@ Resources:
values[3] = anonymizeIpAddress(values[3]);
return values.join(' ');
}
async function process(record) {
const anonymizedKey = record.s3.object.key.slice(0, -2) + 'anonymized.gz';
let chunk = Buffer.alloc(0);
Expand Down Expand Up @@ -175,7 +170,6 @@ Resources:
try {
const getObjectResponse = await s3.send(new GetObjectCommand(params));
const writePipeline = pipeline(
getObjectResponse.Body,
zlib.createGunzip(),
Expand All @@ -185,7 +179,6 @@ Resources:
zlib.createGzip(),
() => {}
);
await new Upload({
client: s3,
params: {
Expand Down Expand Up @@ -220,7 +213,6 @@ Resources:
await s3.send(new DeleteObjectCommand(params));
}
}
exports.handler = async (event) => {
console.log(JSON.stringify(event));
for (let record of event.Records) {
Expand All @@ -234,7 +226,7 @@ Resources:
Handler: 'index.handler'
MemorySize: 1024
Role: !GetAtt 'Role.Arn'
Runtime: 'nodejs18.x'
Runtime: 'nodejs20.x'
Timeout: 300
ErrorsTooHighAlarm:
Condition: HasAlertTopic
Expand Down
11 changes: 1 addition & 10 deletions operations/cloudfront-access-logs-anonymizer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,19 +109,16 @@ Resources:
const { S3Client, GetObjectCommand, HeadObjectCommand, DeleteObjectCommand } = require('@aws-sdk/client-s3');
const { Upload } = require('@aws-sdk/lib-storage');
const s3 = new S3Client({apiVersion: '2006-03-01'});
function anonymizeIPv4Address(str) {
const s = str.split('.');
s[3] = '0';
return s.join('.');
}
function anonymizeIPv6Address(str) {
const s = str.split(':').slice(0, 2);
s.push(':');
return s.join(':');
}
function anonymizeIpAddress(str) {
if (str === '-' || str === 'unknown') {
return str;
Expand All @@ -134,7 +131,6 @@ Resources:
return str;
}
}
function transformLine(line) {
if (line.startsWith('#') || line.trim() === '') {
return line;
Expand All @@ -144,7 +140,6 @@ Resources:
values[19] = anonymizeIpAddress(values[19]);
return values.join('\t');
}
async function process(record) {
const anonymizedKey = record.s3.object.key.slice(0, -2) + 'anonymized.gz';
let chunk = Buffer.alloc(0);
Expand Down Expand Up @@ -173,10 +168,8 @@ Resources:
if ('versionId' in record.s3.object) {
params.VersionId = record.s3.object.versionId;
}
try {
const getObjectResponse = await s3.send(new GetObjectCommand(params));
const writePipeline = pipeline(
getObjectResponse.Body,
zlib.createGunzip(),
Expand Down Expand Up @@ -214,14 +207,12 @@ Resources:
throw err;
}
}
if (chunk.length > 0) {
throw new Error('file was not read completly');
} else {
await s3.send(new DeleteObjectCommand(params));
}
}
exports.handler = async (event) => {
console.log(JSON.stringify(event));
for (let record of event.Records) {
Expand All @@ -235,7 +226,7 @@ Resources:
Handler: 'index.handler'
MemorySize: 1024
Role: !GetAtt 'Role.Arn'
Runtime: 'nodejs18.x'
Runtime: 'nodejs20.x'
Timeout: 300
ErrorsTooHighAlarm:
Condition: HasAlertTopic
Expand Down
3 changes: 1 addition & 2 deletions security/account-password-policy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ Resources:
Properties:
Code:
ZipFile: |
'use strict';
const response = require('cfn-response');
const { IAMClient, DeleteAccountPasswordPolicyCommand, UpdateAccountPasswordPolicyCommand } = require('@aws-sdk/client-iam');
const iam = new IAMClient({apiVersion: '2010-05-08'});
Expand Down Expand Up @@ -191,7 +190,7 @@ Resources:
Handler: 'index.handler'
MemorySize: 128
Role: !GetAtt 'LambdaRole.Arn'
Runtime: 'nodejs18.x'
Runtime: 'nodejs20.x'
Timeout: 60
LambdaLogGroup:
Type: 'AWS::Logs::LogGroup'
Expand Down
3 changes: 1 addition & 2 deletions security/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@ Resources:
Properties:
Code:
ZipFile: |
'use strict';
const response = require('cfn-response');
const { ConfigServiceClient, DeleteRetentionConfigurationCommand, PutRetentionConfigurationCommand } = require('@aws-sdk/client-config-service');
const config = new ConfigServiceClient({apiVersion: '2014-11-12'});
Expand Down Expand Up @@ -228,7 +227,7 @@ Resources:
Handler: 'index.handler'
MemorySize: 128
Role: !GetAtt 'LambdaRole.Arn'
Runtime: 'nodejs18.x'
Runtime: 'nodejs20.x'
Timeout: 60
LambdaLogGroup:
Type: 'AWS::Logs::LogGroup'
Expand Down
2 changes: 1 addition & 1 deletion security/securityhub-controls.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ Resources:
Handler: 'index.handler'
MemorySize: 128
Role: !GetAtt 'LambdaRole.Arn'
Runtime: 'nodejs18.x'
Runtime: 'nodejs20.x'
Timeout: 60
LambdaLogGroup:
Type: 'AWS::Logs::LogGroup'
Expand Down
3 changes: 1 addition & 2 deletions state/elasticache-memcached.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,6 @@ Resources:
Properties:
Code:
ZipFile: |
'use strict';
const response = require('cfn-response');
exports.handler = (event, context, cb) => {
const nodes = parseInt(event.ResourceProperties.NumCacheNodes, 10);
Expand All @@ -265,7 +264,7 @@ Resources:
Handler: 'index.handler'
MemorySize: 128
Role: !GetAtt 'CustomResourceLambdaRole.Arn'
Runtime: 'nodejs18.x'
Runtime: 'nodejs20.x'
Timeout: 60
CustomResourceLambdaLogGroup:
Type: 'AWS::Logs::LogGroup'
Expand Down
3 changes: 1 addition & 2 deletions state/s3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,6 @@ Resources:
Properties:
Code:
ZipFile: |
'use strict';
const response = require('cfn-response');
const { S3Client, GetBucketAclCommand, PutBucketAclCommand } = require('@aws-sdk/client-s3');
const s3 = new S3Client({apiVersion: '2006-03-01'});
Expand Down Expand Up @@ -471,7 +470,7 @@ Resources:
Handler: 'index.handler'
MemorySize: 128
Role: !GetAtt 'LambdaRole.Arn'
Runtime: 'nodejs18.x'
Runtime: 'nodejs20.x'
Timeout: 60
LambdaLogGroup:
Condition: HasCloudFrontAccessLogWrite
Expand Down
6 changes: 3 additions & 3 deletions static-website/lambdaedge-index-document.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,9 @@ Resources:
Handler: 'index.handler'
MemorySize: 128
Role: !GetAtt 'ViewerRequestRole.Arn'
Runtime: 'nodejs18.x'
Runtime: 'nodejs20.x'
Timeout: 5
ViewerRequestVersionV4:
ViewerRequestVersionV5:
Type: 'AWS::Lambda::Version'
Properties:
FunctionName: !Ref ViewerRequestFunction
Expand All @@ -176,4 +176,4 @@ Outputs:
Value: !Sub '${AWS::StackName}'
ViewerRequestLambdaEdgeFunctionVersionARN:
Description: 'Version ARN of Lambda@Edge viewer request function.'
Value: !Ref ViewerRequestVersionV4
Value: !Ref ViewerRequestVersionV5

0 comments on commit 1cbedce

Please sign in to comment.