-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bdf798f
commit 383dbd2
Showing
6 changed files
with
260 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
type Mutation { | ||
createGame(input: CreateGameInput!): Game! | ||
} | ||
|
||
type Query { | ||
getGame(input: ID!): Game! | ||
} | ||
|
||
input CreateGameInput { | ||
name: String! | ||
description: String | ||
publicNotes: String | ||
privateNotes: String | ||
fireflyUserId: ID! | ||
players: [ID!]! | ||
} | ||
|
||
type Game { | ||
id: ID! | ||
name: String! | ||
description: String | ||
publicNotes: String | ||
privateNotes: String | ||
# fireflyUser: User! | ||
# players: [ID!]! | ||
# playerSheets: [PlayerSheet!]! | ||
# shipSheet: ShipSheet | ||
# clocks: [Clock!]! | ||
createdAt: AWSDateTime! | ||
updatedAt: AWSDateTime! | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
resource "aws_appsync_graphql_api" "graphql" { | ||
name = var.prefix | ||
schema = file("../../../graphql/schema.graphql") | ||
authentication_type = "AWS_IAM" | ||
xray_enabled = true | ||
|
||
log_config { | ||
cloudwatch_logs_role_arn = aws_iam_role.graphql_log.arn | ||
field_log_level = "ERROR" | ||
} | ||
|
||
additional_authentication_provider { | ||
authentication_type = "AMAZON_COGNITO_USER_POOLS" | ||
user_pool_config { | ||
user_pool_id = aws_cognito_user_pool.cognito.id | ||
aws_region = data.aws_region.current.name | ||
} | ||
} | ||
|
||
tags = { | ||
Name = var.prefix | ||
} | ||
} | ||
|
||
resource "aws_cloudwatch_log_group" "graphql_log" { | ||
Check warning on line 25 in terraform/module/wildsea/graphql.tf Codacy Production / Codacy Static Code Analysisterraform/module/wildsea/graphql.tf#L25
Check warning on line 25 in terraform/module/wildsea/graphql.tf Codacy Production / Codacy Static Code Analysisterraform/module/wildsea/graphql.tf#L25
|
||
name = "/aws/appsync/${var.prefix}" | ||
retention_in_days = 14 | ||
|
||
tags = { | ||
Name = var.prefix | ||
} | ||
} | ||
|
||
resource "aws_iam_role" "graphql_log" { | ||
name = "${var.prefix}-graphql-log" | ||
assume_role_policy = data.aws_iam_policy_document.graphql_log_assume.json | ||
|
||
tags = { | ||
Name = var.prefix | ||
} | ||
} | ||
|
||
data "aws_iam_policy_document" "graphql_log_assume" { | ||
statement { | ||
actions = ["sts:AssumeRole"] | ||
principals { | ||
type = "Service" | ||
identifiers = ["appsync.${data.aws_partition.current.dns_suffix}"] | ||
} | ||
} | ||
} | ||
|
||
resource "aws_iam_role_policy_attachment" "grahql_log" { | ||
role = aws_iam_role.graphql_log.name | ||
policy_arn = "arn:${data.aws_partition.current.partition}:iam::aws:policy/service-role/AWSAppSyncPushToCloudWatchLogs" | ||
} |