쿠키 기본 설정 선택

당사는 사이트와 서비스를 제공하는 데 필요한 필수 쿠키 및 유사한 도구를 사용합니다. 고객이 사이트를 어떻게 사용하는지 파악하고 개선할 수 있도록 성능 쿠키를 사용해 익명의 통계를 수집합니다. 필수 쿠키는 비활성화할 수 없지만 '사용자 지정' 또는 ‘거부’를 클릭하여 성능 쿠키를 거부할 수 있습니다.

사용자가 동의하는 경우 AWS와 승인된 제3자도 쿠키를 사용하여 유용한 사이트 기능을 제공하고, 사용자의 기본 설정을 기억하고, 관련 광고를 비롯한 관련 콘텐츠를 표시합니다. 필수가 아닌 모든 쿠키를 수락하거나 거부하려면 ‘수락’ 또는 ‘거부’를 클릭하세요. 더 자세한 내용을 선택하려면 ‘사용자 정의’를 클릭하세요.

AWS CLI를 사용한 CloudFront 예시

포커스 모드
AWS CLI를 사용한 CloudFront 예시 - AWS Command Line Interface

이 문서는 AWS CLI의 버전 1에만 해당합니다. AWS CLI의 버전 2와 관련된 문서는 버전 2 사용 설명서를 참조하세요.

이 문서는 AWS CLI의 버전 1에만 해당합니다. AWS CLI의 버전 2와 관련된 문서는 버전 2 사용 설명서를 참조하세요.

다음 코드 예제는 CloudFront와 함께 AWS Command Line Interface를 사용하여 작업을 수행하고 일반적인 시나리오를 구현하는 방법을 보여줍니다.

작업은 대규모 프로그램에서 발췌한 코드이며 컨텍스트에 맞춰 실행해야 합니다. 작업은 관련 시나리오의 컨텍스트에 따라 표시되며, 개별 서비스 함수를 직접적으로 호출하는 방법을 보여줍니다.

각 예시에는 전체 소스 코드에 대한 링크가 포함되어 있으며, 여기에서 컨텍스트에 맞춰 코드를 설정하고 실행하는 방법에 대한 지침을 찾을 수 있습니다.

주제

작업

다음 코드 예시에서는 create-cloud-front-origin-access-identity 코드를 사용하는 방법을 보여줍니다.

AWS CLI

CloudFront 원본 액세스 ID 생성

다음 예시에서는 명령줄 인수로 OAI 구성을 제공하여 CloudFront 오리진 액세스 ID(OAI)를 생성합니다.

aws cloudfront create-cloud-front-origin-access-identity \ --cloud-front-origin-access-identity-config \ CallerReference="cli-example",Comment="Example OAI"

다음 예시와 같이 JSON 파일에 OAI 구성을 제공하여 동일한 작업을 수행할 수 있습니다.

aws cloudfront create-cloud-front-origin-access-identity \ --cloud-front-origin-access-identity-config file://OAI-config.json

OAI-config.json 파일은 다음을 포함한 현재 디렉터리의 JSON 문서입니다.

{ "CallerReference": "cli-example", "Comment": "Example OAI" }

명령줄 인수로 OAI 구성을 제공하든 JSON 파일로 제공하든 출력은 동일합니다.

{ "Location": "https://cloudfront.amazonaws.com/2019-03-26/origin-access-identity/cloudfront/E74FTE3AEXAMPLE", "ETag": "E2QWRUHEXAMPLE", "CloudFrontOriginAccessIdentity": { "Id": "E74FTE3AEXAMPLE", "S3CanonicalUserId": "cd13868f797c227fbea2830611a26fe0a21ba1b826ab4bed9b7771c9aEXAMPLE", "CloudFrontOriginAccessIdentityConfig": { "CallerReference": "cli-example", "Comment": "Example OAI" } } }

다음 코드 예시에서는 create-cloud-front-origin-access-identity 코드를 사용하는 방법을 보여줍니다.

AWS CLI

CloudFront 원본 액세스 ID 생성

다음 예시에서는 명령줄 인수로 OAI 구성을 제공하여 CloudFront 오리진 액세스 ID(OAI)를 생성합니다.

aws cloudfront create-cloud-front-origin-access-identity \ --cloud-front-origin-access-identity-config \ CallerReference="cli-example",Comment="Example OAI"

다음 예시와 같이 JSON 파일에 OAI 구성을 제공하여 동일한 작업을 수행할 수 있습니다.

aws cloudfront create-cloud-front-origin-access-identity \ --cloud-front-origin-access-identity-config file://OAI-config.json

OAI-config.json 파일은 다음을 포함한 현재 디렉터리의 JSON 문서입니다.

{ "CallerReference": "cli-example", "Comment": "Example OAI" }

명령줄 인수로 OAI 구성을 제공하든 JSON 파일로 제공하든 출력은 동일합니다.

{ "Location": "https://cloudfront.amazonaws.com/2019-03-26/origin-access-identity/cloudfront/E74FTE3AEXAMPLE", "ETag": "E2QWRUHEXAMPLE", "CloudFrontOriginAccessIdentity": { "Id": "E74FTE3AEXAMPLE", "S3CanonicalUserId": "cd13868f797c227fbea2830611a26fe0a21ba1b826ab4bed9b7771c9aEXAMPLE", "CloudFrontOriginAccessIdentityConfig": { "CallerReference": "cli-example", "Comment": "Example OAI" } } }

다음 코드 예시에서는 create-distribution-with-tags 코드를 사용하는 방법을 보여줍니다.

AWS CLI

태그를 사용하여 CloudFront 배포 생성

다음 create-distribution-with-tags 예제에서는 dist-config-with-tags.json이라는 JSON 파일에서 배포 구성과 태그를 제공하여 두 개의 태그가 있는 배포를 생성합니다.

aws cloudfront create-distribution-with-tags \ --distribution-config-with-tags file://dist-config-with-tags.json

dist-config-with-tags.json 파일은 현재 폴더의 JSON 문서입니다. 두 개의 태그가 포함된 파일 상단의 Tags 객체를 기록해 둡니다.

Name = ExampleDistributionProject = ExampleProject

dist-config-with-tags.json의 콘텐츠:

{ "Tags": { "Items": [ { "Key": "Name", "Value": "ExampleDistribution" }, { "Key": "Project", "Value": "ExampleProject" } ] }, "DistributionConfig": { "CallerReference": "cli-example", "Aliases": { "Quantity": 0 }, "DefaultRootObject": "index.html", "Origins": { "Quantity": 1, "Items": [ { "Id": "amzn-s3-demo-bucket.s3.amazonaws.com-cli-example", "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-cli-example", "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": true, "ViewerCertificate": { "CloudFrontDefaultCertificate": true, "MinimumProtocolVersion": "TLSv1", "CertificateSource": "cloudfront" }, "Restrictions": { "GeoRestriction": { "RestrictionType": "none", "Quantity": 0 } }, "WebACLId": "", "HttpVersion": "http2", "IsIPV6Enabled": true } }

출력:

{ "Location": "https://cloudfront.amazonaws.com/2019-03-26/distribution/EDFDVBD6EXAMPLE", "ETag": "E2QWRUHEXAMPLE", "Distribution": { "Id": "EDFDVBD6EXAMPLE", "ARN": "arn:aws:cloudfront::123456789012:distribution/EDFDVBD6EXAMPLE", "Status": "InProgress", "LastModifiedTime": "2019-12-04T23:35:41.433Z", "InProgressInvalidationBatches": 0, "DomainName": "d111111abcdef8.cloudfront.net", "ActiveTrustedSigners": { "Enabled": false, "Quantity": 0 }, "DistributionConfig": { "CallerReference": "cli-example", "Aliases": { "Quantity": 0 }, "DefaultRootObject": "index.html", "Origins": { "Quantity": 1, "Items": [ { "Id": "amzn-s3-demo-bucket.s3.amazonaws.com-cli-example", "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-cli-example", "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": true, "ViewerCertificate": { "CloudFrontDefaultCertificate": true, "MinimumProtocolVersion": "TLSv1", "CertificateSource": "cloudfront" }, "Restrictions": { "GeoRestriction": { "RestrictionType": "none", "Quantity": 0 } }, "WebACLId": "", "HttpVersion": "http2", "IsIPV6Enabled": true } } }

다음 코드 예시에서는 create-distribution-with-tags 코드를 사용하는 방법을 보여줍니다.

AWS CLI

태그를 사용하여 CloudFront 배포 생성

다음 create-distribution-with-tags 예제에서는 dist-config-with-tags.json이라는 JSON 파일에서 배포 구성과 태그를 제공하여 두 개의 태그가 있는 배포를 생성합니다.

aws cloudfront create-distribution-with-tags \ --distribution-config-with-tags file://dist-config-with-tags.json

dist-config-with-tags.json 파일은 현재 폴더의 JSON 문서입니다. 두 개의 태그가 포함된 파일 상단의 Tags 객체를 기록해 둡니다.

Name = ExampleDistributionProject = ExampleProject

dist-config-with-tags.json의 콘텐츠:

{ "Tags": { "Items": [ { "Key": "Name", "Value": "ExampleDistribution" }, { "Key": "Project", "Value": "ExampleProject" } ] }, "DistributionConfig": { "CallerReference": "cli-example", "Aliases": { "Quantity": 0 }, "DefaultRootObject": "index.html", "Origins": { "Quantity": 1, "Items": [ { "Id": "amzn-s3-demo-bucket.s3.amazonaws.com-cli-example", "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-cli-example", "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": true, "ViewerCertificate": { "CloudFrontDefaultCertificate": true, "MinimumProtocolVersion": "TLSv1", "CertificateSource": "cloudfront" }, "Restrictions": { "GeoRestriction": { "RestrictionType": "none", "Quantity": 0 } }, "WebACLId": "", "HttpVersion": "http2", "IsIPV6Enabled": true } }

출력:

{ "Location": "https://cloudfront.amazonaws.com/2019-03-26/distribution/EDFDVBD6EXAMPLE", "ETag": "E2QWRUHEXAMPLE", "Distribution": { "Id": "EDFDVBD6EXAMPLE", "ARN": "arn:aws:cloudfront::123456789012:distribution/EDFDVBD6EXAMPLE", "Status": "InProgress", "LastModifiedTime": "2019-12-04T23:35:41.433Z", "InProgressInvalidationBatches": 0, "DomainName": "d111111abcdef8.cloudfront.net", "ActiveTrustedSigners": { "Enabled": false, "Quantity": 0 }, "DistributionConfig": { "CallerReference": "cli-example", "Aliases": { "Quantity": 0 }, "DefaultRootObject": "index.html", "Origins": { "Quantity": 1, "Items": [ { "Id": "amzn-s3-demo-bucket.s3.amazonaws.com-cli-example", "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-cli-example", "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": true, "ViewerCertificate": { "CloudFrontDefaultCertificate": true, "MinimumProtocolVersion": "TLSv1", "CertificateSource": "cloudfront" }, "Restrictions": { "GeoRestriction": { "RestrictionType": "none", "Quantity": 0 } }, "WebACLId": "", "HttpVersion": "http2", "IsIPV6Enabled": true } } }

다음 코드 예시에서는 create-distribution을 사용하는 방법을 보여 줍니다.

AWS CLI

예제 1: CloudFront 배포를 생성하는 방법

다음 예제에서는 명령줄 인수를 사용하여 이름이 amzn-s3-demo-bucket인 S3 버킷에 대한 배포를 생성하고 index.html을 기본 루트 객체로 지정합니다.

aws cloudfront create-distribution \ --origin-domain-name amzn-s3-demo-bucket.s3.amazonaws.com \ --default-root-object index.html

출력:

{ "Location": "https://cloudfront.amazonaws.com/2019-03-26/distribution/EMLARXS9EXAMPLE", "ETag": "E9LHASXEXAMPLE", "Distribution": { "Id": "EMLARXS9EXAMPLE", "ARN": "arn:aws:cloudfront::123456789012:distribution/EMLARXS9EXAMPLE", "Status": "InProgress", "LastModifiedTime": "2019-11-22T00:55:15.705Z", "InProgressInvalidationBatches": 0, "DomainName": "d111111abcdef8.cloudfront.net", "ActiveTrustedSigners": { "Enabled": false, "Quantity": 0 }, "DistributionConfig": { "CallerReference": "cli-example", "Aliases": { "Quantity": 0 }, "DefaultRootObject": "index.html", "Origins": { "Quantity": 1, "Items": [ { "Id": "amzn-s3-demo-bucket.s3.amazonaws.com-cli-example", "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-cli-example", "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": true, "ViewerCertificate": { "CloudFrontDefaultCertificate": true, "MinimumProtocolVersion": "TLSv1", "CertificateSource": "cloudfront" }, "Restrictions": { "GeoRestriction": { "RestrictionType": "none", "Quantity": 0 } }, "WebACLId": "", "HttpVersion": "http2", "IsIPV6Enabled": true } } }

예제 2: JSON 파일을 사용하여 CloudFront 배포를 생성하는 방법

다음 예제에서는 JSON 파일을 사용하여 이름이 amzn-s3-demo-bucket인 S3 버킷에 대한 배포를 생성하고 index.html을 기본 루트 객체로 지정합니다.

aws cloudfront create-distribution \ --distribution-config file://dist-config.json

dist-config.json의 콘텐츠:

{ "CallerReference": "cli-example", "Aliases": { "Quantity": 0 }, "DefaultRootObject": "index.html", "Origins": { "Quantity": 1, "Items": [ { "Id": "amzn-s3-demo-bucket.s3.amazonaws.com-cli-example", "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-cli-example", "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": true, "ViewerCertificate": { "CloudFrontDefaultCertificate": true, "MinimumProtocolVersion": "TLSv1", "CertificateSource": "cloudfront" }, "Restrictions": { "GeoRestriction": { "RestrictionType": "none", "Quantity": 0 } }, "WebACLId": "", "HttpVersion": "http2", "IsIPV6Enabled": true }

샘플 출력은 예제 1을 참조하세요.

다음 코드 예시에서는 create-distribution을 사용하는 방법을 보여 줍니다.

AWS CLI

예제 1: CloudFront 배포를 생성하는 방법

다음 예제에서는 명령줄 인수를 사용하여 이름이 amzn-s3-demo-bucket인 S3 버킷에 대한 배포를 생성하고 index.html을 기본 루트 객체로 지정합니다.

aws cloudfront create-distribution \ --origin-domain-name amzn-s3-demo-bucket.s3.amazonaws.com \ --default-root-object index.html

출력:

{ "Location": "https://cloudfront.amazonaws.com/2019-03-26/distribution/EMLARXS9EXAMPLE", "ETag": "E9LHASXEXAMPLE", "Distribution": { "Id": "EMLARXS9EXAMPLE", "ARN": "arn:aws:cloudfront::123456789012:distribution/EMLARXS9EXAMPLE", "Status": "InProgress", "LastModifiedTime": "2019-11-22T00:55:15.705Z", "InProgressInvalidationBatches": 0, "DomainName": "d111111abcdef8.cloudfront.net", "ActiveTrustedSigners": { "Enabled": false, "Quantity": 0 }, "DistributionConfig": { "CallerReference": "cli-example", "Aliases": { "Quantity": 0 }, "DefaultRootObject": "index.html", "Origins": { "Quantity": 1, "Items": [ { "Id": "amzn-s3-demo-bucket.s3.amazonaws.com-cli-example", "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-cli-example", "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": true, "ViewerCertificate": { "CloudFrontDefaultCertificate": true, "MinimumProtocolVersion": "TLSv1", "CertificateSource": "cloudfront" }, "Restrictions": { "GeoRestriction": { "RestrictionType": "none", "Quantity": 0 } }, "WebACLId": "", "HttpVersion": "http2", "IsIPV6Enabled": true } } }

예제 2: JSON 파일을 사용하여 CloudFront 배포를 생성하는 방법

다음 예제에서는 JSON 파일을 사용하여 이름이 amzn-s3-demo-bucket인 S3 버킷에 대한 배포를 생성하고 index.html을 기본 루트 객체로 지정합니다.

aws cloudfront create-distribution \ --distribution-config file://dist-config.json

dist-config.json의 콘텐츠:

{ "CallerReference": "cli-example", "Aliases": { "Quantity": 0 }, "DefaultRootObject": "index.html", "Origins": { "Quantity": 1, "Items": [ { "Id": "amzn-s3-demo-bucket.s3.amazonaws.com-cli-example", "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-cli-example", "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": true, "ViewerCertificate": { "CloudFrontDefaultCertificate": true, "MinimumProtocolVersion": "TLSv1", "CertificateSource": "cloudfront" }, "Restrictions": { "GeoRestriction": { "RestrictionType": "none", "Quantity": 0 } }, "WebACLId": "", "HttpVersion": "http2", "IsIPV6Enabled": true }

샘플 출력은 예제 1을 참조하세요.

다음 코드 예시에서는 create-field-level-encryption-config 코드를 사용하는 방법을 보여줍니다.

AWS CLI

CloudFront 필드 수준 암호화 구성 생성

다음 예시에서는 JSON 파일 fle-config.json에 구성 파라미터를 제공하여 필드 수준 암호화 구성을 생성합니다. 필드 수준 암호화 구성을 생성하려면 먼저 필드 수준 암호화 프로파일이 있어야 합니다. 프로파일을 생성하려면 create-field-level-encryption-profile 명령을 참조하세요.

CloudFront 필드 수준 암호화에 대한 자세한 내용은 Amazon CloudFront 개발자 안내서필드 수준 암호화를 사용하여 민감한 데이터 보호를 참조하세요.

aws cloudfront create-field-level-encryption-config \ --field-level-encryption-config file://fle-config.json

fle-config.json 파일은 다음을 포함한 현재 문서의 JSON 문서입니다.

{ "CallerReference": "cli-example", "Comment": "Example FLE configuration", "QueryArgProfileConfig": { "ForwardWhenQueryArgProfileIsUnknown": true, "QueryArgProfiles": { "Quantity": 0 } }, "ContentTypeProfileConfig": { "ForwardWhenContentTypeIsUnknown": true, "ContentTypeProfiles": { "Quantity": 1, "Items": [ { "Format": "URLEncoded", "ProfileId": "P280MFCLSYOCVU", "ContentType": "application/x-www-form-urlencoded" } ] } } }

출력:

{ "Location": "https://cloudfront.amazonaws.com/2019-03-26/field-level-encryption/C3KM2WVD605UAY", "ETag": "E2P4Z4VU7TY5SG", "FieldLevelEncryption": { "Id": "C3KM2WVD605UAY", "LastModifiedTime": "2019-12-10T21:30:18.974Z", "FieldLevelEncryptionConfig": { "CallerReference": "cli-example", "Comment": "Example FLE configuration", "QueryArgProfileConfig": { "ForwardWhenQueryArgProfileIsUnknown": true, "QueryArgProfiles": { "Quantity": 0, "Items": [] } }, "ContentTypeProfileConfig": { "ForwardWhenContentTypeIsUnknown": true, "ContentTypeProfiles": { "Quantity": 1, "Items": [ { "Format": "URLEncoded", "ProfileId": "P280MFCLSYOCVU", "ContentType": "application/x-www-form-urlencoded" } ] } } } } }

다음 코드 예시에서는 create-field-level-encryption-config 코드를 사용하는 방법을 보여줍니다.

AWS CLI

CloudFront 필드 수준 암호화 구성 생성

다음 예시에서는 JSON 파일 fle-config.json에 구성 파라미터를 제공하여 필드 수준 암호화 구성을 생성합니다. 필드 수준 암호화 구성을 생성하려면 먼저 필드 수준 암호화 프로파일이 있어야 합니다. 프로파일을 생성하려면 create-field-level-encryption-profile 명령을 참조하세요.

CloudFront 필드 수준 암호화에 대한 자세한 내용은 Amazon CloudFront 개발자 안내서필드 수준 암호화를 사용하여 민감한 데이터 보호를 참조하세요.

aws cloudfront create-field-level-encryption-config \ --field-level-encryption-config file://fle-config.json

fle-config.json 파일은 다음을 포함한 현재 문서의 JSON 문서입니다.

{ "CallerReference": "cli-example", "Comment": "Example FLE configuration", "QueryArgProfileConfig": { "ForwardWhenQueryArgProfileIsUnknown": true, "QueryArgProfiles": { "Quantity": 0 } }, "ContentTypeProfileConfig": { "ForwardWhenContentTypeIsUnknown": true, "ContentTypeProfiles": { "Quantity": 1, "Items": [ { "Format": "URLEncoded", "ProfileId": "P280MFCLSYOCVU", "ContentType": "application/x-www-form-urlencoded" } ] } } }

출력:

{ "Location": "https://cloudfront.amazonaws.com/2019-03-26/field-level-encryption/C3KM2WVD605UAY", "ETag": "E2P4Z4VU7TY5SG", "FieldLevelEncryption": { "Id": "C3KM2WVD605UAY", "LastModifiedTime": "2019-12-10T21:30:18.974Z", "FieldLevelEncryptionConfig": { "CallerReference": "cli-example", "Comment": "Example FLE configuration", "QueryArgProfileConfig": { "ForwardWhenQueryArgProfileIsUnknown": true, "QueryArgProfiles": { "Quantity": 0, "Items": [] } }, "ContentTypeProfileConfig": { "ForwardWhenContentTypeIsUnknown": true, "ContentTypeProfiles": { "Quantity": 1, "Items": [ { "Format": "URLEncoded", "ProfileId": "P280MFCLSYOCVU", "ContentType": "application/x-www-form-urlencoded" } ] } } } } }

다음 코드 예시에서는 create-field-level-encryption-profile 코드를 사용하는 방법을 보여줍니다.

AWS CLI

CloudFront 필드 수준 암호화 프로파일을 생성하는 방법

다음 예시에서는 JSON 파일 fle-profile-config.json에 파라미터를 제공하여 필드 수준 암호화 프로파일을 생성합니다. 필드 수준 암호화 프로파일을 생성하려면 먼저 CloudFront 퍼블릭 키가 있어야 합니다. CloudFront 퍼블릭 키를 생성하려면 create-public-key 명령을 참조하세요.

CloudFront 필드 수준 암호화에 대한 자세한 내용은 Amazon CloudFront 개발자 안내서필드 수준 암호화를 사용하여 민감한 데이터 보호를 참조하세요.

aws cloudfront create-field-level-encryption-profile \ --field-level-encryption-profile-config file://fle-profile-config.json

fle-profile-config.json 파일은 다음을 포함한 현재 문서의 JSON 문서입니다.

{ "Name": "ExampleFLEProfile", "CallerReference": "cli-example", "Comment": "FLE profile for AWS CLI example", "EncryptionEntities": { "Quantity": 1, "Items": [ { "PublicKeyId": "K2K8NC4HVFE3M0", "ProviderId": "ExampleFLEProvider", "FieldPatterns": { "Quantity": 1, "Items": [ "ExampleSensitiveField" ] } } ] } }

출력:

{ "Location": "https://cloudfront.amazonaws.com/2019-03-26/field-level-encryption-profile/PPK0UOSIF5WSV", "ETag": "E2QWRUHEXAMPLE", "FieldLevelEncryptionProfile": { "Id": "PPK0UOSIF5WSV", "LastModifiedTime": "2019-12-10T01:03:16.537Z", "FieldLevelEncryptionProfileConfig": { "Name": "ExampleFLEProfile", "CallerReference": "cli-example", "Comment": "FLE profile for AWS CLI example", "EncryptionEntities": { "Quantity": 1, "Items": [ { "PublicKeyId": "K2K8NC4HVFE3M0", "ProviderId": "ExampleFLEProvider", "FieldPatterns": { "Quantity": 1, "Items": [ "ExampleSensitiveField" ] } } ] } } } }

다음 코드 예시에서는 create-field-level-encryption-profile 코드를 사용하는 방법을 보여줍니다.

AWS CLI

CloudFront 필드 수준 암호화 프로파일을 생성하는 방법

다음 예시에서는 JSON 파일 fle-profile-config.json에 파라미터를 제공하여 필드 수준 암호화 프로파일을 생성합니다. 필드 수준 암호화 프로파일을 생성하려면 먼저 CloudFront 퍼블릭 키가 있어야 합니다. CloudFront 퍼블릭 키를 생성하려면 create-public-key 명령을 참조하세요.

CloudFront 필드 수준 암호화에 대한 자세한 내용은 Amazon CloudFront 개발자 안내서필드 수준 암호화를 사용하여 민감한 데이터 보호를 참조하세요.

aws cloudfront create-field-level-encryption-profile \ --field-level-encryption-profile-config file://fle-profile-config.json

fle-profile-config.json 파일은 다음을 포함한 현재 문서의 JSON 문서입니다.

{ "Name": "ExampleFLEProfile", "CallerReference": "cli-example", "Comment": "FLE profile for AWS CLI example", "EncryptionEntities": { "Quantity": 1, "Items": [ { "PublicKeyId": "K2K8NC4HVFE3M0", "ProviderId": "ExampleFLEProvider", "FieldPatterns": { "Quantity": 1, "Items": [ "ExampleSensitiveField" ] } } ] } }

출력:

{ "Location": "https://cloudfront.amazonaws.com/2019-03-26/field-level-encryption-profile/PPK0UOSIF5WSV", "ETag": "E2QWRUHEXAMPLE", "FieldLevelEncryptionProfile": { "Id": "PPK0UOSIF5WSV", "LastModifiedTime": "2019-12-10T01:03:16.537Z", "FieldLevelEncryptionProfileConfig": { "Name": "ExampleFLEProfile", "CallerReference": "cli-example", "Comment": "FLE profile for AWS CLI example", "EncryptionEntities": { "Quantity": 1, "Items": [ { "PublicKeyId": "K2K8NC4HVFE3M0", "ProviderId": "ExampleFLEProvider", "FieldPatterns": { "Quantity": 1, "Items": [ "ExampleSensitiveField" ] } } ] } } } }

다음 코드 예시에서는 create-invalidation 코드를 사용하는 방법을 보여줍니다.

AWS CLI

CloudFront 배포에 대한 무효화를 생성하려면

다음 create-invalidation 예제는 지정된 CloudFront 배포의 지정된 파일에 대한 무효화를 생성합니다.

aws cloudfront create-invalidation \ --distribution-id EDFDVBD6EXAMPLE \ --paths "/example-path/example-file.jpg" "/example-path/example-file2.png"

출력:

{ "Location": "https://cloudfront.amazonaws.com/2019-03-26/distribution/EDFDVBD6EXAMPLE/invalidation/I1JLWSDAP8FU89", "Invalidation": { "Id": "I1JLWSDAP8FU89", "Status": "InProgress", "CreateTime": "2019-12-05T18:24:51.407Z", "InvalidationBatch": { "Paths": { "Quantity": 2, "Items": [ "/example-path/example-file2.png", "/example-path/example-file.jpg" ] }, "CallerReference": "cli-1575570291-670203" } } }

이전 예제에서는 AWS CLI가 자동으로 랜덤 CallerReference를 생성했습니다. 직접 CallerReference를 지정하거나 무효화 매개변수를 명령줄 인수로 전달하지 않으려면 JSON 파일을 사용할 수 있습니다. 다음 예제에서는 inv-batch.json라는 JSON 파일에 무효화 매개 변수를 제공하여 두 파일에 대한 무효화를 생성합니다

aws cloudfront create-invalidation \ --distribution-id EDFDVBD6EXAMPLE \ --invalidation-batch file://inv-batch.json

inv-batch.json의 콘텐츠:

{ "Paths": { "Quantity": 2, "Items": [ "/example-path/example-file.jpg", "/example-path/example-file2.png" ] }, "CallerReference": "cli-example" }

출력:

{ "Location": "https://cloudfront.amazonaws.com/2019-03-26/distribution/EDFDVBD6EXAMPLE/invalidation/I2J0I21PCUYOIK", "Invalidation": { "Id": "I2J0I21PCUYOIK", "Status": "InProgress", "CreateTime": "2019-12-05T18:40:49.413Z", "InvalidationBatch": { "Paths": { "Quantity": 2, "Items": [ "/example-path/example-file.jpg", "/example-path/example-file2.png" ] }, "CallerReference": "cli-example" } } }
  • API 세부 정보는 AWS CLI 명령 참조CreateInvalidation 섹션을 참조하세요.

다음 코드 예시에서는 create-invalidation 코드를 사용하는 방법을 보여줍니다.

AWS CLI

CloudFront 배포에 대한 무효화를 생성하려면

다음 create-invalidation 예제는 지정된 CloudFront 배포의 지정된 파일에 대한 무효화를 생성합니다.

aws cloudfront create-invalidation \ --distribution-id EDFDVBD6EXAMPLE \ --paths "/example-path/example-file.jpg" "/example-path/example-file2.png"

출력:

{ "Location": "https://cloudfront.amazonaws.com/2019-03-26/distribution/EDFDVBD6EXAMPLE/invalidation/I1JLWSDAP8FU89", "Invalidation": { "Id": "I1JLWSDAP8FU89", "Status": "InProgress", "CreateTime": "2019-12-05T18:24:51.407Z", "InvalidationBatch": { "Paths": { "Quantity": 2, "Items": [ "/example-path/example-file2.png", "/example-path/example-file.jpg" ] }, "CallerReference": "cli-1575570291-670203" } } }

이전 예제에서는 AWS CLI가 자동으로 랜덤 CallerReference를 생성했습니다. 직접 CallerReference를 지정하거나 무효화 매개변수를 명령줄 인수로 전달하지 않으려면 JSON 파일을 사용할 수 있습니다. 다음 예제에서는 inv-batch.json라는 JSON 파일에 무효화 매개 변수를 제공하여 두 파일에 대한 무효화를 생성합니다

aws cloudfront create-invalidation \ --distribution-id EDFDVBD6EXAMPLE \ --invalidation-batch file://inv-batch.json

inv-batch.json의 콘텐츠:

{ "Paths": { "Quantity": 2, "Items": [ "/example-path/example-file.jpg", "/example-path/example-file2.png" ] }, "CallerReference": "cli-example" }

출력:

{ "Location": "https://cloudfront.amazonaws.com/2019-03-26/distribution/EDFDVBD6EXAMPLE/invalidation/I2J0I21PCUYOIK", "Invalidation": { "Id": "I2J0I21PCUYOIK", "Status": "InProgress", "CreateTime": "2019-12-05T18:40:49.413Z", "InvalidationBatch": { "Paths": { "Quantity": 2, "Items": [ "/example-path/example-file.jpg", "/example-path/example-file2.png" ] }, "CallerReference": "cli-example" } } }
  • API 세부 정보는 AWS CLI 명령 참조CreateInvalidation 섹션을 참조하세요.

다음 코드 예시에서는 create-public-key 코드를 사용하는 방법을 보여줍니다.

AWS CLI

CloudFront 퍼블릭 키를 생성하려면

다음 예제에서는 pub-key-config.json이라는 JSON 파일로 파라미터를 제공하여 CloudFront 퍼블릭 키를 생성합니다. 이 명령을 사용하려면 먼저 PEM으로 인코딩된 퍼블릭 키가 있어야 합니다. 자세한 내용은 Amazon CloudFront 개발자 안내서RSA 키 페어 생성을 참조하세요.

aws cloudfront create-public-key \ --public-key-config file://pub-key-config.json

pub-key-config.json 파일은 다음을 포함한 현재 문서의 JSON 문서입니다. 참고로 퍼블릭 키는 PEM 형식으로 인코딩됩니다.

{ "CallerReference": "cli-example", "Name": "ExampleKey", "EncodedKey": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxPMbCA2Ks0lnd7IR+3pw\nwd3H/7jPGwj8bLUmore7bX+oeGpZ6QmLAe/1UOWcmZX2u70dYcSIzB1ofZtcn4cJ\nenHBAzO3ohBY/L1tQGJfS2A+omnN6H16VZE1JCK8XSJyfze7MDLcUyHZETdxuvRb\nA9X343/vMAuQPnhinFJ8Wdy8YBXSPpy7r95ylUQd9LfYTBzVZYG2tSesplcOkjM3\n2Uu+oMWxQAw1NINnSLPinMVsutJy6ZqlV3McWNWe4T+STGtWhrPNqJEn45sIcCx4\nq+kGZ2NQ0FyIyT2eiLKOX5Rgb/a36E/aMk4VoDsaenBQgG7WLTnstb9sr7MIhS6A\nrwIDAQAB\n-----END PUBLIC KEY-----\n", "Comment": "example public key" }

출력:

{ "Location": "https://cloudfront.amazonaws.com/2019-03-26/public-key/KDFB19YGCR002", "ETag": "E2QWRUHEXAMPLE", "PublicKey": { "Id": "KDFB19YGCR002", "CreatedTime": "2019-12-05T18:51:43.781Z", "PublicKeyConfig": { "CallerReference": "cli-example", "Name": "ExampleKey", "EncodedKey": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxPMbCA2Ks0lnd7IR+3pw\nwd3H/7jPGwj8bLUmore7bX+oeGpZ6QmLAe/1UOWcmZX2u70dYcSIzB1ofZtcn4cJ\nenHBAzO3ohBY/L1tQGJfS2A+omnN6H16VZE1JCK8XSJyfze7MDLcUyHZETdxuvRb\nA9X343/vMAuQPnhinFJ8Wdy8YBXSPpy7r95ylUQd9LfYTBzVZYG2tSesplcOkjM3\n2Uu+oMWxQAw1NINnSLPinMVsutJy6ZqlV3McWNWe4T+STGtWhrPNqJEn45sIcCx4\nq+kGZ2NQ0FyIyT2eiLKOX5Rgb/a36E/aMk4VoDsaenBQgG7WLTnstb9sr7MIhS6A\nrwIDAQAB\n-----END PUBLIC KEY-----\n", "Comment": "example public key" } } }
  • API 세부 정보는 AWS CLI 명령 참조CreatePublicKey를 참조하세요.

다음 코드 예시에서는 create-public-key 코드를 사용하는 방법을 보여줍니다.

AWS CLI

CloudFront 퍼블릭 키를 생성하려면

다음 예제에서는 pub-key-config.json이라는 JSON 파일로 파라미터를 제공하여 CloudFront 퍼블릭 키를 생성합니다. 이 명령을 사용하려면 먼저 PEM으로 인코딩된 퍼블릭 키가 있어야 합니다. 자세한 내용은 Amazon CloudFront 개발자 안내서RSA 키 페어 생성을 참조하세요.

aws cloudfront create-public-key \ --public-key-config file://pub-key-config.json

pub-key-config.json 파일은 다음을 포함한 현재 문서의 JSON 문서입니다. 참고로 퍼블릭 키는 PEM 형식으로 인코딩됩니다.

{ "CallerReference": "cli-example", "Name": "ExampleKey", "EncodedKey": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxPMbCA2Ks0lnd7IR+3pw\nwd3H/7jPGwj8bLUmore7bX+oeGpZ6QmLAe/1UOWcmZX2u70dYcSIzB1ofZtcn4cJ\nenHBAzO3ohBY/L1tQGJfS2A+omnN6H16VZE1JCK8XSJyfze7MDLcUyHZETdxuvRb\nA9X343/vMAuQPnhinFJ8Wdy8YBXSPpy7r95ylUQd9LfYTBzVZYG2tSesplcOkjM3\n2Uu+oMWxQAw1NINnSLPinMVsutJy6ZqlV3McWNWe4T+STGtWhrPNqJEn45sIcCx4\nq+kGZ2NQ0FyIyT2eiLKOX5Rgb/a36E/aMk4VoDsaenBQgG7WLTnstb9sr7MIhS6A\nrwIDAQAB\n-----END PUBLIC KEY-----\n", "Comment": "example public key" }

출력:

{ "Location": "https://cloudfront.amazonaws.com/2019-03-26/public-key/KDFB19YGCR002", "ETag": "E2QWRUHEXAMPLE", "PublicKey": { "Id": "KDFB19YGCR002", "CreatedTime": "2019-12-05T18:51:43.781Z", "PublicKeyConfig": { "CallerReference": "cli-example", "Name": "ExampleKey", "EncodedKey": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxPMbCA2Ks0lnd7IR+3pw\nwd3H/7jPGwj8bLUmore7bX+oeGpZ6QmLAe/1UOWcmZX2u70dYcSIzB1ofZtcn4cJ\nenHBAzO3ohBY/L1tQGJfS2A+omnN6H16VZE1JCK8XSJyfze7MDLcUyHZETdxuvRb\nA9X343/vMAuQPnhinFJ8Wdy8YBXSPpy7r95ylUQd9LfYTBzVZYG2tSesplcOkjM3\n2Uu+oMWxQAw1NINnSLPinMVsutJy6ZqlV3McWNWe4T+STGtWhrPNqJEn45sIcCx4\nq+kGZ2NQ0FyIyT2eiLKOX5Rgb/a36E/aMk4VoDsaenBQgG7WLTnstb9sr7MIhS6A\nrwIDAQAB\n-----END PUBLIC KEY-----\n", "Comment": "example public key" } } }
  • API 세부 정보는 AWS CLI 명령 참조CreatePublicKey를 참조하세요.

다음 코드 예시에서는 delete-cloud-front-origin-access-identity 코드를 사용하는 방법을 보여줍니다.

AWS CLI

CloudFront 원본 액세스 ID 삭제

다음 예시에서는 ID가 E74FTE3AEXAMPLE인 오리진 액세스 ID(OAI)를 삭제하기 위한 요청입니다. OAI를 삭제하는 방법 OAI의 ID와 ETag가 있어야 합니다. OAI ID는 create-cloud-front-origin-access-identity 및 list-cloud-front-origin-access-identities 명령의 출력에 반환됩니다. ETag를 가져오려면 get-cloud-front-origin-access-identity 또는 get-cloud-front-origin-access-identity-config 명령을 사용합니다. --if-match 옵션을 사용하여 OAI의 ETag를 제공합니다.

aws cloudfront delete-cloud-front-origin-access-identity \ --id E74FTE3AEXAMPLE \ --if-match E2QWRUHEXAMPLE

이 명령이 제대로 실행되면 출력이 표시되지 않습니다.

다음 코드 예시에서는 delete-cloud-front-origin-access-identity 코드를 사용하는 방법을 보여줍니다.

AWS CLI

CloudFront 원본 액세스 ID 삭제

다음 예시에서는 ID가 E74FTE3AEXAMPLE인 오리진 액세스 ID(OAI)를 삭제하기 위한 요청입니다. OAI를 삭제하는 방법 OAI의 ID와 ETag가 있어야 합니다. OAI ID는 create-cloud-front-origin-access-identity 및 list-cloud-front-origin-access-identities 명령의 출력에 반환됩니다. ETag를 가져오려면 get-cloud-front-origin-access-identity 또는 get-cloud-front-origin-access-identity-config 명령을 사용합니다. --if-match 옵션을 사용하여 OAI의 ETag를 제공합니다.

aws cloudfront delete-cloud-front-origin-access-identity \ --id E74FTE3AEXAMPLE \ --if-match E2QWRUHEXAMPLE

이 명령이 제대로 실행되면 출력이 표시되지 않습니다.

다음 코드 예시에서는 delete-distribution 코드를 사용하는 방법을 보여줍니다.

AWS CLI

CloudFront 배포를 삭제하려면

다음 예제에서는 ID EDFDVBD6EXAMPLE을 사용하여 CloudFront 배포를 삭제합니다. 배포를 삭제하려면 먼저 배포를 비활성화해야 합니다. 배포를 비활성화하려면 update-distribution 명령을 사용하세요. 자세한 정보는 update-distribution 예시를 참조하세요.

배포가 비활성화된 경우 이를 삭제할 수 있습니다. 배포를 삭제하려면 배포의 ETag를 제공하는 --if-match 옵션을 사용해야 합니다. ETag를 가져오려면 get-distribution 또는 get-distribution-config 명령을 사용하세요.

aws cloudfront delete-distribution \ --id EDFDVBD6EXAMPLE \ --if-match E2QWRUHEXAMPLE

이 명령이 제대로 실행되면 출력이 표시되지 않습니다.

  • API 세부 정보는 AWS CLI 명령 참조DeleteDistribution 섹션을 참조하세요.

다음 코드 예시에서는 delete-distribution 코드를 사용하는 방법을 보여줍니다.

AWS CLI

CloudFront 배포를 삭제하려면

다음 예제에서는 ID EDFDVBD6EXAMPLE을 사용하여 CloudFront 배포를 삭제합니다. 배포를 삭제하려면 먼저 배포를 비활성화해야 합니다. 배포를 비활성화하려면 update-distribution 명령을 사용하세요. 자세한 정보는 update-distribution 예시를 참조하세요.

배포가 비활성화된 경우 이를 삭제할 수 있습니다. 배포를 삭제하려면 배포의 ETag를 제공하는 --if-match 옵션을 사용해야 합니다. ETag를 가져오려면 get-distribution 또는 get-distribution-config 명령을 사용하세요.

aws cloudfront delete-distribution \ --id EDFDVBD6EXAMPLE \ --if-match E2QWRUHEXAMPLE

이 명령이 제대로 실행되면 출력이 표시되지 않습니다.

  • API 세부 정보는 AWS CLI 명령 참조DeleteDistribution 섹션을 참조하세요.

다음 코드 예시에서는 delete-field-level-encryption-config 코드를 사용하는 방법을 보여줍니다.

AWS CLI

CloudFront 필드 수준 암호화 구성을 삭제하는 방법

다음 예시에서는 ID가 C3KM2WVD605UAY인 CloudFront 필드 수준 암호화 구성을 삭제합니다. 필드 수준 암호화 구성을 삭제하려면 ID와 ETag가 있어야 합니다. ID는 create-field-level-encryption-config 및 list-field-level-encryption-configs 명령의 출력으로 반환됩니다. ETag를 가져오려면 get-field-level-encryption 또는 get-field-level-encryption-config 명령을 사용합니다. --if-match 옵션을 사용하여 구성의 ETag를 제공합니다.

aws cloudfront delete-field-level-encryption-config \ --id C3KM2WVD605UAY \ --if-match E26M4BIAV81ZF6

이 명령이 제대로 실행되면 출력이 표시되지 않습니다.

다음 코드 예시에서는 delete-field-level-encryption-config 코드를 사용하는 방법을 보여줍니다.

AWS CLI

CloudFront 필드 수준 암호화 구성을 삭제하는 방법

다음 예시에서는 ID가 C3KM2WVD605UAY인 CloudFront 필드 수준 암호화 구성을 삭제합니다. 필드 수준 암호화 구성을 삭제하려면 ID와 ETag가 있어야 합니다. ID는 create-field-level-encryption-config 및 list-field-level-encryption-configs 명령의 출력으로 반환됩니다. ETag를 가져오려면 get-field-level-encryption 또는 get-field-level-encryption-config 명령을 사용합니다. --if-match 옵션을 사용하여 구성의 ETag를 제공합니다.

aws cloudfront delete-field-level-encryption-config \ --id C3KM2WVD605UAY \ --if-match E26M4BIAV81ZF6

이 명령이 제대로 실행되면 출력이 표시되지 않습니다.

다음 코드 예시에서는 delete-field-level-encryption-profile 코드를 사용하는 방법을 보여줍니다.

AWS CLI

CloudFront 필드 수준 암호화 프로파일을 삭제하는 방법

다음 예시에서는 ID가 PPK0UOSIF5WSV인 CloudFront 필드 수준 암호화 프로파일을 삭제합니다. 필드 수준 암호화 프로파일을 삭제하려면 ID와 ETag가 있어야 합니다. ID는 create-field-level-encryption-profile 및 list-field-level-encryption-profiles 명령의 출력으로 반환됩니다. ETag를 가져오려면 get-field-level-encryption-profile 또는 get-field-level-encryption-profile-config 명령을 사용합니다. --if-match 옵션을 사용하여 프로파일의 ETag를 제공합니다.

aws cloudfront delete-field-level-encryption-profile \ --id PPK0UOSIF5WSV \ --if-match EJETYFJ9CL66D

이 명령이 제대로 실행되면 출력이 표시되지 않습니다.

다음 코드 예시에서는 delete-field-level-encryption-profile 코드를 사용하는 방법을 보여줍니다.

AWS CLI

CloudFront 필드 수준 암호화 프로파일을 삭제하는 방법

다음 예시에서는 ID가 PPK0UOSIF5WSV인 CloudFront 필드 수준 암호화 프로파일을 삭제합니다. 필드 수준 암호화 프로파일을 삭제하려면 ID와 ETag가 있어야 합니다. ID는 create-field-level-encryption-profile 및 list-field-level-encryption-profiles 명령의 출력으로 반환됩니다. ETag를 가져오려면 get-field-level-encryption-profile 또는 get-field-level-encryption-profile-config 명령을 사용합니다. --if-match 옵션을 사용하여 프로파일의 ETag를 제공합니다.

aws cloudfront delete-field-level-encryption-profile \ --id PPK0UOSIF5WSV \ --if-match EJETYFJ9CL66D

이 명령이 제대로 실행되면 출력이 표시되지 않습니다.

다음 코드 예시에서는 delete-public-key 코드를 사용하는 방법을 보여줍니다.

AWS CLI

CloudFront 퍼블릭 키 삭제

다음 예시에서는 ID가 KDFB19YGCR002인 CloudFront 퍼블릭 키를 삭제합니다. 퍼블릭 키를 삭제하려면 ID와 ETag가 있어야 합니다. ID는 create-public-key 및 list-public-keys 명령의 출력으로 반환됩니다. ETag를 가져오려면 get-public-key 또는 get-public-key-config 명령을 사용합니다. --if-match 옵션을 사용하여 퍼블릭 키의 ETag를 제공합니다.

aws cloudfront delete-public-key \ --id KDFB19YGCR002 \ --if-match E2QWRUHEXAMPLE

이 명령이 제대로 실행되면 출력이 표시되지 않습니다.

  • API 세부 정보는 AWS CLI 명령 참조DeletePublicKey 섹션을 참조하세요.

다음 코드 예시에서는 delete-public-key 코드를 사용하는 방법을 보여줍니다.

AWS CLI

CloudFront 퍼블릭 키 삭제

다음 예시에서는 ID가 KDFB19YGCR002인 CloudFront 퍼블릭 키를 삭제합니다. 퍼블릭 키를 삭제하려면 ID와 ETag가 있어야 합니다. ID는 create-public-key 및 list-public-keys 명령의 출력으로 반환됩니다. ETag를 가져오려면 get-public-key 또는 get-public-key-config 명령을 사용합니다. --if-match 옵션을 사용하여 퍼블릭 키의 ETag를 제공합니다.

aws cloudfront delete-public-key \ --id KDFB19YGCR002 \ --if-match E2QWRUHEXAMPLE

이 명령이 제대로 실행되면 출력이 표시되지 않습니다.

  • API 세부 정보는 AWS CLI 명령 참조DeletePublicKey 섹션을 참조하세요.

다음 코드 예시에서는 get-cloud-front-origin-access-identity-config 코드를 사용하는 방법을 보여줍니다.

AWS CLI

CloudFront 원본 액세스 ID 구성을 가져오려면

다음 예제에서는 ID E74FTE3AEXAMPLE을 사용하여 ETag를 포함한 CloudFront 오리진 액세스 ID(OAI)에 대한 메타데이터를 가져옵니다. OAI ID는 create-cloud-front-origin-access-identity 및 list-cloud-front-origin-access-identities 명령의 출력에 반환됩니다.

aws cloudfront get-cloud-front-origin-access-identity-config --id E74FTE3AEXAMPLE

출력:

{ "ETag": "E2QWRUHEXAMPLE", "CloudFrontOriginAccessIdentityConfig": { "CallerReference": "cli-example", "Comment": "Example OAI" } }

다음 코드 예시에서는 get-cloud-front-origin-access-identity-config 코드를 사용하는 방법을 보여줍니다.

AWS CLI

CloudFront 원본 액세스 ID 구성을 가져오려면

다음 예제에서는 ID E74FTE3AEXAMPLE을 사용하여 ETag를 포함한 CloudFront 오리진 액세스 ID(OAI)에 대한 메타데이터를 가져옵니다. OAI ID는 create-cloud-front-origin-access-identity 및 list-cloud-front-origin-access-identities 명령의 출력에 반환됩니다.

aws cloudfront get-cloud-front-origin-access-identity-config --id E74FTE3AEXAMPLE

출력:

{ "ETag": "E2QWRUHEXAMPLE", "CloudFrontOriginAccessIdentityConfig": { "CallerReference": "cli-example", "Comment": "Example OAI" } }

다음 코드 예시에서는 get-cloud-front-origin-access-identity 코드를 사용하는 방법을 보여줍니다.

AWS CLI

CloudFront 원본 액세스 ID를 가져오려면

다음 예제는 ID가 E74FTE3AEXAMPLE인 CloudFront 오리진 액세스 ID(OAI) 및 그에 딸린 ETag와 관련된 S3 카노니컬 ID를 가져옵니다. OAI ID는 create-cloud-front-origin-access-identity 및 list-cloud-front-origin-access-identities 명령의 출력에 반환됩니다.

aws cloudfront get-cloud-front-origin-access-identity --id E74FTE3AEXAMPLE

출력:

{ "ETag": "E2QWRUHEXAMPLE", "CloudFrontOriginAccessIdentity": { "Id": "E74FTE3AEXAMPLE", "S3CanonicalUserId": "cd13868f797c227fbea2830611a26fe0a21ba1b826ab4bed9b7771c9aEXAMPLE", "CloudFrontOriginAccessIdentityConfig": { "CallerReference": "cli-example", "Comment": "Example OAI" } } }

다음 코드 예시에서는 get-cloud-front-origin-access-identity 코드를 사용하는 방법을 보여줍니다.

AWS CLI

CloudFront 원본 액세스 ID를 가져오려면

다음 예제는 ID가 E74FTE3AEXAMPLE인 CloudFront 오리진 액세스 ID(OAI) 및 그에 딸린 ETag와 관련된 S3 카노니컬 ID를 가져옵니다. OAI ID는 create-cloud-front-origin-access-identity 및 list-cloud-front-origin-access-identities 명령의 출력에 반환됩니다.

aws cloudfront get-cloud-front-origin-access-identity --id E74FTE3AEXAMPLE

출력:

{ "ETag": "E2QWRUHEXAMPLE", "CloudFrontOriginAccessIdentity": { "Id": "E74FTE3AEXAMPLE", "S3CanonicalUserId": "cd13868f797c227fbea2830611a26fe0a21ba1b826ab4bed9b7771c9aEXAMPLE", "CloudFrontOriginAccessIdentityConfig": { "CallerReference": "cli-example", "Comment": "Example OAI" } } }

다음 코드 예시에서는 get-distribution-config 코드를 사용하는 방법을 보여줍니다.

AWS CLI

CloudFront 배포 구성을 가져오려면

다음 예제에서는 ID EDFDVBD6EXAMPLE을 사용하여 ETag를 포함한 CloudFront 배포에 대한 메타데이터를 가져옵니다. 배포 ID는 create-distribution 및 list-distributions 명령에서 반환됩니다.

aws cloudfront get-distribution-config \ --id EDFDVBD6EXAMPLE

출력:

{ "ETag": "E2QWRUHEXAMPLE", "DistributionConfig": { "CallerReference": "cli-example", "Aliases": { "Quantity": 0 }, "DefaultRootObject": "index.html", "Origins": { "Quantity": 1, "Items": [ { "Id": "amzn-s3-demo-bucket.s3.amazonaws.com-cli-example", "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-cli-example", "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": true, "ViewerCertificate": { "CloudFrontDefaultCertificate": true, "MinimumProtocolVersion": "TLSv1", "CertificateSource": "cloudfront" }, "Restrictions": { "GeoRestriction": { "RestrictionType": "none", "Quantity": 0 } }, "WebACLId": "", "HttpVersion": "http2", "IsIPV6Enabled": true } }

다음 코드 예시에서는 get-distribution-config 코드를 사용하는 방법을 보여줍니다.

AWS CLI

CloudFront 배포 구성을 가져오려면

다음 예제에서는 ID EDFDVBD6EXAMPLE을 사용하여 ETag를 포함한 CloudFront 배포에 대한 메타데이터를 가져옵니다. 배포 ID는 create-distribution 및 list-distributions 명령에서 반환됩니다.

aws cloudfront get-distribution-config \ --id EDFDVBD6EXAMPLE

출력:

{ "ETag": "E2QWRUHEXAMPLE", "DistributionConfig": { "CallerReference": "cli-example", "Aliases": { "Quantity": 0 }, "DefaultRootObject": "index.html", "Origins": { "Quantity": 1, "Items": [ { "Id": "amzn-s3-demo-bucket.s3.amazonaws.com-cli-example", "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-cli-example", "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": true, "ViewerCertificate": { "CloudFrontDefaultCertificate": true, "MinimumProtocolVersion": "TLSv1", "CertificateSource": "cloudfront" }, "Restrictions": { "GeoRestriction": { "RestrictionType": "none", "Quantity": 0 } }, "WebACLId": "", "HttpVersion": "http2", "IsIPV6Enabled": true } }

다음 코드 예시에서는 get-distribution 코드를 사용하는 방법을 보여줍니다.

AWS CLI

CloudFront 배포를 가져오려면

다음 get-distribution 예제에서는 ETag를 포함하여 EDFDVBD6EXAMPLE ID를 가진 CloudFront 배포를 가져옵니다. 배포 ID는 create-distribution 및 list-distributions 명령에서 반환됩니다.

aws cloudfront get-distribution \ --id EDFDVBD6EXAMPLE

출력:

{ "ETag": "E2QWRUHEXAMPLE", "Distribution": { "Id": "EDFDVBD6EXAMPLE", "ARN": "arn:aws:cloudfront::123456789012:distribution/EDFDVBD6EXAMPLE", "Status": "Deployed", "LastModifiedTime": "2019-12-04T23:35:41.433Z", "InProgressInvalidationBatches": 0, "DomainName": "d111111abcdef8.cloudfront.net", "ActiveTrustedSigners": { "Enabled": false, "Quantity": 0 }, "DistributionConfig": { "CallerReference": "cli-example", "Aliases": { "Quantity": 0 }, "DefaultRootObject": "index.html", "Origins": { "Quantity": 1, "Items": [ { "Id": "amzn-s3-demo-bucket.s3.amazonaws.com-cli-example", "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-cli-example", "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": true, "ViewerCertificate": { "CloudFrontDefaultCertificate": true, "MinimumProtocolVersion": "TLSv1", "CertificateSource": "cloudfront" }, "Restrictions": { "GeoRestriction": { "RestrictionType": "none", "Quantity": 0 } }, "WebACLId": "", "HttpVersion": "http2", "IsIPV6Enabled": true } } }
  • API 세부 정보는 AWS CLI 명령 참조GetDistribution 섹션을 참조하세요.

다음 코드 예시에서는 get-distribution 코드를 사용하는 방법을 보여줍니다.

AWS CLI

CloudFront 배포를 가져오려면

다음 get-distribution 예제에서는 ETag를 포함하여 EDFDVBD6EXAMPLE ID를 가진 CloudFront 배포를 가져옵니다. 배포 ID는 create-distribution 및 list-distributions 명령에서 반환됩니다.

aws cloudfront get-distribution \ --id EDFDVBD6EXAMPLE

출력:

{ "ETag": "E2QWRUHEXAMPLE", "Distribution": { "Id": "EDFDVBD6EXAMPLE", "ARN": "arn:aws:cloudfront::123456789012:distribution/EDFDVBD6EXAMPLE", "Status": "Deployed", "LastModifiedTime": "2019-12-04T23:35:41.433Z", "InProgressInvalidationBatches": 0, "DomainName": "d111111abcdef8.cloudfront.net", "ActiveTrustedSigners": { "Enabled": false, "Quantity": 0 }, "DistributionConfig": { "CallerReference": "cli-example", "Aliases": { "Quantity": 0 }, "DefaultRootObject": "index.html", "Origins": { "Quantity": 1, "Items": [ { "Id": "amzn-s3-demo-bucket.s3.amazonaws.com-cli-example", "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-cli-example", "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": true, "ViewerCertificate": { "CloudFrontDefaultCertificate": true, "MinimumProtocolVersion": "TLSv1", "CertificateSource": "cloudfront" }, "Restrictions": { "GeoRestriction": { "RestrictionType": "none", "Quantity": 0 } }, "WebACLId": "", "HttpVersion": "http2", "IsIPV6Enabled": true } } }
  • API 세부 정보는 AWS CLI 명령 참조GetDistribution 섹션을 참조하세요.

다음 코드 예시에서는 get-field-level-encryption-config 코드를 사용하는 방법을 보여줍니다.

AWS CLI

CloudFront 필드 수준 암호화 구성에 대한 메타데이터를 가져오는 방법

다음 예시에서는 ID가 C3KM2WVD605UAY인 CloudFront 필드 수준 암호화 구성에 대한 메타데이터(ETag 포함)를 가져옵니다.

aws cloudfront get-field-level-encryption-config --id C3KM2WVD605UAY

출력:

{ "ETag": "E2P4Z4VU7TY5SG", "FieldLevelEncryptionConfig": { "CallerReference": "cli-example", "Comment": "Example FLE configuration", "QueryArgProfileConfig": { "ForwardWhenQueryArgProfileIsUnknown": true, "QueryArgProfiles": { "Quantity": 0, "Items": [] } }, "ContentTypeProfileConfig": { "ForwardWhenContentTypeIsUnknown": true, "ContentTypeProfiles": { "Quantity": 1, "Items": [ { "Format": "URLEncoded", "ProfileId": "P280MFCLSYOCVU", "ContentType": "application/x-www-form-urlencoded" } ] } } } }

다음 코드 예시에서는 get-field-level-encryption-config 코드를 사용하는 방법을 보여줍니다.

AWS CLI

CloudFront 필드 수준 암호화 구성에 대한 메타데이터를 가져오는 방법

다음 예시에서는 ID가 C3KM2WVD605UAY인 CloudFront 필드 수준 암호화 구성에 대한 메타데이터(ETag 포함)를 가져옵니다.

aws cloudfront get-field-level-encryption-config --id C3KM2WVD605UAY

출력:

{ "ETag": "E2P4Z4VU7TY5SG", "FieldLevelEncryptionConfig": { "CallerReference": "cli-example", "Comment": "Example FLE configuration", "QueryArgProfileConfig": { "ForwardWhenQueryArgProfileIsUnknown": true, "QueryArgProfiles": { "Quantity": 0, "Items": [] } }, "ContentTypeProfileConfig": { "ForwardWhenContentTypeIsUnknown": true, "ContentTypeProfiles": { "Quantity": 1, "Items": [ { "Format": "URLEncoded", "ProfileId": "P280MFCLSYOCVU", "ContentType": "application/x-www-form-urlencoded" } ] } } } }

다음 코드 예시에서는 get-field-level-encryption-profile-config 코드를 사용하는 방법을 보여줍니다.

AWS CLI

CloudFront 필드 수준 암호화 프로파일 구성을 가져오는 방법

다음 예시에서는 ID가 PPK0UOSIF5WSV인 CloudFront 필드 수준 암호화 프로파일에 대한 메타데이터(ETag 포함)를 가져옵니다.

aws cloudfront get-field-level-encryption-profile-config --id PPK0UOSIF5WSV

출력:

{ "ETag": "E1QQG65FS2L2GC", "FieldLevelEncryptionProfileConfig": { "Name": "ExampleFLEProfile", "CallerReference": "cli-example", "Comment": "FLE profile for AWS CLI example", "EncryptionEntities": { "Quantity": 1, "Items": [ { "PublicKeyId": "K2K8NC4HVFE3M0", "ProviderId": "ExampleFLEProvider", "FieldPatterns": { "Quantity": 1, "Items": [ "ExampleSensitiveField" ] } } ] } } }

다음 코드 예시에서는 get-field-level-encryption-profile-config 코드를 사용하는 방법을 보여줍니다.

AWS CLI

CloudFront 필드 수준 암호화 프로파일 구성을 가져오는 방법

다음 예시에서는 ID가 PPK0UOSIF5WSV인 CloudFront 필드 수준 암호화 프로파일에 대한 메타데이터(ETag 포함)를 가져옵니다.

aws cloudfront get-field-level-encryption-profile-config --id PPK0UOSIF5WSV

출력:

{ "ETag": "E1QQG65FS2L2GC", "FieldLevelEncryptionProfileConfig": { "Name": "ExampleFLEProfile", "CallerReference": "cli-example", "Comment": "FLE profile for AWS CLI example", "EncryptionEntities": { "Quantity": 1, "Items": [ { "PublicKeyId": "K2K8NC4HVFE3M0", "ProviderId": "ExampleFLEProvider", "FieldPatterns": { "Quantity": 1, "Items": [ "ExampleSensitiveField" ] } } ] } } }

다음 코드 예시에서는 get-field-level-encryption-profile 코드를 사용하는 방법을 보여줍니다.

AWS CLI

CloudFront 필드 수준 암호화 프로파일을 가져오는 방법

다음 예시에서는 ID가 PPK0UOSIF5WSV인 CloudFront 필드 수준 암호화 프로파일(ETag 포함)을 가져옵니다.

aws cloudfront get-field-level-encryption-profile --id PPK0UOSIF5WSV

출력:

{ "ETag": "E1QQG65FS2L2GC", "FieldLevelEncryptionProfile": { "Id": "PPK0UOSIF5WSV", "LastModifiedTime": "2019-12-10T01:03:16.537Z", "FieldLevelEncryptionProfileConfig": { "Name": "ExampleFLEProfile", "CallerReference": "cli-example", "Comment": "FLE profile for AWS CLI example", "EncryptionEntities": { "Quantity": 1, "Items": [ { "PublicKeyId": "K2K8NC4HVFE3M0", "ProviderId": "ExampleFLEProvider", "FieldPatterns": { "Quantity": 1, "Items": [ "ExampleSensitiveField" ] } } ] } } } }

다음 코드 예시에서는 get-field-level-encryption-profile 코드를 사용하는 방법을 보여줍니다.

AWS CLI

CloudFront 필드 수준 암호화 프로파일을 가져오는 방법

다음 예시에서는 ID가 PPK0UOSIF5WSV인 CloudFront 필드 수준 암호화 프로파일(ETag 포함)을 가져옵니다.

aws cloudfront get-field-level-encryption-profile --id PPK0UOSIF5WSV

출력:

{ "ETag": "E1QQG65FS2L2GC", "FieldLevelEncryptionProfile": { "Id": "PPK0UOSIF5WSV", "LastModifiedTime": "2019-12-10T01:03:16.537Z", "FieldLevelEncryptionProfileConfig": { "Name": "ExampleFLEProfile", "CallerReference": "cli-example", "Comment": "FLE profile for AWS CLI example", "EncryptionEntities": { "Quantity": 1, "Items": [ { "PublicKeyId": "K2K8NC4HVFE3M0", "ProviderId": "ExampleFLEProvider", "FieldPatterns": { "Quantity": 1, "Items": [ "ExampleSensitiveField" ] } } ] } } } }

다음 코드 예시에서는 get-field-level-encryption 코드를 사용하는 방법을 보여줍니다.

AWS CLI

CloudFront 필드 수준 암호화 구성을 가져오는 방법

다음 예시에서는 ID가 C3KM2WVD605UAY인 CloudFront 필드 수준 암호화 구성(ETag 포함)을 가져옵니다.

aws cloudfront get-field-level-encryption --id C3KM2WVD605UAY

출력:

{ "ETag": "E2P4Z4VU7TY5SG", "FieldLevelEncryption": { "Id": "C3KM2WVD605UAY", "LastModifiedTime": "2019-12-10T21:30:18.974Z", "FieldLevelEncryptionConfig": { "CallerReference": "cli-example", "Comment": "Example FLE configuration", "QueryArgProfileConfig": { "ForwardWhenQueryArgProfileIsUnknown": true, "QueryArgProfiles": { "Quantity": 0, "Items": [] } }, "ContentTypeProfileConfig": { "ForwardWhenContentTypeIsUnknown": true, "ContentTypeProfiles": { "Quantity": 1, "Items": [ { "Format": "URLEncoded", "ProfileId": "P280MFCLSYOCVU", "ContentType": "application/x-www-form-urlencoded" } ] } } } } }

다음 코드 예시에서는 get-field-level-encryption 코드를 사용하는 방법을 보여줍니다.

AWS CLI

CloudFront 필드 수준 암호화 구성을 가져오는 방법

다음 예시에서는 ID가 C3KM2WVD605UAY인 CloudFront 필드 수준 암호화 구성(ETag 포함)을 가져옵니다.

aws cloudfront get-field-level-encryption --id C3KM2WVD605UAY

출력:

{ "ETag": "E2P4Z4VU7TY5SG", "FieldLevelEncryption": { "Id": "C3KM2WVD605UAY", "LastModifiedTime": "2019-12-10T21:30:18.974Z", "FieldLevelEncryptionConfig": { "CallerReference": "cli-example", "Comment": "Example FLE configuration", "QueryArgProfileConfig": { "ForwardWhenQueryArgProfileIsUnknown": true, "QueryArgProfiles": { "Quantity": 0, "Items": [] } }, "ContentTypeProfileConfig": { "ForwardWhenContentTypeIsUnknown": true, "ContentTypeProfiles": { "Quantity": 1, "Items": [ { "Format": "URLEncoded", "ProfileId": "P280MFCLSYOCVU", "ContentType": "application/x-www-form-urlencoded" } ] } } } } }

다음 코드 예시에서는 get-invalidation 코드를 사용하는 방법을 보여줍니다.

AWS CLI

CloudFront 무효화를 가져오는 방법

다음 예시에서는 ID가 EDFDVBD6EXAMPLE인 CloudFront 배포의 ID I2J0I21PCUYOIK를 통해 무효화를 가져옵니다.

aws cloudfront get-invalidation --id I2J0I21PCUYOIK --distribution-id EDFDVBD6EXAMPLE

출력:

{ "Invalidation": { "Status": "Completed", "InvalidationBatch": { "Paths": { "Items": [ "/example-path/example-file.jpg", "/example-path/example-file-2.jpg" ], "Quantity": 2 }, "CallerReference": "cli-example" }, "Id": "I2J0I21PCUYOIK", "CreateTime": "2019-12-05T18:40:49.413Z" } }
  • API 세부 정보는 AWS CLI 명령 참조GetInvalidation 섹션을 참조하세요.

다음 코드 예시에서는 get-invalidation 코드를 사용하는 방법을 보여줍니다.

AWS CLI

CloudFront 무효화를 가져오는 방법

다음 예시에서는 ID가 EDFDVBD6EXAMPLE인 CloudFront 배포의 ID I2J0I21PCUYOIK를 통해 무효화를 가져옵니다.

aws cloudfront get-invalidation --id I2J0I21PCUYOIK --distribution-id EDFDVBD6EXAMPLE

출력:

{ "Invalidation": { "Status": "Completed", "InvalidationBatch": { "Paths": { "Items": [ "/example-path/example-file.jpg", "/example-path/example-file-2.jpg" ], "Quantity": 2 }, "CallerReference": "cli-example" }, "Id": "I2J0I21PCUYOIK", "CreateTime": "2019-12-05T18:40:49.413Z" } }
  • API 세부 정보는 AWS CLI 명령 참조GetInvalidation 섹션을 참조하세요.

다음 코드 예시에서는 get-public-key-config 코드를 사용하는 방법을 보여줍니다.

AWS CLI

CloudFront 퍼블릭 키 구성을 가져오는 방법

다음 예시에서는 ID가 KDFB19YGCR002인 CloudFront 퍼블릭 키에 대한 메타데이터(ETag 포함)를 가져옵니다. 퍼블릭 키 ID는 create-public-key 및 list-public-keys 명령에 반환됩니다.

aws cloudfront get-public-key-config --id KDFB19YGCR002

출력:

{ "ETag": "E2QWRUHEXAMPLE", "PublicKeyConfig": { "CallerReference": "cli-example", "Name": "ExampleKey", "EncodedKey": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxPMbCA2Ks0lnd7IR+3pw\nwd3H/7jPGwj8bLUmore7bX+oeGpZ6QmLAe/1UOWcmZX2u70dYcSIzB1ofZtcn4cJ\nenHBAzO3ohBY/L1tQGJfS2A+omnN6H16VZE1JCK8XSJyfze7MDLcUyHZETdxuvRb\nA9X343/vMAuQPnhinFJ8Wdy8YBXSPpy7r95ylUQd9LfYTBzVZYG2tSesplcOkjM3\n2Uu+oMWxQAw1NINnSLPinMVsutJy6ZqlV3McWNWe4T+STGtWhrPNqJEn45sIcCx4\nq+kGZ2NQ0FyIyT2eiLKOX5Rgb/a36E/aMk4VoDsaenBQgG7WLTnstb9sr7MIhS6A\nrwIDAQAB\n-----END PUBLIC KEY-----\n", "Comment": "example public key" } }
  • API 세부 정보는 AWS CLI 명령 참조GetPublicKeyConfig 섹션을 참조하세요.

다음 코드 예시에서는 get-public-key-config 코드를 사용하는 방법을 보여줍니다.

AWS CLI

CloudFront 퍼블릭 키 구성을 가져오는 방법

다음 예시에서는 ID가 KDFB19YGCR002인 CloudFront 퍼블릭 키에 대한 메타데이터(ETag 포함)를 가져옵니다. 퍼블릭 키 ID는 create-public-key 및 list-public-keys 명령에 반환됩니다.

aws cloudfront get-public-key-config --id KDFB19YGCR002

출력:

{ "ETag": "E2QWRUHEXAMPLE", "PublicKeyConfig": { "CallerReference": "cli-example", "Name": "ExampleKey", "EncodedKey": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxPMbCA2Ks0lnd7IR+3pw\nwd3H/7jPGwj8bLUmore7bX+oeGpZ6QmLAe/1UOWcmZX2u70dYcSIzB1ofZtcn4cJ\nenHBAzO3ohBY/L1tQGJfS2A+omnN6H16VZE1JCK8XSJyfze7MDLcUyHZETdxuvRb\nA9X343/vMAuQPnhinFJ8Wdy8YBXSPpy7r95ylUQd9LfYTBzVZYG2tSesplcOkjM3\n2Uu+oMWxQAw1NINnSLPinMVsutJy6ZqlV3McWNWe4T+STGtWhrPNqJEn45sIcCx4\nq+kGZ2NQ0FyIyT2eiLKOX5Rgb/a36E/aMk4VoDsaenBQgG7WLTnstb9sr7MIhS6A\nrwIDAQAB\n-----END PUBLIC KEY-----\n", "Comment": "example public key" } }
  • API 세부 정보는 AWS CLI 명령 참조GetPublicKeyConfig 섹션을 참조하세요.

다음 코드 예시에서는 get-public-key 코드를 사용하는 방법을 보여줍니다.

AWS CLI

CloudFront 퍼블릭 키 가져오기

다음 예시에서는 ID가 KDFB19YGCR002인 CloudFront 퍼블릭 키(ETag 포함)를 가져옵니다. 퍼블릭 키 ID는 create-public-key 및 list-public-keys 명령에 반환됩니다.

aws cloudfront get-public-key --id KDFB19YGCR002

출력:

{ "ETag": "E2QWRUHEXAMPLE", "PublicKey": { "Id": "KDFB19YGCR002", "CreatedTime": "2019-12-05T18:51:43.781Z", "PublicKeyConfig": { "CallerReference": "cli-example", "Name": "ExampleKey", "EncodedKey": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxPMbCA2Ks0lnd7IR+3pw\nwd3H/7jPGwj8bLUmore7bX+oeGpZ6QmLAe/1UOWcmZX2u70dYcSIzB1ofZtcn4cJ\nenHBAzO3ohBY/L1tQGJfS2A+omnN6H16VZE1JCK8XSJyfze7MDLcUyHZETdxuvRb\nA9X343/vMAuQPnhinFJ8Wdy8YBXSPpy7r95ylUQd9LfYTBzVZYG2tSesplcOkjM3\n2Uu+oMWxQAw1NINnSLPinMVsutJy6ZqlV3McWNWe4T+STGtWhrPNqJEn45sIcCx4\nq+kGZ2NQ0FyIyT2eiLKOX5Rgb/a36E/aMk4VoDsaenBQgG7WLTnstb9sr7MIhS6A\nrwIDAQAB\n-----END PUBLIC KEY-----\n", "Comment": "example public key" } } }
  • API 세부 정보는 AWS CLI 명령 참조GetPublicKey 섹션을 참조하세요.

다음 코드 예시에서는 get-public-key 코드를 사용하는 방법을 보여줍니다.

AWS CLI

CloudFront 퍼블릭 키 가져오기

다음 예시에서는 ID가 KDFB19YGCR002인 CloudFront 퍼블릭 키(ETag 포함)를 가져옵니다. 퍼블릭 키 ID는 create-public-key 및 list-public-keys 명령에 반환됩니다.

aws cloudfront get-public-key --id KDFB19YGCR002

출력:

{ "ETag": "E2QWRUHEXAMPLE", "PublicKey": { "Id": "KDFB19YGCR002", "CreatedTime": "2019-12-05T18:51:43.781Z", "PublicKeyConfig": { "CallerReference": "cli-example", "Name": "ExampleKey", "EncodedKey": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxPMbCA2Ks0lnd7IR+3pw\nwd3H/7jPGwj8bLUmore7bX+oeGpZ6QmLAe/1UOWcmZX2u70dYcSIzB1ofZtcn4cJ\nenHBAzO3ohBY/L1tQGJfS2A+omnN6H16VZE1JCK8XSJyfze7MDLcUyHZETdxuvRb\nA9X343/vMAuQPnhinFJ8Wdy8YBXSPpy7r95ylUQd9LfYTBzVZYG2tSesplcOkjM3\n2Uu+oMWxQAw1NINnSLPinMVsutJy6ZqlV3McWNWe4T+STGtWhrPNqJEn45sIcCx4\nq+kGZ2NQ0FyIyT2eiLKOX5Rgb/a36E/aMk4VoDsaenBQgG7WLTnstb9sr7MIhS6A\nrwIDAQAB\n-----END PUBLIC KEY-----\n", "Comment": "example public key" } } }
  • API 세부 정보는 AWS CLI 명령 참조GetPublicKey 섹션을 참조하세요.

다음 코드 예시에서는 list-cloud-front-origin-access-identities 코드를 사용하는 방법을 보여줍니다.

AWS CLI

CloudFront 오리진 액세스 ID를 나열하려면

다음 예제에서는 AWS 계정의 CloudFront 원본 액세스 ID(OAI) 목록을 가져옵니다.

aws cloudfront list-cloud-front-origin-access-identities

출력:

{ "CloudFrontOriginAccessIdentityList": { "Items": [ { "Id": "E74FTE3AEXAMPLE", "S3CanonicalUserId": "cd13868f797c227fbea2830611a26fe0a21ba1b826ab4bed9b7771c9aEXAMPLE", "Comment": "Example OAI" }, { "Id": "EH1HDMBEXAMPLE", "S3CanonicalUserId": "1489f6f2e6faacaae7ff64c4c3e6956c24f78788abfc1718c3527c263bf7a17EXAMPLE", "Comment": "Test OAI" }, { "Id": "E2X2C9TEXAMPLE", "S3CanonicalUserId": "cbfeebb915a64749f9be546a45b3fcfd3a31c779673c13c4dd460911ae402c2EXAMPLE", "Comment": "Example OAI #2" } ] } }

다음 코드 예시에서는 list-cloud-front-origin-access-identities 코드를 사용하는 방법을 보여줍니다.

AWS CLI

CloudFront 오리진 액세스 ID를 나열하려면

다음 예제에서는 AWS 계정의 CloudFront 원본 액세스 ID(OAI) 목록을 가져옵니다.

aws cloudfront list-cloud-front-origin-access-identities

출력:

{ "CloudFrontOriginAccessIdentityList": { "Items": [ { "Id": "E74FTE3AEXAMPLE", "S3CanonicalUserId": "cd13868f797c227fbea2830611a26fe0a21ba1b826ab4bed9b7771c9aEXAMPLE", "Comment": "Example OAI" }, { "Id": "EH1HDMBEXAMPLE", "S3CanonicalUserId": "1489f6f2e6faacaae7ff64c4c3e6956c24f78788abfc1718c3527c263bf7a17EXAMPLE", "Comment": "Test OAI" }, { "Id": "E2X2C9TEXAMPLE", "S3CanonicalUserId": "cbfeebb915a64749f9be546a45b3fcfd3a31c779673c13c4dd460911ae402c2EXAMPLE", "Comment": "Example OAI #2" } ] } }

다음 코드 예시에서는 list-distributions 코드를 사용하는 방법을 보여줍니다.

AWS CLI

CloudFront 배포를 나열하려면

다음 예제에서는 AWS 계정의 CloudFront 배포 목록을 가져옵니다.

aws cloudfront list-distributions

출력:

{ "DistributionList": { "Items": [ { "Id": "E23YS8OEXAMPLE", "ARN": "arn:aws:cloudfront::123456789012:distribution/E23YS8OEXAMPLE", "Status": "Deployed", "LastModifiedTime": "2024-08-05T18:23:40.375000+00:00", "DomainName": "abcdefgh12ijk.cloudfront.net", "Aliases": { "Quantity": 0 }, "Origins": { "Quantity": 1, "Items": [ { "Id": "amzn-s3-demo-bucket.s3.us-east-1.amazonaws.com", "DomainName": "amzn-s3-demo-bucket.s3.us-east-1.amazonaws.com", "OriginPath": "", "CustomHeaders": { "Quantity": 0 }, "S3OriginConfig": { "OriginAccessIdentity": "" }, "ConnectionAttempts": 3, "ConnectionTimeout": 10, "OriginShield": { "Enabled": false }, "OriginAccessControlId": "EIAP8PEXAMPLE" } ] }, "OriginGroups": { "Quantity": 0 }, "DefaultCacheBehavior": { "TargetOriginId": "amzn-s3-demo-bucket.s3.us-east-1.amazonaws.com", "TrustedSigners": { "Enabled": false, "Quantity": 0 }, "TrustedKeyGroups": { "Enabled": false, "Quantity": 0 }, "ViewerProtocolPolicy": "allow-all", "AllowedMethods": { "Quantity": 2, "Items": [ "HEAD", "GET" ], "CachedMethods": { "Quantity": 2, "Items": [ "HEAD", "GET" ] } }, "SmoothStreaming": false, "Compress": true, "LambdaFunctionAssociations": { "Quantity": 0 }, "FunctionAssociations": { "Quantity": 0 }, "FieldLevelEncryptionId": "", "CachePolicyId": "658327ea-f89d-4fab-a63d-7e886EXAMPLE" }, "CacheBehaviors": { "Quantity": 0 }, "CustomErrorResponses": { "Quantity": 0 }, "Comment": "", "PriceClass": "PriceClass_All", "Enabled": true, "ViewerCertificate": { "CloudFrontDefaultCertificate": true, "SSLSupportMethod": "vip", "MinimumProtocolVersion": "TLSv1", "CertificateSource": "cloudfront" }, "Restrictions": { "GeoRestriction": { "RestrictionType": "none", "Quantity": 0 } }, "WebACLId": "", "HttpVersion": "HTTP2", "IsIPV6Enabled": true, "Staging": false } ] } }
  • API 세부 정보는 AWS CLI 명령 참조ListDistributions 섹션을 참조하세요.

다음 코드 예시에서는 list-distributions 코드를 사용하는 방법을 보여줍니다.

AWS CLI

CloudFront 배포를 나열하려면

다음 예제에서는 AWS 계정의 CloudFront 배포 목록을 가져옵니다.

aws cloudfront list-distributions

출력:

{ "DistributionList": { "Items": [ { "Id": "E23YS8OEXAMPLE", "ARN": "arn:aws:cloudfront::123456789012:distribution/E23YS8OEXAMPLE", "Status": "Deployed", "LastModifiedTime": "2024-08-05T18:23:40.375000+00:00", "DomainName": "abcdefgh12ijk.cloudfront.net", "Aliases": { "Quantity": 0 }, "Origins": { "Quantity": 1, "Items": [ { "Id": "amzn-s3-demo-bucket.s3.us-east-1.amazonaws.com", "DomainName": "amzn-s3-demo-bucket.s3.us-east-1.amazonaws.com", "OriginPath": "", "CustomHeaders": { "Quantity": 0 }, "S3OriginConfig": { "OriginAccessIdentity": "" }, "ConnectionAttempts": 3, "ConnectionTimeout": 10, "OriginShield": { "Enabled": false }, "OriginAccessControlId": "EIAP8PEXAMPLE" } ] }, "OriginGroups": { "Quantity": 0 }, "DefaultCacheBehavior": { "TargetOriginId": "amzn-s3-demo-bucket.s3.us-east-1.amazonaws.com", "TrustedSigners": { "Enabled": false, "Quantity": 0 }, "TrustedKeyGroups": { "Enabled": false, "Quantity": 0 }, "ViewerProtocolPolicy": "allow-all", "AllowedMethods": { "Quantity": 2, "Items": [ "HEAD", "GET" ], "CachedMethods": { "Quantity": 2, "Items": [ "HEAD", "GET" ] } }, "SmoothStreaming": false, "Compress": true, "LambdaFunctionAssociations": { "Quantity": 0 }, "FunctionAssociations": { "Quantity": 0 }, "FieldLevelEncryptionId": "", "CachePolicyId": "658327ea-f89d-4fab-a63d-7e886EXAMPLE" }, "CacheBehaviors": { "Quantity": 0 }, "CustomErrorResponses": { "Quantity": 0 }, "Comment": "", "PriceClass": "PriceClass_All", "Enabled": true, "ViewerCertificate": { "CloudFrontDefaultCertificate": true, "SSLSupportMethod": "vip", "MinimumProtocolVersion": "TLSv1", "CertificateSource": "cloudfront" }, "Restrictions": { "GeoRestriction": { "RestrictionType": "none", "Quantity": 0 } }, "WebACLId": "", "HttpVersion": "HTTP2", "IsIPV6Enabled": true, "Staging": false } ] } }
  • API 세부 정보는 AWS CLI 명령 참조ListDistributions 섹션을 참조하세요.

다음 코드 예시에서는 list-field-level-encryption-configs 코드를 사용하는 방법을 보여줍니다.

AWS CLI

CloudFront 필드 수준 암호화 구성을 나열하는 방법

다음 예시에서는 AWS 계정의 CloudFront 필드 수준 암호화 구성 목록을 가져옵니다.

aws cloudfront list-field-level-encryption-configs

출력:

{ "FieldLevelEncryptionList": { "MaxItems": 100, "Quantity": 1, "Items": [ { "Id": "C3KM2WVD605UAY", "LastModifiedTime": "2019-12-10T21:30:18.974Z", "Comment": "Example FLE configuration", "QueryArgProfileConfig": { "ForwardWhenQueryArgProfileIsUnknown": true, "QueryArgProfiles": { "Quantity": 0, "Items": [] } }, "ContentTypeProfileConfig": { "ForwardWhenContentTypeIsUnknown": true, "ContentTypeProfiles": { "Quantity": 1, "Items": [ { "Format": "URLEncoded", "ProfileId": "P280MFCLSYOCVU", "ContentType": "application/x-www-form-urlencoded" } ] } } } ] } }

다음 코드 예시에서는 list-field-level-encryption-configs 코드를 사용하는 방법을 보여줍니다.

AWS CLI

CloudFront 필드 수준 암호화 구성을 나열하는 방법

다음 예시에서는 AWS 계정의 CloudFront 필드 수준 암호화 구성 목록을 가져옵니다.

aws cloudfront list-field-level-encryption-configs

출력:

{ "FieldLevelEncryptionList": { "MaxItems": 100, "Quantity": 1, "Items": [ { "Id": "C3KM2WVD605UAY", "LastModifiedTime": "2019-12-10T21:30:18.974Z", "Comment": "Example FLE configuration", "QueryArgProfileConfig": { "ForwardWhenQueryArgProfileIsUnknown": true, "QueryArgProfiles": { "Quantity": 0, "Items": [] } }, "ContentTypeProfileConfig": { "ForwardWhenContentTypeIsUnknown": true, "ContentTypeProfiles": { "Quantity": 1, "Items": [ { "Format": "URLEncoded", "ProfileId": "P280MFCLSYOCVU", "ContentType": "application/x-www-form-urlencoded" } ] } } } ] } }

다음 코드 예시에서는 list-field-level-encryption-profiles 코드를 사용하는 방법을 보여줍니다.

AWS CLI

CloudFront 필드 수준 암호화 프로파일을 나열하는 방법

다음 예시에서는 AWS 계정의 CloudFront 필드 수준 암호화 구성을 가져옵니다.

aws cloudfront list-field-level-encryption-profiles

출력:

{ "FieldLevelEncryptionProfileList": { "MaxItems": 100, "Quantity": 2, "Items": [ { "Id": "P280MFCLSYOCVU", "LastModifiedTime": "2019-12-05T01:05:39.896Z", "Name": "ExampleFLEProfile", "EncryptionEntities": { "Quantity": 1, "Items": [ { "PublicKeyId": "K2K8NC4HVFE3M0", "ProviderId": "ExampleFLEProvider", "FieldPatterns": { "Quantity": 1, "Items": [ "ExampleSensitiveField" ] } } ] }, "Comment": "FLE profile for AWS CLI example" }, { "Id": "PPK0UOSIF5WSV", "LastModifiedTime": "2019-12-10T01:03:16.537Z", "Name": "ExampleFLEProfile2", "EncryptionEntities": { "Quantity": 1, "Items": [ { "PublicKeyId": "K2ABC10EXAMPLE", "ProviderId": "ExampleFLEProvider2", "FieldPatterns": { "Quantity": 1, "Items": [ "ExampleSensitiveField2" ] } } ] }, "Comment": "FLE profile #2 for AWS CLI example" } ] } }

다음 코드 예시에서는 list-field-level-encryption-profiles 코드를 사용하는 방법을 보여줍니다.

AWS CLI

CloudFront 필드 수준 암호화 프로파일을 나열하는 방법

다음 예시에서는 AWS 계정의 CloudFront 필드 수준 암호화 구성을 가져옵니다.

aws cloudfront list-field-level-encryption-profiles

출력:

{ "FieldLevelEncryptionProfileList": { "MaxItems": 100, "Quantity": 2, "Items": [ { "Id": "P280MFCLSYOCVU", "LastModifiedTime": "2019-12-05T01:05:39.896Z", "Name": "ExampleFLEProfile", "EncryptionEntities": { "Quantity": 1, "Items": [ { "PublicKeyId": "K2K8NC4HVFE3M0", "ProviderId": "ExampleFLEProvider", "FieldPatterns": { "Quantity": 1, "Items": [ "ExampleSensitiveField" ] } } ] }, "Comment": "FLE profile for AWS CLI example" }, { "Id": "PPK0UOSIF5WSV", "LastModifiedTime": "2019-12-10T01:03:16.537Z", "Name": "ExampleFLEProfile2", "EncryptionEntities": { "Quantity": 1, "Items": [ { "PublicKeyId": "K2ABC10EXAMPLE", "ProviderId": "ExampleFLEProvider2", "FieldPatterns": { "Quantity": 1, "Items": [ "ExampleSensitiveField2" ] } } ] }, "Comment": "FLE profile #2 for AWS CLI example" } ] } }

다음 코드 예시에서는 list-invalidations 코드를 사용하는 방법을 보여줍니다.

AWS CLI

CloudFront 무효화를 나열하는 방법

다음 예시에서는 ID가 EDFDVBD6EXAMPLE인 CloudFront 배포에 대한 무효화 목록을 가져옵니다.

aws cloudfront list-invalidations --distribution-id EDFDVBD6EXAMPLE

출력:

{ "InvalidationList": { "Marker": "", "Items": [ { "Status": "Completed", "Id": "YNY2LI2BVJ4NJU", "CreateTime": "2019-08-31T21:15:52.042Z" } ], "IsTruncated": false, "MaxItems": 100, "Quantity": 1 } }
  • API 세부 정보는 AWS CLI 명령 참조ListInvalidations 섹션을 참조하세요.

다음 코드 예시에서는 list-invalidations 코드를 사용하는 방법을 보여줍니다.

AWS CLI

CloudFront 무효화를 나열하는 방법

다음 예시에서는 ID가 EDFDVBD6EXAMPLE인 CloudFront 배포에 대한 무효화 목록을 가져옵니다.

aws cloudfront list-invalidations --distribution-id EDFDVBD6EXAMPLE

출력:

{ "InvalidationList": { "Marker": "", "Items": [ { "Status": "Completed", "Id": "YNY2LI2BVJ4NJU", "CreateTime": "2019-08-31T21:15:52.042Z" } ], "IsTruncated": false, "MaxItems": 100, "Quantity": 1 } }
  • API 세부 정보는 AWS CLI 명령 참조ListInvalidations 섹션을 참조하세요.

다음 코드 예시에서는 list-public-keys 코드를 사용하는 방법을 보여줍니다.

AWS CLI

CloudFront 퍼블릭 키를 나열하는 방법

다음 예시에서는 AWS 계정의 CloudFront 퍼블릭 키 목록을 가져옵니다.

aws cloudfront list-public-keys

출력:

{ "PublicKeyList": { "MaxItems": 100, "Quantity": 2, "Items": [ { "Id": "K2K8NC4HVFE3M0", "Name": "ExampleKey", "CreatedTime": "2019-12-05T01:04:28.818Z", "EncodedKey": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxPMbCA2Ks0lnd7IR+3pw\nwd3H/7jPGwj8bLUmore7bX+oeGpZ6QmLAe/1UOWcmZX2u70dYcSIzB1ofZtcn4cJ\nenHBAzO3ohBY/L1tQGJfS2A+omnN6H16VZE1JCK8XSJyfze7MDLcUyHZETdxuvRb\nA9X343/vMAuQPnhinFJ8Wdy8YBXSPpy7r95ylUQd9LfYTBzVZYG2tSesplcOkjM3\n2Uu+oMWxQAw1NINnSLPinMVsutJy6ZqlV3McWNWe4T+STGtWhrPNqJEn45sIcCx4\nq+kGZ2NQ0FyIyT2eiLKOX5Rgb/a36E/aMk4VoDsaenBQgG7WLTnstb9sr7MIhS6A\nrwIDAQAB\n-----END PUBLIC KEY-----\n", "Comment": "example public key" }, { "Id": "K1S0LWQ2L5HTBU", "Name": "ExampleKey2", "CreatedTime": "2019-12-09T23:28:11.110Z", "EncodedKey": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApOCAg88A8+f4dujn9Izt\n26LxtgAkn2opGgo/NKpMiaisyw5qlg3f1gol7FV6pYNl78iJg3EO8JBbwtlH+cR9\nLGSf60NDeVhm76Oc39Np/vWgOdsGQcRbi9WmKZeSODqjQGzVZWqPmito3FzWVk6b\nfVY5N36U/RdbVAJm95Km+qaMYlbIdF40t72bi3IkKYV5hlB2XoDjlQ9F6ajQKyTB\nMHa3SN8q+3ZjQ4sJJ7D1V6r4wR8jDcFVD5NckWJmmgIVnkOQM37NYeoDnkaOuTpu\nha/+3b8tOb2z3LBVHPkp85zJRAOXacSwf5rZtPYKBNFsixTa2n55k2r218mOkMC4\nUwIDAQAB\n-----END PUBLIC KEY-----", "Comment": "example public key #2" } ] } }
  • API 세부 정보는 AWS CLI 명령 참조ListPublicKeys 섹션을 참조하세요.

다음 코드 예시에서는 list-public-keys 코드를 사용하는 방법을 보여줍니다.

AWS CLI

CloudFront 퍼블릭 키를 나열하는 방법

다음 예시에서는 AWS 계정의 CloudFront 퍼블릭 키 목록을 가져옵니다.

aws cloudfront list-public-keys

출력:

{ "PublicKeyList": { "MaxItems": 100, "Quantity": 2, "Items": [ { "Id": "K2K8NC4HVFE3M0", "Name": "ExampleKey", "CreatedTime": "2019-12-05T01:04:28.818Z", "EncodedKey": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxPMbCA2Ks0lnd7IR+3pw\nwd3H/7jPGwj8bLUmore7bX+oeGpZ6QmLAe/1UOWcmZX2u70dYcSIzB1ofZtcn4cJ\nenHBAzO3ohBY/L1tQGJfS2A+omnN6H16VZE1JCK8XSJyfze7MDLcUyHZETdxuvRb\nA9X343/vMAuQPnhinFJ8Wdy8YBXSPpy7r95ylUQd9LfYTBzVZYG2tSesplcOkjM3\n2Uu+oMWxQAw1NINnSLPinMVsutJy6ZqlV3McWNWe4T+STGtWhrPNqJEn45sIcCx4\nq+kGZ2NQ0FyIyT2eiLKOX5Rgb/a36E/aMk4VoDsaenBQgG7WLTnstb9sr7MIhS6A\nrwIDAQAB\n-----END PUBLIC KEY-----\n", "Comment": "example public key" }, { "Id": "K1S0LWQ2L5HTBU", "Name": "ExampleKey2", "CreatedTime": "2019-12-09T23:28:11.110Z", "EncodedKey": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApOCAg88A8+f4dujn9Izt\n26LxtgAkn2opGgo/NKpMiaisyw5qlg3f1gol7FV6pYNl78iJg3EO8JBbwtlH+cR9\nLGSf60NDeVhm76Oc39Np/vWgOdsGQcRbi9WmKZeSODqjQGzVZWqPmito3FzWVk6b\nfVY5N36U/RdbVAJm95Km+qaMYlbIdF40t72bi3IkKYV5hlB2XoDjlQ9F6ajQKyTB\nMHa3SN8q+3ZjQ4sJJ7D1V6r4wR8jDcFVD5NckWJmmgIVnkOQM37NYeoDnkaOuTpu\nha/+3b8tOb2z3LBVHPkp85zJRAOXacSwf5rZtPYKBNFsixTa2n55k2r218mOkMC4\nUwIDAQAB\n-----END PUBLIC KEY-----", "Comment": "example public key #2" } ] } }
  • API 세부 정보는 AWS CLI 명령 참조ListPublicKeys 섹션을 참조하세요.

다음 코드 예시에서는 list-tags-for-resource 코드를 사용하는 방법을 보여줍니다.

AWS CLI

CloudFront 배포의 태그 나열

다음 예시에서는 CloudFront 배포 목록을 가져옵니다.

aws cloudfront list-tags-for-resource \ --resource arn:aws:cloudfront::123456789012:distribution/EDFDVBD6EXAMPLE

출력:

{ "Tags": { "Items": [ { "Key": "DateCreated", "Value": "2019-12-04" }, { "Key": "Name", "Value": "Example name" }, { "Key": "Project", "Value": "Example project" } ] } }

다음 코드 예시에서는 list-tags-for-resource 코드를 사용하는 방법을 보여줍니다.

AWS CLI

CloudFront 배포의 태그 나열

다음 예시에서는 CloudFront 배포 목록을 가져옵니다.

aws cloudfront list-tags-for-resource \ --resource arn:aws:cloudfront::123456789012:distribution/EDFDVBD6EXAMPLE

출력:

{ "Tags": { "Items": [ { "Key": "DateCreated", "Value": "2019-12-04" }, { "Key": "Name", "Value": "Example name" }, { "Key": "Project", "Value": "Example project" } ] } }

다음 코드 예시에서는 sign 코드를 사용하는 방법을 보여줍니다.

AWS CLI

CloudFront URL에 서명하는 방법

다음 예시는 CloudFront URL에 서명합니다. URL에 서명하는 방법 키 페어 ID(AWS관리 콘솔에서 액세스 키 ID라고 함)와 신뢰할 수 있는 서명자의 CloudFront 키 페어의 프라이빗 키가 필요합니다. 서명된 URL에 대한 자세한 내용은 Amazon CloudFront 개발자 안내서서명된 URL 및 서명된 쿠키로 프라이빗 콘텐츠 제공을 참조하세요.

aws cloudfront sign \ --url https://d111111abcdef8.cloudfront.net/private-content/private-file.html \ --key-pair-id APKAEIBAERJR2EXAMPLE \ --private-key file://cf-signer-priv-key.pem \ --date-less-than 2020-01-01

출력:

https://d111111abcdef8.cloudfront.net/private-content/private-file.html?Expires=1577836800&Signature=nEXK7Kby47XKeZQKVc6pwkif6oZc-JWSpDkH0UH7EBGGqvgurkecCbgL5VfUAXyLQuJxFwRQWscz-owcq9KpmewCXrXQbPaJZNi9XSNwf4YKurPDQYaRQawKoeenH0GFteRf9ELK-Bs3nljTLjtbgzIUt7QJNKXcWr8AuUYikzGdJ4-qzx6WnxXfH~fxg4-GGl6l2kgCpXUB6Jx6K~Y3kpVOdzUPOIqFLHAnJojbhxqrVejomZZ2XrquDvNUCCIbePGnR3d24UPaLXG4FKOqNEaWDIBXu7jUUPwOyQCvpt-GNvjRJxqWf93uMobeMOiVYahb-e0KItiQewGcm0eLZQ__&Key-Pair-Id=APKAEIBAERJR2EXAMPLE
  • API 세부 정보는 AWS CLI 명령 참조Sign을 참조하세요.

다음 코드 예시에서는 sign 코드를 사용하는 방법을 보여줍니다.

AWS CLI

CloudFront URL에 서명하는 방법

다음 예시는 CloudFront URL에 서명합니다. URL에 서명하는 방법 키 페어 ID(AWS관리 콘솔에서 액세스 키 ID라고 함)와 신뢰할 수 있는 서명자의 CloudFront 키 페어의 프라이빗 키가 필요합니다. 서명된 URL에 대한 자세한 내용은 Amazon CloudFront 개발자 안내서서명된 URL 및 서명된 쿠키로 프라이빗 콘텐츠 제공을 참조하세요.

aws cloudfront sign \ --url https://d111111abcdef8.cloudfront.net/private-content/private-file.html \ --key-pair-id APKAEIBAERJR2EXAMPLE \ --private-key file://cf-signer-priv-key.pem \ --date-less-than 2020-01-01

출력:

https://d111111abcdef8.cloudfront.net/private-content/private-file.html?Expires=1577836800&Signature=nEXK7Kby47XKeZQKVc6pwkif6oZc-JWSpDkH0UH7EBGGqvgurkecCbgL5VfUAXyLQuJxFwRQWscz-owcq9KpmewCXrXQbPaJZNi9XSNwf4YKurPDQYaRQawKoeenH0GFteRf9ELK-Bs3nljTLjtbgzIUt7QJNKXcWr8AuUYikzGdJ4-qzx6WnxXfH~fxg4-GGl6l2kgCpXUB6Jx6K~Y3kpVOdzUPOIqFLHAnJojbhxqrVejomZZ2XrquDvNUCCIbePGnR3d24UPaLXG4FKOqNEaWDIBXu7jUUPwOyQCvpt-GNvjRJxqWf93uMobeMOiVYahb-e0KItiQewGcm0eLZQ__&Key-Pair-Id=APKAEIBAERJR2EXAMPLE
  • API 세부 정보는 AWS CLI 명령 참조Sign을 참조하세요.

다음 코드 예시에서는 tag-resource 코드를 사용하는 방법을 보여줍니다.

AWS CLI

CloudFront 배포에 태그 지정

다음 tag-resource 예시에서는 지정된 CloudFront 배포에 두 개의 태그를 추가합니다.

aws cloudfront tag-resource \ --resource arn:aws:cloudfront::123456789012:distribution/EDFDVBD6EXAMPLE \ --tags 'Items=[{Key=Name,Value="Example name"},{Key=Project,Value="Example project"}]'

명령줄 인수를 사용하는 대신 다음 예시와 같이 JSON 파일로 태그를 제공할 수 있습니다.

aws cloudfront tag-resource \ --resource arn:aws:cloudfront::123456789012:distribution/EDFDVBD6EXAMPLE \ --tags file://tags.json

tags.json의 콘텐츠:

{ "Items": [ { "Key": "Name", "Value": "Example name" }, { "Key": "Project", "Value": "Example project" } ] }

이 명령은 출력을 생성하지 않습니다.

  • API 세부 정보는 AWS CLI 명령 참조의 TagResource를 참조하세요.

다음 코드 예시에서는 tag-resource 코드를 사용하는 방법을 보여줍니다.

AWS CLI

CloudFront 배포에 태그 지정

다음 tag-resource 예시에서는 지정된 CloudFront 배포에 두 개의 태그를 추가합니다.

aws cloudfront tag-resource \ --resource arn:aws:cloudfront::123456789012:distribution/EDFDVBD6EXAMPLE \ --tags 'Items=[{Key=Name,Value="Example name"},{Key=Project,Value="Example project"}]'

명령줄 인수를 사용하는 대신 다음 예시와 같이 JSON 파일로 태그를 제공할 수 있습니다.

aws cloudfront tag-resource \ --resource arn:aws:cloudfront::123456789012:distribution/EDFDVBD6EXAMPLE \ --tags file://tags.json

tags.json의 콘텐츠:

{ "Items": [ { "Key": "Name", "Value": "Example name" }, { "Key": "Project", "Value": "Example project" } ] }

이 명령은 출력을 생성하지 않습니다.

  • API 세부 정보는 AWS CLI 명령 참조의 TagResource를 참조하세요.

다음 코드 예시에서는 untag-resource 코드를 사용하는 방법을 보여줍니다.

AWS CLI

CloudFront 배포에서 태그를 제거하는 방법

다음 예시에서는 명령줄 인수를 사용하여 CloudFront 배포에서 두 태그를 제거합니다.

aws cloudfront untag-resource \ --resource arn:aws:cloudfront::123456789012:distribution/EDFDVBD6EXAMPLE \ --tag-keys Items=Name,Project

명령줄 인수를 사용하는 대신 다음 예시와 같이 JSON 파일로 태그 키를 제공할 수 있습니다.

aws cloudfront untag-resource \ --resource arn:aws:cloudfront::123456789012:distribution/EDFDVBD6EXAMPLE \ --tag-keys file://tag-keys.json

tag-keys.json 파일은 다음을 포함한 현재 문서의 JSON 문서입니다.

{ "Items": [ "Name", "Project" ] }

이 명령이 제대로 실행되면 출력이 표시되지 않습니다.

  • API 세부 정보는 AWS CLI 명령 참조UntagResource 섹션을 참조하세요.

다음 코드 예시에서는 untag-resource 코드를 사용하는 방법을 보여줍니다.

AWS CLI

CloudFront 배포에서 태그를 제거하는 방법

다음 예시에서는 명령줄 인수를 사용하여 CloudFront 배포에서 두 태그를 제거합니다.

aws cloudfront untag-resource \ --resource arn:aws:cloudfront::123456789012:distribution/EDFDVBD6EXAMPLE \ --tag-keys Items=Name,Project

명령줄 인수를 사용하는 대신 다음 예시와 같이 JSON 파일로 태그 키를 제공할 수 있습니다.

aws cloudfront untag-resource \ --resource arn:aws:cloudfront::123456789012:distribution/EDFDVBD6EXAMPLE \ --tag-keys file://tag-keys.json

tag-keys.json 파일은 다음을 포함한 현재 문서의 JSON 문서입니다.

{ "Items": [ "Name", "Project" ] }

이 명령이 제대로 실행되면 출력이 표시되지 않습니다.

  • API 세부 정보는 AWS CLI 명령 참조UntagResource 섹션을 참조하세요.

다음 코드 예시에서는 update-cloud-front-origin-access-identity 코드를 사용하는 방법을 보여줍니다.

AWS CLI

CloudFront 원본 액세스 ID 업데이트

다음 예시에서는 ID가 E74FTE3AEXAMPLE인 오리진 액세스 ID(OAI)를 업데이트하기 위한 요청입니다. 업데이트할 수 있는 유일한 필드는 OAI의 Comment입니다.

OAI를 업데이트하려면 OAI의 ID와 ETag가 있어야 합니다. OAI ID는 create-cloud-front-origin-access-identity 및 list-cloud-front-origin-access-identities 명령의 출력에 반환됩니다. ETag를 가져오려면 get-cloud-front-origin-access-identity 또는 get-cloud-front-origin-access-identity-config 명령을 사용합니다. --if-match 옵션을 사용하여 OAI의 ETag를 제공합니다.

aws cloudfront update-cloud-front-origin-access-identity \ --id E74FTE3AEXAMPLE \ --if-match E2QWRUHEXAMPLE \ --cloud-front-origin-access-identity-config \ CallerReference=cli-example,Comment="Example OAI Updated"

다음 예시와 같이 JSON 파일에 OAI 구성을 제공하여 동일한 작업을 수행할 수 있습니다.

aws cloudfront update-cloud-front-origin-access-identity \ --id E74FTE3AEXAMPLE \ --if-match E2QWRUHEXAMPLE \ --cloud-front-origin-access-identity-config file://OAI-config.json

OAI-config.json 파일은 다음을 포함한 현재 디렉터리의 JSON 문서입니다.

{ "CallerReference": "cli-example", "Comment": "Example OAI Updated" }

명령줄 인수로 OAI 구성을 제공하든 JSON 파일로 제공하든 출력은 동일합니다.

{ "ETag": "E9LHASXEXAMPLE", "CloudFrontOriginAccessIdentity": { "Id": "E74FTE3AEXAMPLE", "S3CanonicalUserId": "cd13868f797c227fbea2830611a26fe0a21ba1b826ab4bed9b7771c9aEXAMPLE", "CloudFrontOriginAccessIdentityConfig": { "CallerReference": "cli-example", "Comment": "Example OAI Updated" } } }

다음 코드 예시에서는 update-cloud-front-origin-access-identity 코드를 사용하는 방법을 보여줍니다.

AWS CLI

CloudFront 원본 액세스 ID 업데이트

다음 예시에서는 ID가 E74FTE3AEXAMPLE인 오리진 액세스 ID(OAI)를 업데이트하기 위한 요청입니다. 업데이트할 수 있는 유일한 필드는 OAI의 Comment입니다.

OAI를 업데이트하려면 OAI의 ID와 ETag가 있어야 합니다. OAI ID는 create-cloud-front-origin-access-identity 및 list-cloud-front-origin-access-identities 명령의 출력에 반환됩니다. ETag를 가져오려면 get-cloud-front-origin-access-identity 또는 get-cloud-front-origin-access-identity-config 명령을 사용합니다. --if-match 옵션을 사용하여 OAI의 ETag를 제공합니다.

aws cloudfront update-cloud-front-origin-access-identity \ --id E74FTE3AEXAMPLE \ --if-match E2QWRUHEXAMPLE \ --cloud-front-origin-access-identity-config \ CallerReference=cli-example,Comment="Example OAI Updated"

다음 예시와 같이 JSON 파일에 OAI 구성을 제공하여 동일한 작업을 수행할 수 있습니다.

aws cloudfront update-cloud-front-origin-access-identity \ --id E74FTE3AEXAMPLE \ --if-match E2QWRUHEXAMPLE \ --cloud-front-origin-access-identity-config file://OAI-config.json

OAI-config.json 파일은 다음을 포함한 현재 디렉터리의 JSON 문서입니다.

{ "CallerReference": "cli-example", "Comment": "Example OAI Updated" }

명령줄 인수로 OAI 구성을 제공하든 JSON 파일로 제공하든 출력은 동일합니다.

{ "ETag": "E9LHASXEXAMPLE", "CloudFrontOriginAccessIdentity": { "Id": "E74FTE3AEXAMPLE", "S3CanonicalUserId": "cd13868f797c227fbea2830611a26fe0a21ba1b826ab4bed9b7771c9aEXAMPLE", "CloudFrontOriginAccessIdentityConfig": { "CallerReference": "cli-example", "Comment": "Example OAI Updated" } } }

다음 코드 예시에서는 update-distribution을 사용하는 방법을 보여 줍니다.

AWS CLI

예제 1: CloudFront 배포의 기본 루트 객체를 업데이트하는 방법

다음 예제에서는 EDFDVBD6EXAMPLE ID를 가진 CloudFront 배포에 대해 기본 루트 객체를 index.html로 업데이트합니다.

aws cloudfront update-distribution \ --id EDFDVBD6EXAMPLE \ --default-root-object index.html

출력:

{ "ETag": "E2QWRUHEXAMPLE", "Distribution": { "Id": "EDFDVBD6EXAMPLE", "ARN": "arn:aws:cloudfront::123456789012:distribution/EDFDVBD6EXAMPLE", "Status": "InProgress", "LastModifiedTime": "2019-12-06T18:55:39.870Z", "InProgressInvalidationBatches": 0, "DomainName": "d111111abcdef8.cloudfront.net", "ActiveTrustedSigners": { "Enabled": false, "Quantity": 0 }, "DistributionConfig": { "CallerReference": "6b10378d-49be-4c4b-a642-419ccaf8f3b5", "Aliases": { "Quantity": 0 }, "DefaultRootObject": "index.html", "Origins": { "Quantity": 1, "Items": [ { "Id": "example-website", "DomainName": "www.example.com", "OriginPath": "", "CustomHeaders": { "Quantity": 0 }, "CustomOriginConfig": { "HTTPPort": 80, "HTTPSPort": 443, "OriginProtocolPolicy": "match-viewer", "OriginSslProtocols": { "Quantity": 2, "Items": [ "SSLv3", "TLSv1" ] }, "OriginReadTimeout": 30, "OriginKeepaliveTimeout": 5 } } ] }, "OriginGroups": { "Quantity": 0 }, "DefaultCacheBehavior": { "TargetOriginId": "example-website", "ForwardedValues": { "QueryString": false, "Cookies": { "Forward": "none" }, "Headers": { "Quantity": 1, "Items": [ "*" ] }, "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": true, "ViewerCertificate": { "CloudFrontDefaultCertificate": true, "MinimumProtocolVersion": "TLSv1", "CertificateSource": "cloudfront" }, "Restrictions": { "GeoRestriction": { "RestrictionType": "none", "Quantity": 0 } }, "WebACLId": "", "HttpVersion": "http1.1", "IsIPV6Enabled": true } } }

예제 2: CloudFront 배포를 업데이트하는 방법

다음 예제에서는 dist-config-disable.json이라는 JSON 파일로 배포 구성을 제공하여 ID EMLARXS9EXAMPLE을 사용한 CloudFront 배포를 비활성화합니다. 배포를 업데이트하려면 배포의 ETag를 제공하는 --if-match 옵션을 사용해야 합니다. ETag를 가져오려면 get-distribution 또는 get-distribution-config 명령을 사용하세요. JSON 파일에서 Enabled 필드가 false로 설정되어 있습니다.

다음 예제를 사용하여 배포를 비활성화한 후 delete-distribution 명령을 사용하여 배포를 삭제할 수 있습니다.

aws cloudfront update-distribution \ --id EMLARXS9EXAMPLE \ --if-match E2QWRUHEXAMPLE \ --distribution-config file://dist-config-disable.json

dist-config-disable.json의 콘텐츠:

{ "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 }

출력:

{ "ETag": "E9LHASXEXAMPLE", "Distribution": { "Id": "EMLARXS9EXAMPLE", "ARN": "arn:aws:cloudfront::123456789012:distribution/EMLARXS9EXAMPLE", "Status": "InProgress", "LastModifiedTime": "2019-12-06T18:32:35.553Z", "InProgressInvalidationBatches": 0, "DomainName": "d111111abcdef8.cloudfront.net", "ActiveTrustedSigners": { "Enabled": false, "Quantity": 0 }, "DistributionConfig": { "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 } } }

다음 코드 예시에서는 update-distribution을 사용하는 방법을 보여 줍니다.

AWS CLI

예제 1: CloudFront 배포의 기본 루트 객체를 업데이트하는 방법

다음 예제에서는 EDFDVBD6EXAMPLE ID를 가진 CloudFront 배포에 대해 기본 루트 객체를 index.html로 업데이트합니다.

aws cloudfront update-distribution \ --id EDFDVBD6EXAMPLE \ --default-root-object index.html

출력:

{ "ETag": "E2QWRUHEXAMPLE", "Distribution": { "Id": "EDFDVBD6EXAMPLE", "ARN": "arn:aws:cloudfront::123456789012:distribution/EDFDVBD6EXAMPLE", "Status": "InProgress", "LastModifiedTime": "2019-12-06T18:55:39.870Z", "InProgressInvalidationBatches": 0, "DomainName": "d111111abcdef8.cloudfront.net", "ActiveTrustedSigners": { "Enabled": false, "Quantity": 0 }, "DistributionConfig": { "CallerReference": "6b10378d-49be-4c4b-a642-419ccaf8f3b5", "Aliases": { "Quantity": 0 }, "DefaultRootObject": "index.html", "Origins": { "Quantity": 1, "Items": [ { "Id": "example-website", "DomainName": "www.example.com", "OriginPath": "", "CustomHeaders": { "Quantity": 0 }, "CustomOriginConfig": { "HTTPPort": 80, "HTTPSPort": 443, "OriginProtocolPolicy": "match-viewer", "OriginSslProtocols": { "Quantity": 2, "Items": [ "SSLv3", "TLSv1" ] }, "OriginReadTimeout": 30, "OriginKeepaliveTimeout": 5 } } ] }, "OriginGroups": { "Quantity": 0 }, "DefaultCacheBehavior": { "TargetOriginId": "example-website", "ForwardedValues": { "QueryString": false, "Cookies": { "Forward": "none" }, "Headers": { "Quantity": 1, "Items": [ "*" ] }, "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": true, "ViewerCertificate": { "CloudFrontDefaultCertificate": true, "MinimumProtocolVersion": "TLSv1", "CertificateSource": "cloudfront" }, "Restrictions": { "GeoRestriction": { "RestrictionType": "none", "Quantity": 0 } }, "WebACLId": "", "HttpVersion": "http1.1", "IsIPV6Enabled": true } } }

예제 2: CloudFront 배포를 업데이트하는 방법

다음 예제에서는 dist-config-disable.json이라는 JSON 파일로 배포 구성을 제공하여 ID EMLARXS9EXAMPLE을 사용한 CloudFront 배포를 비활성화합니다. 배포를 업데이트하려면 배포의 ETag를 제공하는 --if-match 옵션을 사용해야 합니다. ETag를 가져오려면 get-distribution 또는 get-distribution-config 명령을 사용하세요. JSON 파일에서 Enabled 필드가 false로 설정되어 있습니다.

다음 예제를 사용하여 배포를 비활성화한 후 delete-distribution 명령을 사용하여 배포를 삭제할 수 있습니다.

aws cloudfront update-distribution \ --id EMLARXS9EXAMPLE \ --if-match E2QWRUHEXAMPLE \ --distribution-config file://dist-config-disable.json

dist-config-disable.json의 콘텐츠:

{ "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 }

출력:

{ "ETag": "E9LHASXEXAMPLE", "Distribution": { "Id": "EMLARXS9EXAMPLE", "ARN": "arn:aws:cloudfront::123456789012:distribution/EMLARXS9EXAMPLE", "Status": "InProgress", "LastModifiedTime": "2019-12-06T18:32:35.553Z", "InProgressInvalidationBatches": 0, "DomainName": "d111111abcdef8.cloudfront.net", "ActiveTrustedSigners": { "Enabled": false, "Quantity": 0 }, "DistributionConfig": { "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 } } }

다음 코드 예시에서는 update-field-level-encryption-config 코드를 사용하는 방법을 보여줍니다.

AWS CLI

CloudFront 필드 수준 암호화 구성을 업데이트하는 방법

다음 예시에서는 JSON 파일에 파라미터를 제공하여 UD가 C3KM2WVD605UAY인 필드 수준 암호화 구성을 업데이트합니다.

필드 수준 암호화 구성을 업데이트하려면 구성의 ID 및 ETag가 있어야 합니다. ID는 create-field-level-encryption-config 및 list-field-level-encryption-configs 명령의 출력으로 반환됩니다. ETag를 가져오려면 get-field-level-encryption 또는 get-field-level-encryption-config 명령을 사용합니다. --if-match 옵션을 사용하여 구성의 ETag를 제공합니다.

aws cloudfront update-field-level-encryption-config \ --id C3KM2WVD605UAY \ --if-match E2P4Z4VU7TY5SG \ --field-level-encryption-config file://fle-config.json

fle-config.json 파일은 다음을 포함한 현재 디렉터리의 JSON 문서입니다.

{ "CallerReference": "cli-example", "Comment": "Updated example FLE configuration", "QueryArgProfileConfig": { "ForwardWhenQueryArgProfileIsUnknown": true, "QueryArgProfiles": { "Quantity": 0 } }, "ContentTypeProfileConfig": { "ForwardWhenContentTypeIsUnknown": true, "ContentTypeProfiles": { "Quantity": 1, "Items": [ { "Format": "URLEncoded", "ProfileId": "P280MFCLSYOCVU", "ContentType": "application/x-www-form-urlencoded" } ] } } }

출력:

{ "ETag": "E26M4BIAV81ZF6", "FieldLevelEncryption": { "Id": "C3KM2WVD605UAY", "LastModifiedTime": "2019-12-10T22:26:26.170Z", "FieldLevelEncryptionConfig": { "CallerReference": "cli-example", "Comment": "Updated example FLE configuration", "QueryArgProfileConfig": { "ForwardWhenQueryArgProfileIsUnknown": true, "QueryArgProfiles": { "Quantity": 0, "Items": [] } }, "ContentTypeProfileConfig": { "ForwardWhenContentTypeIsUnknown": true, "ContentTypeProfiles": { "Quantity": 1, "Items": [ { "Format": "URLEncoded", "ProfileId": "P280MFCLSYOCVU", "ContentType": "application/x-www-form-urlencoded" } ] } } } } }

다음 코드 예시에서는 update-field-level-encryption-config 코드를 사용하는 방법을 보여줍니다.

AWS CLI

CloudFront 필드 수준 암호화 구성을 업데이트하는 방법

다음 예시에서는 JSON 파일에 파라미터를 제공하여 UD가 C3KM2WVD605UAY인 필드 수준 암호화 구성을 업데이트합니다.

필드 수준 암호화 구성을 업데이트하려면 구성의 ID 및 ETag가 있어야 합니다. ID는 create-field-level-encryption-config 및 list-field-level-encryption-configs 명령의 출력으로 반환됩니다. ETag를 가져오려면 get-field-level-encryption 또는 get-field-level-encryption-config 명령을 사용합니다. --if-match 옵션을 사용하여 구성의 ETag를 제공합니다.

aws cloudfront update-field-level-encryption-config \ --id C3KM2WVD605UAY \ --if-match E2P4Z4VU7TY5SG \ --field-level-encryption-config file://fle-config.json

fle-config.json 파일은 다음을 포함한 현재 디렉터리의 JSON 문서입니다.

{ "CallerReference": "cli-example", "Comment": "Updated example FLE configuration", "QueryArgProfileConfig": { "ForwardWhenQueryArgProfileIsUnknown": true, "QueryArgProfiles": { "Quantity": 0 } }, "ContentTypeProfileConfig": { "ForwardWhenContentTypeIsUnknown": true, "ContentTypeProfiles": { "Quantity": 1, "Items": [ { "Format": "URLEncoded", "ProfileId": "P280MFCLSYOCVU", "ContentType": "application/x-www-form-urlencoded" } ] } } }

출력:

{ "ETag": "E26M4BIAV81ZF6", "FieldLevelEncryption": { "Id": "C3KM2WVD605UAY", "LastModifiedTime": "2019-12-10T22:26:26.170Z", "FieldLevelEncryptionConfig": { "CallerReference": "cli-example", "Comment": "Updated example FLE configuration", "QueryArgProfileConfig": { "ForwardWhenQueryArgProfileIsUnknown": true, "QueryArgProfiles": { "Quantity": 0, "Items": [] } }, "ContentTypeProfileConfig": { "ForwardWhenContentTypeIsUnknown": true, "ContentTypeProfiles": { "Quantity": 1, "Items": [ { "Format": "URLEncoded", "ProfileId": "P280MFCLSYOCVU", "ContentType": "application/x-www-form-urlencoded" } ] } } } } }

다음 코드 예시에서는 update-field-level-encryption-profile 코드를 사용하는 방법을 보여줍니다.

AWS CLI

CloudFront 필드 수준 암호화 프로파일을 업데이트하는 방법

다음 예시에서는 ID가 PPK0UOSIF5WSV인 필드 수준 암호화 프로파일을 업데이트합니다. 이 예시에서는 JSON 파일에 파라미터를 제공하여 프로파일의 NameComment를 업데이트하고 두 번째 항목을 추가합니다.

필드 수준 암호화 프로파일을 업데이트하려면 프로파일의 ID와 ETag가 있어야 합니다. ID는 create-field-level-encryption-profile 및 list-field-level-encryption-profiles 명령의 출력으로 반환됩니다. ETag를 가져오려면 get-field-level-encryption-profile 또는 get-field-level-encryption-profile-config 명령을 사용합니다. --if-match 옵션을 사용하여 프로파일의 ETag를 제공합니다.

aws cloudfront update-field-level-encryption-profile \ --id PPK0UOSIF5WSV \ --if-match E1QQG65FS2L2GC \ --field-level-encryption-profile-config file://fle-profile-config.json

fle-profile-config.json 파일은 다음을 포함한 현재 디렉터리의 JSON 문서입니다.

{ "Name": "ExampleFLEProfileUpdated", "CallerReference": "cli-example", "Comment": "Updated FLE profile for AWS CLI example", "EncryptionEntities": { "Quantity": 1, "Items": [ { "PublicKeyId": "K2K8NC4HVFE3M0", "ProviderId": "ExampleFLEProvider", "FieldPatterns": { "Quantity": 2, "Items": [ "ExampleSensitiveField", "SecondExampleSensitiveField" ] } } ] } }

출력:

{ "ETag": "EJETYFJ9CL66D", "FieldLevelEncryptionProfile": { "Id": "PPK0UOSIF5WSV", "LastModifiedTime": "2019-12-10T19:05:58.296Z", "FieldLevelEncryptionProfileConfig": { "Name": "ExampleFLEProfileUpdated", "CallerReference": "cli-example", "Comment": "Updated FLE profile for AWS CLI example", "EncryptionEntities": { "Quantity": 1, "Items": [ { "PublicKeyId": "K2K8NC4HVFE3M0", "ProviderId": "ExampleFLEProvider", "FieldPatterns": { "Quantity": 2, "Items": [ "ExampleSensitiveField", "SecondExampleSensitiveField" ] } } ] } } } }

다음 코드 예시에서는 update-field-level-encryption-profile 코드를 사용하는 방법을 보여줍니다.

AWS CLI

CloudFront 필드 수준 암호화 프로파일을 업데이트하는 방법

다음 예시에서는 ID가 PPK0UOSIF5WSV인 필드 수준 암호화 프로파일을 업데이트합니다. 이 예시에서는 JSON 파일에 파라미터를 제공하여 프로파일의 NameComment를 업데이트하고 두 번째 항목을 추가합니다.

필드 수준 암호화 프로파일을 업데이트하려면 프로파일의 ID와 ETag가 있어야 합니다. ID는 create-field-level-encryption-profile 및 list-field-level-encryption-profiles 명령의 출력으로 반환됩니다. ETag를 가져오려면 get-field-level-encryption-profile 또는 get-field-level-encryption-profile-config 명령을 사용합니다. --if-match 옵션을 사용하여 프로파일의 ETag를 제공합니다.

aws cloudfront update-field-level-encryption-profile \ --id PPK0UOSIF5WSV \ --if-match E1QQG65FS2L2GC \ --field-level-encryption-profile-config file://fle-profile-config.json

fle-profile-config.json 파일은 다음을 포함한 현재 디렉터리의 JSON 문서입니다.

{ "Name": "ExampleFLEProfileUpdated", "CallerReference": "cli-example", "Comment": "Updated FLE profile for AWS CLI example", "EncryptionEntities": { "Quantity": 1, "Items": [ { "PublicKeyId": "K2K8NC4HVFE3M0", "ProviderId": "ExampleFLEProvider", "FieldPatterns": { "Quantity": 2, "Items": [ "ExampleSensitiveField", "SecondExampleSensitiveField" ] } } ] } }

출력:

{ "ETag": "EJETYFJ9CL66D", "FieldLevelEncryptionProfile": { "Id": "PPK0UOSIF5WSV", "LastModifiedTime": "2019-12-10T19:05:58.296Z", "FieldLevelEncryptionProfileConfig": { "Name": "ExampleFLEProfileUpdated", "CallerReference": "cli-example", "Comment": "Updated FLE profile for AWS CLI example", "EncryptionEntities": { "Quantity": 1, "Items": [ { "PublicKeyId": "K2K8NC4HVFE3M0", "ProviderId": "ExampleFLEProvider", "FieldPatterns": { "Quantity": 2, "Items": [ "ExampleSensitiveField", "SecondExampleSensitiveField" ] } } ] } } } }

이 페이지에서

프라이버시사이트 이용 약관쿠키 기본 설정
© 2025, Amazon Web Services, Inc. 또는 계열사. All rights reserved.