java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.core.Construct
software.amazon.awscdk.core.Resource
software.amazon.awscdk.services.cloudfront.KeyGroup
All Implemented Interfaces:
IConstruct, IDependable, IResource, IKeyGroup, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:43.718Z") @Stability(Stable) public class KeyGroup extends Resource implements IKeyGroup
A Key Group configuration.

Example:

 // Validating signed URLs or signed cookies with Trusted Key Groups
 // public key in PEM format
 String publicKey;
 PublicKey pubKey = PublicKey.Builder.create(this, "MyPubKey")
         .encodedKey(publicKey)
         .build();
 KeyGroup keyGroup = KeyGroup.Builder.create(this, "MyKeyGroup")
         .items(List.of(pubKey))
         .build();
 Distribution.Builder.create(this, "Dist")
         .defaultBehavior(BehaviorOptions.builder()
                 .origin(new HttpOrigin("www.example.com"))
                 .trustedKeyGroups(List.of(keyGroup))
                 .build())
         .build();
 
  • Constructor Details

    • KeyGroup

      protected KeyGroup(software.amazon.jsii.JsiiObjectRef objRef)
    • KeyGroup

      protected KeyGroup(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • KeyGroup

      @Stability(Stable) public KeyGroup(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull KeyGroupProps props)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      props - This parameter is required.
  • Method Details

    • fromKeyGroupId

      @Stability(Stable) @NotNull public static IKeyGroup fromKeyGroupId(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String keyGroupId)
      Imports a Key Group from its id.

      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      keyGroupId - This parameter is required.
    • getKeyGroupId

      @Stability(Stable) @NotNull public String getKeyGroupId()
      The ID of the key group.
      Specified by:
      getKeyGroupId in interface IKeyGroup