Skip to content

Commit

Permalink
add function code
Browse files Browse the repository at this point in the history
  • Loading branch information
alexlevy0 committed Dec 5, 2023
1 parent 368df16 commit 1b30a56
Show file tree
Hide file tree
Showing 31 changed files with 2,133 additions and 20 deletions.
3 changes: 3 additions & 0 deletions .graphqlconfig.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ projects:
codeGenTarget: typescript
generatedFileName: src/API.ts
docsFilePath: src/graphql
extensions:
amplify:
version: 3
68 changes: 68 additions & 0 deletions amplify/backend/auth/clipcrafteraidf20eeec/cli-inputs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"version": "1",
"cognitoConfig": {
"identityPoolName": "clipcrafteraidf20eeec_identitypool_df20eeec",
"allowUnauthenticatedIdentities": false,
"resourceNameTruncated": "clipcrdf20eeec",
"userPoolName": "clipcrafteraidf20eeec_userpool_df20eeec",
"autoVerifiedAttributes": [
"email"
],
"mfaConfiguration": "OFF",
"mfaTypes": [
"SMS Text Message"
],
"smsAuthenticationMessage": "Your authentication code is {####}",
"smsVerificationMessage": "Your verification code is {####}",
"emailVerificationSubject": "Your verification code",
"emailVerificationMessage": "Your verification code is {####}",
"defaultPasswordPolicy": false,
"passwordPolicyMinLength": 8,
"passwordPolicyCharacters": [],
"requiredAttributes": [
"email"
],
"aliasAttributes": [],
"userpoolClientGenerateSecret": false,
"userpoolClientRefreshTokenValidity": 30,
"userpoolClientWriteAttributes": [
"email"
],
"userpoolClientReadAttributes": [
"email"
],
"userpoolClientLambdaRole": "clipcrdf20eeec_userpoolclient_lambda_role",
"userpoolClientSetAttributes": false,
"sharedId": "df20eeec",
"resourceName": "clipcrafteraidf20eeec",
"authSelections": "identityPoolAndUserPool",
"useDefault": "defaultSocial",
"hostedUI": true,
"usernameAttributes": [
"email"
],
"hostedUIDomainName": "clipcrafterai",
"authProvidersUserPool": [
"Google"
],
"hostedUIProviderMeta": "[{\"ProviderName\":\"Google\",\"authorize_scopes\":\"openid email profile\",\"AttributeMapping\":{\"email\":\"email\",\"username\":\"sub\"}}]",
"userPoolGroupList": [],
"serviceName": "Cognito",
"useEnabledMfas": false,
"authRoleArn": {
"Fn::GetAtt": [
"AuthRole",
"Arn"
]
},
"unauthRoleArn": {
"Fn::GetAtt": [
"UnauthRole",
"Arn"
]
},
"breakCircularDependency": false,
"dependsOn": [],
"oAuthMetadata": "{\"AllowedOAuthFlows\":[\"code\"],\"AllowedOAuthScopes\":[\"phone\",\"email\",\"openid\",\"profile\",\"aws.cognito.signin.user.admin\"],\"CallbackURLs\":[\"https://main.dvqngwodvr6ir.amplifyapp.com/\",\"http://localhost:3000/\"],\"LogoutURLs\":[\"https://main.dvqngwodvr6ir.amplifyapp.com/\",\"http://localhost:3000/\"]}"
}
}
95 changes: 95 additions & 0 deletions amplify/backend/backend-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,100 @@
"providerPlugin": "awscloudformation",
"service": "AppSync"
}
},
"auth": {
"clipcrafteraidf20eeec": {
"customAuth": false,
"dependsOn": [],
"frontendAuthConfig": {
"mfaConfiguration": "OFF",
"mfaTypes": [
"SMS"
],
"passwordProtectionSettings": {
"passwordPolicyCharacters": [],
"passwordPolicyMinLength": 8
},
"signupAttributes": [
"EMAIL"
],
"socialProviders": [
"GOOGLE"
],
"usernameAttributes": [
"EMAIL"
],
"verificationMechanisms": [
"EMAIL"
]
},
"providerPlugin": "awscloudformation",
"service": "Cognito"
}
},
"function": {
"S3Triggera6bc74ca": {
"build": true,
"providerPlugin": "awscloudformation",
"service": "Lambda"
}
},
"hosting": {
"amplifyhosting": {
"lastPushTimeStamp": "2023-12-05T02:46:04.181Z",
"service": "amplifyhosting",
"type": "cicd"
}
},
"parameters": {
"AMPLIFY_function_S3Triggera6bc74ca_deploymentBucketName": {
"usedBy": [
{
"category": "function",
"resourceName": "S3Triggera6bc74ca"
}
]
},
"AMPLIFY_function_S3Triggera6bc74ca_s3Key": {
"usedBy": [
{
"category": "function",
"resourceName": "S3Triggera6bc74ca"
}
]
},
"AMPLIFY_hosting_amplifyhosting_appId": {
"usedBy": [
{
"category": "hosting",
"resourceName": "amplifyhosting"
}
]
},
"AMPLIFY_hosting_amplifyhosting_type": {
"usedBy": [
{
"category": "hosting",
"resourceName": "amplifyhosting"
}
]
}
},
"storage": {
"clipcrafteraistorage": {
"dependsOn": [
{
"attributes": [
"Name",
"Arn",
"LambdaExecutionRole"
],
"category": "function",
"resourceName": "S3Triggera6bc74ca"
}
],
"providerPlugin": "awscloudformation",
"service": "S3"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "{\"createdOn\":\"Mac\",\"createdBy\":\"Amplify\",\"createdWith\":\"12.8.2\",\"stackType\":\"function-Lambda\",\"metadata\":{}}",
"Parameters": {
"env": {
"Type": "String"
},
"deploymentBucketName": {
"Type": "String"
},
"s3Key": {
"Type": "String"
}
},
"Conditions": {
"ShouldNotCreateEnvResources": {
"Fn::Equals": [
{
"Ref": "env"
},
"NONE"
]
}
},
"Resources": {
"LambdaFunction": {
"Type": "AWS::Lambda::Function",
"Metadata": {
"aws:asset:path": "./src",
"aws:asset:property": "Code"
},
"Properties": {
"Handler": "index.handler",
"FunctionName": {
"Fn::If": [
"ShouldNotCreateEnvResources",
"S3Triggera6bc74ca",
{
"Fn::Join": [
"",
[
"S3Triggera6bc74ca",
"-",
{
"Ref": "env"
}
]
]
}
]
},
"Environment": {
"Variables": {
"ENV": {
"Ref": "env"
}
}
},
"Role": {
"Fn::GetAtt": [
"LambdaExecutionRole",
"Arn"
]
},
"Runtime": "nodejs18.x",
"Timeout": 25,
"Code": {
"S3Bucket": {
"Ref": "deploymentBucketName"
},
"S3Key": {
"Ref": "s3Key"
}
}
}
},
"LambdaExecutionRole": {
"Type": "AWS::IAM::Role",
"Properties": {
"RoleName": {
"Fn::If": [
"ShouldNotCreateEnvResources",
"S3Triggera6bc74caLambdaRolea6bc74ca",
{
"Fn::Join": [
"",
[
"S3Triggera6bc74caLambdaRolea6bc74ca",
"-",
{
"Ref": "env"
}
]
]
}
]
},
"AssumeRolePolicyDocument": {
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": [
"lambda.amazonaws.com"
]
},
"Action": [
"sts:AssumeRole"
]
}
]
}
}
},
"lambdaexecutionpolicy": {
"DependsOn": [
"LambdaExecutionRole"
],
"Type": "AWS::IAM::Policy",
"Properties": {
"PolicyName": "lambda-execution-policy",
"Roles": [
{
"Ref": "LambdaExecutionRole"
}
],
"PolicyDocument": {
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"logs:CreateLogGroup",
"logs:CreateLogStream",
"logs:PutLogEvents"
],
"Resource": {
"Fn::Sub": [
"arn:aws:logs:${region}:${account}:log-group:/aws/lambda/${lambda}:log-stream:*",
{
"region": {
"Ref": "AWS::Region"
},
"account": {
"Ref": "AWS::AccountId"
},
"lambda": {
"Ref": "LambdaFunction"
}
}
]
}
}
]
}
}
}
},
"Outputs": {
"Name": {
"Value": {
"Ref": "LambdaFunction"
}
},
"Arn": {
"Value": {
"Fn::GetAtt": [
"LambdaFunction",
"Arn"
]
}
},
"Region": {
"Value": {
"Ref": "AWS::Region"
}
},
"LambdaExecutionRole": {
"Value": {
"Ref": "LambdaExecutionRole"
}
},
"LambdaExecutionRoleArn": {
"Value": {
"Fn::GetAtt": [
"LambdaExecutionRole",
"Arn"
]
}
}
}
}
6 changes: 6 additions & 0 deletions amplify/backend/function/S3Triggera6bc74ca/amplify.state
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"pluginId": "amplify-nodejs-function-runtime-provider",
"functionRuntime": "nodejs",
"defaultEditorFile": "src/index.js",
"useLegacyBuild": true
}
Loading

0 comments on commit 1b30a56

Please sign in to comment.