---
AWSTemplateFormatVersion: '2010-09-09'
Description: CodeBuild Source Credential for GitHub

Parameters:
  SecretName:
    Type: String
    Description: Name of secret with GitHub token
    Default: "github"

Resources:
  CodeBuildSourceCredential:
    Type: AWS::CodeBuild::SourceCredential
    Properties:
      AuthType: PERSONAL_ACCESS_TOKEN
      ServerType: GITHUB
      Token: !Sub "{{resolve:secretsmanager:${SecretName}:SecretString}}"