인프라를 코드로 관리하자.
1
VPC
command-naver-dev-vpc
KR-1
Subnet 생성
command-naver-dev-pub1
10.0.0.0/24
일반
참고
command-na-dev-vpc
command-na-dev-pub1
2
로키 리눅스나 우분트 리눅스 명령서버 1대 만들기
1
리눅스 서버 로그인
로키 리눅스 가능
centos 가능
2
# Register the Microsoft RedHat repository
curl https://packages.microsoft.com/config/rhel/7/prod.repo | sudo tee /etc/yum.repos.d/microsoft.repo
3
# Install PowerShell
sudo yum install -y powershell
4
# Start PowerShell
pwsh
[root@Server-EC2 ~]# pwsh
PowerShell 7.2.2
Copyright (c) Microsoft Corporation.
Type 'help' to get help.
PS /root> exit
https://code.visualstudio.com/docs/setup/setup-overview
1
wget -O ncloud-cli.zip https://www.ncloud.com/api/support/download/files/26
unzip ncloud-cli.zip
cd cli_linux
chmod 740 ncloud
chmod 740 ./jre8/bin/java
vi ~/.bashrc
# .bashrc
# User specific aliases and functions
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
export PATH=$PATH:/root/cli_linux
2
cd cli_linux/
vi ncloud
#!/bin/bash
DIR=$(dirname $(realpath $0))
$DIR/jre8/bin/java -jar $DIR/lib/ncloud-api-cli-1.1.6-SNAPSHOT-jar-with-dependencies.jar "$@"
source .bashrc
ncloud
2
ncloud 환경 설정 하기
access-key , secret-key를 알아야 한다.
my page > 인증키 관리에서 확인 할수 있다.
[root@Server-EC2 ~]# ncloud configure
set [DEFAULT]'s configuration.
Ncloud Access Key ID []: EQCygJㅌㅌㅌㅌㅌㅌㅌㅌㅌㅌㅌㅌㅌ
Ncloud Secret Access Key []: 3z0xYㅌㅌㅌㅌㅌㅌㅌㅌㅌㅌㅌㅌㅌ
Ncloud API URL (default:https://ncloud.apigw.ntruss.com) []:
3
확인
[root@Server-EC2 ~]# ncloud server getRegionList
{"getRegionListResponse": {
"requestId": "a7c0441c-b5c9-406b-9546-6499ce3c88f5",
"returnCode": "0",
"returnMessage": "success",
"totalRows": 6,
"regionList": [
{
"regionNo": "1",
"regionCode": "KR",
"regionName": "Korea"
},
{
"regionNo": "3",
"regionCode": "HK",
"regionName": "HongKong"
},
{
"regionNo": "7",
"regionCode": "SGN",
"regionName": "Singapore(New)"
},
{
"regionNo": "8",
"regionCode": "JPN",
"regionName": "Japan(New)"
},
{
"regionNo": "9",
"regionCode": "USWN",
"regionName": "US-West(New)"
},
{
"regionNo": "10",
"regionCode": "DEN",
"regionName": "Germany(New)"
}
]
}}
sudo yum install -y yum-utils
sudo yum-config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo
sudo yum -y install terraform
terraform
https://brunch.co.kr/@topasvga/2368
감사합니다.