-
Notifications
You must be signed in to change notification settings - Fork 3
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
Showing
8 changed files
with
7,259 additions
and
46 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 |
---|---|---|
|
@@ -6,3 +6,5 @@ node_modules | |
# CDK asset staging directory | ||
.cdk.staging | ||
cdk.out | ||
|
||
/.idea |
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 |
---|---|---|
@@ -1,21 +1,7 @@ | ||
#!/usr/bin/env node | ||
import 'source-map-support/register'; | ||
import * as cdk from 'aws-cdk-lib'; | ||
import { AwsVoicevoxProxyStack } from '../lib/aws-voicevox-proxy-stack'; | ||
import "source-map-support/register"; | ||
import * as cdk from "aws-cdk-lib"; | ||
import {AwsVoicevoxProxyStack} from "../lib/aws-voicevox-proxy-stack"; | ||
|
||
const app = new cdk.App(); | ||
new AwsVoicevoxProxyStack(app, 'AwsVoicevoxProxyStack', { | ||
/* If you don't specify 'env', this stack will be environment-agnostic. | ||
* Account/Region-dependent features and context lookups will not work, | ||
* but a single synthesized template can be deployed anywhere. */ | ||
|
||
/* Uncomment the next line to specialize this stack for the AWS Account | ||
* and Region that are implied by the current CLI configuration. */ | ||
// env: { account: process.env.CDK_DEFAULT_ACCOUNT, region: process.env.CDK_DEFAULT_REGION }, | ||
|
||
/* Uncomment the next line if you know exactly what Account and Region you | ||
* want to deploy the stack to. */ | ||
// env: { account: '123456789012', region: 'us-east-1' }, | ||
|
||
/* For more information, see https://docs.aws.amazon.com/cdk/latest/guide/environments.html */ | ||
}); | ||
new AwsVoicevoxProxyStack(app, "AwsVoicevoxProxyStack", {}); |
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 |
---|---|---|
@@ -1,16 +1,25 @@ | ||
import * as cdk from 'aws-cdk-lib'; | ||
import { Construct } from 'constructs'; | ||
// import * as sqs from 'aws-cdk-lib/aws-sqs'; | ||
import * as cdk from "aws-cdk-lib"; | ||
import * as lambda from "aws-cdk-lib/aws-lambda"; | ||
import * as logs from "aws-cdk-lib/aws-logs"; | ||
import {Construct} from "constructs"; | ||
import * as path from "path"; | ||
|
||
export class AwsVoicevoxProxyStack extends cdk.Stack { | ||
constructor(scope: Construct, id: string, props?: cdk.StackProps) { | ||
super(scope, id, props); | ||
constructor(scope: Construct, id: string, props?: cdk.StackProps) { | ||
super(scope, id, props); | ||
|
||
// The code that defines your stack goes here | ||
const apiFunc = new lambda.DockerImageFunction(this, "ApiFunc", { | ||
code: lambda.DockerImageCode.fromImageAsset(path.resolve(__dirname, "../src/lambdas/ApiFunc/")), | ||
logRetention: logs.RetentionDays.ONE_WEEK, | ||
memorySize: 2048, | ||
timeout: cdk.Duration.seconds(30), | ||
}); | ||
const url = apiFunc.addFunctionUrl({ | ||
authType: lambda.FunctionUrlAuthType.NONE, | ||
}); | ||
|
||
// example resource | ||
// const queue = new sqs.Queue(this, 'AwsVoicevoxProxyQueue', { | ||
// visibilityTimeout: cdk.Duration.seconds(300) | ||
// }); | ||
} | ||
new cdk.CfnOutput(this, "ApiUrl", { | ||
value: url.url, | ||
}); | ||
} | ||
} |
Oops, something went wrong.