Slide 9
Slide 9 text
stackの記述
export class LiffCdkSampleStack extends Stack {
constructor(scope: Construct, id: string, props?: StackProps) {
super(scope, id, props);
const liffAppBucket = new s3.Bucket(this, 'LiffAppBucket', {
websiteIndexDocument: 'index.html'
});
const liffAppDistribution = new
cloudfront.CloudFrontWebDistribution(this, 'LiffAppDistribution', {
originConfigs: [
{
s3OriginSource: {
s3BucketSource: liffAppBucket,
originAccessIdentity: liffAppIdentity
},
behaviors: [{isDefaultBehavior: true}]
}
],
})
Stackを継承したclassの中の
constructorに作りたいリソースを
書いていく
前段で作成したS3バケットを変数に入
れておき、CloudFrontのオリジンに渡し
ている。これで連携可能
9
※途中省略しています