I am trying to update the Origins_Item specifically the Domain Name in a CloudFront Distribution using the Update-CFDistribution.
After consulting the AWS Powershell Reference here: 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.
it appears that the path to DomainNames property isn't correct. Can you please refer to the payload provided in this question ?
AWS cli query to get to cloudfront "Domain Name" with specific origin name
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.