This project automates the creation and management of multiple Spotify playlists using Terraform. It utilizes the Spotify API to interact with your Spotify account and create playlists tailored for different occasions such as morning, evening, party night, etc.
Before starting, make sure you have the following:
- Terraform Installed: Ensure Terraform is installed on your machine.
- Docker Installed: Make sure Docker is installed and running.
- Spotify Account: You need a Spotify account (free tier is sufficient).
- Spotify Developer Account: Register and create an application to get the Client ID and Client Secret.
- VS Code Editor: Recommended for editing Terraform files.
- Create a new directory for your Terraform project and navigate to it in your terminal.
- Create a file named
main.tf
.
In main.tf
, define the Spotify provider:
provider "spotify" {
api_key = var.spotify_api_key
}
To interact with Spotify's API, you need to create a Spotify Developer App:
- Go to the Spotify Developer Dashboard.
- Log in with your Spotify account.
- Click on "Create an App" and fill in the required details.
- Note down the
Client ID
andClient Secret
.
Create a .env
file to store your Spotify application's Client ID and Secret:
SPOTIFY_CLIENT_ID=<your_spotify_client_id>
SPOTIFY_CLIENT_SECRET=<your_spotify_client_secret>
Ensure Docker Desktop is running, then start the authorization proxy server:
docker run --rm -it -p 27228:27228 --env-file .env ghcr.io/conradludgate/spotify-auth-proxy
- Initialize the Terraform configuration:
terraform init
- Apply the Terraform configuration:
terraform apply
After applying the Terraform configuration, log in to your Spotify account and verify that the playlists have been created and populated with the specified tracks.
Automating Spotify playlist management with Terraform streamlines the process of creating and maintaining playlists for various occasions. Customize the playlists and tracks according to your preferences to enhance your music listening experience.