AWS SDK Version 3 for .NET
API 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.

Creates a key group that you can use with CloudFront signed URLs and signed cookies.

To create a key group, you must specify at least one public key for the key group. After you create a key group, you can reference it from one or more cache behaviors. When you reference a key group in a cache behavior, CloudFront requires signed URLs or signed cookies for all requests that match the cache behavior. The URLs or cookies must be signed with a private key whose corresponding public key is in the key group. The signed URL or cookie contains information about which public key CloudFront should use to verify the signature. For more information, see Serving private content in the Amazon CloudFront Developer Guide.

Note:

For .NET Core this operation is only available in asynchronous form. Please refer to CreateKeyGroupAsync.

Namespace: Amazon.CloudFront
Assembly: AWSSDK.CloudFront.dll
Version: 3.x.y.z

Syntax

C#
public virtual CreateKeyGroupResponse CreateKeyGroup(
         CreateKeyGroupRequest request
)

Parameters

request
Type: Amazon.CloudFront.Model.CreateKeyGroupRequest

Container for the necessary parameters to execute the CreateKeyGroup service method.

Return Value


The response from the CreateKeyGroup service method, as returned by CloudFront.

Exceptions

ExceptionCondition
InvalidArgumentException An argument is invalid.
KeyGroupAlreadyExistsException A key group with this name already exists. You must provide a unique name. To modify an existing key group, use UpdateKeyGroup.
TooManyKeyGroupsException You have reached the maximum number of key groups for this Amazon Web Services account. For more information, see Quotas (formerly known as limits) in the Amazon CloudFront Developer Guide.
TooManyPublicKeysInKeyGroupException The number of public keys in this key group is more than the maximum allowed. For more information, see Quotas (formerly known as limits) in the Amazon CloudFront Developer Guide.

Version Information

.NET Framework:
Supported in: 4.5, 4.0, 3.5

See Also