- AWS Account
- AWS CLI configured
- Terraform installed
- Copy
.env.localto.envand fill in your AWS credentials:
cp .env.local .env- Edit
.envwith your AWS credentials:
AWS_ACCESS_KEY_ID=your-access-key-id
AWS_SECRET_ACCESS_KEY=your-secret-access-key
AWS_DEFAULT_REGION=ap-northeast-1
terraform initInitialize the Terraform working directory. Downloads provider plugins and modules.
terraform validateCheck whether the configuration is valid.
terraform fmtAutomatically format Terraform configuration files to a canonical format.
terraform planShow what changes Terraform will make to your infrastructure.
terraform applyApply the changes required to reach the desired state of the configuration.
terraform apply -auto-approveApply changes without prompting for confirmation.
terraform destroyDestroy all resources managed by this Terraform configuration.
terraform showDisplay the current state or a saved plan.
terraform state listList all resources in the state file.
terraform outputDisplay output values from the state file.
terraform refreshUpdate the state file with real infrastructure.
aws sts get-caller-identityVerify which AWS account and user you're authenticated as.