「The parameter S3 bucket has been deleted.」エラーで CloudFront ディストリビューションを削除できない場合の対処方法を教えてください
困っていること
CloudFront ディストリビューションの削除しようとしたところ、以下のエラーが発生し、削除できません。削除方法を教えてください。
The parameter S3 bucket has been deleted.
回答
現在設定されている S3 オリジンを任意の S3 オリジンに変更した上で、再度削除をお試しください。
コンソール上での操作が上手くいかない場合は、CLI コマンドを使用し、JSON 設定ファイルとともに S3 オリジンを変更してください。
ディストリビューションを更新するには、ディストリビューション ID と ETag の指定が必要です。
ディストリビューション ID は、list-distributions コマンド、ETag は、get-distribution コマンドまたは get-distribution-config コマンドで取得できます。
aws cloudfront update-distribution \
--id EMLARXS9EXAMPLE \
--if-match E2QWRUHEXAMPLE \
--distribution-config file://dist-config-disable.json
aws cloudfront list-distributions
aws cloudfront get-distribution-config \
--id EMLARXS9EXAMPLE
{
"CallerReference": "cli-1574382155-496510",
"Aliases": {
"Quantity": 0
},
"DefaultRootObject": "index.html",
"Origins": {
"Quantity": 1,
"Items": [
{
"Id": "amzn-s3-demo-bucket.s3.amazonaws.com-1574382155-273939",
"DomainName": "amzn-s3-demo-bucket.s3.amazonaws.com",
"OriginPath": "",
"CustomHeaders": {
"Quantity": 0
},
"S3OriginConfig": {
"OriginAccessIdentity": ""
}
}
]
},
"OriginGroups": {
"Quantity": 0
},
"DefaultCacheBehavior": {
"TargetOriginId": "amzn-s3-demo-bucket.s3.amazonaws.com-1574382155-273939",
"ForwardedValues": {
"QueryString": false,
"Cookies": {
"Forward": "none"
},
"Headers": {
"Quantity": 0
},
"QueryStringCacheKeys": {
"Quantity": 0
}
},
"TrustedSigners": {
"Enabled": false,
"Quantity": 0
},
"ViewerProtocolPolicy": "allow-all",
"MinTTL": 0,
"AllowedMethods": {
"Quantity": 2,
"Items": [
"HEAD",
"GET"
],
"CachedMethods": {
"Quantity": 2,
"Items": [
"HEAD",
"GET"
]
}
},
"SmoothStreaming": false,
"DefaultTTL": 86400,
"MaxTTL": 31536000,
"Compress": false,
"LambdaFunctionAssociations": {
"Quantity": 0
},
"FieldLevelEncryptionId": ""
},
"CacheBehaviors": {
"Quantity": 0
},
"CustomErrorResponses": {
"Quantity": 0
},
"Comment": "",
"Logging": {
"Enabled": false,
"IncludeCookies": false,
"Bucket": "",
"Prefix": ""
},
"PriceClass": "PriceClass_All",
"Enabled": false,
"ViewerCertificate": {
"CloudFrontDefaultCertificate": true,
"MinimumProtocolVersion": "TLSv1",
"CertificateSource": "cloudfront"
},
"Restrictions": {
"GeoRestriction": {
"RestrictionType": "none",
"Quantity": 0
}
},
"WebACLId": "",
"HttpVersion": "http2",
"IsIPV6Enabled": true
}







