powershell AWS Cloudfront缓存失效

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了powershell AWS Cloudfront缓存失效相关的知识,希望对你有一定的参考价值。

# AWS credentials profile name (should be unique)
# Used to store your AWS credentials to: ~/.aws/
$CredentialsProfileName = ""

# AWS CLoudfront Region
$Region = ""

# AWS Cloudfront Distribution Id
$DistributionId = ""

# AWS Access Key
$AccessKey = ""

# AWS Secret Key
$SecretKey = ""

# Space-delimited list of paths to invalidate.
# For example: /index.html /images/*
$InvalidationPaths = ""


Write-Host "Setting up AWS profile environment"
aws configure set aws_access_key_id $AccessKey --profile $CredentialsProfileName
aws configure set aws_secret_access_key $SecretKey --profile $CredentialsProfileName
aws configure set default.region $Region --profile $CredentialsProfileName
aws configure set preview.cloudfront true --profile $CredentialsProfileName

Write-Host "Initiating AWS cloudfront invalidation of the following paths:"
Write-Host $InvalidationPaths
aws cloudfront create-invalidation --profile $CredentialsProfileName --distribution-id $DistributionId --paths $InvalidationPaths

Write-Host "Please note that it may take up to 15-20 minutes for AWS to complete the cloudfront cache invalidation"

以上是关于powershell AWS Cloudfront缓存失效的主要内容,如果未能解决你的问题,请参考以下文章

如何在 Lambda 函数中使用 AWS.CloudFront.Signer

AWS:如何为自定义域名配置 Cloudfront

用于 PHP 托管的 AWS CloudFront

AWS - 找不到 Cloudfront 堆栈

使用aws命令行刷新cloudfront缓存

AWS SOC 2 API 网关 / CloudFront