mirror of
https://github.com/serverless/serverless.git
synced 2026-01-18 14:58:43 +00:00
165 lines
3.5 KiB
JSON
165 lines
3.5 KiB
JSON
{
|
|
"AWSTemplateFormatVersion": "2010-09-09",
|
|
"Parameters": {
|
|
"aaaPrefix": {
|
|
"Type": "String",
|
|
"Default": "test",
|
|
"AllowedValues": [
|
|
"me",
|
|
"test",
|
|
"prod"
|
|
]
|
|
},
|
|
"aaaDefaultDynamoRWThroughput": {
|
|
"Type": "String",
|
|
"Default": "1"
|
|
},
|
|
"aaaProjectName": {
|
|
"Type": "String",
|
|
"Default": "jaws",
|
|
"AllowedValues": [
|
|
"jaws"
|
|
]
|
|
},
|
|
"HostedZoneName": {
|
|
"Type": "String",
|
|
"Default": "myapp.com"
|
|
},
|
|
"imagesReadThroughput": {
|
|
"Type": "String",
|
|
"Default": "1"
|
|
},
|
|
"imagesWriteThroughput": {
|
|
"Type": "String",
|
|
"Default": "1"
|
|
}
|
|
},
|
|
"Resources": {
|
|
"images": {
|
|
"Type": "AWS::DynamoDB::Table",
|
|
"Properties": {
|
|
"TableName": {
|
|
"Fn::Join": [
|
|
"-",
|
|
[
|
|
{
|
|
"Ref": "aaaPrefix"
|
|
},
|
|
{
|
|
"Ref": "aaaProjectName"
|
|
},
|
|
"images"
|
|
]
|
|
]
|
|
},
|
|
"AttributeDefinitions": [
|
|
{
|
|
"AttributeName": "bucketKey",
|
|
"AttributeType": "S"
|
|
}
|
|
],
|
|
"KeySchema": [
|
|
{
|
|
"AttributeName": "bucketKey",
|
|
"KeyType": "HASH"
|
|
}
|
|
],
|
|
"ProvisionedThroughput": {
|
|
"ReadCapacityUnits": {
|
|
"Ref": "imagesReadThroughput"
|
|
},
|
|
"WriteCapacityUnits": {
|
|
"Ref": "imagesWriteThroughput"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"users": {
|
|
"Type": "AWS::DynamoDB::Table",
|
|
"DependsOn": "images",
|
|
"Properties": {
|
|
"TableName": {
|
|
"Fn::Join": [
|
|
"-",
|
|
[
|
|
{
|
|
"Ref": "aaaPrefix"
|
|
},
|
|
{
|
|
"Ref": "aaaProjectName"
|
|
},
|
|
"users"
|
|
]
|
|
]
|
|
},
|
|
"AttributeDefinitions": [
|
|
{
|
|
"AttributeName": "_id",
|
|
"AttributeType": "S"
|
|
},
|
|
{
|
|
"AttributeName": "email",
|
|
"AttributeType": "S"
|
|
}
|
|
],
|
|
"KeySchema": [
|
|
{
|
|
"AttributeName": "_id",
|
|
"KeyType": "HASH"
|
|
}
|
|
],
|
|
"ProvisionedThroughput": {
|
|
"ReadCapacityUnits": {
|
|
"Ref": "aaaDefaultDynamoRWThroughput"
|
|
},
|
|
"WriteCapacityUnits": {
|
|
"Ref": "aaaDefaultDynamoRWThroughput"
|
|
}
|
|
},
|
|
"GlobalSecondaryIndexes": [
|
|
{
|
|
"IndexName": "email-index",
|
|
"KeySchema": [
|
|
{
|
|
"AttributeName": "email",
|
|
"KeyType": "HASH"
|
|
}
|
|
],
|
|
"Projection": {
|
|
"ProjectionType": "ALL"
|
|
},
|
|
"ProvisionedThroughput": {
|
|
"ReadCapacityUnits": {
|
|
"Ref": "aaaDefaultDynamoRWThroughput"
|
|
},
|
|
"WriteCapacityUnits": {
|
|
"Ref": "aaaDefaultDynamoRWThroughput"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"imagesBucket": {
|
|
"Type": "AWS::S3::Bucket",
|
|
"DeletionPolicy": "Delete",
|
|
"Properties": {
|
|
"BucketName": {
|
|
"Fn::Join": [
|
|
"",
|
|
[
|
|
{
|
|
"Ref": "aaaProjectName"
|
|
},
|
|
"-images.",
|
|
{
|
|
"Ref": "HostedZoneName"
|
|
}
|
|
]
|
|
]
|
|
},
|
|
"AccessControl": "PublicRead"
|
|
}
|
|
}
|
|
}
|
|
} |