From 7f74d55514b9602bb59cacd78270f42606952427 Mon Sep 17 00:00:00 2001 From: Michael Wittig Date: Mon, 5 Dec 2022 17:27:51 +0100 Subject: [PATCH] feat: configure Redis maxmemory policy (closes #2) --- .github/workflows/lint.yml | 21 +++++++++++++++++++++ mastodon.yaml | 8 ++++++++ package-lock.json | 14 +++++++------- package.json | 2 +- 4 files changed, 37 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..83ba482 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,21 @@ +--- +name: lint +on: push +permissions: + id-token: write + contents: read +defaults: + run: + shell: bash +jobs: + lint: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v2 + with: + python-version: '3.8' + - name: cfn-lint + run: | + pip install cfn-lint==0.72.1 + cfn-lint -i W3002 -t mastodon.yaml \ No newline at end of file diff --git a/mastodon.yaml b/mastodon.yaml index b0fa7d5..d21628b 100644 --- a/mastodon.yaml +++ b/mastodon.yaml @@ -91,6 +91,13 @@ Resources: Versioning: 'false' Cors: 'AllowAll' TemplateURL: './node_modules/@cfn-modules/s3-bucket/module.yml' + CacheParameterGroup: + Type: 'AWS::ElastiCache::ParameterGroup' + Properties: + CacheParameterGroupFamily: 'redis5.0' + Description: !Ref 'AWS::StackName' + Properties: + 'maxmemory-policy': 'noeviction' Cache: Type: 'AWS::CloudFormation::Stack' Properties: @@ -107,6 +114,7 @@ Resources: SnapshotName: '' NumShards: '1' NumReplicas: '0' + CacheParameterGroupName: !Ref CacheParameterGroup TemplateURL: './node_modules/@cfn-modules/elasticache-redis/module.yml' Database: Type: 'AWS::CloudFormation::Stack' diff --git a/package-lock.json b/package-lock.json index 3305c1d..f858c16 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,7 @@ "@cfn-modules/cloudwatch-dashboard": "^1.6.0", "@cfn-modules/ecs-alb-target": "^1.4.0", "@cfn-modules/ecs-cluster": "^1.1.0", - "@cfn-modules/elasticache-redis": "^1.0.1", + "@cfn-modules/elasticache-redis": "^1.1.0", "@cfn-modules/fargate-service": "^2.13.0", "@cfn-modules/kms-key": "^1.2.1", "@cfn-modules/lb-dns-record": "^1.0.0", @@ -86,9 +86,9 @@ "integrity": "sha512-Kai7lgLjUBHznkOl6iqY2daTOLAOwOMaB/Vl5PdBFuhdIsqLubfVSJ0GdRuowgGPoWsq4ubmI4JVgJdzh13rDA==" }, "node_modules/@cfn-modules/elasticache-redis": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@cfn-modules/elasticache-redis/-/elasticache-redis-1.0.1.tgz", - "integrity": "sha512-fhSA7AfrCfTIrmBf13XdD3pKb8c92qYcwP015ooviG0cQxG7tVVY/l4P1o4DwzKSb8e/oiKRe9hGfopnI2gVIg==" + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@cfn-modules/elasticache-redis/-/elasticache-redis-1.1.0.tgz", + "integrity": "sha512-OZ3PpUKvTYa/xcksB12Fw7Y6JSrFrcmUDlezT0/YFY9S3QksDlochU3e8xkdIj8x+hrcSNVRX3PsGXCCSR7ntQ==" }, "node_modules/@cfn-modules/fargate-service": { "version": "2.13.0", @@ -240,9 +240,9 @@ "integrity": "sha512-Kai7lgLjUBHznkOl6iqY2daTOLAOwOMaB/Vl5PdBFuhdIsqLubfVSJ0GdRuowgGPoWsq4ubmI4JVgJdzh13rDA==" }, "@cfn-modules/elasticache-redis": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@cfn-modules/elasticache-redis/-/elasticache-redis-1.0.1.tgz", - "integrity": "sha512-fhSA7AfrCfTIrmBf13XdD3pKb8c92qYcwP015ooviG0cQxG7tVVY/l4P1o4DwzKSb8e/oiKRe9hGfopnI2gVIg==" + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@cfn-modules/elasticache-redis/-/elasticache-redis-1.1.0.tgz", + "integrity": "sha512-OZ3PpUKvTYa/xcksB12Fw7Y6JSrFrcmUDlezT0/YFY9S3QksDlochU3e8xkdIj8x+hrcSNVRX3PsGXCCSR7ntQ==" }, "@cfn-modules/fargate-service": { "version": "2.13.0", diff --git a/package.json b/package.json index b3dcb81..00f1faa 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "@cfn-modules/cloudwatch-dashboard": "^1.6.0", "@cfn-modules/ecs-alb-target": "^1.4.0", "@cfn-modules/ecs-cluster": "^1.1.0", - "@cfn-modules/elasticache-redis": "^1.0.1", + "@cfn-modules/elasticache-redis": "^1.1.0", "@cfn-modules/fargate-service": "^2.13.0", "@cfn-modules/kms-key": "^1.2.1", "@cfn-modules/lb-dns-record": "^1.0.0",