Packerizing your config
1. Install packer [here](https://www.packer.io/downloads).
Packerizing your config
- Install packer here.
- Read up on the docs for your cloud/platform/stack (we're using AWS here).
- You can use what's in this directory to get started!
Set up authentication
You'll need API access to your amazon account. To get this set up, log into your AWS Admin Console and navigate to: - IAM - Users - "Add Users" and pick a username - Select AWS Credential Type: "Access key - Programmatic access" - "Next - Permissions" -- add fine-grained permissions here, "Attach policies directly" and attaching AdministratorAccess will work, but it's not particularly safe or best practice. - After creating the IAM User, copy the "AWS Access Key ID" and "Secret Access key" that's displayed. The secret key will only be shown this once, so store it safely!
Export those keys in the shell where you'll be running packer commands, and you'll be good to go:
export AWS_ACCESS_KEY_ID="<YOUR_AWS_ACCESS_KEY_ID>"
export AWS_SECRET_ACCESS_KEY="<YOUR_AWS_SECRET_ACCESS_KEY>"
Run Packer
packer init .
# Format your packer code, if you've changed my example around
packer fmt .
packer validate .
Now you can build your AMI!
packer build wordpress-aws-ubuntu.pkr.hcl
Write down important output
This is an ugly hack which I made to keep things simple and easy to follow:
- The autogenerated mysql password is echoed out to the shell AND written into /etc/packer-setup.log by default.
Use your instance!
- Go to your AMIs -- they're region specific, so make sure your packer builder region and the one your're looking at in your AWS Console are the same.
- Select the AMI you just built and click "Launch instance from AMI"
- Configure EC2 Instance options like your SSH key and how big the storage volume should be
- Launch the instance and wait for it to boot.
- Grab your instance's public IP (click on the instance, then select the "networking" tab and look for "Public IPv4 address")
- Connect via SSH! (username is ubuntu)
ssh ubuntu@yourInstanceIPAddress
Check out your webite!
Open the WordPress Installer in your Browser http://example.com/wp-admin/setup-config.php
Debugging
If you run into any errors after making modifications to this script, debug them! That's where all the learning really happens, anyway. Here are some resources:
- Packer Debugging -
-debugand-on-error=askare extremely useful.
TODO
- get vars into the config files (they've got tutorialinux hardcoded in them)
- compare and tune php.ini
- mysql server root password and mysql_secure_installation
- occasional failure to find mysql server... ==> packer-wordpress-tutorialinux-aws.amazon-ebs.ubuntu: E: Unable to locate package mysql-server
Basics Course
- see this readme
- decompose hands-on course scripts into scriptable chunks
- base setup script (apt installs)
- discuss MANUAL steps -- why are they manual? Can we automate or defer them?
- noninteractive mysql install?
- add vars to make it more configurable
- config file templating using packer vars
Related Documents
How you work
You are a coding agent running in the Codex CLI, a terminal-based coding assistant. Codex CLI is an open source project led by OpenAI. You are expected to be precise, safe, and helpful.
内置 Agent 提示词
Claude Code 内置了 6 个子 Agent,各自有独立的系统提示词和工具权限,用于分工处理不同类型的子任务。以下是每个 Agent 的完整系统提示词。
Overture Integration for Claude Code
You have access to **Overture**, an MCP server that visualizes your execution plans as interactive flowcharts before you write any code.
SolidInvoice - AI Assistant Guide
This document provides comprehensive guidance for AI assistants working with the SolidInvoice codebase. It covers the architecture, conventions, workflows, and best practices to help you understand and effectively contribute to this project.