AWSTemplateFormatVersion: '2010-09-09' Parameters: InstanceType: Type: String Default: t3.micro Description: EC2 machine instance size (see https://aws.amazon.com/ec2/instance-types/) KeyName: Type: AWS::EC2::KeyPair::KeyName Description: SSH key to use for logging in (see https://docs.aws.amazon.com/ground-station/latest/ug/create-ec2-ssh-key-pair.html) AmiId: Type: AWS::SSM::Parameter::Value Default: '/aws/service/ami-amazon-linux-latest/amzn2-ami-hvm-x86_64-gp2' Description: Amazon Linux 2 image ID (leave this as is) VolumeSize: Type: Number Default: 64 MinValue: 16 Description: Disk size in Gb to allocate for storing downloaded episodes PodsyncVersion: Type: String Default: latest Description: Podsync version to use (see https://github.com/mxpv/podsync/releases) PodsyncPort: Type: Number Default: 8080 MaxValue: 65535 Description: Server port to use YouTubeApiKey: Type: String Default: '' Description: | Key to use for YouTube API access (see https://github.com/mxpv/podsync/blob/master/docs/how_to_get_youtube_api_key.md) VimeoAccessToken: Type: String Default: '' Description: | Key to use for Vimeo API access (see https://github.com/mxpv/podsync/blob/master/docs/how_to_get_vimeo_token.md) FeedId: Type: String Default: 'ID1' AllowedPattern: '.+' # Required Description: | ID to use for the feed (you'll access it as http://localhost/ID1.xml) FeedUrl: Type: String AllowedPattern: '.+' Description: | YouTube or Vimeo URL to host with Podsync (for example: https://www.youtube.com/user/XYZ) PageSize: Type: Number Default: 50 MinValue: 10 Description: | The number of episodes to query each time Format: Type: String AllowedValues: - 'audio' - 'video' Default: 'video' Description: Feed format (audio or video) Quality: Type: String AllowedValues: - 'high' - 'low' Default: 'high' Description: Feed quality (high or low) Metadata: AWS::CloudFormation::Interface: ParameterGroups: - Label: default: 'VM configuration' Parameters: - InstanceType - KeyName - AmiId - VolumeSize - Label: default: 'Podsync configuration' Parameters: - PodsyncVersion - PodsyncPort - YouTubeApiKey - VimeoAccessToken - Label: default: 'Feed configuration' Parameters: - FeedId - FeedUrl - PageSize - Format - Quality ParameterLabels: InstanceType: default: 'Instance type' KeyName: default: 'SSH key name' AmiId: default: 'AMI ID' VolumeSize: default: 'Volume size' PodsyncVersion: default: 'Version' PodsyncPort: default: 'Server port' YouTubeApiKey: default: 'YouTube API Key' VimeoAccessToken: default: 'Vimeo Token' FeedId: default: 'Feed ID' FeedUrl: default: 'Feed URL' PageSize: default: 'Page size' Resources: Ec2Instance: Type: AWS::EC2::Instance CreationPolicy: ResourceSignal: Count: 1 Properties: InstanceType: !Ref InstanceType KeyName: !Ref KeyName ImageId: !Ref AmiId SecurityGroups: - !Ref AccessSecurityGroup EbsOptimized: true BlockDeviceMappings: - DeviceName: /dev/xvda Ebs: VolumeSize: !Ref VolumeSize IamInstanceProfile: !Ref SsmInstanceProfile Tags: - Key: 'Name' Value: !Sub "${AWS::StackName}" UserData: Fn::Base64: !Sub | #!/usr/bin/env bash set -ex trap '/opt/aws/bin/cfn-signal --exit-code 1 --resource Ec2Instance --region ${AWS::Region} --stack ${AWS::StackName}' ERR # Install Docker yum update -y amazon-linux-extras install docker systemctl start docker usermod -a -G docker ec2-user export publichost=$(ec2-metadata --public-hostname | cut -d ' ' -f2) # Create configuration file mkdir -p /home/ec2-user/podsync/data tee /home/ec2-user/podsync/config.toml <