AWSTemplateFormatVersion: 2010-09-09
Description: >-
  Create the Origin access identity for CloudFront
Parameters:
  OriginIdentityComment:
    Description: The name of the Origin Identity
    Type: String
    Default: Website-Bucket-Access
Resources:
  OriginID:
    Type: AWS::CloudFront::CloudFrontOriginAccessIdentity
    Properties: 
      CloudFrontOriginAccessIdentityConfig:
        Comment: !Ref OriginIdentityComment
Outputs:
  OriginID:
    Description: Website Origin Identity ID
    Value: !Ref OriginID
    Export:
      Name: !Join
        - '-'
        - - !Ref 'AWS::StackName'
          - OriginID