Skip to content

Commit 80b5001

Browse files
author
amazon-meaisiah
committed
Remove a bunch of unused crud
The less we can check into Git, the better.
1 parent b0b3725 commit 80b5001

File tree

15 files changed

+19
-6005
lines changed

15 files changed

+19
-6005
lines changed

cloudformation/template.yaml

Lines changed: 17 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@ Transform: 'AWS::Serverless-2016-10-31'
44

55
Description: My Dev Portal Stack
66
Metadata:
7+
cfn-lint:
8+
config:
9+
ignore_checks:
10+
# There's circular dependencies between the API + backend lambda and API + IAM execution role for
11+
# that won't get fixed anytime remotely soon.
12+
- E3004
13+
# Not useful at all.
14+
- I1022
15+
716
AWS::CloudFormation::Interface:
817
ParameterGroups:
918
-
@@ -673,6 +682,8 @@ Resources:
673682

674683
CustomersTable:
675684
Type: AWS::DynamoDB::Table
685+
DeletionPolicy: Retain
686+
UpdateReplacePolicy: Retain
676687
Properties:
677688
TableName: !Ref DevPortalCustomersTableName
678689
AttributeDefinitions:
@@ -703,6 +714,8 @@ Resources:
703714

704715
PreLoginAccountsTable:
705716
Type: AWS::DynamoDB::Table
717+
DeletionPolicy: Retain
718+
UpdateReplacePolicy: Retain
706719
Properties:
707720
TableName: !Ref DevPortalPreLoginAccountsTableName
708721
AttributeDefinitions:
@@ -718,6 +731,8 @@ Resources:
718731
FeedbackTable:
719732
Type: AWS::DynamoDB::Table
720733
Condition: EnableFeedbackSubmission
734+
DeletionPolicy: Retain
735+
UpdateReplacePolicy: Retain
721736
Properties:
722737
TableName: !Ref DevPortalFeedbackTableName
723738
AttributeDefinitions:
@@ -727,8 +742,8 @@ Resources:
727742
- AttributeName: Id
728743
KeyType: HASH
729744
ProvisionedThroughput:
730-
ReadCapacityUnits: '5'
731-
WriteCapacityUnits: '5'
745+
ReadCapacityUnits: 5
746+
WriteCapacityUnits: 5
732747
GlobalSecondaryIndexes:
733748
- IndexName: FeedbackIdIndex
734749
KeySchema:
@@ -1987,29 +2002,6 @@ Resources:
19872002
- cognito-idp:ListUsersInGroup
19882003
Resource: !GetAtt CognitoUserPool.Arn
19892004

1990-
UserGroupImporterLogsRole:
1991-
Type: AWS::IAM::Role
1992-
Properties:
1993-
AssumeRolePolicyDocument:
1994-
Version: '2012-10-17'
1995-
Statement:
1996-
Effect: Allow
1997-
Principal:
1998-
Service: cognito-idp.amazonaws.com
1999-
Action: sts:AssumeRole
2000-
Policies:
2001-
- PolicyName: WriteCloudWatchLogs
2002-
PolicyDocument:
2003-
Version: '2012-10-17'
2004-
Statement:
2005-
- Effect: Allow
2006-
Action:
2007-
- logs:CreateLogGroup
2008-
- logs:CreateLogStream
2009-
- logs:DescribeLogStreams
2010-
- logs:PutLogEvents
2011-
Resource: arn:aws:logs:*:*:*
2012-
20132005
UserGroupImporterExecutionRole:
20142006
Type: AWS::IAM::Role
20152007
Properties:
@@ -2031,14 +2023,6 @@ Resources:
20312023
- logs:CreateLogStream
20322024
- logs:PutLogEvents
20332025
Resource: arn:aws:logs:*:*:*
2034-
- PolicyName: PassRole
2035-
PolicyDocument:
2036-
Version: '2012-10-17'
2037-
Statement:
2038-
- Effect: Allow
2039-
Action:
2040-
- iam:PassRole
2041-
Resource: !GetAtt UserGroupImporterLogsRole.Arn
20422026
- PolicyName: S3GetObject
20432027
PolicyDocument:
20442028
Version: '2012-10-17'
@@ -2086,7 +2070,6 @@ Resources:
20862070
Environment:
20872071
Variables:
20882072
UserPoolId: !Ref CognitoUserPool
2089-
LogsRoleArn: !GetAtt UserGroupImporterLogsRole.Arn
20902073
AdminsGroup: !Ref CognitoAdminsGroup
20912074
RegisteredGroup: !Ref CognitoRegisteredGroup
20922075
CustomersTable: !Ref CustomersTable

lambdas/backend/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ app.use(bodyParser.urlencoded({ limit: '10mb', extended: true }))
2121
app.use(awsServerlessExpressMiddleware.eventContext())
2222

2323
function wrapError (func) {
24-
return async (req, res, callback) => {
24+
return async (req, res) => {
2525
try {
26-
await func(req, res, callback)
26+
await func(req, res)
2727
} catch (e) {
2828
console.error(`Error: ${e.stack}`)
2929
res.status(500).json(util.makeErrorResponse(e))

lambdas/listener/package-lock.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

lambdas/listener/package.json

Lines changed: 0 additions & 10 deletions
This file was deleted.

lambdas/user-group-importer/index.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,11 @@
33
const readline = require('readline')
44
const AWS = require('aws-sdk')
55
const { PassThrough } = require('stream')
6-
const fetch = require('node-fetch')
76
const cognitoIdp = new AWS.CognitoIdentityServiceProvider({ apiVersion: '2016-04-18' })
87
const s3 = new AWS.S3({ apiVersion: '2006-03-01' })
98
const dynamodb = new AWS.DynamoDB({ apiVersion: '2012-08-10' })
109

1110
const userPoolId = process.env.UserPoolId
12-
const logsRoleArn = process.env.LogsRoleArn
1311
const adminsGroup = process.env.AdminsGroup
1412
const registeredGroup = process.env.RegisteredGroup
1513
const customersTableName = process.env.CustomersTable

0 commit comments

Comments
 (0)