🎉
cdktf
node v22
innerError Error: Cannot find module '../build/Debug/pty.node'
node-gypを手動で入れれば動くとのこと。
またNode20以下であればそのまま動く。マジかよ。
We currently support Node.js versions 17, 18, 19, and 20.
https://developer.hashicorp.com/terraform/cdktf/cli-reference/cli-configuration#node-gyp-errors
cdktf diff
[2025-03-19T00:06:02.938] [INFO] default - Unable to determine Terraform version: Error: Terraform CLI not present - Please install a current version https://learn.hashicorp.com/terraform/getting-started/install.html
execvp(3) failed.: No such file or directory
terraform
brew install hashicorp/tap/terraform
==> Installing terraform from hashicorp/tap
Error: Your Command Line Tools are too outdated.
Update them from Software Update in System Settings.
If that doesn't show you any updates, run:
sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --install
Alternatively, manually download them from:
https://developer.apple.com/download/all/.
You should download the Command Line Tools for Xcode 16.0.
brew --config
HOMEBREW_VERSION: 4.4.24
ORIGIN: https://github.com/Homebrew/brew
HEAD: 2f6db3757e6c8533750264c0d397c3671665e2f4
Last commit: 8 days ago
Branch: stable
Core tap JSON: 18 Mar 15:21 UTC
Core cask tap JSON: 18 Mar 15:21 UTC
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_MAKE_JOBS: 8
Homebrew Ruby: 3.3.7 => /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.7/bin/ruby
CPU: octa-core 64-bit arm_blizzard_avalanche
Clang: 15.0.0 build 1500
Git: 2.39.3 => /Library/Developer/CommandLineTools/usr/bin/git
Curl: 8.7.1 => /usr/bin/curl
macOS: 15.2-arm64
CLT: 15.0.0.0.1.1694021235
Xcode: N/A
Rosetta 2: false
sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --install
brew --config
...
CLT: 16.2.0.0.1.1733547573
brew tap hashicorp/tap
brew install hashicorp/tap/terraform
gcloud
gcloud config configurations list
gcloud auth application-default login
gcloud config set project __project_name__
gcloud config configurations create __name__
gcloud auth login
gcloud config set account ruiewo@example.com
Error: Failed to get existing workspaces: querying Cloud Storage failed: storage: bucket doesn't exist
初回実行時にGcsBackendがないためエラーになる。
事前に手動でBucketを作成するか、別のterraformから事前にbucketを作成しておく。
new GcsBackend(this, {
bucket: `tf-state`,
prefix: "terraform/state",
})
Set IAM Binding for role "roles/storage.objectAdmin" on "project" returned error
Error 403: Policy update access denied., forbidden
実行者の権限がeditor権限だったためiamポリシーを変更できず。
new ProjectIamBinding(this, "storage-object-admin", {
project,
role: "roles/storage.objectAdmin",
members: [`serviceAccount:${storageServiceAccount.email}`],
})
Error: Error acquiring the state lock
terraform force-unlock __ID__
> Local state cannot be unlocked by another process
cdktf.outディレクトリを丸ごと消す。
=> 動かない
=> GcsBackendの中身全部消す
Discussion