PrivateLink 서비스 연계하기

Cloud Functions와 PrivateLink 서비스를 연계하여 Samsung Cloud Platform 내부의 VPC와 VPC, VPC와 서비스를 외부 인터넷 없이 연결할 수 있습니다.
데이터가 내부 네트워크만 이용하게되어 보안성이 높고, 퍼블릭 IP, NAT, VPN, 인터넷 게이트웨이 등이 필요하지 않습니다.

PrivateLink 서비스 활성화하기

PrivateLink Service를 연계하기 위해 서비스를 먼저 활성화해야 합니다.

PrivateLink 서비스를 활성화하려면 다음 절차를 따르세요.

  1. 모든 서비스 > Compute > Cloud Functions 메뉴를 클릭하세요. Cloud Functions의 Service Home 페이지로 이동합니다.
  2. Service Home 페이지에서 Function 메뉴를 클릭하세요. Function 목록 페이지로 이동합니다.
  3. Function 목록 페이지에서 PrivateLink를 연계할 자원을 클릭하세요. Function 상세 페이지로 이동합니다.
  4. Function 상세 페이지에서 구성 탭을 클릭하세요.
  5. Private 연결 구성에서 PrivateLink Service수정 버튼을 클릭하세요. PrivateLink Service 수정 팝업창이 열립니다.
  6. PrivateLink Service 수정 팝업창에서 활성화 여부사용 항목을 체크한 후, 확인 버튼을 클릭하세요. 구성 탭의 Private 연결 구성에 PrivateLink Service 정보가 표시됩니다.
구분상세 설명
Private URLPrivateLink Service URL 정보
PrivateLink Service IDPrivateLink Service ID 정보
요청 Endpoint 관리PrivateLink Service 연결을 요청한 PrivateLink Endpoint 목록
  • Endpoint ID와 승인 상태
  • 승인 관리 버튼을 클릭하여 상태 변경 가능
    • Requesting: 연결 요청 중인 Endpoint. 승인 또는 거부 버튼을 클릭하여 승인 여부 선택
    • Active: 연결이 완료된 Endpoint. 차단 버튼을 클릭하여 연결 해제 가능
    • Disconnected: 연결이 해제된 Endpoint. 재연결 버튼을 클릭하여 연결 가능
    • Reject: 연결 요청 승인이 거부된 Endpoint
표. PrivateLink Service 상세 정보 항목

PrivateLink 서비스 연계하기

PrivateLink Service를 연계하여 함수를 다른 VPC에서 프라이빗하게 접근할 수 있도록 노출시킬 수 있습니다.

안내
PrivateLink Service를 먼저 활성화한 후, 연계 작업을 진행하세요.

PrivateLink 서비스를 연계하려면 다음 작업을 확인하세요.

  • 발급된 Private URL 호출을 위하여 PrivateLink Endpoint의 IP주소와 Private URL 주소에 대한 도메인을 등록하세요.
    192.168.0.13 abc123.scf.private.kr-west1.qa2.samsungsdscloud.com
    
  • PrivateLink Service 호출 시 필요한 Endpoint 생성자의 인증 정보를 기반으로 IAM 인증을 확인하세요.
    x-scf-access-key
    
    x-scf-secret-key
    

PrivateLink Endpoint 생성하기

사용자 VPC의 PrivateLink Service에 접근하기 위한 Entry Point를 생성합니다.

주의
Endpoint 생성 시 추가 비용이 발생할 수 있습니다.

PrivateLink Endpoint를 생성하려면 다음 절차를 따르세요.

  1. 모든 서비스 > Compute > Cloud Functions 메뉴를 클릭하세요. Cloud Functions의 Service Home 페이지로 이동합니다.
  2. Service Home 페이지에서 Function 메뉴를 클릭하세요. Function 목록 페이지로 이동합니다.
  3. Function 목록 페이지에서 PrivateLink를 연계할 자원을 클릭하세요. Function 상세 페이지로 이동합니다.
  4. Function 상세 페이지에서 구성 탭을 클릭하세요.
  5. Private 연결 구성에서 PrivateLink Endpoint추가 버튼을 클릭하세요. PrivateLink Endpoint 추가 팝업창이 열립니다.
  6. PrivateLink Service 추가 팝업창에서 PrivateLink Service IDAlias 정보를 입력한 후, 확인 버튼을 클릭하세요.
  7. 생성을 알리는 팝업창이 열리면 확인 버튼을 클릭하세요. 구성 탭의 Private 연결 구성에 PrivateLink Endpoint 정보가 표시됩니다.
구분상세 설명
PrivateLink Endpoint IDPrivateLink Endpoint ID 정보
PrivateLink Service IDPrivateLink Service ID 정보
AliasPrivateLink Endpoint 접근을 위해 IP 주소 대신 사용 가능한 hostalias 정보
상태PrivateLink Endpoint의 승인 상태
  • Requesting: 승인 대기 중
  • Active: 승인 및 연결
  • Disconnected: 연결 해제
  • Reject: 승인 거부. 재요청 버튼을 클릭하여 재요청 가능
  • 삭제: 해당 Endpoint 삭제
표. PrivateLink Endpoint 상세 정보 항목

APIGW Private EPS 연계하기

SCF Endpoint와 APIGW Private Endpoint를 연결하려면 SCF Endpoint Alias에 APIGW EPS의 resource path를 대신하여 Private URL을 기재해야 합니다.

  • Private URL 예시: 181b6126ef6d4e4b81370df5.apigw.private.kr-west1.s.samsungsdscloud.com/get/resourcepath

APIGW Private EPS 연계하려면 다음 코드를 참조하세요.

배경색 변경
const request = require('request');

/**
 * @description User writing area (Function details)
*/
exports.handleRequest = async function (params) {
    return await sendRequest(params);
};
 
async function sendRequest(req) {
    return new Promise((resolve, reject) => {
        // Port 80 and Port 443 are available
        url = "https://{alias}/{resource_path}"; // Destination URL
        /**
        {alias}는 함수 내에서 Endpoint 생성 시 입력한 alias명
        {resoure_path}는 APIGW EPS의 Private URL에서 지정한 resource path (/get/resourcepath)
        */

        const options = {
            uri: url,
            method:'GET',
            json: true,
            strictSSL: false,
            rejectUnauthorized: false
        }
         
        request(options, (error, response, body) => {
            if (error) {
                reject(error);
            } else {
                resolve({
                    statusCode: response.statusCode,
                    body: JSON.stringify(body)
                });
            }
        });
    });
}
const request = require('request');

/**
 * @description User writing area (Function details)
*/
exports.handleRequest = async function (params) {
    return await sendRequest(params);
};
 
async function sendRequest(req) {
    return new Promise((resolve, reject) => {
        // Port 80 and Port 443 are available
        url = "https://{alias}/{resource_path}"; // Destination URL
        /**
        {alias}는 함수 내에서 Endpoint 생성 시 입력한 alias명
        {resoure_path}는 APIGW EPS의 Private URL에서 지정한 resource path (/get/resourcepath)
        */

        const options = {
            uri: url,
            method:'GET',
            json: true,
            strictSSL: false,
            rejectUnauthorized: false
        }
         
        request(options, (error, response, body) => {
            if (error) {
                reject(error);
            } else {
                resolve({
                    statusCode: response.statusCode,
                    body: JSON.stringify(body)
                });
            }
        });
    });
}
APIGW Private EPS 연계 코드
Blueprint 상세 가이드
Release Note