Skip to content

Commit

Permalink
fix(rules): add AWS ECR
Browse files Browse the repository at this point in the history
  • Loading branch information
bodinsamuel committed Sep 18, 2023
1 parent de210bb commit 04b66db
Show file tree
Hide file tree
Showing 10 changed files with 59 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/rules/__snapshots__/index.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ exports[`all > should match everything 1`] = `
"aws.dynamodb",
"aws.ebs",
"aws.ec2",
"aws.ecr",
"aws.ecs",
"aws.efs",
"aws.eks",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ exports[`docker > should match all dependencies 1`] = `
"aws",
"aws.cloudfront",
"aws.ec2",
"aws.ecr",
"aws.fargate",
"aws.lambda",
"aws.s3",
Expand Down Expand Up @@ -184,6 +185,11 @@ exports[`docker > should match all dependencies 2`] = `
"atlassian/gajira-transition",
"1",
],
[
"githubAction",
"aws-actions/amazon-ecr-login",
"1",
],
[
"githubAction",
"aws-actions/amazon-eks-fargate",
Expand Down
6 changes: 6 additions & 0 deletions src/rules/spec/golang/__snapshots__/lockfile.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ exports[`golang (lockfile) > should match everything 1`] = `
"aws.dynamodb",
"aws.ebs",
"aws.ec2",
"aws.ecr",
"aws.ecs",
"aws.efs",
"aws.eks",
Expand Down Expand Up @@ -278,6 +279,11 @@ exports[`golang (lockfile) > should match everything 2`] = `
"github.com/aws/aws-sdk-go-v2/service/ec2",
"v1.0.0",
],
[
"golang",
"github.com/aws/aws-sdk-go-v2/service/ecr",
"v1.0.0",
],
[
"golang",
"github.com/aws/aws-sdk-go-v2/service/ecs",
Expand Down
11 changes: 11 additions & 0 deletions src/rules/spec/nodejs/__snapshots__/component.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ exports[`npm > should match everything 1`] = `
"aws.dynamodb",
"aws.ebs",
"aws.ec2",
"aws.ecr",
"aws.ecs",
"aws.efs",
"aws.eks",
Expand Down Expand Up @@ -271,6 +272,11 @@ exports[`npm > should match everything 2`] = `
"@aws-cdk/aws-ec2",
"0.0.0",
],
[
"npm",
"@aws-cdk/aws-ecr",
"0.0.0",
],
[
"npm",
"@aws-cdk/aws-ecs",
Expand Down Expand Up @@ -441,6 +447,11 @@ exports[`npm > should match everything 2`] = `
"@aws-sdk/client-ec2",
"0.0.0",
],
[
"npm",
"@aws-sdk/client-ecr",
"0.0.0",
],
[
"npm",
"@aws-sdk/client-ecs",
Expand Down
6 changes: 6 additions & 0 deletions src/rules/spec/ruby/__snapshots__/lockfile.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ exports[`ruby (component) > should match everything 1`] = `
"aws.dynamodb",
"aws.ebs",
"aws.ec2",
"aws.ecr",
"aws.ecs",
"aws.efs",
"aws.eks",
Expand Down Expand Up @@ -200,6 +201,11 @@ exports[`ruby (component) > should match everything 2`] = `
"aws-sdk-ec2",
"1.0.0",
],
[
"ruby",
"aws-sdk-ecr",
"1.0.0",
],
[
"ruby",
"aws-sdk-ecs",
Expand Down
6 changes: 6 additions & 0 deletions src/rules/spec/rust/__snapshots__/component.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ exports[`rust (component) > should match everything 1`] = `
"aws.dynamodb",
"aws.ebs",
"aws.ec2",
"aws.ecr",
"aws.ecs",
"aws.efs",
"aws.eks",
Expand Down Expand Up @@ -144,6 +145,11 @@ exports[`rust (component) > should match everything 2`] = `
"aws-sdk-ec2",
"1.0.0",
],
[
"rust",
"aws-sdk-ecr",
"1.0.0",
],
[
"rust",
"aws-sdk-ecs",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ exports[`terraform (resource) > should match everything 1`] = `
"aws.dynamodb",
"aws.ebs",
"aws.ec2",
"aws.ecr",
"aws.ecs",
"aws.efs",
"aws.eks",
Expand Down
20 changes: 20 additions & 0 deletions src/rules/storage/aws.ecr.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { register } from '../../register.js';

register({
tech: 'aws.ecr',
name: 'AWS ECR',
type: 'storage',
dependencies: [
{ type: 'npm', name: '@aws-cdk/aws-ecr' },
{ type: 'npm', name: '@aws-sdk/client-ecr' },
{ type: 'rust', name: 'aws-sdk-ecr' },
{ type: 'ruby', name: 'aws-sdk-ecr' },
{ type: 'golang', name: 'github.com/aws/aws-sdk-go-v2/service/ecr' },
{
type: 'terraform.resource',
name: /^aws_ecr_/,
example: 'aws_ecr_repository',
},
{ type: 'githubAction', name: 'aws-actions/amazon-ecr-login' },
],
});
1 change: 1 addition & 0 deletions src/rules/storage/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import './aws.cloudfront.js';
import './aws.ebs.js';
import './aws.ecr.js';
import './aws.efs.js';
import './aws.glacier.js';
import './aws.s3.js';
Expand Down
1 change: 1 addition & 0 deletions src/types/techs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export type AllowedKeys =
| 'aws.dynamodb'
| 'aws.ebs'
| 'aws.ec2'
| 'aws.ecr'
| 'aws.ecs'
| 'aws.efs'
| 'aws.eks'
Expand Down

0 comments on commit 04b66db

Please sign in to comment.