Name:
interface
Value:
Amplify has re-imagined the way frontend developers build fullstack applications. Develop and deploy without the hassle.

Page updated May 9, 2024

Maintenance ModeYou are viewing Amplify Gen 1 documentation. Amplify Gen 1 has entered maintenance mode and will reach end of life on May 1, 2027. New project should use Amplify Gen 2. For existing Gen 1 projects, a migration guide and tooling are available to help you upgrade. Switch to the latest Gen 2 docs →

Amplifyカテゴリの設定

Amplify CLIを使用する場合、amplifyconfiguration.jsonファイルは、追加および設定したリソースに基づいて自動的に作成および更新されます。

Amplify CLIを使用していない場合や、これらの設定をオーバーライドする必要がある場合、このドキュメントには各カテゴリの利用可能な設定プロパティが示されています。

古いプロジェクトで作業している場合、選択したフレームワークまたは言語の前のバージョンの設定プロパティも確認できます。

一般的な設定

Amplify.configure()設定は、通常、プロジェクトのエントリーポイントファイル(例:/src/main.js)に含めることができます。これは2つのパラメータを取ります - ResourcesConfigLibraryOptionsです。

Amplify.configure({ ...resourcesConfig }, { ...libraryOptions });

認証(Amazon Cognito)

Amplify.configure({
Auth: {
Cognito: {
userPoolClientId: 'abcdefghij1234567890',
userPoolId: 'us-east-1_abcd1234',
loginWith: { // Optional
oauth: {
domain: 'abcdefghij1234567890-29051e27.auth.us-east-1.amazoncognito.com',
scopes: ['openid','email','phone','profile','aws.cognito.signin.user.admin'],
redirectSignIn: ['http://localhost:3000/','https://example.com/'],
redirectSignOut: ['http://localhost:3000/','https://example.com/'],
responseType: 'code',
}
username: 'true',
email: 'false', // Optional
phone: 'false', // Optional
}
}
}
});

API GraphQL(AWS AppSync)

Amplify.configure({
API: {
GraphQL: {
endpoint:
'https://abcdefghij1234567890.appsync-api.us-east-1.amazonaws.com/graphql',
defaultAuthMode: 'apiKey',
apiKey: 'da-abcdefghij1234567890', // Optional
region: 'us-east-1', // Optional
customEndpoint: 'https://example.com/graphql', // Optional
customEndpointRegion: 'us-east-1' // Optional
}
}
});

API Rest(Amazon API Gateway)

Amplify.configure({
API: {
REST: {
YourAPIName: {
endpoint:
'https://abcdefghij1234567890.execute-api.us-east-1.amazonaws.com/stageName',
region: 'us-east-1' // Optional
}
}
}
});

ストレージ(Amazon S3)

Amplify.configure({
Storage: {
S3: {
bucket: 'your-bucket-name', // Optional
region: 'us-east-1' // Optional
}
}
});

分析(Amazon Pinpoint)

Amplify.configure({
Analytics: {
Personalize: {
trackingId: 'abcd1234',
region: 'us-east-1',
flushInterval: 0, // Optional
flushSize: 0 // Optional
},
Pinpoint: {
appId: 'abcdefghij1234567890',
region: 'us-east-1',
flushInterval: 0, // Optional
flushSize: 0, // Optional
bufferSize: 0 // Optional
},
Kinesis: {
region: 'us-east-1',
flushInterval: 0, // Optional
flushSize: 0, // Optional
bufferSize: 0 // Optional
},
KinesisFirehose: {
region: 'us-east-1',
flushInterval: 0, // Optional
flushSize: 0, // Optional
bufferSize: 0 // Optional
}
}
});

予測

Amplify.configure({
Predictions: {
convert: {
translateText: {
region: 'us-east-1',
proxy: false,
defaults: {
sourceLanguage: 'en',
targetLanguage: 'zh'
}
},
speechGenerator: {
region: 'us-east-1',
proxy: false,
defaults: {
VoiceId: 'Ivy',
LanguageCode: 'en-US'
}
},
transcription: {
region: 'us-east-1',
proxy: false,
defaults: {
language: 'en-US'
}
}
},
identify: {
identifyText: {
proxy: false,
region: 'us-east-1',
defaults: {
format: 'PLAIN'
}
},
identifyEntities: {
proxy: false,
region: 'us-east-1',
celebrityDetectionEnabled: true,
defaults: {
collectionId: 'identifyEntities8b89c648',
maxEntities: 50
}
},
identifyLabels: {
proxy: false,
region: 'us-east-1',
defaults: {
type: 'LABELS'
}
}
},
interpret: {
interpretText: {
region: 'us-east-1',
proxy: false,
defaults: {
type: 'ALL'
}
}
}
}
});

インタラクション

Amplify.configure({
Interactions: {
LexV1: {
MyV1Bot: {
alias: 'BotAlias',
region: 'us-east-1'
}
},
LexV2: {
MyV2Bot: {
botId: 'ABCDE12345',
aliasId: 'BotAlias',
localeId: 'localId',
region: 'us-east-1'
}
}
}
});

通知

Amplify.configure({
Notifications: {
InAppMessaging: {
Pinpoint: {
appId: 'abcdefgh12345678',
region: 'us-east-1'
}
},
PushNotification: {
Pinpoint: {
appId: 'abcdefgh12345678',
region: 'us-east-1'
}
}
}
});

Geo

Amplify.configure({
Geo: {
LocationService: {
region: 'us-east-1',
maps: {
// Optional
items: {},
default: ''
},
searchIndices: {
// Optional
items: [''],
default: ''
},
geofenceCollections: {
// Optional
items: [''],
default: ''
}
}
}
});