0

I am trying to launch spot instances from Spot Fleet:

aws ec2 request-spot-fleet --spot-fleet-request-config file://aws-spot6.json
below is json content
{
  "SpotPrice": "0.06",
  "TargetCapacity": 1,
  "IamFleetRole": "arn:aws:iam::614786711942:role/aws-ec2-spot-fleet-tagging-role",
      "LaunchSpecifications": [
      {
          "ImageId": "ami-0b86323be1672551f",
          "KeyName": "amitpoc",
          "SecurityGroups": [
              {
                  "GroupId": "sg-0069a6368b0260ca9"
              }
          ],
          "InstanceType": "t2.large",
          "SubnetId": "subnet-03c112988598e6e7c",     
          "TagSpecifications": [
        {
          "ResourceType": "instance",
          "Tags": [
            {
              "Key": "Type",
              "Value": "poc"
            }
          ]
        }
      ]

     }

  ],
 "Type": "maintain"
}

This is happening properly.
Now I want to find all the spot instances which were launched, with their private & public IP in a file. This needs to happen in Windows through PowerShell.

kenlukas
  • 3,101
  • 2
  • 16
  • 26
Amit M
  • 1

1 Answers1

1

You need to use the describe-spot-fleet-instances command:

aws ec2 describe-spot-fleet-instances --spot-fleet-request-id <value>

For more info read the aws-cli help:

aws ec2 describe-spot-fleet-instances help
Alex J
  • 2,844
  • 2
  • 23
  • 24
  • is there any way to find all the running instance with tag of "poc". please see the above json file where applying tags. – Amit M Oct 21 '19 at 07:06