EC2 の起動部分はドキュメントに説明があるため,割愛します.余談になるのですが,接続する時にこれまでは RDP クライアントを使ってきたので今回も使おうとしたところ System Manager Fleet Manager があったので使ってみました.インバウンドでポートを開放しなくてもブラウザで OS にログインできちゃうのがすごかったので,もし使ったことがない方は是非試して欲しいです.EC2 が起動したら Active Directory のインストールと AD Connector が接続するためのサービスアカウントを追加します.既に様々な記事を公開している方がいるので,ここも割愛します.
AD Connector で EC2 on Active Directory に接続します.これは設定のウィザードに沿って進めば問題ないです.自分はポート開放がちゃんとできてなくてかなり詰まってしまったので,そこを誤らなければスムーズに接続できちゃうと思います.加えて AD Connector を Workspaces が使えるように登録します.AD Connector の設定時に指定したサブネットとは異なるサブネットを登録する必要がありますが,それ以外は特に詰まるところなく設定できました.
プロジェクト初期化して, terraform apply で適用してみます.期待通りに First My project を追加できました.
❯ terraform init
~中略~
Terraform has been successfully initialized!
~中略~
❯ terraform apply
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
# bytebase_project.first_my_project will be created
+ resource "bytebase_project""first_my_project"{
+ id =(known after apply)
+ key ="FMP"
+ resource_id ="first-my-project"
+ schema_change ="DDL"
+ tenant_mode ="TENANT_MODE_DISABLED"
+ title ="Firest My project"
+ visibility ="VISIBILITY_PUBLIC"
+ workflow ="UI"}
Plan: 1 to add, 0 to change, 0 to destroy.
Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.
Enter a value: yes
bytebase_project.first_my_project: Creating...
bytebase_project.first_my_project: Creation complete after 0s [id=projects/first-my-project]
╷
│ Warning: Project not exists
│
│ with bytebase_project.first_my_project,
│ on project.tf line 1, in resource "bytebase_project""first_my_project":
│ 1: resource "bytebase_project""first_my_project"{
│
│ Project projects/first-my-project not exists, try to exec the create operation
╵
Apply complete! Resources: 1 added, 0 changed, 0 destroyed.