|
| 1 | +service: saml-to |
| 2 | + |
| 3 | +frameworkVersion: 3.38.0 |
| 4 | +variablesResolutionMode: "20210326" |
| 5 | +configValidationMode: off |
| 6 | +disabledDeprecations: |
| 7 | + - "*" |
| 8 | + |
| 9 | +# plugins: |
| 10 | +# - serverless-esbuild |
| 11 | +# - serverless-react |
| 12 | +# - serverless-dotenv-plugin |
| 13 | +# - serverless-offline-resources |
| 14 | +# - serverless-offline |
| 15 | + |
| 16 | +provider: |
| 17 | + name: aws |
| 18 | + runtime: nodejs18.x |
| 19 | + iam: |
| 20 | + role: |
| 21 | + statements: |
| 22 | + - Effect: Allow |
| 23 | + Action: |
| 24 | + - "dynamodb:*" |
| 25 | + - "secretsmanager:*" |
| 26 | + - "sns:*" |
| 27 | + - "sqs:*" |
| 28 | + Resource: "*" |
| 29 | + stage: ${opt:stage, "local"} |
| 30 | + logRetentionInDays: 1 |
| 31 | + tracing: |
| 32 | + apiGateway: true |
| 33 | + lambda: true |
| 34 | + environment: |
| 35 | + STAGE: ${self:provider.stage} |
| 36 | + |
| 37 | +functions: |
| 38 | + github: |
| 39 | + handler: src/lambda.handler |
| 40 | + timeout: 29 |
| 41 | + layers: |
| 42 | + - arn:aws:lambda:us-east-1:034541671702:layer:openssl-lambda:1 |
| 43 | + - arn:aws:lambda:us-east-1:580360238192:layer:nonlive-github-sls-rest-api:3 |
| 44 | + environment: |
| 45 | + SERVICE_NAME: github-sls-rest-api |
| 46 | + SERVICE_SLUG: github |
| 47 | + events: |
| 48 | + - httpApi: |
| 49 | + method: "*" |
| 50 | + path: /github/{proxy+} |
| 51 | + # - sns: |
| 52 | + # arn: ${file(serverless.config.js):topic-arn} |
| 53 | + # - sns: |
| 54 | + # arn: ${file(serverless.config.js):auth-topic-arn} |
| 55 | + # - sns: |
| 56 | + # arn: arn:aws:sns:us-east-1:580360238192:cf-hook |
| 57 | + - stream: |
| 58 | + type: dynamodb |
| 59 | + batchSize: 1 |
| 60 | + maximumRecordAgeInSeconds: 600 |
| 61 | + arn: |
| 62 | + Fn::GetAtt: [GithubTable, StreamArn] |
| 63 | + # - stream: |
| 64 | + # type: kinesis |
| 65 | + # batchSize: 1 |
| 66 | + # maximumRecordAgeInSeconds: 86400 |
| 67 | + # arn: |
| 68 | + # Fn::GetAtt: [Stream, Arn] |
| 69 | + |
| 70 | +resources: |
| 71 | + Resources: |
| 72 | + # Secret: |
| 73 | + # Type: AWS::SecretsManager::Secret |
| 74 | + # Properties: |
| 75 | + # Name: ${self:service}-${self:provider.stage} |
| 76 | + # SecretString: ${file(scripts/config.js):SECRETS} |
| 77 | + |
| 78 | + # Topic: |
| 79 | + # Type: AWS::SNS::Topic |
| 80 | + # Properties: |
| 81 | + # TopicName: ${self:service}-${self:provider.stage} |
| 82 | + |
| 83 | + # Queue: |
| 84 | + # Type: AWS::SQS::Queue |
| 85 | + # Properties: |
| 86 | + # QueueName: ${self:service}-${self:provider.stage} |
| 87 | + |
| 88 | + GithubTable: |
| 89 | + Type: AWS::DynamoDB::Table |
| 90 | + Properties: |
| 91 | + TableName: ${self:provider.stage}-github-sls-rest-api |
| 92 | + KeySchema: |
| 93 | + - AttributeName: pk |
| 94 | + KeyType: HASH |
| 95 | + - AttributeName: sk |
| 96 | + KeyType: RANGE |
| 97 | + AttributeDefinitions: |
| 98 | + - AttributeName: pk |
| 99 | + AttributeType: S |
| 100 | + - AttributeName: sk |
| 101 | + AttributeType: S |
| 102 | + GlobalSecondaryIndexes: |
| 103 | + - IndexName: sk-pk-index |
| 104 | + KeySchema: |
| 105 | + - AttributeName: sk |
| 106 | + KeyType: HASH |
| 107 | + - AttributeName: pk |
| 108 | + KeyType: RANGE |
| 109 | + Projection: |
| 110 | + ProjectionType: ALL |
| 111 | + StreamSpecification: |
| 112 | + StreamViewType: NEW_AND_OLD_IMAGES |
| 113 | + TimeToLiveSpecification: |
| 114 | + AttributeName: expires |
| 115 | + Enabled: true |
| 116 | + PointInTimeRecoverySpecification: |
| 117 | + PointInTimeRecoveryEnabled: true |
| 118 | + SSESpecification: |
| 119 | + SSEEnabled: true |
| 120 | + BillingMode: PAY_PER_REQUEST |
| 121 | + |
| 122 | + IdpRequestsTable: |
| 123 | + Type: AWS::DynamoDB::Table |
| 124 | + Properties: |
| 125 | + TableName: ${self:provider.stage}-github-sls-rest-api-idp-requests |
| 126 | + KeySchema: |
| 127 | + - AttributeName: pk |
| 128 | + KeyType: HASH |
| 129 | + - AttributeName: sk |
| 130 | + KeyType: RANGE |
| 131 | + AttributeDefinitions: |
| 132 | + - AttributeName: pk |
| 133 | + AttributeType: S |
| 134 | + - AttributeName: sk |
| 135 | + AttributeType: S |
| 136 | + GlobalSecondaryIndexes: |
| 137 | + - IndexName: sk-pk-index |
| 138 | + KeySchema: |
| 139 | + - AttributeName: sk |
| 140 | + KeyType: HASH |
| 141 | + - AttributeName: pk |
| 142 | + KeyType: RANGE |
| 143 | + Projection: |
| 144 | + ProjectionType: ALL |
| 145 | + StreamSpecification: |
| 146 | + StreamViewType: NEW_AND_OLD_IMAGES |
| 147 | + TimeToLiveSpecification: |
| 148 | + AttributeName: expires |
| 149 | + Enabled: true |
| 150 | + PointInTimeRecoverySpecification: |
| 151 | + PointInTimeRecoveryEnabled: true |
| 152 | + SSESpecification: |
| 153 | + SSEEnabled: true |
| 154 | + BillingMode: PAY_PER_REQUEST |
| 155 | + |
| 156 | + CachedConfigTable: |
| 157 | + Type: AWS::DynamoDB::Table |
| 158 | + Properties: |
| 159 | + TableName: ${self:provider.stage}-github-sls-rest-api-cached-config |
| 160 | + KeySchema: |
| 161 | + - AttributeName: pk |
| 162 | + KeyType: HASH |
| 163 | + - AttributeName: sk |
| 164 | + KeyType: RANGE |
| 165 | + AttributeDefinitions: |
| 166 | + - AttributeName: pk |
| 167 | + AttributeType: S |
| 168 | + - AttributeName: sk |
| 169 | + AttributeType: S |
| 170 | + GlobalSecondaryIndexes: |
| 171 | + - IndexName: sk-pk-index |
| 172 | + KeySchema: |
| 173 | + - AttributeName: sk |
| 174 | + KeyType: HASH |
| 175 | + - AttributeName: pk |
| 176 | + KeyType: RANGE |
| 177 | + Projection: |
| 178 | + ProjectionType: ALL |
| 179 | + StreamSpecification: |
| 180 | + StreamViewType: NEW_AND_OLD_IMAGES |
| 181 | + TimeToLiveSpecification: |
| 182 | + AttributeName: expires |
| 183 | + Enabled: true |
| 184 | + PointInTimeRecoverySpecification: |
| 185 | + PointInTimeRecoveryEnabled: true |
| 186 | + SSESpecification: |
| 187 | + SSEEnabled: true |
| 188 | + BillingMode: PAY_PER_REQUEST |
0 commit comments