AWS Tools for Windows PowerShell
Command Reference

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.

Synopsis

Calls the Amazon Lightsail UpdateDistribution API operation.

Syntax

Update-LSDistribution
-DistributionName <String>
-CacheBehaviorSettings_AllowedHTTPMethod <String>
-DefaultCacheBehavior_Behavior <BehaviorEnum>
-CacheBehavior <CacheBehaviorPerPath[]>
-CacheBehaviorSettings_CachedHTTPMethod <String>
-ForwardedCookies_CookiesAllowList <String[]>
-CacheBehaviorSettings_DefaultTTL <Int64>
-ForwardedHeaders_HeadersAllowList <String[]>
-IsEnabled <Boolean>
-CacheBehaviorSettings_MaximumTTL <Int64>
-CacheBehaviorSettings_MinimumTTL <Int64>
-Origin_Name <String>
-ForwardedCookies_Option <ForwardValues>
-ForwardedHeaders_Option <ForwardValues>
-ForwardedQueryStrings_Option <Boolean>
-Origin_ProtocolPolicy <OriginProtocolPolicyEnum>
-ForwardedQueryStrings_QueryStringsAllowList <String[]>
-Origin_RegionName <RegionName>
-Select <String>
-PassThru <SwitchParameter>
-Force <SwitchParameter>

Description

Updates an existing Amazon Lightsail content delivery network (CDN) distribution. Use this action to update the configuration of your existing distribution

Parameters

-CacheBehavior <CacheBehaviorPerPath[]>
An array of objects that describe the per-path cache behavior for the distribution.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesCacheBehaviors
-CacheBehaviorSettings_AllowedHTTPMethod <String>
The HTTP methods that are processed and forwarded to the distribution's origin.You can specify the following options:
  • GET,HEAD - The distribution forwards the GET and HEAD methods.
  • GET,HEAD,OPTIONS - The distribution forwards the GET, HEAD, and OPTIONS methods.
  • GET,HEAD,OPTIONS,PUT,PATCH,POST,DELETE - The distribution forwards the GET, HEAD, OPTIONS, PUT, PATCH, POST, and DELETE methods.
If you specify the third option, you might need to restrict access to your distribution's origin so users can't perform operations that you don't want them to. For example, you might not want users to have permission to delete objects from your origin.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesCacheBehaviorSettings_AllowedHTTPMethods
-CacheBehaviorSettings_CachedHTTPMethod <String>
The HTTP method responses that are cached by your distribution.You can specify the following options:
  • GET,HEAD - The distribution caches responses to the GET and HEAD methods.
  • GET,HEAD,OPTIONS - The distribution caches responses to the GET, HEAD, and OPTIONS methods.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesCacheBehaviorSettings_CachedHTTPMethods
-CacheBehaviorSettings_DefaultTTL <Int64>
The default amount of time that objects stay in the distribution's cache before the distribution forwards another request to the origin to determine whether the content has been updated.The value specified applies only when the origin does not add HTTP headers such as Cache-Control max-age, Cache-Control s-maxage, and Expires to objects.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-CacheBehaviorSettings_MaximumTTL <Int64>
The maximum amount of time that objects stay in the distribution's cache before the distribution forwards another request to the origin to determine whether the object has been updated.The value specified applies only when the origin adds HTTP headers such as Cache-Control max-age, Cache-Control s-maxage, and Expires to objects.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-CacheBehaviorSettings_MinimumTTL <Int64>
The minimum amount of time that objects stay in the distribution's cache before the distribution forwards another request to the origin to determine whether the object has been updated.A value of 0 must be specified for minimumTTL if the distribution is configured to forward all headers to the origin.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-DefaultCacheBehavior_Behavior <BehaviorEnum>
The cache behavior of the distribution.The following cache behaviors can be specified:
  • cache - This option is best for static sites. When specified, your distribution caches and serves your entire website as static content. This behavior is ideal for websites with static content that doesn't change depending on who views it, or for websites that don't use cookies, headers, or query strings to personalize content.
  • dont-cache - This option is best for sites that serve a mix of static and dynamic content. When specified, your distribution caches and serve only the content that is specified in the distribution's CacheBehaviorPerPath parameter. This behavior is ideal for websites or web applications that use cookies, headers, and query strings to personalize content for individual users.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-DistributionName <String>
The name of the distribution to update.Use the GetDistributions action to get a list of distribution names that you can specify.
Required?True
Position?1
Accept pipeline input?True (ByValue, ByPropertyName)
This parameter overrides confirmation prompts to force the cmdlet to continue its operation. This parameter should always be used with caution.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-ForwardedCookies_CookiesAllowList <String[]>
The specific cookies to forward to your distribution's origin.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesCacheBehaviorSettings_ForwardedCookies_CookiesAllowList
-ForwardedCookies_Option <ForwardValues>
Specifies which cookies to forward to the distribution's origin for a cache behavior: all, none, or allow-list to forward only the cookies specified in the cookiesAllowList parameter.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesCacheBehaviorSettings_ForwardedCookies_Option
-ForwardedHeaders_HeadersAllowList <String[]>
The specific headers to forward to your distribution's origin.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesCacheBehaviorSettings_ForwardedHeaders_HeadersAllowList
-ForwardedHeaders_Option <ForwardValues>
The headers that you want your distribution to forward to your origin and base caching on.You can configure your distribution to do one of the following:
  • all - Forward all headers to your origin.
  • none - Forward only the default headers.
  • allow-list - Forward only the headers you specify using the headersAllowList parameter.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesCacheBehaviorSettings_ForwardedHeaders_Option
-ForwardedQueryStrings_Option <Boolean>
Indicates whether the distribution forwards and caches based on query strings.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesCacheBehaviorSettings_ForwardedQueryStrings_Option
-ForwardedQueryStrings_QueryStringsAllowList <String[]>
The specific query strings that the distribution forwards to the origin.Your distribution will cache content based on the specified query strings.If the option parameter is true, then your distribution forwards all query strings, regardless of what you specify using the queryStringsAllowList parameter.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesCacheBehaviorSettings_ForwardedQueryStrings_QueryStringsAllowList
-IsEnabled <Boolean>
Indicates whether to enable the distribution.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-Origin_Name <String>
The name of the origin resource.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-Origin_ProtocolPolicy <OriginProtocolPolicyEnum>
The protocol that your Amazon Lightsail distribution uses when establishing a connection with your origin to pull content.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-Origin_RegionName <RegionName>
The AWS Region name of the origin resource.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-PassThru <SwitchParameter>
Changes the cmdlet behavior to return the value passed to the DistributionName parameter. The -PassThru parameter is deprecated, use -Select '^DistributionName' instead. This parameter will be removed in a future version.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-Select <String>
Use the -Select parameter to control the cmdlet output. The default value is 'Operation'. Specifying -Select '*' will result in the cmdlet returning the whole service response (Amazon.Lightsail.Model.UpdateDistributionResponse). Specifying the name of a property of type Amazon.Lightsail.Model.UpdateDistributionResponse will result in that property being returned. Specifying -Select '^ParameterName' will result in the cmdlet returning the selected cmdlet parameter value.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)

Common Credential and Region Parameters

-AccessKey <String>
The AWS access key for the user account. This can be a temporary access key if the corresponding session token is supplied to the -SessionToken parameter.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesAK
-Credential <AWSCredentials>
An AWSCredentials object instance containing access and secret key information, and optionally a token for session-based credentials.
Required?False
Position?Named
Accept pipeline input?True (ByValue, ByPropertyName)
-EndpointUrl <String>
The endpoint to make the call against.Note: This parameter is primarily for internal AWS use and is not required/should not be specified for normal usage. The cmdlets normally determine which endpoint to call based on the region specified to the -Region parameter or set as default in the shell (via Set-DefaultAWSRegion). Only specify this parameter if you must direct the call to a specific custom endpoint.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-NetworkCredential <PSCredential>
Used with SAML-based authentication when ProfileName references a SAML role profile. Contains the network credentials to be supplied during authentication with the configured identity provider's endpoint. This parameter is not required if the user's default network identity can or should be used during authentication.
Required?False
Position?Named
Accept pipeline input?True (ByValue, ByPropertyName)
-ProfileLocation <String>
Used to specify the name and location of the ini-format credential file (shared with the AWS CLI and other AWS SDKs)If this optional parameter is omitted this cmdlet will search the encrypted credential file used by the AWS SDK for .NET and AWS Toolkit for Visual Studio first. If the profile is not found then the cmdlet will search in the ini-format credential file at the default location: (user's home directory)\.aws\credentials.If this parameter is specified then this cmdlet will only search the ini-format credential file at the location given.As the current folder can vary in a shell or during script execution it is advised that you use specify a fully qualified path instead of a relative path.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesAWSProfilesLocation, ProfilesLocation
-ProfileName <String>
The user-defined name of an AWS credentials or SAML-based role profile containing credential information. The profile is expected to be found in the secure credential file shared with the AWS SDK for .NET and AWS Toolkit for Visual Studio. You can also specify the name of a profile stored in the .ini-format credential file used with the AWS CLI and other AWS SDKs.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesStoredCredentials, AWSProfileName
-Region <Object>
The system name of an AWS region or an AWSRegion instance. This governs the endpoint that will be used when calling service operations. Note that the AWS resources referenced in a call are usually region-specific.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesRegionToCall
-SecretKey <String>
The AWS secret key for the user account. This can be a temporary secret key if the corresponding session token is supplied to the -SessionToken parameter.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesSK, SecretAccessKey
-SessionToken <String>
The session token if the access and secret keys are temporary session-based credentials.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesST

Outputs

This cmdlet returns an Amazon.Lightsail.Model.Operation object. The service call response (type Amazon.Lightsail.Model.UpdateDistributionResponse) can also be referenced from properties attached to the cmdlet entry in the $AWSHistory stack.

Supported Version

AWS Tools for PowerShell: 2.x.y.z