8000 Update beta from dev by davisengeler · Pull Request #98 · Vibe-House-LLC/memeSRC · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Update beta from dev #98

8000 New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Feb 27, 2023
Merged
9 changes: 9 additions & 0 deletions amplify/backend/api/memesrc/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@
# all models in this schema. Learn more about authorization rules here: https://docs.amplify.aws/cli/graphql/authorization-rules
# input AMPLIFY { globalAuthRule: AuthRule = { allow: public } } # FOR TESTING ONLY!

type AnalyticsMetrics @model @auth(
rules: [
{ allow: groups, groups: ["admins", "mods"] }
]
) {
id: ID!,
value: String
}

type ContentMetadata @model @auth(
rules: [
{ allow: groups, groups: ["admins", "mods"] },
Expand Down
7 changes: 7 additions & 0 deletions amplify/backend/backend-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,13 @@
],
"category": "storage",
"resourceName": "memesrcGeneratedImages"
},
{
"attributes": [
"GraphQLAPIIdOutput"
],
"category": "api",
"resourceName": "memesrc"
}
],
"providerPlugin": "awscloudformation",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
"memesrcGeneratedImages": [
"create",
"read"
],
"AnalyticsMetrics:@model(appsync)": [
"create",
"read",
"update"
]
}
},
Expand Down
DDB0
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
"storagememesrcGeneratedImagesBucketName": {
"Type": "String",
"Default": "storagememesrcGeneratedImagesBucketName"
},
"apimemesrcGraphQLAPIIdOutput": {
"Type": "String",
"Default": "apimemesrcGraphQLAPIIdOutput"
}
},
"Conditions": {
Expand Down Expand Up @@ -76,6 +80,35 @@
},
"STORAGE_MEMESRCGENERATEDIMAGES_BUCKETNAME": {
"Ref": "storagememesrcGeneratedImagesBucketName"
},
"API_MEMESRC_ANALYTICSMETRICSTABLE_NAME": {
"Fn::ImportValue": {
"Fn::Sub": "${apimemesrcGraphQLAPIIdOutput}:GetAtt:AnalyticsMetricsTable:Name"
}
},
"API_MEMESRC_ANALYTICSMETRICSTABLE_ARN": {
"Fn::Join": [
"",
[
"arn:aws:dynamodb:",
{
"Ref": "AWS::Region"
},
":",
{
"Ref": "AWS::AccountId"
},
":table/",
{
"Fn::ImportValue": {
"Fn::Sub": "${apimemesrcGraphQLAPIIdOutput}:GetAtt:AnalyticsMetricsTable:Name"
}
}
]
]
},
"API_MEMESRC_GRAPHQLAPIIDOUTPUT": {
"Ref": "apimemesrcGraphQLAPIIdOutput"
}
}
},
Expand Down Expand Up @@ -224,6 +257,67 @@
]
}
]
},
{
"Effect": "Allow",
"Action": [
"dynamodb:Put*",
"dynamodb:Create*",
"dynamodb:BatchWriteItem",
"dynamodb:Get*",
"dynamodb:BatchGetItem",
"dynamodb:List*",
"dynamodb:Describe*",
"dynamodb:Scan",
"dynamodb:Query",
"dynamodb:Update*",
"dynamodb:RestoreTable*"
],
"Resource": [
{
"Fn::Join": [
"",
[
"arn:aws:dynamodb:",
{
"Ref": "AWS::Region"
},
":",
{
"Ref": "AWS::AccountId"
},
":table/",
{
"Fn::ImportValue": {
"Fn::Sub": "${apimemesrcGraphQLAPIIdOutput}:GetAtt:AnalyticsMetricsTable:Name"
}
}
]
]
},
{
"Fn::Join": [
"",
[
"arn:aws:dynamodb:",
{
"Ref": "AWS::Region"
},
":",
{
"Ref": "AWS::AccountId"
},
":table/",
{
"Fn::ImportValue": {
"Fn::Sub": "${apimemesrcGraphQLAPIIdOutput}:GetAtt:AnalyticsMetricsTable:Name"
}
},
"/index/*"
]
]
}
]
}
]
}
Expand Down Expand Up @@ -293,6 +387,45 @@
]
},
"DependsOn": "LambdaExecutionRole"
},
"CloudWatchEvent": {
"Type": "AWS::Events::Rule",
"Properties": {
"Description": "Schedule rule for Lambda",
"ScheduleExpression": {
"Ref": "CloudWatchRule"
},
"State": "ENABLED",
"Targets": [
{
"Arn": {
"Fn::GetAtt": [
"LambdaFunction",
"Arn"
]
},
"Id": {
"Ref": "LambdaFunction"
}
}
]
}
},
"PermissionForEventsToInvokeLambda": {
"Type": "AWS::Lambda::Permission",
"Properties": {
"FunctionName": {
"Ref": "LambdaFunction"
},
"Action": "lambda:InvokeFunction",
"Principal": "events.amazonaws.com",
"SourceArn": {
"Fn::GetAtt": [
"CloudWatchEvent",
"Arn"
]
}
}
}
},
"Outputs": {
Expand Down Expand Up @@ -326,6 +459,11 @@
"Arn"
]
}
},
"CloudWatchEventRule": {
"Value": {
"Ref": "CloudWatchEvent"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
{}
{
"CloudWatchRule": "rate(5 minutes)"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"queryStringParameters": {
"metric": "popularShows"
"metric": "totalFrameViews"
}
}
Loading
0