KeyGroupProps

class aws_cdk.aws_cloudfront.KeyGroupProps(*, items, comment=None, key_group_name=None)

Bases: object

Properties for creating a Public Key.

Parameters
  • items (Sequence[IPublicKey]) – A list of public keys to add to the key group.

  • comment (Optional[str]) – A comment to describe the key group. Default: - no comment

  • key_group_name (Optional[str]) – A name to identify the key group. Default: - generated from the id

ExampleMetadata

infused

Example:

# Validating signed URLs or signed cookies with Trusted Key Groups

# public key in PEM format
# public_key is of type string

pub_key = cloudfront.PublicKey(self, "MyPubKey",
    encoded_key=public_key
)

key_group = cloudfront.KeyGroup(self, "MyKeyGroup",
    items=[pub_key
    ]
)

cloudfront.Distribution(self, "Dist",
    default_behavior=cloudfront.BehaviorOptions(
        origin=origins.HttpOrigin("www.example.com"),
        trusted_key_groups=[key_group
        ]
    )
)

Attributes

comment

A comment to describe the key group.

Default
  • no comment

Return type

Optional[str]

items

A list of public keys to add to the key group.

Return type

List[IPublicKey]

key_group_name

A name to identify the key group.

Default
  • generated from the id

Return type

Optional[str]