Resource: aws_cloudfront_key_group

Example Usage

The following example below creates a CloudFront key group.

resource "aws_cloudfront_public_key" "example" {
  comment     = "example public key"
  encoded_key = file("public_key.pem")
  name        = "example-key"
}

resource "aws_cloudfront_key_group" "example" {
  comment = "example key group"
  items   = [aws_cloudfront_public_key.example.id]
  name    = "example-key-group"
}

Argument Reference

This resource supports the following arguments:

Attribute Reference

This resource exports the following attributes in addition to the arguments above:

Import

In Terraform v1.5.0 and later, use an import block to import CloudFront Key Group using the id. For example:

import {
  to = aws_cloudfront_key_group.example
  id = "4b4f2r1c-315d-5c2e-f093-216t50jed10f"
}

Using terraform import, import CloudFront Key Group using the id. For example:

% terraform import aws_cloudfront_key_group.example 4b4f2r1c-315d-5c2e-f093-216t50jed10f