Skip to content

Commit

Permalink
distributionの位置を変更しました
Browse files Browse the repository at this point in the history
  • Loading branch information
AsukaNamiki committed Apr 7, 2024
1 parent 6ad81e9 commit e9a3f64
Showing 1 changed file with 16 additions and 17 deletions.
33 changes: 16 additions & 17 deletions src/backend/lib/backend-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,23 +129,6 @@ export class BackendStack extends cdk.Stack {
],
});

new cdk.aws_s3_deployment.BucketDeployment(this, 'WebsiteDeploy', {
sources: [
cdk.aws_s3_deployment.Source.data(
'/index.html',
'<html><body><h1>Hello World</h1></body></html>'
),
cdk.aws_s3_deployment.Source.data(
'/error.html',
'<html><body><h1>Error!!!!!!!!!!!!!</h1></body></html>'
),
],
destinationBucket: websiteBucket,
distribution: distribution,
distributionPaths: ['/*'],
});


const cfnOriginAccessControl = new cdk.aws_cloudfront.CfnOriginAccessControl(
this,
"OriginAccessControl",
Expand Down Expand Up @@ -188,5 +171,21 @@ export class BackendStack extends cdk.Stack {
cfnDistribution.addOverride('Properties.DistributionConfig.Origins.0.S3OriginConfig.OriginAccessIdentity', "")
cfnDistribution.addPropertyDeletionOverride('DistributionConfig.Origins.0.CustomOriginConfig')

new cdk.aws_s3_deployment.BucketDeployment(this, 'WebsiteDeploy', {
sources: [
cdk.aws_s3_deployment.Source.data(
'/index.html',
'<html><body><h1>Hello World</h1></body></html>'
),
cdk.aws_s3_deployment.Source.data(
'/error.html',
'<html><body><h1>Error!!!!!!!!!!!!!</h1></body></html>'
),
],
destinationBucket: websiteBucket,
distribution: distribution,
distributionPaths: ['/*'],
});

}
}

0 comments on commit e9a3f64

Please sign in to comment.