teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

1

不要な部分を削除

2021/10/18 11:08

投稿

asral
asral

スコア10

answer CHANGED
@@ -9,12 +9,9 @@
9
9
 
10
10
  $Instance_Id = Invoke-RestMethod -Uri http://169.254.169.254/latest/meta-data/instance-id
11
11
 
12
- $Region = Invoke-RestMethod -Uri http://169.254.169.254/latest/meta-data/placement/availability-zone
13
-
14
- # IPアドレスの設定
15
-
16
12
  for ($i=0; $i -lt 1; $i++)
17
- {
13
+ {
14
+ # EIPのインスタンスIPアドレスの取得
18
15
  $ins_id = (Get-EC2Address -Filter @(@{Name="instance-id";Values=null} ; @{Name="allocation-id";Values=$array[$i]}) | Select-Object InstanceId).InstanceId
19
16
 
20
17
  If($ins_id -eq $null)