diff --git a/clients/client-cloudfront/src/commands/ListOriginAccessControlsCommand.ts b/clients/client-cloudfront/src/commands/ListOriginAccessControlsCommand.ts index c69ca555de3b..938fcdb99f2b 100644 --- a/clients/client-cloudfront/src/commands/ListOriginAccessControlsCommand.ts +++ b/clients/client-cloudfront/src/commands/ListOriginAccessControlsCommand.ts @@ -28,12 +28,17 @@ export interface ListOriginAccessControlsCommandInput extends ListOriginAccessCo export interface ListOriginAccessControlsCommandOutput extends ListOriginAccessControlsResult, __MetadataBearer {} /** - *

Gets the list of CloudFront origin access controls in this Amazon Web Services account.

+ *

Gets the list of CloudFront origin access controls (OACs) in this Amazon Web Services account.

*

You can optionally specify the maximum number of items to receive in the response. If * the total number of items in the list exceeds the maximum that you specify, or the * default maximum, the response is paginated. To get the next page of items, send another * request that specifies the NextMarker value from the current response as * the Marker value in the next request.

+ * + *

If you're not using origin access controls for your Amazon Web Services account, the + * ListOriginAccessControls operation doesn't return the + * Items element in the response.

+ *
* @example * Use a bare-bones client and the command you need to make an API call. * ```javascript diff --git a/clients/client-cloudfront/src/commands/UpdateDistributionCommand.ts b/clients/client-cloudfront/src/commands/UpdateDistributionCommand.ts index 0f9970c586e4..5c5d53c3f7d5 100644 --- a/clients/client-cloudfront/src/commands/UpdateDistributionCommand.ts +++ b/clients/client-cloudfront/src/commands/UpdateDistributionCommand.ts @@ -51,10 +51,8 @@ export interface UpdateDistributionCommandOutput extends UpdateDistributionResul * the following important requirements and restrictions:

* * *
  • - *

    Submit an UpdateDistribution request, providing the distribution + *

    Submit an UpdateDistribution request, providing the updated distribution * configuration. The new configuration replaces the existing configuration. The * values that you specify in an UpdateDistribution request are not * merged into your existing configuration. Make sure to include all fields: the diff --git a/clients/client-cloudfront/src/models/models_1.ts b/clients/client-cloudfront/src/models/models_1.ts index 9c7fffe34ef7..ceb07b312b2c 100644 --- a/clients/client-cloudfront/src/models/models_1.ts +++ b/clients/client-cloudfront/src/models/models_1.ts @@ -5243,7 +5243,7 @@ export interface UpdateDistributionWithStagingConfigRequest { *

    The current versions (ETag values) of both primary and staging distributions. * Provide these in the following format:

    *

    - * , + * <primary ETag>, <staging ETag> *

    * @public */ diff --git a/clients/client-cloudfront/src/pagination/ListPublicKeysPaginator.ts b/clients/client-cloudfront/src/pagination/ListPublicKeysPaginator.ts new file mode 100644 index 000000000000..7ac029d11c47 --- /dev/null +++ b/clients/client-cloudfront/src/pagination/ListPublicKeysPaginator.ts @@ -0,0 +1,24 @@ +// smithy-typescript generated code +import { createPaginator } from "@smithy/core"; +import { Paginator } from "@smithy/types"; + +import { CloudFrontClient } from "../CloudFrontClient"; +import { + ListPublicKeysCommand, + ListPublicKeysCommandInput, + ListPublicKeysCommandOutput, +} from "../commands/ListPublicKeysCommand"; +import { CloudFrontPaginationConfiguration } from "./Interfaces"; + +/** + * @public + */ +export const paginateListPublicKeys: ( + config: CloudFrontPaginationConfiguration, + input: ListPublicKeysCommandInput, + ...rest: any[] +) => Paginator = createPaginator< + CloudFrontPaginationConfiguration, + ListPublicKeysCommandInput, + ListPublicKeysCommandOutput +>(CloudFrontClient, ListPublicKeysCommand, "Marker", "PublicKeyList.NextMarker", "MaxItems"); diff --git a/clients/client-cloudfront/src/pagination/index.ts b/clients/client-cloudfront/src/pagination/index.ts index 1df24413c840..c8d5a65d52a8 100644 --- a/clients/client-cloudfront/src/pagination/index.ts +++ b/clients/client-cloudfront/src/pagination/index.ts @@ -4,4 +4,5 @@ export * from "./ListCloudFrontOriginAccessIdentitiesPaginator"; export * from "./ListDistributionsPaginator"; export * from "./ListInvalidationsPaginator"; export * from "./ListKeyValueStoresPaginator"; +export * from "./ListPublicKeysPaginator"; export * from "./ListStreamingDistributionsPaginator"; diff --git a/clients/client-cloudfront/src/waiters/waitForDistributionDeployed.ts b/clients/client-cloudfront/src/waiters/waitForDistributionDeployed.ts index 4ab97e102822..40764bebbf28 100644 --- a/clients/client-cloudfront/src/waiters/waitForDistributionDeployed.ts +++ b/clients/client-cloudfront/src/waiters/waitForDistributionDeployed.ts @@ -30,7 +30,7 @@ export const waitForDistributionDeployed = async ( params: WaiterConfiguration, input: GetDistributionCommandInput ): Promise => { - const serviceDefaults = { minDelay: 60, maxDelay: 120 }; + const serviceDefaults = { minDelay: 60, maxDelay: 2100 }; return createWaiter({ ...serviceDefaults, ...params }, input, checkState); }; /** @@ -42,7 +42,7 @@ export const waitUntilDistributionDeployed = async ( params: WaiterConfiguration, input: GetDistributionCommandInput ): Promise => { - const serviceDefaults = { minDelay: 60, maxDelay: 120 }; + const serviceDefaults = { minDelay: 60, maxDelay: 2100 }; const result = await createWaiter({ ...serviceDefaults, ...params }, input, checkState); return checkExceptions(result); }; diff --git a/clients/client-cloudfront/src/waiters/waitForInvalidationCompleted.ts b/clients/client-cloudfront/src/waiters/waitForInvalidationCompleted.ts index 7febce31ef44..ed0499b03201 100644 --- a/clients/client-cloudfront/src/waiters/waitForInvalidationCompleted.ts +++ b/clients/client-cloudfront/src/waiters/waitForInvalidationCompleted.ts @@ -30,7 +30,7 @@ export const waitForInvalidationCompleted = async ( params: WaiterConfiguration, input: GetInvalidationCommandInput ): Promise => { - const serviceDefaults = { minDelay: 20, maxDelay: 120 }; + const serviceDefaults = { minDelay: 20, maxDelay: 600 }; return createWaiter({ ...serviceDefaults, ...params }, input, checkState); }; /** @@ -42,7 +42,7 @@ export const waitUntilInvalidationCompleted = async ( params: WaiterConfiguration, input: GetInvalidationCommandInput ): Promise => { - const serviceDefaults = { minDelay: 20, maxDelay: 120 }; + const serviceDefaults = { minDelay: 20, maxDelay: 600 }; const result = await createWaiter({ ...serviceDefaults, ...params }, input, checkState); return checkExceptions(result); }; diff --git a/clients/client-cloudfront/src/waiters/waitForStreamingDistributionDeployed.ts b/clients/client-cloudfront/src/waiters/waitForStreamingDistributionDeployed.ts index 6c0b0a0db41c..3c232fc953cc 100644 --- a/clients/client-cloudfront/src/waiters/waitForStreamingDistributionDeployed.ts +++ b/clients/client-cloudfront/src/waiters/waitForStreamingDistributionDeployed.ts @@ -36,7 +36,7 @@ export const waitForStreamingDistributionDeployed = async ( params: WaiterConfiguration, input: GetStreamingDistributionCommandInput ): Promise => { - const serviceDefaults = { minDelay: 60, maxDelay: 120 }; + const serviceDefaults = { minDelay: 60, maxDelay: 1500 }; return createWaiter({ ...serviceDefaults, ...params }, input, checkState); }; /** @@ -48,7 +48,7 @@ export const waitUntilStreamingDistributionDeployed = async ( params: WaiterConfiguration, input: GetStreamingDistributionCommandInput ): Promise => { - const serviceDefaults = { minDelay: 60, maxDelay: 120 }; + const serviceDefaults = { minDelay: 60, maxDelay: 1500 }; const result = await createWaiter({ ...serviceDefaults, ...params }, input, checkState); return checkExceptions(result); }; diff --git a/codegen/sdk-codegen/aws-models/cloudfront.json b/codegen/sdk-codegen/aws-models/cloudfront.json index f57ea7fba585..b821dd9fc3a6 100644 --- a/codegen/sdk-codegen/aws-models/cloudfront.json +++ b/codegen/sdk-codegen/aws-models/cloudfront.json @@ -1,33 +1,5 @@ { "smithy": "2.0", - "metadata": { - "suppressions": [ - { - "id": "HttpMethodSemantics", - "namespace": "*" - }, - { - "id": "HttpResponseCodeSemantics", - "namespace": "*" - }, - { - "id": "PaginatedTrait", - "namespace": "*" - }, - { - "id": "HttpHeaderTrait", - "namespace": "*" - }, - { - "id": "HttpUriConflict", - "namespace": "*" - }, - { - "id": "Service", - "namespace": "*" - } - ] - }, "shapes": { "com.amazonaws.cloudfront#AccessControlAllowHeadersList": { "type": "list", @@ -3914,6 +3886,54 @@ ], "traits": { "smithy.api#documentation": "

    Creates a CloudFront function.

    \n

    To create a function, you provide the function code and some configuration information\n\t\t\tabout the function. The response contains an Amazon Resource Name (ARN) that uniquely\n\t\t\tidentifies the function.

    \n

    When you create a function, it's in the DEVELOPMENT stage. In this stage,\n\t\t\tyou can test the function with TestFunction, and update it with\n\t\t\t\tUpdateFunction.

    \n

    When you're ready to use your function with a CloudFront distribution, use\n\t\t\t\tPublishFunction to copy the function from the DEVELOPMENT\n\t\t\tstage to LIVE. When it's live, you can attach the function to a\n\t\t\tdistribution's cache behavior, using the function's ARN.

    ", + "smithy.api#examples": [ + { + "title": "To create a function", + "documentation": "Use the following command to create a function.", + "input": { + "Name": "my-function-name", + "FunctionConfig": { + "Comment": "my-function-comment", + "Runtime": "cloudfront-js-2.0", + "KeyValueStoreAssociations": { + "Quantity": 1, + "Items": [ + { + "KeyValueStoreARN": "arn:aws:cloudfront::123456789012:key-value-store/54947df8-0e9e-4471-a2f9-9af509fb5889" + } + ] + } + }, + "FunctionCode": "function-code.js" + }, + "output": { + "FunctionSummary": { + "Name": "my-function-name", + "Status": "UNPUBLISHED", + "FunctionConfig": { + "Comment": "my-function-comment", + "Runtime": "cloudfront-js-2.0", + "KeyValueStoreAssociations": { + "Quantity": 1, + "Items": [ + { + "KeyValueStoreARN": "arn:aws:cloudfront::123456789012:key-value-store/54947df8-0e9e-4471-a2f9-9af509fb5889" + } + ] + } + }, + "FunctionMetadata": { + "FunctionARN": "arn:aws:cloudfront::123456789012:function/my-function-name", + "Stage": "DEVELOPMENT", + "CreatedTime": "2023-11-07T19:53:50.334Z", + "LastModifiedTime": "2023-11-07T19:53:50.334Z" + } + }, + "Location": "https://cloudfront.amazonaws.com/2020-05-31/function/arn:aws:cloudfront::123456789012:function/my-function-name", + "ETag": "ETVPDKIKX0DER" + } + } + ], "smithy.api#http": { "method": "POST", "uri": "/2020-05-31/function", @@ -4175,6 +4195,32 @@ ], "traits": { "smithy.api#documentation": "

    Specifies the key value store resource to add to your account. In your account, the key value store names must be unique. You can also import key value store data in JSON format from an S3 bucket by providing a valid ImportSource that you own.

    ", + "smithy.api#examples": [ + { + "title": "To create a KeyValueStore", + "documentation": "Use the following command to create a KeyValueStore.", + "input": { + "Name": "my-keyvaluestore-name", + "Comment": "my-key-valuestore-comment", + "ImportSource": { + "SourceType": "S3", + "SourceARN": "arn:aws:s3:::my-bucket/validJSON.json" + } + }, + "output": { + "KeyValueStore": { + "Name": "my-keyvaluestore-name", + "Id": "54947df8-0e9e-4471-a2f9-9af509fb5889", + "Comment": "my-key-valuestore-comment", + "ARN": "arn:aws:cloudfront::123456789012:key-value-store/54947df8-0e9e-4471-a2f9-9af509fb5889", + "Status": "PROVISIONING", + "LastModifiedTime": "2023-11-07T18:15:52.042Z" + }, + "ETag": "ETVPDKIKX0DER", + "Location": "https://cloudfront.amazonaws.com/2020-05-31/key-value-store/arn:aws:cloudfront::123456789012:key-value-store/54947df8-0e9e-4471-a2f9-9af509fb5889" + } + } + ], "smithy.api#http": { "method": "POST", "uri": "/2020-05-31/key-value-store", @@ -5673,6 +5719,16 @@ ], "traits": { "smithy.api#documentation": "

    Specifies the key value store to delete.

    ", + "smithy.api#examples": [ + { + "title": "To delete a KeyValueStore", + "documentation": "Use the following command to delete a KeyValueStore.", + "input": { + "Name": "my-keyvaluestore-name", + "IfMatch": "ETVPDKIKX0DER" + } + } + ], "smithy.api#http": { "method": "DELETE", "uri": "/2020-05-31/key-value-store/{Name}", @@ -6196,6 +6252,26 @@ ], "traits": { "smithy.api#documentation": "

    Specifies the key value store and its configuration.

    ", + "smithy.api#examples": [ + { + "title": "To describe a KeyValueStore", + "documentation": "Use the following command to describe a KeyValueStore.", + "input": { + "Name": "my-keyvaluestore-name" + }, + "output": { + "KeyValueStore": { + "Name": "my-keyvaluestore-name", + "Id": "54947df8-0e9e-4471-a2f9-9af509fb5889", + "Comment": "my-key-valuestore-comment", + "ARN": "arn:aws:cloudfront::123456789012:key-value-store/54947df8-0e9e-4471-a2f9-9af509fb5889", + "Status": "READY", + "LastModifiedTime": "2023-11-07T18:20:33.056Z" + }, + "ETag": "ETVPDKIKX0DER" + } + } + ], "smithy.api#http": { "method": "GET", "uri": "/2020-05-31/key-value-store/{Name}", @@ -8169,7 +8245,8 @@ } } ], - "minDelay": 60 + "minDelay": 60, + "maxDelay": 2100 } } } @@ -8649,7 +8726,8 @@ } } ], - "minDelay": 20 + "minDelay": 20, + "maxDelay": 600 } } } @@ -9481,7 +9559,8 @@ } } ], - "minDelay": 60 + "minDelay": 60, + "maxDelay": 1500 } } } @@ -11833,6 +11912,32 @@ ], "traits": { "smithy.api#documentation": "

    Specifies the key value stores to list.

    ", + "smithy.api#examples": [ + { + "title": "To get a list of KeyValueStores", + "documentation": "The following command retrieves a list of KeyValueStores with READY status.", + "input": { + "Status": "READY" + }, + "output": { + "KeyValueStoreList": { + "NextMarker": "", + "MaxItems": 100, + "Quantity": 1, + "Items": [ + { + "Name": "my-keyvaluestore-name", + "Id": "54947df8-0e9e-4471-a2f9-9af509fb5889", + "Comment": "", + "ARN": "arn:aws:cloudfront::123456789012:key-value-store/54947df8-0e9e-4471-a2f9-9af509fb5889", + "Status": "READY", + "LastModifiedTime": "2023-11-07T18:45:21.069Z" + } + ] + } + } + } + ], "smithy.api#http": { "method": "GET", "uri": "/2020-05-31/key-value-store", @@ -11904,7 +12009,7 @@ } ], "traits": { - "smithy.api#documentation": "

    Gets the list of CloudFront origin access controls in this Amazon Web Services account.

    \n

    You can optionally specify the maximum number of items to receive in the response. If\n\t\t\tthe total number of items in the list exceeds the maximum that you specify, or the\n\t\t\tdefault maximum, the response is paginated. To get the next page of items, send another\n\t\t\trequest that specifies the NextMarker value from the current response as\n\t\t\tthe Marker value in the next request.

    ", + "smithy.api#documentation": "

    Gets the list of CloudFront origin access controls (OACs) in this Amazon Web Services account.

    \n

    You can optionally specify the maximum number of items to receive in the response. If\n\t\t\tthe total number of items in the list exceeds the maximum that you specify, or the\n\t\t\tdefault maximum, the response is paginated. To get the next page of items, send another\n\t\t\trequest that specifies the NextMarker value from the current response as\n\t\t\tthe Marker value in the next request.

    \n \n

    If you're not using origin access controls for your Amazon Web Services account, the\n\t\t\t\t\tListOriginAccessControls operation doesn't return the\n\t\t\t\t\tItems element in the response.

    \n
    ", "smithy.api#http": { "method": "GET", "uri": "/2020-05-31/origin-access-control", @@ -12040,6 +12145,12 @@ "method": "GET", "uri": "/2020-05-31/public-key", "code": 200 + }, + "smithy.api#paginated": { + "inputToken": "Marker", + "outputToken": "PublicKeyList.NextMarker", + "items": "PublicKeyList.Items", + "pageSize": "MaxItems" } } }, @@ -17377,7 +17488,7 @@ } ], "traits": { - "smithy.api#documentation": "

    Updates the configuration for a CloudFront distribution.

    \n

    The update process includes getting the current distribution configuration, updating\n\t\t\tit to make your changes, and then submitting an UpdateDistribution request\n\t\t\tto make the updates.

    \n

    \n To update a web distribution using the CloudFront\n\t\t\tAPI\n

    \n
      \n
    1. \n

      Use GetDistributionConfig to get the current configuration,\n\t\t\t\t\tincluding the version identifier (ETag).

      \n
    2. \n
    3. \n

      Update the distribution configuration that was returned in the response. Note\n\t\t\t\t\tthe following important requirements and restrictions:

      \n
        \n
      • \n

        You must rename the ETag field to IfMatch,\n\t\t\t\t\t\t\tleaving the value unchanged. (Set the value of IfMatch to\n\t\t\t\t\t\t\tthe value of ETag, then remove the ETag\n\t\t\t\t\t\t\tfield.)

        \n
      • \n
      • \n

        You can't change the value of CallerReference.

        \n
      • \n
      \n
    4. \n
    5. \n

      Submit an UpdateDistribution request, providing the distribution\n\t\t\t\t\tconfiguration. The new configuration replaces the existing configuration. The\n\t\t\t\t\tvalues that you specify in an UpdateDistribution request are not\n\t\t\t\t\tmerged into your existing configuration. Make sure to include all fields: the\n\t\t\t\t\tones that you modified and also the ones that you didn't.

      \n
    6. \n
    ", + "smithy.api#documentation": "

    Updates the configuration for a CloudFront distribution.

    \n

    The update process includes getting the current distribution configuration, updating\n\t\t\tit to make your changes, and then submitting an UpdateDistribution request\n\t\t\tto make the updates.

    \n

    \n To update a web distribution using the CloudFront\n\t\t\tAPI\n

    \n
      \n
    1. \n

      Use GetDistributionConfig to get the current configuration,\n\t\t\t\t\tincluding the version identifier (ETag).

      \n
    2. \n
    3. \n

      Update the distribution configuration that was returned in the response. Note\n\t\t\t\t\tthe following important requirements and restrictions:

      \n
        \n
      • \n

        You must copy the ETag field value from the response. (You'll use it for the IfMatch parameter in your request.) Then, remove the ETag\n\t\t\t\t\t\t\tfield from the distribution configuration.

        \n
      • \n
      • \n

        You can't change the value of CallerReference.

        \n
      • \n
      \n
    4. \n
    5. \n

      Submit an UpdateDistribution request, providing the updated distribution\n\t\t\t\t\tconfiguration. The new configuration replaces the existing configuration. The\n\t\t\t\t\tvalues that you specify in an UpdateDistribution request are not\n\t\t\t\t\tmerged into your existing configuration. Make sure to include all fields: the\n\t\t\t\t\tones that you modified and also the ones that you didn't.

      \n
    6. \n
    ", "smithy.api#http": { "method": "PUT", "uri": "/2020-05-31/distribution/{Id}/config", @@ -17664,7 +17775,7 @@ "IfMatch": { "target": "com.amazonaws.cloudfront#string", "traits": { - "smithy.api#documentation": "

    The current versions (ETag values) of both primary and staging distributions.\n\t\t\tProvide these in the following format:

    \n

    \n , \n

    ", + "smithy.api#documentation": "

    The current versions (ETag values) of both primary and staging distributions.\n\t\t\tProvide these in the following format:

    \n

    \n <primary ETag>, <staging ETag>\n

    ", "smithy.api#httpHeader": "If-Match" } } @@ -17939,6 +18050,54 @@ ], "traits": { "smithy.api#documentation": "

    Updates a CloudFront function.

    \n

    You can update a function's code or the comment that describes the function. You\n\t\t\tcannot update a function's name.

    \n

    To update a function, you provide the function's name and version (ETag\n\t\t\tvalue) along with the updated function code. To get the name and version, you can use\n\t\t\t\tListFunctions and DescribeFunction.

    ", + "smithy.api#examples": [ + { + "title": "To update a function", + "documentation": "Use the following command to update a function.", + "input": { + "Name": "my-function-name", + "FunctionConfig": { + "Comment": "my-changed-comment", + "Runtime": "cloudfront-js-2.0", + "KeyValueStoreAssociations": { + "Quantity": 1, + "Items": [ + { + "KeyValueStoreARN": "arn:aws:cloudfront::123456789012:key-value-store/54947df8-0e9e-4471-a2f9-9af509fb5889" + } + ] + } + }, + "FunctionCode": "function-code-changed.js", + "IfMatch": "ETVPDKIKX0DER" + }, + "output": { + "FunctionSummary": { + "Name": "my-function-name", + "Status": "UNPUBLISHED", + "FunctionConfig": { + "Comment": "my-changed-comment", + "Runtime": "cloudfront-js-2.0", + "KeyValueStoreAssociations": { + "Quantity": 1, + "Items": [ + { + "KeyValueStoreARN": "arn:aws:cloudfront::123456789012:key-value-store/54947df8-0e9e-4471-a2f9-9af509fb5889" + } + ] + } + }, + "FunctionMetadata": { + "FunctionARN": "arn:aws:cloudfront::123456789012:function/my-function-name", + "Stage": "DEVELOPMENT", + "CreatedTime": "2023-11-07T19:53:50.334Z", + "LastModifiedTime": "2023-11-07T20:01:37.174Z" + } + }, + "ETag": "E3UN6WX5RRO2AG" + } + } + ], "smithy.api#http": { "method": "PUT", "uri": "/2020-05-31/function/{Name}", @@ -18127,6 +18286,28 @@ ], "traits": { "smithy.api#documentation": "

    Specifies the key value store to update.

    ", + "smithy.api#examples": [ + { + "title": "To update a KeyValueStore", + "documentation": "Use the following command to update a KeyValueStore.", + "input": { + "Name": "my-keyvaluestore-name", + "Comment": "my-changed-comment", + "IfMatch": "ETVPDKIKX0DER" + }, + "output": { + "KeyValueStore": { + "Name": "my-keyvaluestore-name", + "Id": "54947df8-0e9e-4471-a2f9-9af509fb5889", + "Comment": "my-changed-comment", + "ARN": "arn:aws:cloudfront::123456789012:key-value-store/54947df8-0e9e-4471-a2f9-9af509fb5889", + "Status": "READY", + "LastModifiedTime": "2023-11-07T18:45:21.069Z" + }, + "ETag": "E3UN6WX5RRO2AG" + } + } + ], "smithy.api#http": { "method": "PUT", "uri": "/2020-05-31/key-value-store/{Name}",