- リポジトリの作成 (app, infra)
- リポジトリをローカルに pull
- AWSアカウントにログイン
- ターミナルのウィンドウ配置
具体的なコマンドはこちらに: https://github.com/tmokmss/isucon12q-infra
- 環境のセットアップ
import { Handler } from 'aws-lambda'; | |
type Input = { | |
/** | |
* AWS Region name to call the service | |
*/ | |
targetRegion: string; | |
/** | |
* AWS service name (must be in AWS SDK for JS v3 style) |
use std::fmt::Debug; | |
use std::sync::Arc; | |
use async_trait::async_trait; | |
use aws_sdk_rdsdata::error::ProvideErrorMetadata; | |
use futures::{stream, Sink, SinkExt, StreamExt}; | |
use tokio::net::TcpListener; | |
use pgwire::api::auth::noop::NoopStartupHandler; | |
use pgwire::api::portal::Portal; |
import { BedrockRuntimeClient, InvokeModelCommand } from '@aws-sdk/client-bedrock-runtime'; | |
const client = new BedrockRuntimeClient({ region: 'us-east-1' }); | |
const sendPrompt = async (prompt) => { | |
const command = new InvokeModelCommand({ | |
modelId: 'anthropic.claude-instant-v1', | |
body: JSON.stringify({ | |
prompt, | |
temperature: 0.6, |
{ | |
"CDK Construct": { | |
"prefix": "cdk-constructv2", | |
"body": [ | |
"import { Construct } from 'constructs';", | |
"", | |
"export interface ${1:ConstructName}Props {", | |
"", | |
"}", | |
"", |
具体的なコマンドはこちらに: https://github.com/tmokmss/isucon12q-infra
const https = require('https') | |
exports.handler = async (event) => { | |
console.log(event) | |
const req = event.requestContext.http; | |
const sourceIp = req.sourceIp; | |
// can perform IP address restriction here | |
// e.g. if (sourceIp != "11.4.51.4") throw new Error() |
import { Construct } from 'constructs'; | |
import { aws_databrew as databrew } from 'aws-cdk-lib'; | |
import { IBucket } from 'aws-cdk-lib/aws-s3'; | |
import { IRole } from 'aws-cdk-lib/aws-iam'; | |
export interface JobProps { | |
readonly name: string; | |
readonly inputBucket: IBucket; | |
readonly inputKey: string; | |
readonly outputBucket: IBucket; |
#!/bin/bash | |
# A shell script to create AWS resources for Terraform S3 backend | |
STACK_NAME=TerraformStateStack-6nc8asv # add random suffix to prevent from colliding with any existing stacks | |
TEMPLATE_PATH="$(dirname "$0")/workspace_cfn.yaml" | |
aws cloudformation deploy --stack-name $STACK_NAME --template-file $TEMPLATE_PATH --no-cli-pager | |
aws cloudformation describe-stacks --stack-name $STACK_NAME --query "Stacks[0].Outputs" --no-cli-pager |
resource "aws_s3_bucket" "aws_config_bucket" { | |
bucket_prefix = "aws-config-" | |
server_side_encryption_configuration { | |
rule { | |
apply_server_side_encryption_by_default { | |
sse_algorithm = "AES256" | |
} | |
} | |
} | |
} |
import * as cdk from '@aws-cdk/core'; | |
import * as ecs from '@aws-cdk/aws-ecs'; | |
import * as efs from '@aws-cdk/aws-efs'; | |
import * as ec2 from '@aws-cdk/aws-ec2'; | |
export class FargateStack extends cdk.Stack { | |
constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) { | |
super(scope, id, props); | |
const vpc = new ec2.Vpc(this, 'vpc'); |