简体   繁体   English

AWS更新Cloudfront域名

[英]AWS Update Cloudfront Domain Name

I am trying to update the Origins_Item specifically the Domain Name in a CloudFront Distribution using the Update-CFDistribution. 我正在尝试使用Update-CFDistribution更新Origins_Item,尤其是CloudFront分布中的域名。

After consulting the AWS Powershell Reference here: https://docs.aws.amazon.com/powershell/latest/reference/Index.html 在这里查阅AWS Powershell参考之后: https : //docs.aws.amazon.com/powershell/latest/reference/Index.html

This is the code I am trying to use. 这是我尝试使用的代码。

$CloudFront = $(Get-CFDistribution -Id abc123def).DistributionConfig.Origins.Items
$CloudFront.DomainName = "test.example.amazonaws.com"
Update-CFDistribution -Origins_Item $CloudFront -Id abc123def

But I am encountering the following error: 但是我遇到以下错误:

The property 'DomainName' cannot be found on this object. Verify that the property exists and can be set.

I am new to both powershell and AWS so any help would be much appreciated. 我对Powershell和AWS都是新手,所以我们将不胜感激。

it appears that the path to DomainNames property isn't correct. 似乎DomainNames属性的路径不正确。 Can you please refer to the payload provided in this question ? 您能否参考此问题中提供的有效负载?
AWS cli query to get to cloudfront "Domain Name" with specific origin name AWS CLI查询以使用特定来源名称访问云前“域名”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM