improve database schema
This commit is contained in:
parent
215c0d72fd
commit
890087a572
@ -45,6 +45,20 @@ new aws.cloudwatch.LogGroup(`${prefix}-lambda-log-group`, {
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// ---- database ----
|
||||||
|
new aws.dynamodb.Table(`${prefix}-db`, {
|
||||||
|
tags,
|
||||||
|
name: "objects",
|
||||||
|
attributes: [
|
||||||
|
{ name: "userId", type: "S", },
|
||||||
|
{ name: "sortKey", type: "S", },
|
||||||
|
],
|
||||||
|
hashKey: "userId",
|
||||||
|
rangeKey: "sortKey",
|
||||||
|
billingMode: "PAY_PER_REQUEST",
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
// ---- API Gateway ----
|
// ---- API Gateway ----
|
||||||
const api = new aws.apigatewayv2.Api(`${prefix}-api`, {
|
const api = new aws.apigatewayv2.Api(`${prefix}-api`, {
|
||||||
tags,
|
tags,
|
||||||
|
@ -1,17 +0,0 @@
|
|||||||
import * as aws from "@pulumi/aws";
|
|
||||||
import * as pulumi from "@pulumi/pulumi";
|
|
||||||
|
|
||||||
import * as common from "./common";
|
|
||||||
|
|
||||||
const tags = common.tags;
|
|
||||||
const prefix = `${common.prefix}-database`;
|
|
||||||
|
|
||||||
new aws.dynamodb.Table(`${prefix}-users`, {
|
|
||||||
tags,
|
|
||||||
name: "Users", // これがDynamoDBのTableNameになる
|
|
||||||
attributes: [
|
|
||||||
{ name: "id", type: "S", },
|
|
||||||
],
|
|
||||||
hashKey: "id",
|
|
||||||
billingMode: "PAY_PER_REQUEST",
|
|
||||||
});
|
|
@ -4,7 +4,5 @@ import * as aws from "@pulumi/aws";
|
|||||||
import * as backend from "./backend";
|
import * as backend from "./backend";
|
||||||
import * as frontend from "./frontend";
|
import * as frontend from "./frontend";
|
||||||
|
|
||||||
import "./database";
|
|
||||||
|
|
||||||
export const frontendDomain = frontend.cloudfront.domainName;
|
export const frontendDomain = frontend.cloudfront.domainName;
|
||||||
export const backendEndpoint = backend.endpoint;
|
export const backendEndpoint = backend.endpoint;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user