REST API Examples - cloud-barista/cb-spider GitHub Wiki

CB-Spider REST API ν™œμš© μ˜ˆμ‹œ


* λ³Έ κ°€μ΄λ“œλŠ” CB-Spider의 REST APIλ₯Ό μ΄μš©ν•œ λ©€ν‹°ν΄λΌμš°λ“œ μ œμ–΄μ— λŒ€ν•œ μ˜ˆμ‹œλ₯Ό μ œκ³΅ν•˜κ³  μžˆμŠ΅λ‹ˆλ‹€.
* λ³Έ κ°€μ΄λ“œλŠ” AWS VM 생성 및 μ œμ–΄ μ€‘μ‹¬μœΌλ‘œ κ°€μ΄λ“œν•˜κ³  μžˆμŠ΅λ‹ˆλ‹€. 
* κ·Έ μ™Έ CSP 및 μžμ›μ— λŒ€ν•œ ν™œμš©μ€ λ‹€μŒ User Guide 및 API λ¬Έμ„œ 등을 μ°Έκ³ ν•˜μ—¬ μœ μ‚¬ν•œ λ°©λ²•μœΌλ‘œ 적용 κ°€λŠ₯ν•©λ‹ˆλ‹€. 

[μ‹€ν–‰ 절차]

  1. 사전 μ€€λΉ„
  2. μ—°κ²° 등둝
  3. μžμ› 생성
  4. VM μ œμ–΄
  5. μžμ› μ‚­μ œ

1. 사전 μ€€λΉ„

  • 연동 λŒ€μƒ CSP 계정 생성 및 Credential μ€€λΉ„

  • Terminal-1: CB-Spider μ„œλ²„ μ‹€ν–‰ ν™˜κ²½

  • Terminal-2: CB-Spider ν΄λΌμ΄μ–ΈνŠΈ μ‹€ν–‰ ν™˜κ²½

    • curl을 μ΄μš©ν•œ CB-Spider REST API κ°„λ‹¨ν•œ μ‹œν—˜
      • CB-Spider μ„œλ²„κ°€ μ œκ³΅ν•˜λŠ” 연동 λŒ€μƒ CSP λͺ©λ‘ 좜λ ₯
        curl -sX GET http://localhost:1024/spider/cloudos |json_pp
        
        output
        {
           "cloudos" : [
              "AWS",
              "AZURE",
              "GCP",
              "ALIBABA",
              "TENCENT",
              "IBM",
              "OPENSTACK",
              "NCP",
              "NCPVPC",
              "NHNCLOUD",
              "KTCLOUD",
              "KTCLOUDVPC",
              "MOCK"
           ]
        }
        

μ΄ν•˜ Terminal-2μ—μ„œ μ‹€ν–‰

2. μ—°κ²° 등둝

연동 λŒ€μƒ ν΄λΌμš°λ“œμ˜ μ—°κ²° 섀정을 μœ„ν•œ 정보λ₯Ό λ“±λ‘ν•œλ‹€.
μ—°κ²° 섀정을 λ“±λ‘ν•œ ν›„μ—λŠ” 등둝 μ‹œμ— λΆ€μ—¬ν•œ μ—°κ²° 이름(Connection Name)을 μ΄μš©ν•˜μ—¬ λŒ€μƒ ν΄λΌμš°λ“œμ— μ—°κ²° 및 μ œμ–΄ν•  수 μžˆλ‹€. 
μ—°κ²° 섀정은 λ‹€μŒ 순으둜 μ§„ν–‰ν•œλ‹€.

  (1) Cloud Driver 등둝
  (2) Cloud Credential 등둝
  (3) Cloud Region/Zone 등둝
  (4) Cloud Connection 등둝 
  • (1) Cloud Driver 등둝

    • μ—°λ™ν•˜κ³ μž ν•˜λŠ” λŒ€μƒ Cloud(CSP)에 λ§žλŠ” Cloud Driver 정보λ₯Ό λ“±λ‘ν•œλ‹€.
    • 등둝 μ˜ˆμ‹œ
      curl -sX POST http://localhost:1024/spider/driver \
          -H 'Content-Type: application/json' \
          -d '{
              "DriverName": "aws-driver01",
              "ProviderName": "AWS",
              "DriverLibFileName": "aws-driver-v1.0.so"
          }' | json_pp
      
      output
      {
         "DriverLibFileName" : "aws-driver-v1.0.so",
         "DriverName" : "aws-driver01",
         "ProviderName" : "AWS"
      }
      
  • (2) Cloud Credential 등둝

    • μ—°λ™ν•˜κ³ μž ν•˜λŠ” λŒ€μƒ Cloud(CSP)에 λ§žλŠ” Credential 정보λ₯Ό λ“±λ‘ν•œλ‹€.
    • 등둝 μ˜ˆμ‹œ(XXXXX: CSPλ‘œλΆ€ν„° λ°œκΈ‰ 받은 μ •λ³΄λ‘œ ꡐ체)
      curl -sX POST http://localhost:1024/spider/credential \
          -H 'Content-Type: application/json' \
          -d '{
              "CredentialName": "aws-credential01",
              "ProviderName": "AWS",
              "KeyValueInfoList": [
                  {"Key": "aws_access_key_id", "Value": "XXXXXXXXXXXXXXXXXXXXXXX"},
                  {"Key": "aws_secret_access_key", "Value": "XXXXXXXXXXXXXXXXXXXXXXX"}
              ]
          }' | json_pp
      
      output
      {
         "CredentialName" : "aws-credential01",
         "KeyValueInfoList" : [
            {
               "Key" : "ClientId",
               "Value" : "XXXXXXXXXXXXXXXXXXXXXXX"
            },
            {
               "Key" : "ClientSecret",
               "Value" : "XXXXXXXXXXXXXXXXXXXXXXX"
            }
         ],
         "ProviderName" : "AWS"
      }
      
  • (3) Cloud Region/Zone 등둝

    • μ—°λ™ν•˜κ³ μž ν•˜λŠ” λŒ€μƒ Cloud(CSP)에 λ§žλŠ” Region/Zone 정보λ₯Ό λ“±λ‘ν•œλ‹€.
    • 등둝 μ˜ˆμ‹œ(AWS의 ohio, oregon μ§€μ—­μ˜ 2개의 Region/Zone 등둝 μ˜ˆμ‹œ)
      regions=("aws-ohio:us-east-2:us-east-2a"
               "aws-oregon:us-west-2:us-west-2a")
      
      for region in "${regions[@]}"; do
          IFS=":" read -r RegionName Region Zone <<< "$region"
          curl -sX POST http://localhost:1024/spider/region \
              -H 'Content-Type: application/json' \
              -d '{
                  "RegionName": "'$RegionName'",
                  "ProviderName": "AWS",
                  "KeyValueInfoList": [
                      {"Key": "Region", "Value": "'$Region'"},
                      {"Key": "Zone", "Value": "'$Zone'"}
                  ]
              }' | json_pp
      done
      
      output
      {
         "AvailableZoneList" : null,
         "KeyValueInfoList" : [
            {
               "Key" : "Region",
               "Value" : "us-east-2"
            },
            {
               "Key" : "Zone",
               "Value" : "us-east-2a"
            }
         ],
         "ProviderName" : "AWS",
         "RegionName" : "aws-ohio"
      }
      {
         "AvailableZoneList" : null,
         "KeyValueInfoList" : [
            {
               "Key" : "Region",
               "Value" : "us-west-2"
            },
      ... μ€‘λž΅ ...
      
  • (4) Cloud Connection 등둝

    • μ—°λ™ν•˜κ³ μž ν•˜λŠ” λŒ€μƒ Cloud(CSP)에 λ§žλŠ” Connection 정보λ₯Ό λ“±λ‘ν•œλ‹€.
    • μ•žμ—μ„œ λ“±λ‘ν•œ driver name, credential name, region name을 μ„€μ •ν•œλ‹€.
    • 등둝 μ˜ˆμ‹œ(AWS ohio, oregon κ΄€λ ¨ 2개의 Connection 등둝 μ˜ˆμ‹œ)
      configs=("aws-ohio-config:aws-ohio"
               "aws-oregon-config:aws-oregon")
      
      for config in "${configs[@]}"; do
          IFS=":" read -r ConfigName RegionName <<< "$config"
          curl -sX POST http://localhost:1024/spider/connectionconfig \
              -H 'Content-Type: application/json' \
              -d '{
                  "ConfigName": "'$ConfigName'",
                  "ProviderName": "AWS",
                  "DriverName": "aws-driver01",
                  "CredentialName": "aws-credential01",
                  "RegionName": "'$RegionName'"
              }' | json_pp
      done
      
      output
      {
         "ConfigName" : "aws-ohio-config",
         "CredentialName" : "aws-credential01",
         "DriverName" : "aws-driver01",
         "ProviderName" : "AWS",
         "RegionName" : "aws-ohio"
      }
      {
         "ConfigName" : "aws-oregon-config",
         "CredentialName" : "aws-credential01",
         "DriverName" : "aws-driver01",
         "ProviderName" : "AWS",
         "RegionName" : "aws-oregon"
      }
      

3. μžμ› 생성

연동 λŒ€μƒ ν΄λΌμš°λ“œμ˜ VM 인프라 및 Container(Kubernetes Cluster) 인프라 생성을 μœ„ν•œ κΈ°λ³Έ μžμ›λ“€μ„ μƒμ„±ν•œλ‹€.
μžμ› 생성 μ‹œμ—λŠ” μœ„μ—μ„œ λ“±λ‘ν•œ μ—°κ²° 이름(Connection Name)을 μ„€μ •μœΌλ‘œ λŒ€μƒ CSP, Driver 및 ν™œμš© Credential 등이 μ§€μ •λœλ‹€.
κΈ°λ³Έ μžμ› 생성 ν›„μ—λŠ” μƒμ„±λœ μžμ› 이름을 ν™œμš©ν•˜μ—¬ VM 및 Clusterλ₯Ό 생성 및 μ œμ–΄ν•  수 μžˆλ‹€. 
κΈ°λ³Έ μžμ› 생성은 μžμ›κ°„ μ˜μ‘΄μ„±μ„ κ³ λ €ν•˜μ—¬ λ‹€μŒ 순으둜 μ§„ν–‰ν•œλ‹€.

  (1) VPC/Subnet 생성
  (2) Security Group 생성
  (3) SSH KeyPair 생성 

β€» μ°Έκ³ : μžμ› 의쑴 관계
  - VPC 생성 μ‹œμ—λŠ” μ΅œμ†Œ 1개 μ΄μƒμ˜ Subnet μ„€μ • ν•„μš”, VPC 생성 ν›„ Subnet μΆ”κ°€/μ‚­μ œ κ°€λŠ₯
  - Subnet, Security Group 및 VM 등은 νŠΉμ • VPC ν•˜μœ„μ— 생성 κ°€λŠ₯ 
  - VPC μ‚­μ œλŠ” λŒ€μƒ VPCλ₯Ό ν™œμš©ν•˜λŠ” VM을 ν¬ν•¨ν•œ λͺ¨λ“  μžμ› μ‚­μ œ ν›„ μ‚­μ œ κ°€λŠ₯
  - Subnet은 VPC μ‚­μ œμ‹œ ν•¨κ»˜ μ‚­μ œ κ°€λŠ₯
  • (1) VPC/Subnet 생성

    • μƒμ„±ν•˜κ³ μž ν•˜λŠ” λŒ€μƒ 인프라 쑰건에 λ§žλŠ” VPC/Subnet을 μƒμ„±ν•œλ‹€.
    • 생성 μ˜ˆμ‹œ
      • CONN_CONFIG:μœ„μ—μ„œ λ“±λ‘ν•œ Connection Name(CSP λ³€κ²½μ‹œ λŒ€μƒ Connection Name으둜 μ„€μ • ν•„μš”)
      export CONN_CONFIG=aws-ohio-config
      
      curl -sX POST http://localhost:1024/spider/vpc \
          -H 'Content-Type: application/json' \
          -d '{ 
              "ConnectionName": "'${CONN_CONFIG}'", 
              "ReqInfo": { 
                  "Name": "vpc-01", 
                  "IPv4_CIDR": "192.168.0.0/16", 
                  "SubnetInfoList": [ 
                      { "Name": "subnet-01", "IPv4_CIDR": "192.168.1.0/24" } 
                  ] 
              } 
          }' | json_pp
      
      output
      {
         "IId" : {
            "NameId" : "vpc-01",
            "SystemId" : "vpc-060eb5dc45c1117b0"
         },
         "IPv4_CIDR" : "192.168.0.0/16",
         "SubnetInfoList" : [
            {
               "IId" : {
                  "NameId" : "subnet-01",
                  "SystemId" : "subnet-0b140aaac2024ef83"
               },
               "IPv4_CIDR" : "192.168.1.0/24",
               "KeyValueList" : [
                  {
                     "Key" : "VpcId",
                     "Value" : "vpc-060eb5dc45c1117b0"
                  },
                  ... μ€‘λž΅ ...
                  {
                     "Key" : "Status",
                     "Value" : "available"
                  }
               ],
               "TagList" : [
                  {
                     "Key" : "Name",
                     "Value" : "subnet-01-crehtv3p70iugvns0a7g"
                  }
               ],
               "Zone" : "us-east-2a"
            }
         ],
         "TagList" : [
            {
               "Key" : "Name",
               "Value" : "vpc-01-crehtv3p70iugvns0a70"
            }
         ]
      }
      
  • (2) Security Group 생성

    • μƒμ„±ν•˜κ³ μž ν•˜λŠ” λŒ€μƒ 인프라 쑰건에 λ§žλŠ” Security Group을 μƒμ„±ν•œλ‹€.
    • 생성 μ˜ˆμ‹œ
      • CONN_CONFIG:μœ„μ—μ„œ λ“±λ‘ν•œ Connection Name(CSP λ³€κ²½μ‹œ λŒ€μƒ Connection Name으둜 μ„€μ • ν•„μš”)
      export CONN_CONFIG=aws-ohio-config
      
      curl -sX POST http://localhost:1024/spider/securitygroup \
          -H 'Content-Type: application/json' \
          -d '{ 
              "ConnectionName": "'${CONN_CONFIG}'", 
              "ReqInfo": { 
                  "Name": "sg-01", 
                  "VPCName": "vpc-01", 
                  "SecurityRules": [ 
                      { 
                          "FromPort": "1", 
                          "ToPort" : "65535", 
                          "IPProtocol" : "tcp", 
                          "Direction" : "inbound" 
                      } 
                  ] 
              } 
          }' | json_pp
      
      output
      {
         "IId" : {
            "NameId" : "sg-01",
            "SystemId" : "sg-090b7a22f58bf49f2"
         },
         "KeyValueList" : [
            {
               "Key" : "GroupName",
               "Value" : "sg01-crehvcbp70iugvns0a80"
            },
            ... μ€‘λž΅ ...
         ],
         "SecurityRules" : [
            {
               "CIDR" : "0.0.0.0/0",
               "Direction" : "inbound",
               "FromPort" : "1",
               "IPProtocol" : "TCP",
               "ToPort" : "65535"
            },
            {
               "CIDR" : "0.0.0.0/0",
               "Direction" : "outbound",
               "FromPort" : "-1",
               "IPProtocol" : "ALL",
               "ToPort" : "-1"
            }
         ],
         "TagList" : [
            {
               "Key" : "Name",
               "Value" : "sg01-crehvcbp70iugvns0a80"
            }
         ],
         "VpcIID" : {
            "NameId" : "vpc-01",
            "SystemId" : "vpc-060eb5dc45c1117b0"
         }
      }
      
  • (3) SSH KeyPair 생성

    • μƒμ„±ν•˜κ³ μž ν•˜λŠ” λŒ€μƒ 인프라 쑰건에 λ§žλŠ” KeyPairλ₯Ό μƒμ„±ν•œλ‹€.
    • 생성 μ˜ˆμ‹œ
      • CONN_CONFIG:μœ„μ—μ„œ λ“±λ‘ν•œ Connection Name(CSP λ³€κ²½μ‹œ λŒ€μƒ Connection Name으둜 μ„€μ • ν•„μš”)
      export CONN_CONFIG=aws-ohio-config
      
      curl -sX POST http://localhost:1024/spider/keypair \
          -H 'Content-Type: application/json' \
          -d '{ 
              "ConnectionName": "'${CONN_CONFIG}'", 
              "ReqInfo": { 
                  "Name": "keypair-01" 
              } 
          }' | json_pp
      
      output
      {
         "Fingerprint" : "2e:b2:3d:0c:b8:19:3e:70:fa:98:a6:c6:f5:d2:b6:bb:03:2c:a8:03",
         "IId" : {
            "NameId" : "keypair-01",
            "SystemId" : "keypair-01-crei0krp70iugvns0a8g"
         },
         "KeyValueList" : [
            {
               "Key" : "KeyMaterial",
               "Value" : "-----BEGIN RSA PRIVATE KEY-----\n... μ€‘λž΅ ...\n-----END RSA PRIVATE KEY-----"
            }
         ],
         "PrivateKey" : "-----BEGIN RSA PRIVATE KEY-----\n... μ€‘λž΅ ...\n-----END RSA PRIVATE KEY-----",
         "TagList" : [
            {
               "Key" : "Name",
               "Value" : "keypair-01-crei0krp70iugvns0a8g"
            }
         ]
      }
      

4. VM μ œμ–΄

연동 λŒ€μƒ ν΄λΌμš°λ“œμ— VM을 생성 및 μ œμ–΄κ°€ κ°€λŠ₯ν•˜λ‹€.
VM μ œμ–΄ μ‹œμ—λŠ” μœ„μ—μ„œ λ“±λ‘ν•œ μ—°κ²° 이름(Connection Name)을 μ„€μ •μœΌλ‘œ λŒ€μƒ CSP, Driver 및 ν™œμš© Credential 등이 μ§€μ •λœλ‹€.
VM 생성 μ‹œμ—λŠ” μœ„μ—μ„œ μƒμ„±ν•œ κΈ°λ³Έ μžμ›λ“€μ„ ν™œμš©ν•˜μ—¬ VM 생성이 κ°€λŠ₯ν•˜λ‹€.
VM 생성 ν›„μ—λŠ” μƒμ„±λœ VM의 ν™œμš©μ„±μ„ 높이기 μœ„ν•˜μ—¬ Disk, MyImage 및 NLB λ“±μ˜ μΆ”κ°€ μžμ›μ„ μ—°κ³„ν•˜μ—¬ ν™œμš© κ°€λŠ₯ν•˜λ‹€. 
λ³Έ κ°€μ΄λ“œμ—μ„œλŠ” μΆ”κ°€ μžμ›μ— λŒ€ν•œ ν™œμš©μ€ μƒλž΅ν•˜κ³  VM μ œμ–΄μ— λŒ€ν•΄μ„œ λ‹€μŒ 순으둜 κ°€μ΄λ“œν•œλ‹€.

  (1) VM 생성
  (2) VM μƒνƒœ
  (3) VM μ‚­μ œ 
  • (1) VM 생성

    • μƒμ„±ν•˜κ³ μž ν•˜λŠ” λŒ€μƒ 인프라 쑰건에 λ§žλŠ” VM을 μƒμ„±ν•œλ‹€.
    • 생성 μ˜ˆμ‹œ
      • CONN_CONFIG:μœ„μ—μ„œ λ“±λ‘ν•œ Connection Name(CSP λ³€κ²½μ‹œ λŒ€μƒ Connection Name으둜 μ„€μ • ν•„μš”)
      • IMAGE_NAME,SPEC_NAME: AWSκ°€ ν˜„μž¬ μ œκ³΅ν•˜λŠ” 정보(CSP λ³€κ²½μ‹œ CSP에 맞게 λ³€κ²½ ν•„μš”)
      • κ·Έμ™Έ μžμ› 이름: μœ„μ—μ„œ μƒμ„±ν•œ μžμ› 이름
      export CONN_CONFIG=aws-ohio-config
      export IMAGE_NAME=ami-00978328f54e31526
      export SPEC_NAME=t3.micro
      
      curl -sX POST http://localhost:1024/spider/vm \
          -H 'Content-Type: application/json' \
          -d '{ 
              "ConnectionName": "'${CONN_CONFIG}'", 
              "ReqInfo": { 
                  "Name": "'${CONN_CONFIG}'-vm-01", 
                  "ImageName": "'${IMAGE_NAME}'", 
                  "VPCName": "vpc-01", 
                  "SubnetName": "subnet-01", 
                  "SecurityGroupNames": [ "sg-01" ], 
                  "VMSpecName": "'${SPEC_NAME}'", 
                  "KeyPairName": "keypair-01" 
              } 
          }' | json_pp
      
      output
      {
         "AccessPoint" : "",
         "IId" : {
            "NameId" : "aws-ohio-config-vm-01",
            "SystemId" : "i-0e0267464de62c56f"
         },
         "ImageIId" : {
            "NameId" : "ami-00978328f54e31526",
            "SystemId" : "ami-00978328f54e31526"
         },
         "ImageType" : "PublicImage",
         "KeyPairIId" : {
            "NameId" : "keypair-01",
            "SystemId" : "keypair-01-crei0krp70iugvns0a8g"
         },
         "KeyValueList" : [
            {
               "Key" : "State",
               "Value" : "running"
            },
            {
               "Key" : "Architecture",
               "Value" : "x86_64"
            },
            ... μ€‘λž΅ ...
         ],
         "NetworkInterface" : "eni-attach-0dcaaeb4270e4edd0",
         "Platform" : "LINUX/UNIX",
         "PrivateDNS" : "ip-192-168-1-64.us-east-2.compute.internal",
         "PrivateIP" : "192.168.1.64",
         "PublicIP" : "3.149.245.118",
         "Region" : {
            "Region" : "us-east-2",
            "Zone" : "us-east-2a"
         },
         "RootDeviceName" : "/dev/sda1",
         "RootDiskSize" : "8",
         "RootDiskType" : "gp2",
         "SSHAccessPoint" : "3.149.245.118:22",
         "SecurityGroupIIds" : [
            {
               "NameId" : "sg-01",
               "SystemId" : "sg-090b7a22f58bf49f2"
            }
         ],
         "StartTime" : "2024-09-08T04:35:18Z",
         "SubnetIID" : {
            "NameId" : "subnet-01",
            "SystemId" : "subnet-0b140aaac2024ef83"
         },
         "TagList" : [
            {
               "Key" : "Name",
               "Value" : "aws-ohio-config-vm-01-creij1bp70iugvns0a90"
            }
         ],
         "VMBlockDisk" : "/dev/sda1",
         "VMSpecName" : "t3.micro",
         "VMUserId" : "cb-user",
         "VpcIID" : {
            "NameId" : "vpc-01",
            "SystemId" : "vpc-060eb5dc45c1117b0"
         }
      }
      
  • (2) VM μƒνƒœ

    • μƒμ„±ν•œ VM μƒνƒœ 정보λ₯Ό ν™•μΈν•œλ‹€.
    • 확인 μ˜ˆμ‹œ
      • CONN_CONFIG:μœ„μ—μ„œ λ“±λ‘ν•œ Connection Name(CSP λ³€κ²½μ‹œ λŒ€μƒ Connection Name으둜 μ„€μ • ν•„μš”)
      export CONN_CONFIG=aws-ohio-config
      
      curl -sX GET http://localhost:1024/spider/vmstatus \
          -H 'Content-Type: application/json' \
          -d '{ 
              "ConnectionName": "'${CONN_CONFIG}'" 
          }' | json_pp
      
      output
      {
         "vmstatus" : [
            {
               "IId" : {
                  "NameId" : "aws-ohio-config-vm-01",
                  "SystemId" : "i-0e0267464de62c56f"
               },
               "VmStatus" : "Running"
            }
         ]
      }
      
  • (3) VM μ‚­μ œ

    • ν™œμš©ν•œ VM을 μ‚­μ œν•œλ‹€.
    • μ‚­μ œ μ˜ˆμ‹œ
      • CONN_CONFIG:μœ„μ—μ„œ λ“±λ‘ν•œ Connection Name(CSP λ³€κ²½μ‹œ λŒ€μƒ Connection Name으둜 μ„€μ • ν•„μš”)
      export CONN_CONFIG=aws-ohio-config
      
      curl -sX DELETE http://localhost:1024/spider/vm/${CONN_CONFIG}-vm-01 \
          -H 'Content-Type: application/json' \
          -d '{ 
              "ConnectionName": "'${CONN_CONFIG}'" 
          }' | json_pp
      
      output
      {
         "Status" : "Terminated"
      }
      

5. μžμ› μ‚­μ œ

ν™œμš©ν•œ κΈ°λ³Έ μžμ›λ“€μ„ μ‚­μ œν•œλ‹€.
μžμ› μ‚­μ œ μ‹œμ—λŠ” μœ„μ—μ„œ λ“±λ‘ν•œ μ—°κ²° 이름(Connection Name)을 μ„€μ •μœΌλ‘œ λŒ€μƒ CSP, Driver 및 ν™œμš© Credential 등이 μ§€μ •λœλ‹€.
κΈ°λ³Έ μžμ› μ‚­μ œλŠ” μžμ›κ°„ μ˜μ‘΄μ„±μ„ κ³ λ €ν•˜μ—¬ λ‹€μŒκ³Ό 같이 μƒμ„±ν•œ μ—­μˆœμœΌλ‘œ μ‚­μ œν•œλ‹€.

  (1) SSH KeyPair μ‚­μ œ 
  (2) Security Group μ‚­μ œ
  (3) VPC/Subnet μ‚­μ œ

β€» μ°Έκ³ : μžμ› 의쑴 관계
  - VPC 생성 μ‹œμ—λŠ” μ΅œμ†Œ 1개 μ΄μƒμ˜ Subnet μ„€μ • ν•„μš”, VPC 생성 ν›„ Subnet μΆ”κ°€/μ‚­μ œ κ°€λŠ₯
  - Subnet, Security Group 및 VM 등은 νŠΉμ • VPC ν•˜μœ„μ— 생성 κ°€λŠ₯ 
  - VPC μ‚­μ œλŠ” λŒ€μƒ VPCλ₯Ό ν™œμš©ν•˜λŠ” VM을 ν¬ν•¨ν•œ λͺ¨λ“  μžμ› μ‚­μ œ ν›„ μ‚­μ œ κ°€λŠ₯
  - Subnet은 VPC μ‚­μ œμ‹œ ν•¨κ»˜ μ‚­μ œ κ°€λŠ₯
  • (1) SSH KeyPair μ‚­μ œ

    • ν™œμš©ν•œ SSH KeyPairλ₯Ό μ‚­μ œν•œλ‹€.
    • μ‚­μ œ μ˜ˆμ‹œ
      • CONN_CONFIG:μœ„μ—μ„œ λ“±λ‘ν•œ Connection Name(CSP λ³€κ²½μ‹œ λŒ€μƒ Connection Name으둜 μ„€μ • ν•„μš”)
      export CONN_CONFIG=aws-ohio-config
      
      curl -sX DELETE http://localhost:1024/spider/keypair/keypair-01 \
          -H 'Content-Type: application/json' \
          -d '{ 
              "ConnectionName": "'${CONN_CONFIG}'" 
          }' | json_pp
      
      output
      {
         "Result" : "true"
      }
      
  • (2) Security Group μ‚­μ œ

    • ν™œμš©ν•œ Security Group을 μ‚­μ œν•œλ‹€.
    • μ‚­μ œ μ˜ˆμ‹œ
      • CONN_CONFIG:μœ„μ—μ„œ λ“±λ‘ν•œ Connection Name(CSP λ³€κ²½μ‹œ λŒ€μƒ Connection Name으둜 μ„€μ • ν•„μš”)
      export CONN_CONFIG=aws-ohio-config
      
      curl -sX DELETE http://localhost:1024/spider/securitygroup/sg-01 \
          -H 'Content-Type: application/json' \
          -d '{ 
              "ConnectionName": "'${CONN_CONFIG}'" 
          }' | json_pp
      
      output
      {
         "Result" : "true"
      }
      
  • (3) VPC/Subnet μ‚­μ œ

    • ν™œμš©ν•œ VPC/Subnet을 μ‚­μ œν•œλ‹€.
    • μ‚­μ œ μ˜ˆμ‹œ
      • CONN_CONFIG:μœ„μ—μ„œ λ“±λ‘ν•œ Connection Name(CSP λ³€κ²½μ‹œ λŒ€μƒ Connection Name으둜 μ„€μ • ν•„μš”)
      export CONN_CONFIG=aws-ohio-config
      
      curl -sX DELETE http://localhost:1024/spider/vpc/vpc-01 \
          -H 'Content-Type: application/json' \
          -d '{ 
              "ConnectionName": "'${CONN_CONFIG}'" 
          }' | json_pp
      
      output
      {
         "Result" : "true"
      }