AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.
New-CFDistribution-ViewerCertificate_ACMCertificateArn <String>-Logging_Bucket <String>-DefaultCacheBehavior_CachePolicyId <String>-DistributionConfig_CallerReference <String>-ViewerCertificate_CloudFrontDefaultCertificate <Boolean>-DistributionConfig_Comment <String>-DefaultCacheBehavior_Compress <Boolean>-DistributionConfig_ContinuousDeploymentPolicyId <String>-DistributionConfig_DefaultRootObject <String>-TrustedKeyGroups_Enabled <Boolean>-TrustedSigners_Enabled <Boolean>-DistributionConfig_Enabled <Boolean>-Logging_Enabled <Boolean>-DefaultCacheBehavior_FieldLevelEncryptionId <String>-Cookies_Forward <ItemSelection>-DistributionConfig_HttpVersion <HttpVersion>-ViewerCertificate_IAMCertificateId <String>-Logging_IncludeCookie <Boolean>-DistributionConfig_IsIPV6Enabled <Boolean>-Aliases_Item <String[]>-CacheBehaviors_Item <CacheBehavior[]>-CustomErrorResponses_Item <CustomErrorResponse[]>-CachedMethods_Item <String[]>-AllowedMethods_Item <String[]>-WhitelistedNames_Item <String[]>-Headers_Item <String[]>-QueryStringCacheKeys_Item <String[]>-FunctionAssociations_Item <FunctionAssociation[]>-LambdaFunctionAssociations_Item <LambdaFunctionAssociation[]>-TrustedKeyGroups_Item <String[]>-TrustedSigners_Item <String[]>-OriginGroups_Item <OriginGroup[]>-Origins_Item <Origin[]>-GeoRestriction_Item <String[]>-ViewerCertificate_MinimumProtocolVersion <MinimumProtocolVersion>-DefaultCacheBehavior_OriginRequestPolicyId <String>-Logging_Prefix <String>-DistributionConfig_PriceClass <PriceClass>-Aliases_Quantity <Int32>-CacheBehaviors_Quantity <Int32>-CustomErrorResponses_Quantity <Int32>-CachedMethods_Quantity <Int32>-AllowedMethods_Quantity <Int32>-WhitelistedNames_Quantity <Int32>-Headers_Quantity <Int32>-QueryStringCacheKeys_Quantity <Int32>-FunctionAssociations_Quantity <Int32>-LambdaFunctionAssociations_Quantity <Int32>-TrustedKeyGroups_Quantity <Int32>-TrustedSigners_Quantity <Int32>-OriginGroups_Quantity <Int32>-Origins_Quantity <Int32>-GeoRestriction_Quantity <Int32>-ForwardedValues_QueryString <Boolean>-DefaultCacheBehavior_RealtimeLogConfigArn <String>-DefaultCacheBehavior_ResponseHeadersPolicyId <String>-GeoRestriction_RestrictionType <GeoRestrictionType>-DefaultCacheBehavior_SmoothStreaming <Boolean>-ViewerCertificate_SSLSupportMethod <SSLSupportMethod>-DistributionConfig_Staging <Boolean>-DefaultCacheBehavior_TargetOriginId <String>-DefaultCacheBehavior_ViewerProtocolPolicy <ViewerProtocolPolicy>-DistributionConfig_WebACLId <String>-ViewerCertificate_Certificate <String>-ViewerCertificate_CertificateSource <CertificateSource>-DefaultCacheBehavior_DefaultTTL <Int64>-DefaultCacheBehavior_MaxTTL <Int64>-DefaultCacheBehavior_MinTTL <Int64>-Select <String>-Force <SwitchParameter>-ClientConfig <AmazonCloudFrontConfig>
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | DistributionConfig_Aliases_Items |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | DistributionConfig_Aliases_Quantity |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | DistributionConfig_DefaultCacheBehavior_AllowedMethods_Items |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | DistributionConfig_DefaultCacheBehavior_AllowedMethods_Quantity |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | DistributionConfig_CacheBehaviors_Items |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | DistributionConfig_CacheBehaviors_Quantity |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | DistributionConfig_DefaultCacheBehavior_AllowedMethods_CachedMethods_Items |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | DistributionConfig_DefaultCacheBehavior_AllowedMethods_CachedMethods_Quantity |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | DistributionConfig_DefaultCacheBehavior_ForwardedValues_Cookies_Forward |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | DistributionConfig_CustomErrorResponses_Items |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | DistributionConfig_CustomErrorResponses_Quantity |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | DistributionConfig_DefaultCacheBehavior_CachePolicyId |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | DistributionConfig_DefaultCacheBehavior_Compress |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | DistributionConfig_DefaultCacheBehavior_DefaultTTL |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | DistributionConfig_DefaultCacheBehavior_FieldLevelEncryptionId |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | DistributionConfig_DefaultCacheBehavior_MaxTTL |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | DistributionConfig_DefaultCacheBehavior_MinTTL |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | DistributionConfig_DefaultCacheBehavior_OriginRequestPolicyId |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | DistributionConfig_DefaultCacheBehavior_RealtimeLogConfigArn |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | DistributionConfig_DefaultCacheBehavior_ResponseHeadersPolicyId |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | DistributionConfig_DefaultCacheBehavior_SmoothStreaming |
Required? | True |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | DistributionConfig_DefaultCacheBehavior_TargetOriginId |
Required? | True |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | DistributionConfig_DefaultCacheBehavior_ViewerProtocolPolicy |
Required? | True |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | True |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | True |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | DistributionConfig_DefaultCacheBehavior_ForwardedValues_QueryString |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | DistributionConfig_DefaultCacheBehavior_FunctionAssociations_Items |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | DistributionConfig_DefaultCacheBehavior_FunctionAssociations_Quantity |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | DistributionConfig_Restrictions_GeoRestriction_Items |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | DistributionConfig_Restrictions_GeoRestriction_Quantity |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | DistributionConfig_Restrictions_GeoRestriction_RestrictionType |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | DistributionConfig_DefaultCacheBehavior_ForwardedValues_Headers_Items |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | DistributionConfig_DefaultCacheBehavior_ForwardedValues_Headers_Quantity |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | DistributionConfig_DefaultCacheBehavior_LambdaFunctionAssociations_Items |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | DistributionConfig_DefaultCacheBehavior_LambdaFunctionAssociations_Quantity |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | DistributionConfig_Logging_Bucket |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | DistributionConfig_Logging_Enabled |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | DistributionConfig_Logging_IncludeCookies |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | DistributionConfig_Logging_Prefix |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | DistributionConfig_OriginGroups_Items |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | DistributionConfig_OriginGroups_Quantity |
Required? | True |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | DistributionConfig_Origins_Items |
Required? | True |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | DistributionConfig_Origins_Quantity |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | DistributionConfig_DefaultCacheBehavior_ForwardedValues_QueryStringCacheKeys_Items |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | DistributionConfig_DefaultCacheBehavior_ForwardedValues_QueryStringCacheKeys_Quantity |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | DistributionConfig_DefaultCacheBehavior_TrustedKeyGroups_Enabled |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | DistributionConfig_DefaultCacheBehavior_TrustedKeyGroups_Items |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | DistributionConfig_DefaultCacheBehavior_TrustedKeyGroups_Quantity |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | DistributionConfig_DefaultCacheBehavior_TrustedSigners_Enabled |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | DistributionConfig_DefaultCacheBehavior_TrustedSigners_Items |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | DistributionConfig_DefaultCacheBehavior_TrustedSigners_Quantity |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | DistributionConfig_ViewerCertificate_ACMCertificateArn |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | DistributionConfig_ViewerCertificate_Certificate |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | DistributionConfig_ViewerCertificate_CertificateSource |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | DistributionConfig_ViewerCertificate_CloudFrontDefaultCertificate |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | DistributionConfig_ViewerCertificate_IAMCertificateId |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | DistributionConfig_ViewerCertificate_MinimumProtocolVersion |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | DistributionConfig_ViewerCertificate_SSLSupportMethod |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | DistributionConfig_DefaultCacheBehavior_ForwardedValues_Cookies_WhitelistedNames_Items |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | DistributionConfig_DefaultCacheBehavior_ForwardedValues_Cookies_WhitelistedNames_Quantity |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | AK |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByValue, ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByValue, ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | AWSProfilesLocation, ProfilesLocation |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | StoredCredentials, AWSProfileName |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | RegionToCall |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | SK, SecretAccessKey |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | ST |
$origin = New-Object Amazon.CloudFront.Model.Origin
$origin.DomainName = "amzn-s3-demo-bucket.s3.amazonaws.com"
$origin.Id = "UniqueOrigin1"
$origin.S3OriginConfig = New-Object Amazon.CloudFront.Model.S3OriginConfig
$origin.S3OriginConfig.OriginAccessIdentity = ""
New-CFDistribution `
-DistributionConfig_Enabled $true `
-DistributionConfig_Comment "Test distribution" `
-Origins_Item $origin `
-Origins_Quantity 1 `
-Logging_Enabled $true `
-Logging_IncludeCookie $true `
-Logging_Bucket amzn-s3-demo-logging-bucket.s3.amazonaws.com `
-Logging_Prefix "help/" `
-DistributionConfig_CallerReference Client1 `
-DistributionConfig_DefaultRootObject index.html `
-DefaultCacheBehavior_TargetOriginId $origin.Id `
-ForwardedValues_QueryString $true `
-Cookies_Forward all `
-WhitelistedNames_Quantity 0 `
-TrustedSigners_Enabled $false `
-TrustedSigners_Quantity 0 `
-DefaultCacheBehavior_ViewerProtocolPolicy allow-all `
-DefaultCacheBehavior_MinTTL 1000 `
-DistributionConfig_PriceClass "PriceClass_All" `
-CacheBehaviors_Quantity 0 `
-Aliases_Quantity 0Creates a basic CloudFront distribution, configured with logging and caching.
AWS Tools for PowerShell: 2.x.y.z