From d34c23c602678f0a72db665f361315c6c48ccf9a Mon Sep 17 00:00:00 2001 From: b1021204 Date: Sun, 13 Oct 2024 00:00:53 +0900 Subject: [PATCH 1/3] =?UTF-8?q?=E9=8D=B5=E3=81=AE=E8=87=AA=E5=8B=95?= =?UTF-8?q?=E3=83=80=E3=82=A6=E3=83=B3=E3=83=AD=E3=83=BC=E3=83=89=E5=8F=AF?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- funawskeyb1021204 (1).pem | 27 ++++++ internal/provider/VM_resource.go | 156 +++++++++++++++++++++++++++++++ internal/provider/provider.go | 1 + main.tf | 12 +-- terraform.tfstate | 38 ++++++-- 5 files changed, 220 insertions(+), 14 deletions(-) create mode 100644 funawskeyb1021204 (1).pem diff --git a/funawskeyb1021204 (1).pem b/funawskeyb1021204 (1).pem new file mode 100644 index 0000000..ab4bd23 --- /dev/null +++ b/funawskeyb1021204 (1).pem @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEpAIBAAKCAQEAuJrIDJmxuEH8W4p5sn+FK4Mt3bDfe73QkDSZ5FPbw0DICdBy ++it9sbaerWFjKmdEKnBAxo5OJhlNNn2XJm4nP2b3cMpc24wcgQnJnxqizt1gdTsX +prUP8Vh3MC+Emf+T7eGMBXsRCNHtAdOIN14uEWUu9tkRaR6o2Z7C5WZ+6Mb+ky98 +eEY3pr8jOznFo55LmlKUFfifDBDWzOaH1YGtjOoj+HeVspZGwB/rfWWrLuSKm3jc +/8pt8WLhwE437bhi2dQ1cWiWWxveoZOvR3quOiNON4AzVKLwt58TZMRSNpcPNXUN +KFWEEhDVJo4+4+DXQDVCvFjv5lJE4cXARrnvLwIDAQABAoIBAQCrsIjN70OysuwZ +1zhIIwGf7mkB/jZbx7Xp6IIYMUX62o0xU4Ub1scYOVhquGCaV2C2d6BHCqL0HCQL +wdKKE3i9Ju6LICospqr7+DZkm0lAS/QiE8tza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dK8Vf97sM7YD +xpj7Qp2ffZvzJvTlwjXtAEUsZQ+WZyiz4t0lv37n93N6RfJvASt8/Q== +-----END RSA PRIVATE KEY----- \ No newline at end of file diff --git a/internal/provider/VM_resource.go b/internal/provider/VM_resource.go index 538efea..0bfaf62 100644 --- a/internal/provider/VM_resource.go +++ b/internal/provider/VM_resource.go @@ -23,6 +23,7 @@ var _ resource.Resource = &VMResource{} var _ resource.ResourceWithImportState = &VMResource{} var _ function.Function = &ip{} var _ function.Function = &machine_pass{} +var _ function.Function = &key{} func NewVMResource() resource.Resource { return &VMResource{} @@ -57,6 +58,9 @@ type ip struct{} // VMのパスワードをスクレイピングする関数 type machine_pass struct{} +// VM の鍵をダウンロードし、アドレスを返す関数 +type key struct{} + func NewIp() function.Function { return &ip{} } @@ -65,6 +69,10 @@ func NewMachinePass() function.Function { return &machine_pass{} } +func NewKey() function.Function { + return &key{} +} + // ipアドレススクレイピング用のメタデータ func (f *ip) Metadata(ctx context.Context, req function.MetadataRequest, resp *function.MetadataResponse) { resp.Name = "ip" @@ -129,6 +137,38 @@ func (f *machine_pass) Definition(ctx context.Context, req function.DefinitionRe } } +// 鍵ダウンロード関数用のメタデータ +func (f *key) Metadata(ctx context.Context, req function.MetadataRequest, resp *function.MetadataResponse) { + resp.Name = "key" +} + +// 鍵ダウンロード関数用の定義 +func (f *key) Definition(ctx context.Context, req function.DefinitionRequest, resp *function.DefinitionResponse) { + resp.Definition = function.Definition{ + Summary: "Download ssh key and return key address", + Description: "Pleace give usenamae, pass, env and address you want to download.", + Parameters: []function.Parameter{ + function.StringParameter{ + Name: "username", + Description: "username", + }, + function.StringParameter{ + Name: "password", + Description: "pass", + }, + function.StringParameter{ + Name: "environment", + Description: "env of VM", + }, + function.StringParameter{ + Name: "address", + Description: "address which you want to download.", + }, + }, + Return: function.StringReturn{}, + } +} + // resource用のメタデータ func (r *VMResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { resp.TypeName = req.ProviderTypeName + "_resource" @@ -543,3 +583,119 @@ func (f *machine_pass) Run(ctx context.Context, req function.RunRequest, resp *f resp.Error = function.ConcatFuncErrors(resp.Error, resp.Result.Set(ctx, machine_pass)) return } + +// 鍵ダウンロード用のrun + +func (f *key) Run(ctx context.Context, req function.RunRequest, resp *function.RunResponse) { + //var Machine_Data Machine_Data + var username string + var password string + var environment string + var address string + + // Read Terraform argument data into the variables + resp.Error = function.ConcatFuncErrors(resp.Error, req.Arguments.Get(ctx, &username, &password, &environment, &address)) + driver := agouti.ChromeDriver( + // ここでChromeOptions + agouti.ChromeOptions("prefs", map[string]interface{}{ + "download.default_directory": address, + "download.prompt_for_download": false, + "download.directory_upgrade": true, + "plugins.plugins_disabled": "Chrome PDF Viewer", + "plugins.always_open_pdf_externally": true, + }), /* + agouti.ChromeOptions("args", []string{ + "--disable-extensions", + "--disable-print-preview", + "--ignore-certificate-errors", + }),*/ + agouti.Debug, + ) + /* + デバック中のためコメントアウト + driver := agouti.ChromeDriver( + agouti.ChromeOptions( + "args", []string{ + "--headless", + "--disavle-gpu", + }), + ) + */ + log.Printf("Open Google Chorome...\n") + + if err := driver.Start(); err != nil { + log.Fatalf("Failed to start driver:%v\n", err) + } + + defer driver.Stop() + page, err := driver.NewPage() + if err != nil { + log.Fatalf("Failed to open Chorome page:%v\n", err) + } + log.Printf("Success to open Google Chorome.\n") + + // access to FUN login page.. + log.Printf("Access to FUN VM WebAPI...\n") + if err := page.Navigate("https://manage.p.fun.ac.jp/server_manage"); err != nil { + log.Fatalf("Failed to access to FUN VM WebAPI:%v\n", err) + } + + time.Sleep(1 * time.Second) + + // 入力ボックスにユーザ名・パスを打ち込む + elem_user := page.FindByName("username") + elem_pass := page.FindByName("password") + elem_user.Fill(username) + elem_pass.Fill(password) + log.Printf("fill username: %v\n", username) + log.Printf("fill password\n") + + // Submit + if err := page.FindByClass("credentials_input_submit").Click(); err != nil { + log.Fatalf("Failed to login:%v\n", err) + return + } + log.Printf("Success to login FUN VM WebAPI!!\n") + + time.Sleep(1 * time.Second) + + // 環境画面の項目数を入れる関数。暫定5個に設定しておく + max_environment := 5 + for i := 1; i <= max_environment; i++ { + + log.Printf("Serch for environment: %v\n...", environment) + text, _ := page.FindByXPath("/html/body/div/div/main/div/form/div[1]/div/select/option[" + strconv.Itoa(i) + "]").Text() + if text == environment { + + log.Printf("get environment: %v\n", text) + if err := page.FindByXPath("/html/body/div/div/main/div/form/div[1]/div/select/option[" + strconv.Itoa(i) + "]").Click(); err != nil { + log.Fatalf("Failed to click environment: %v\n", err) + } + break + } + // max_environment個分のの項目をチェックしてなかった場合エラーにする + if i == max_environment { + log.Fatalf("Can't look up environment: %v\n", environment) + } + } + + // 次のページへ行く + if err := page.FindByXPath("/html/body/div/div/main/div/form/div[2]/div/span").Click(); err != nil { + log.Fatalf("faild to click next page bottuon") + } + + time.Sleep(1 * time.Second) + + //ダウンロードボタンクリック + if err := page.FindByXPath("/html/body/form/div/div[4]/div[1]/div[3]/div/div[2]/div[2]/div/a").Click(); err != nil { + log.Fatalf("Failed to Download key:%v\n", err) + return + } + + key_name, _ := page.FindByXPath("/html/body/form/div/div[4]/div[1]/div[3]/div/div[2]/div[2]/div/span").Text() + log.Printf("key name is %v and address is %v/%v.pem\n", key_name, address, key_name) + address = address + "/" + key_name + ".pem" + page.CloseWindow() + resp.Error = function.ConcatFuncErrors(resp.Error, resp.Result.Set(ctx, address)) + return +} diff --git a/internal/provider/provider.go b/internal/provider/provider.go index 1393248..03c4df1 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -115,6 +115,7 @@ func (p *scrapingProvider) Functions(_ context.Context) []func() function.Functi return []func() function.Function{ NewIp, NewMachinePass, + NewKey, } } diff --git a/main.tf b/main.tf index 3354cd9..ba256ed 100644 --- a/main.tf +++ b/main.tf @@ -15,16 +15,16 @@ resource "scraping_resource" "example"{ environment = "Linux(Ubuntu22.04LTS)(2024前期)(10/31廃止)" username = "b1021204" password = "SAKURAskip108" - machine_name = "EC2-geotail-146000" + machine_name = "EC2-geotail-146055" machine_stop = false connection { type = "ssh" user = "ubuntu" - password = provider::scraping::ip("b1021204", "SAKURAskip108", "Linux(Ubuntu22.04LTS)(2024前期)(10/31廃止)", "EC2-geotail-146000") - private_key = file("/Users/nsysk_0101/univ/b4/terraform-provider-scraping/funawskeyb1021204.pem") - host = provider::scraping::ip("b1021204", "SAKURAskip108", "Linux(Ubuntu22.04LTS)(2024前期)(10/31廃止)", "EC2-geotail-146000") + password = provider::scraping::ip("b1021204", "SAKURAskip108", "Linux(Ubuntu22.04LTS)(2024前期)(10/31廃止)", "EC2-geotail-146055") + private_key = file(provider::scraping::key("b1021204", "SAKURAskip108", "Linux(Ubuntu22.04LTS)(2024前期)(10/31廃止)", "/Users/nsysk_0101/univ/b4/terraform-provider-scraping")) + host = provider::scraping::ip("b1021204", "SAKURAskip108", "Linux(Ubuntu22.04LTS)(2024前期)(10/31廃止)", "EC2-geotail-146055") } provisioner "remote-exec" { @@ -34,11 +34,11 @@ resource "scraping_resource" "example"{ } } - +/* output "ip" { value = provider::scraping::ip("b1021204", "SAKURAskip108", "Linux(Ubuntu22.04LTS)(2024前期)(10/31廃止)", "EC2-geotail-146000") } - +*/ diff --git a/terraform.tfstate b/terraform.tfstate index f0e8b47..7a174d4 100644 --- a/terraform.tfstate +++ b/terraform.tfstate @@ -1,14 +1,36 @@ { "version": 4, "terraform_version": "1.8.4", -<<<<<<< HEAD - "serial": 11, - "lineage": "198ae01d-118b-1b8c-d70e-da3bd819bff3", -======= - "serial": 3, - "lineage": "7f513c7d-da56-1ac1-f792-c90b484cf64d", ->>>>>>> ip_serch + "serial": 1, + "lineage": "f586d212-5978-00f1-0381-646aaa3e4ef6", "outputs": {}, - "resources": [], + "resources": [ + { + "mode": "managed", + "type": "scraping_resource", + "name": "example", + "provider": "provider[\"registry.terraform.io/hashicorp/scraping\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "environment": "Linux(Ubuntu22.04LTS)(2024前期)(10/31廃止)", + "machine_name": "EC2-geotail-146055", + "machine_stop": false, + "password": "SAKURAskip108", + "username": "b1021204" + }, + "sensitive_attributes": [ + [ + { + "type": "get_attr", + "value": "password" + } + ] + ] + } + ] + } + ], "check_results": null } From 06875b014aab755df612e3fd90605e75716cf326 Mon Sep 17 00:00:00 2001 From: b1021204 Date: Tue, 15 Oct 2024 19:32:50 +0900 Subject: [PATCH 2/3] =?UTF-8?q?instance=E3=81=AE=E6=8C=87=E5=AE=9A?= =?UTF-8?q?=E3=80=82start=E6=99=82=E3=81=AB=E6=8C=87=E5=AE=9A=E3=81=A7?= =?UTF-8?q?=E3=81=8D=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- funawskeyb1021204 (2).pem | 27 +++++++++++++++++++++++++++ funawskeyb1021204 (3).pem | 27 +++++++++++++++++++++++++++ funawskeyb1021204 (4).pem | 27 +++++++++++++++++++++++++++ funawskeyb1021204 (5).pem | 27 +++++++++++++++++++++++++++ internal/provider/VM_resource.go | 27 +++++++++++++++++---------- internal/provider/start_vm.go | 21 +++++++++++++++++++++ main.tf | 8 ++++++-- terraform-registry-manifest.json | 6 ------ terraform.tfstate | 7 ++++--- terraform.tfstate.backup | 18 ++++-------------- 10 files changed, 160 insertions(+), 35 deletions(-) create mode 100644 funawskeyb1021204 (2).pem create mode 100644 funawskeyb1021204 (3).pem create mode 100644 funawskeyb1021204 (4).pem create mode 100644 funawskeyb1021204 (5).pem delete mode 100644 terraform-registry-manifest.json diff --git a/funawskeyb1021204 (2).pem b/funawskeyb1021204 (2).pem new file mode 100644 index 0000000..ab4bd23 --- /dev/null +++ b/funawskeyb1021204 (2).pem @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEpAIBAAKCAQEAuJrIDJmxuEH8W4p5sn+FK4Mt3bDfe73QkDSZ5FPbw0DICdBy ++it9sbaerWFjKmdEKnBAxo5OJhlNNn2XJm4nP2b3cMpc24wcgQnJnxqiz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kkoY/Wm3u8+0ayGth1OthV/pGKFNUl6inTbksbM6KbdsBvBQrks6M +NQSmSetfbYt9FpB6WMOEPrAZAoGABQFPPgB5R3Y2ZFmfrq7WPKjGxdsh2KmPcquK +9Eo6TnkCXPWDD5Qn6F4BILsX8iFoS3xEy3ctFe9LmgjwraRZA2d/cgFZvpa5nZBo +WXA2GwpFtkAU2+GgiO2mZoaKPH3UJZUdk4I3blNdaTQjeS7YAQFfJU/T9OiOKdOF +LtCQDiMCgYBJAajrQsBuKE4uHQmRkvXMSEo7TmCuQmPCSwmSfVW1cJNUj2Idl5re +VGGZPvbY27ZSMJMJ3pNqj6HtMFWBAPCwj96VtiK3gG18NDSw1TgTdK8Vf97sM7YD +xpj7Qp2ffZvzJvTlwjXtAEUsZQ+WZyiz4t0lv37n93N6RfJvASt8/Q== +-----END RSA PRIVATE KEY----- \ No newline at end of file diff --git a/funawskeyb1021204 (3).pem b/funawskeyb1021204 (3).pem new file mode 100644 index 0000000..ab4bd23 --- /dev/null +++ b/funawskeyb1021204 (3).pem @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEpAIBAAKCAQEAuJrIDJmxuEH8W4p5sn+FK4Mt3bDfe73QkDSZ5FPbw0DICdBy ++it9sbaerWFjKmdEKnBAxo5OJhlNNn2XJm4nP2b3cMpc24wcgQnJnxqizt1gdTsX +prUP8Vh3MC+Emf+T7eGMBXsRCNHtAdOIN14uEWUu9tkRaR6o2Z7C5WZ+6Mb+ky98 +eEY3pr8jOznFo55LmlKUFfifDBDWzOaH1YGtjOoj+HeVspZGwB/rfWWrLuSKm3jc +/8pt8WLhwE437bhi2dQ1cWiWWxveoZOvR3quOiNON4AzVKLwt58TZMRSNpcPNXUN +KFWEEhDVJo4+4+DXQDVCvFjv5lJE4cXARrnvLwIDAQABAoIBAQCrsIjN70OysuwZ +1zhIIwGf7mkB/jZbx7Xp6IIYMUX62o0xU4Ub1scYOVhquGCaV2C2d6BHCqL0HCQL +wdKKE3i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HtMFWBAPCwj96VtiK3gG18NDSw1TgTdK8Vf97sM7YD +xpj7Qp2ffZvzJvTlwjXtAEUsZQ+WZyiz4t0lv37n93N6RfJvASt8/Q== +-----END RSA PRIVATE KEY----- \ No newline at end of file diff --git a/funawskeyb1021204 (4).pem b/funawskeyb1021204 (4).pem new file mode 100644 index 0000000..ab4bd23 --- /dev/null +++ b/funawskeyb1021204 (4).pem @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEpAIBAAKCAQEAuJrIDJmxuEH8W4p5sn+FK4Mt3bDfe73QkDSZ5FPbw0DICdBy ++it9sbaerWFjKmdEKnBAxo5OJhlNNn2XJm4nP2b3cMpc24wcgQnJnxqizt1gdTsX +prUP8Vh3MC+Emf+T7eGMBXsRCNHtAdOIN14uEWUu9tkRaR6o2Z7C5WZ+6Mb+ky98 +eEY3pr8jOznFo55LmlKUFfifDBDWzOaH1YGtjOoj+HeVspZGwB/rfWWrLuSKm3jc +/8pt8WLhwE437bhi2dQ1cWiWWxveoZOvR3quOiNON4AzVKLwt58TZMRSNpcPNXUN +KFWEEhDVJo4+4+DXQDVCvFjv5lJE4cXARrnvLwIDAQABAoIBAQCrsIjN70OysuwZ +1zhIIwGf7mkB/jZbx7Xp6IIYMUX62o0xU4Ub1scYOVhquGCaV2C2d6BHCqL0HCQL +wdKKE3i9Ju6LICospqr7+DZkm0lAS/QiE8tzaIJjXHu9fPQ+pczXOSYZEtRM97EO +OcY+eIEv/IMpYcknkzRG8bkh0anGo3RO6bZIA1LjwS0OqBVejimK/qegXitOJ3ml +XPDAnL/X9VqmEU7zLBPY2CqPlwBnV2mEoAN1fyL8EYrgx8EQ5o2KdmhPi7dDIaAV +VXR4SLFRRnZam4hs7FsYRHKn7J3mdJu1diFtHXsWGO5FNuSnopFAdarkGCNUs0Pt +xjFaXFvBAoGBAPpBHv9GYdL49zQOgHLsVezYuKJYaq3yQwgt4EPsPW+facBgdiAm +b4YhIc8nC2AdickW65MTsD8JCv142YoCXF9Wjv2ktpiRhkzfMmOR25OJONDDhQaB +XgrF86oIlN8f9CoGvW7F1DtqM/HBFVF4WgXJNkKwxgjOx3W5D0jT2mP1AoGBALzX +zTMZZA/XmJ8sXcd7fjsaAK7HgmbIv6DwLMduxUxjwJ8nDwvSh/ZCiqVkwrkDv0i9 +3hA1I2M+Rg3vAkvnoaPQqy7WQSIdNiGbLdAJXXnwfQ5D9WIUZl0r98XGokVHR2SN +XH/lULJyn4yumSz/cCJlIBUSUJQLp1VJZZg04/QTAoGBAPB3rs9g1BMjhHaTEL5d +dlt2DESDbU7kIaE0Y/EgihA+QCHJDvjptfRO1ev1+qpK9+EwkwDqxEpt6A+UFoTU +q+o4hIIZyhNkkoY/Wm3u8+0ayGth1OthV/pGKFNUl6inTbksbM6KbdsBvBQrks6M +NQSmSetfbYt9FpB6WMOEPrAZAoGABQFPPgB5R3Y2ZFmfrq7WPKjGxdsh2KmPcquK +9Eo6TnkCXPWDD5Qn6F4BILsX8iFoS3xEy3ctFe9LmgjwraRZA2d/cgFZvpa5nZBo +WXA2GwpFtkAU2+GgiO2mZoaKPH3UJZUdk4I3blNdaTQjeS7YAQFfJU/T9OiOKdOF +LtCQDiMCgYBJAajrQsBuKE4uHQmRkvXMSEo7TmCuQmPCSwmSfVW1cJNUj2Idl5re +VGGZPvbY27ZSMJMJ3pNqj6HtMFWBAPCwj96VtiK3gG18NDSw1TgTdK8Vf97sM7YD +xpj7Qp2ffZvzJvTlwjXtAEUsZQ+WZyiz4t0lv37n93N6RfJvASt8/Q== +-----END RSA PRIVATE KEY----- \ No newline at end of file diff --git a/funawskeyb1021204 (5).pem b/funawskeyb1021204 (5).pem new file mode 100644 index 0000000..ab4bd23 --- /dev/null +++ b/funawskeyb1021204 (5).pem @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEpAIBAAKCAQEAuJrIDJmxuEH8W4p5sn+FK4Mt3bDfe73QkDSZ5FPbw0DICdBy ++it9sbaerWFjKmdEKn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1+qpK9+EwkwDqxEpt6A+UFoTU +q+o4hIIZyhNkkoY/Wm3u8+0ayGth1OthV/pGKFNUl6inTbksbM6KbdsBvBQrks6M +NQSmSetfbYt9FpB6WMOEPrAZAoGABQFPPgB5R3Y2ZFmfrq7WPKjGxdsh2KmPcquK +9Eo6TnkCXPWDD5Qn6F4BILsX8iFoS3xEy3ctFe9LmgjwraRZA2d/cgFZvpa5nZBo +WXA2GwpFtkAU2+GgiO2mZoaKPH3UJZUdk4I3blNdaTQjeS7YAQFfJU/T9OiOKdOF +LtCQDiMCgYBJAajrQsBuKE4uHQmRkvXMSEo7TmCuQmPCSwmSfVW1cJNUj2Idl5re +VGGZPvbY27ZSMJMJ3pNqj6HtMFWBAPCwj96VtiK3gG18NDSw1TgTdK8Vf97sM7YD +xpj7Qp2ffZvzJvTlwjXtAEUsZQ+WZyiz4t0lv37n93N6RfJvASt8/Q== +-----END RSA PRIVATE KEY----- \ No newline at end of file diff --git a/internal/provider/VM_resource.go b/internal/provider/VM_resource.go index 0bfaf62..a255fbe 100644 --- a/internal/provider/VM_resource.go +++ b/internal/provider/VM_resource.go @@ -36,20 +36,22 @@ type VMResource struct { // 各関数内で使われるデータの構造体 type Machine_Data struct { - environment string - username string - password string - machine_name string - machine_stop bool + environment string + username string + password string + machine_name string + machine_stop bool + instance_type string } // ExampleResourceModel describes the resource data model. type VMResourceModel struct { - Environment types.String `tfsdk:"environment"` - Username types.String `tfsdk:"username"` - Password types.String `tfsdk:"password"` - Machine_name types.String `tfsdk:"machine_name"` - Machine_stop types.Bool `tfsdk:"machine_stop"` + Environment types.String `tfsdk:"environment"` + Username types.String `tfsdk:"username"` + Password types.String `tfsdk:"password"` + Machine_name types.String `tfsdk:"machine_name"` + Machine_stop types.Bool `tfsdk:"machine_stop"` + Instance_Type types.String `tfsdk:"instance_type"` } //  IPアドレスをスクレイピングする関数 @@ -199,6 +201,9 @@ func (r *VMResource) Schema(ctx context.Context, req resource.SchemaRequest, res "machine_stop": schema.BoolAttribute{ Optional: true, }, + "instance_type": schema.StringAttribute{ + Optional: true, + }, }, } } @@ -241,6 +246,7 @@ func (r *VMResource) Create(ctx context.Context, req resource.CreateRequest, res Machine_Data.machine_name = data.Machine_name.ValueString() Machine_Data.machine_stop = data.Machine_stop.ValueBool() Machine_Data.environment = data.Environment.ValueString() + Machine_Data.instance_type = data.Instance_Type.ValueString() ctx = tflog.SetField(ctx, "username", Machine_Data.username) ctx = tflog.SetField(ctx, "password", Machine_Data.password) @@ -287,6 +293,7 @@ func (r *VMResource) Update(ctx context.Context, req resource.UpdateRequest, res Machine_Data.environment = data.Environment.ValueString() Machine_Data.machine_name = data.Machine_name.ValueString() Machine_Data.machine_stop = data.Machine_stop.ValueBool() + Machine_Data.instance_type = data.Instance_Type.ValueString() ctx = tflog.SetField(ctx, "username", Machine_Data.username) ctx = tflog.SetField(ctx, "password", Machine_Data.password) diff --git a/internal/provider/start_vm.go b/internal/provider/start_vm.go index a14ca32..34159da 100644 --- a/internal/provider/start_vm.go +++ b/internal/provider/start_vm.go @@ -96,7 +96,28 @@ func start_vm(Machine_Data Machine_Data) { log.Printf("found machin_name = %v!!!", Machine_Data.machine_name) log.Printf("start %v...\n", Machine_Data.machine_name) + // インスタンスネームが指定されているときに、スクレイピングする + + for j := 0; j <= 4; j++ { + log.Printf("serch for instance_type = %v \n", Machine_Data.instance_type) + if Machine_Data.instance_type != "" { + instance, _ := page.FindByXPath("/html/body/form/div/div[4]/div[2]/div[" + strconv.Itoa(i+1) + "]/table/tbody/tr[1]/td[2]/div/select/option[" + strconv.Itoa(j) + "]").Text() + // a, _ := page.FindByXPath("/html/body/form/div/div[4]/div[2]/div[3]/table/tbody/tr[1]/td[2]/div/select/option[2]").Text() + log.Printf("now, scraping...: %v", instance) + if instance == Machine_Data.instance_type { + if err := page.FindByXPath("/html/body/form/div/div[4]/div[2]/div[" + strconv.Itoa(i+1) + "]/table/tbody/tr[1]/td[2]/div/select/option[" + strconv.Itoa(j) + "]").Click(); err != nil { + log.Printf("Can't choice instance_type: %v\n", Machine_Data.instance_type) + log.Fatalf("Pleace choeck instance_type\n") + return + } + + } + } + + } + // 見つけたマシン名のスタートボタンをおす + time.Sleep(1 * time.Second) if err := page.FindByName("startBtn_" + strconv.Itoa(i)).Click(); err != nil { log.Fatalf("Failed to start;%v\n", err) return diff --git a/main.tf b/main.tf index ba256ed..17002d8 100644 --- a/main.tf +++ b/main.tf @@ -15,10 +15,12 @@ resource "scraping_resource" "example"{ environment = "Linux(Ubuntu22.04LTS)(2024前期)(10/31廃止)" username = "b1021204" password = "SAKURAskip108" - machine_name = "EC2-geotail-146055" + machine_name = "EC2-geotail-155163" machine_stop = false + instance_type = "t4g.large" +/* connection { type = "ssh" user = "ubuntu" @@ -34,7 +36,7 @@ resource "scraping_resource" "example"{ } } -/* + output "ip" { value = provider::scraping::ip("b1021204", "SAKURAskip108", "Linux(Ubuntu22.04LTS)(2024前期)(10/31廃止)", "EC2-geotail-146000") @@ -42,3 +44,5 @@ output "ip" { */ + +} \ No newline at end of file diff --git a/terraform-registry-manifest.json b/terraform-registry-manifest.json deleted file mode 100644 index fec2a56..0000000 --- a/terraform-registry-manifest.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "version": 1, - "metadata": { - "protocol_versions": ["6.0"] - } -} diff --git a/terraform.tfstate b/terraform.tfstate index 7a174d4..7e99a15 100644 --- a/terraform.tfstate +++ b/terraform.tfstate @@ -1,8 +1,8 @@ { "version": 4, "terraform_version": "1.8.4", - "serial": 1, - "lineage": "f586d212-5978-00f1-0381-646aaa3e4ef6", + "serial": 5, + "lineage": "6a249484-8e55-a171-52da-99d2a322cf74", "outputs": {}, "resources": [ { @@ -15,7 +15,8 @@ "schema_version": 0, "attributes": { "environment": "Linux(Ubuntu22.04LTS)(2024前期)(10/31廃止)", - "machine_name": "EC2-geotail-146055", + "instance_type": "t4g.large", + "machine_name": "EC2-geotail-155163", "machine_stop": false, "password": "SAKURAskip108", "username": "b1021204" diff --git a/terraform.tfstate.backup b/terraform.tfstate.backup index 7fb9a86..561cb0b 100644 --- a/terraform.tfstate.backup +++ b/terraform.tfstate.backup @@ -1,20 +1,9 @@ { "version": 4, "terraform_version": "1.8.4", -<<<<<<< HEAD - "serial": 9, - "lineage": "198ae01d-118b-1b8c-d70e-da3bd819bff3", + "serial": 3, + "lineage": "6a249484-8e55-a171-52da-99d2a322cf74", "outputs": {}, -======= - "serial": 1, - "lineage": "7f513c7d-da56-1ac1-f792-c90b484cf64d", - "outputs": { - "ip": { - "value": "10.224.146.0", - "type": "string" - } - }, ->>>>>>> ip_serch "resources": [ { "mode": "managed", @@ -26,7 +15,8 @@ "schema_version": 0, "attributes": { "environment": "Linux(Ubuntu22.04LTS)(2024前期)(10/31廃止)", - "machine_name": "EC2-geotail-146000", + "instance_type": "t4g.large", + "machine_name": "EC2-geotail-153037", "machine_stop": false, "password": "SAKURAskip108", "username": "b1021204" From 0e48521e95cd4dfaa0bb220204cf3e3287213547 Mon Sep 17 00:00:00 2001 From: b1021204 Date: Sat, 26 Oct 2024 01:21:53 +0900 Subject: [PATCH 3/3] a --- funawskeyb1021204 (1).pem | 27 --------------------------- funawskeyb1021204 (2).pem | 27 --------------------------- funawskeyb1021204 (3).pem | 27 --------------------------- funawskeyb1021204 (4).pem | 27 --------------------------- funawskeyb1021204 (5).pem | 27 --------------------------- funawskeyb1021204.pem | 27 --------------------------- terraform.tfstate | 6 +++--- terraform.tfstate.backup | 36 ++++-------------------------------- 8 files changed, 7 insertions(+), 197 deletions(-) delete mode 100644 funawskeyb1021204 (1).pem delete mode 100644 funawskeyb1021204 (2).pem delete mode 100644 funawskeyb1021204 (3).pem delete mode 100644 funawskeyb1021204 (4).pem delete mode 100644 funawskeyb1021204 (5).pem delete mode 100644 funawskeyb1021204.pem diff --git a/funawskeyb1021204 (1).pem b/funawskeyb1021204 (1).pem deleted file mode 100644 index ab4bd23..0000000 --- a/funawskeyb1021204 (1).pem +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA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yn4yumSz/cCJlIBUSUJQLp1VJZZg04/QTAoGBAPB3rs9g1BMjhHaTEL5d -dlt2DESDbU7kIaE0Y/EgihA+QCHJDvjptfRO1ev1+qpK9+EwkwDqxEpt6A+UFoTU -q+o4hIIZyhNkkoY/Wm3u8+0ayGth1OthV/pGKFNUl6inTbksbM6KbdsBvBQrks6M -NQSmSetfbYt9FpB6WMOEPrAZAoGABQFPPgB5R3Y2ZFmfrq7WPKjGxdsh2KmPcquK -9Eo6TnkCXPWDD5Qn6F4BILsX8iFoS3xEy3ctFe9LmgjwraRZA2d/cgFZvpa5nZBo -WXA2GwpFtkAU2+GgiO2mZoaKPH3UJZUdk4I3blNdaTQjeS7YAQFfJU/T9OiOKdOF -LtCQDiMCgYBJAajrQsBuKE4uHQmRkvXMSEo7TmCuQmPCSwmSfVW1cJNUj2Idl5re -VGGZPvbY27ZSMJMJ3pNqj6HtMFWBAPCwj96VtiK3gG18NDSw1TgTdK8Vf97sM7YD -xpj7Qp2ffZvzJvTlwjXtAEUsZQ+WZyiz4t0lv37n93N6RfJvASt8/Q== ------END RSA PRIVATE KEY----- \ No newline at end of file diff --git a/funawskeyb1021204 (2).pem b/funawskeyb1021204 (2).pem deleted file mode 100644 index ab4bd23..0000000 --- a/funawskeyb1021204 (2).pem +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEpAIBAAKCAQEAuJrIDJmxuEH8W4p5sn+FK4Mt3bDfe73QkDSZ5FPbw0DICdBy -+it9sbaerWFjKmdEKnBAxo5OJhlNNn2XJm4nP2b3cMpc24wcgQnJnxqizt1gdTsX -prUP8Vh3MC+Emf+T7eGMBXsRCNHtAdOIN14uEWUu9tkRaR6o2Z7C5WZ+6Mb+ky98 -eEY3pr8jOznFo55LmlKUFfifDBDWzOaH1YGtjOoj+HeVspZGwB/rfWWrLuSKm3jc -/8pt8WLhwE437bhi2dQ1cWiWWxveoZOvR3quOiNON4AzVKLwt58TZMRSNpcPNXUN -KFWE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oaKPH3UJZUdk4I3blNdaTQjeS7YAQFfJU/T9OiOKdOF -LtCQDiMCgYBJAajrQsBuKE4uHQmRkvXMSEo7TmCuQmPCSwmSfVW1cJNUj2Idl5re -VGGZPvbY27ZSMJMJ3pNqj6HtMFWBAPCwj96VtiK3gG18NDSw1TgTdK8Vf97sM7YD -xpj7Qp2ffZvzJvTlwjXtAEUsZQ+WZyiz4t0lv37n93N6RfJvASt8/Q== ------END RSA PRIVATE KEY----- \ No newline at end of file diff --git a/funawskeyb1021204 (3).pem b/funawskeyb1021204 (3).pem deleted file mode 100644 index ab4bd23..0000000 --- a/funawskeyb1021204 (3).pem +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEpAIBAAKCAQEAuJrIDJmxuEH8W4p5sn+FK4Mt3bDfe73QkDSZ5FPbw0DICdBy -+it9sbaerWFjKmdEKnBAxo5OJhlNNn2XJm4nP2b3cMpc24wcgQnJnxqizt1gdTsX -prUP8Vh3MC+Emf+T7eGMBXsRCNHtAdOIN14uEWUu9tkRaR6o2Z7C5WZ+6Mb+ky98 -eEY3pr8jOznFo55LmlKUFfifDBDWzOaH1YGtjOoj+HeVspZGwB/rfWWrLuSKm3jc -/8pt8WLhwE437bhi2dQ1cWiWWxveoZOvR3quOiNON4AzVKLwt58TZMRSNpcPNXUN -KFWEEhDVJo4+4+DXQDVCvFjv5lJE4cXARrnvLwIDAQABAoIBAQCrsIjN70OysuwZ -1zhIIwGf7mkB/jZbx7Xp6IIYMUX62o0xU4Ub1scYOVhquGCaV2C2d6BHCqL0HCQL -wdKKE3i9Ju6LICospqr7+DZkm0lAS/QiE8tzaIJjXHu9fPQ+pczXOSYZEtRM97EO -OcY+eIEv/IMpYcknkzRG8bkh0anGo3RO6bZIA1LjwS0OqBVejimK/qegXitOJ3ml -XPDAnL/X9VqmEU7zLBPY2CqPlwBnV2mEoAN1fyL8EYrgx8EQ5o2KdmhPi7dDIaAV -VXR4SLFRRnZam4hs7FsYRHKn7J3mdJu1diFtHXsWGO5FNuSnopFAdarkGCNUs0Pt -xjFaXFvBAoGBAPpBHv9GYdL49zQOgHLsVezYuKJYaq3yQwgt4EPsPW+facBgdiAm -b4YhIc8nC2AdickW65MTsD8JCv142YoCXF9Wjv2ktpiRhkzfMmOR25OJONDDhQaB -XgrF86oIlN8f9CoGvW7F1DtqM/HBFVF4WgXJNkKwxgjOx3W5D0jT2mP1AoGBALzX -zTMZZA/XmJ8sXcd7fjsaAK7HgmbIv6DwLMduxUxjwJ8nDwvSh/ZCiqVkwrkDv0i9 -3hA1I2M+Rg3vAkvnoaPQqy7WQSIdNiGbLdAJXXnwfQ5D9WIUZl0r98XGokVHR2SN -XH/lULJyn4yumSz/cCJlIBUSUJQLp1VJZZg04/QTAoGBAPB3rs9g1BMjhHaTEL5d -dlt2DESDbU7kIaE0Y/EgihA+QCHJDvjptfRO1ev1+qpK9+EwkwDqxEpt6A+UFoTU -q+o4hIIZyhNkkoY/Wm3u8+0ayGth1OthV/pGKFNUl6inTbksbM6KbdsBvBQrks6M -NQSmSetfbYt9FpB6WMOEPrAZAoGABQFPPgB5R3Y2ZFmfrq7WPKjGxdsh2KmPcquK -9Eo6TnkCXPWDD5Qn6F4BILsX8iFoS3xEy3ctFe9LmgjwraRZA2d/cgFZvpa5nZBo -WXA2GwpFtkAU2+GgiO2mZoaKPH3UJZUdk4I3blNdaTQjeS7YAQFfJU/T9OiOKdOF -LtCQDiMCgYBJAajrQsBuKE4uHQmRkvXMSEo7TmCuQmPCSwmSfVW1cJNUj2Idl5re -VGGZPvbY27ZSMJMJ3pNqj6HtMFWBAPCwj96VtiK3gG18NDSw1TgTdK8Vf97sM7YD -xpj7Qp2ffZvzJvTlwjXtAEUsZQ+WZyiz4t0lv37n93N6RfJvASt8/Q== ------END RSA PRIVATE KEY----- \ No newline at end of file diff --git a/funawskeyb1021204 (4).pem b/funawskeyb1021204 (4).pem deleted file mode 100644 index ab4bd23..0000000 --- a/funawskeyb1021204 (4).pem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XXnwfQ5D9WIUZl0r98XGokVHR2SN -XH/lULJyn4yumSz/cCJlIBUSUJQLp1VJZZg04/QTAoGBAPB3rs9g1BMjhHaTEL5d -dlt2DESDbU7kIaE0Y/EgihA+QCHJDvjptfRO1ev1+qpK9+EwkwDqxEpt6A+UFoTU -q+o4hIIZyhNkkoY/Wm3u8+0ayGth1OthV/pGKFNUl6inTbksbM6KbdsBvBQrks6M -NQSmSetfbYt9FpB6WMOEPrAZAoGABQFPPgB5R3Y2ZFmfrq7WPKjGxdsh2KmPcquK -9Eo6TnkCXPWDD5Qn6F4BILsX8iFoS3xEy3ctFe9LmgjwraRZA2d/cgFZvpa5nZBo -WXA2GwpFtkAU2+GgiO2mZoaKPH3UJZUdk4I3blNdaTQjeS7YAQFfJU/T9OiOKdOF -LtCQDiMCgYBJAajrQsBuKE4uHQmRkvXMSEo7TmCuQmPCSwmSfVW1cJNUj2Idl5re -VGGZPvbY27ZSMJMJ3pNqj6HtMFWBAPCwj96VtiK3gG18NDSw1TgTdK8Vf97sM7YD -xpj7Qp2ffZvzJvTlwjXtAEUsZQ+WZyiz4t0lv37n93N6RfJvASt8/Q== ------END RSA PRIVATE KEY----- \ No newline at end of file diff --git a/funawskeyb1021204 (5).pem b/funawskeyb1021204 (5).pem deleted file mode 100644 index ab4bd23..0000000 --- a/funawskeyb1021204 (5).pem +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEpAIBAAKCAQEAuJrIDJmxuEH8W4p5sn+FK4Mt3bDfe73QkDSZ5FPbw0DICdBy -+it9sbaerWFjKmdEKnBAxo5OJhlNNn2XJm4nP2b3cMpc24wcgQnJnxqizt1gdTsX -prUP8Vh3MC+Emf+T7eGMBXsRCNHtAdOIN14uEWUu9tkRaR6o2Z7C5WZ+6Mb+ky98 -eEY3pr8jOznFo55LmlKUFfifDBDWzOaH1YGtjOoj+HeVspZGwB/rfWWrLuSKm3jc -/8pt8WLhwE437bhi2dQ1cWiWWxveoZOv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cgFZvpa5nZBo -WXA2GwpFtkAU2+GgiO2mZoaKPH3UJZUdk4I3blNdaTQjeS7YAQFfJU/T9OiOKdOF -LtCQDiMCgYBJAajrQsBuKE4uHQmRkvXMSEo7TmCuQmPCSwmSfVW1cJNUj2Idl5re -VGGZPvbY27ZSMJMJ3pNqj6HtMFWBAPCwj96VtiK3gG18NDSw1TgTdK8Vf97sM7YD -xpj7Qp2ffZvzJvTlwjXtAEUsZQ+WZyiz4t0lv37n93N6RfJvASt8/Q== ------END RSA PRIVATE KEY----- \ No newline at end of file diff --git a/funawskeyb1021204.pem b/funawskeyb1021204.pem deleted file mode 100644 index ab4bd23..0000000 --- a/funawskeyb1021204.pem +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEpAIBAAKCAQEAuJrIDJmxuEH8W4p5sn+FK4Mt3bDfe73QkDSZ5FPbw0DICdBy -+it9sbaerWFjKmdEKnBAxo5OJhlNNn2XJm4nP2b3cMpc24wcgQnJnxqizt1gdTsX -prUP8Vh3MC+Emf+T7eGMBXsRCNHtAdOIN14uEWUu9tkRaR6o2Z7C5WZ+6Mb+ky98 -eEY3pr8jOznFo55LmlKUFfifDBDWzOaH1YGtjOoj+HeVspZGwB/rfWWrLuSKm3jc -/8pt8WLhwE437bhi2dQ1cWiWWxveoZOvR3quOiNON4AzVKLwt58TZMRSNpcPNXUN -KFWEEhDVJo4+4+DXQDVCvFjv5lJE4cXARrnvLwIDAQABAoIBAQCrsIjN70OysuwZ -1zhIIwGf7mkB/jZbx7Xp6IIYMUX62o0xU4Ub1scYOVhquGCaV2C2d6BHCqL0HCQL -wdKKE3i9Ju6LICospqr7+DZkm0lAS/QiE8tzaIJjXHu9fPQ+pczXOSYZEtRM97EO -OcY+eIEv/IMpYcknkzRG8bkh0anGo3RO6bZIA1LjwS0OqBVejimK/qegXitOJ3ml -XPDAnL/X9VqmEU7zLBPY2CqPlwBnV2mEoAN1fyL8EYrgx8EQ5o2KdmhPi7dDIaAV -VXR4SLFRRnZam4hs7FsYRHKn7J3mdJu1diFtHXsWGO5FNuSnopFAdarkGCNUs0Pt -xjFaXFvBAoGBAPpBHv9GYdL49zQOgHLsVezYuKJYaq3yQwgt4EPsPW+facBgdiAm -b4YhIc8nC2AdickW65MTsD8JCv142YoCXF9Wjv2ktpiRhkzfMmOR25OJONDDhQaB -XgrF86oIlN8f9CoGvW7F1DtqM/HBFVF4WgXJNkKwxgjOx3W5D0jT2mP1AoGBALzX -zTMZZA/XmJ8sXcd7fjsaAK7HgmbIv6DwLMduxUxjwJ8nDwvSh/ZCiqVkwrkDv0i9 -3hA1I2M+Rg3vAkvnoaPQqy7WQSIdNiGbLdAJXXnwfQ5D9WIUZl0r98XGokVHR2SN -XH/lULJyn4yumSz/cCJlIBUSUJQLp1VJZZg04/QTAoGBAPB3rs9g1BMjhHaTEL5d -dlt2DESDbU7kIaE0Y/EgihA+QCHJDvjptfRO1ev1+qpK9+EwkwDqxEpt6A+UFoTU -q+o4hIIZyhNkkoY/Wm3u8+0ayGth1OthV/pGKFNUl6inTbksbM6KbdsBvBQrks6M -NQSmSetfbYt9FpB6WMOEPrAZAoGABQFPPgB5R3Y2ZFmfrq7WPKjGxdsh2KmPcquK -9Eo6TnkCXPWDD5Qn6F4BILsX8iFoS3xEy3ctFe9LmgjwraRZA2d/cgFZvpa5nZBo -WXA2GwpFtkAU2+GgiO2mZoaKPH3UJZUdk4I3blNdaTQjeS7YAQFfJU/T9OiOKdOF -LtCQDiMCgYBJAajrQsBuKE4uHQmRkvXMSEo7TmCuQmPCSwmSfVW1cJNUj2Idl5re -VGGZPvbY27ZSMJMJ3pNqj6HtMFWBAPCwj96VtiK3gG18NDSw1TgTdK8Vf97sM7YD -xpj7Qp2ffZvzJvTlwjXtAEUsZQ+WZyiz4t0lv37n93N6RfJvASt8/Q== ------END RSA PRIVATE KEY----- \ No newline at end of file diff --git a/terraform.tfstate b/terraform.tfstate index 7e99a15..1d47fba 100644 --- a/terraform.tfstate +++ b/terraform.tfstate @@ -1,8 +1,8 @@ { "version": 4, - "terraform_version": "1.8.4", - "serial": 5, - "lineage": "6a249484-8e55-a171-52da-99d2a322cf74", + "terraform_version": "1.9.7", + "serial": 1, + "lineage": "eee271dc-cea1-b954-4492-d7888391a4fb", "outputs": {}, "resources": [ { diff --git a/terraform.tfstate.backup b/terraform.tfstate.backup index 561cb0b..5eb31ab 100644 --- a/terraform.tfstate.backup +++ b/terraform.tfstate.backup @@ -1,37 +1,9 @@ { "version": 4, - "terraform_version": "1.8.4", - "serial": 3, - "lineage": "6a249484-8e55-a171-52da-99d2a322cf74", + "terraform_version": "1.9.7", + "serial": 1, + "lineage": "8151eac3-2250-2af5-af4e-f9ed67767aaa", "outputs": {}, - "resources": [ - { - "mode": "managed", - "type": "scraping_resource", - "name": "example", - "provider": "provider[\"registry.terraform.io/hashicorp/scraping\"]", - "instances": [ - { - "schema_version": 0, - "attributes": { - "environment": "Linux(Ubuntu22.04LTS)(2024前期)(10/31廃止)", - "instance_type": "t4g.large", - "machine_name": "EC2-geotail-153037", - "machine_stop": false, - "password": "SAKURAskip108", - "username": "b1021204" - }, - "sensitive_attributes": [ - [ - { - "type": "get_attr", - "value": "password" - } - ] - ] - } - ] - } - ], + "resources": [], "check_results": null }