[partner techshift 2017] aws 마켓플레이스 등록을 위한 테크니컬 체크리스트
TRANSCRIPT
마켓플레이스의 상품 유형
아래 3가지 유형 중 어느 유형으로 상품을 구성하여 등록/판매할지 결정
01
복잡한구성필요없이단일서버
이미지를 설치하여사용하는
패키지형소프트웨어
AMI:
Amazon Machine
Image
Clusters
and
AWS Resources
SaaS on AWS
02
전체소프트웨어환경을고객의
AWS 인프라계정에구현하는
클러스터형소프트웨어
03
고객은별도설치/구성할필요없이
판매자의서비스환경에서제공되는
서비스형소프트웨어
AMI 상품 – 대표적인 유형
VPC 10.0.0.0/16
Public Subnets
Private Subnets
10.0.1.0/24
10.0.128.0/24 10.0.129.0/24
…
FirewallIDS/IPS...
UTM
WEBWAS … …
…
WEBWAS
단일 인스턴스 상품
VPC 10.0.0.0/16
Public Subnets
Private Subnets
10.0.1.0/24
10.0.128.0/24 10.0.129.0/24
…
Agent
관리 / 배포Manager
서버
WAS … Batch …
10.0.2.0/24
WEB …
Agent 배포/관리형 상품
AMI 상품 - Pricing Model
Pricing Model Description
Bring Your Own License (BYOL)
마켓플레이스를 통해 고객 AWS 계정 내 설치는 되나 사용을 위해선 해당판매사로부터 라이센스를 구매하여 사용
Free
Hourly Hourly Hourly with Free Trial: 5 ~ 30 일 무료 제공Hourly with Monthly: 둘다 과금Hourly with Annual: Hourly with Free Trial and Annual:
Monthly Monthly : 월 정액. 사용하는 인스턴스 숫자나 시간은 관계없음NOTE: Free Trial and Annual pricing cannot be combined with Monthly pricing
Usage "AWS Marketplace Metering Service"
무료, 유료, BYOL, Trial 기간 등의 가격 정책을 결정해야 함.
AMI 상품 - Pricing Model
Usage 과금 : AWS Marketplace Metering Service
Users, Hosts, Bandwidth, 또는 Data 기준 중 택1+
(optional) 사용자 정의(최대 8개, ex. admin, power user, and read-only user) 기준
시나리오 측정 방법
Provisioned User Current #(sampling) or Max #(한시간 동안)
Concurrent User Current #(sampling) or Max/Total #(한시간 동안)
Provisioned Host Current #(sampling) or Max #(한시간 동안)
Concurrent Host Current #(sampling) or Max/Total #(한시간 동안)
Provisioned Bandwidth Current #(sampling) or Max #(한시간 동안)
Accumulated Data Current GB(sampling) , or Max/Total GB(한시간 동안)
AMI 상품 - Pricing Model
Usage 과금 : AWS Marketplace Metering Service
- 매 시간마다 측정된 값을 AWS Marketplace Metering Service SDK를 통해 호출
. 해당 application 내, 독립된 프로세스 또는 crontab
. IAM role 필요 : aws-marketplace:MeterUsage
. 리전별 endpoint로 호출 : getCurrentRegion()로 리전 확인
AMI 상품 – Product 사용성
- 상용 서비스 가능 수준이여야 함
- 제품 설치 시 별도 추가 작업없이 고객 환경에 맞는 초기화 자동 수행
• User Data(사용자 데이터) – EC2 인스턴스 최초 실행 시 구성작업 자동 실행
. shell 스크립트 또는 cloud-init 명령어
#!/bin/bashyum update –yyum install -y httpd24 php56 mysql55-server php56-mysqlndservice httpd startchkconfig httpd ongroupadd wwwusermod -a -G www ec2-userchown -R root:www /var/wwwchmod 2775 /var/wwwfind /var/www -type d -exec chmod 2775 {} +find /var/www -type f -exec chmod 0664 {} +echo "<?php phpinfo(); ?>" > /var/www/html/phpinfo.php
#cloud-configrepo_update: truerepo_upgrade: all
packages:- httpd24- php56- mysql55-server- php56-mysqlnd
runcmd:- service httpd start- chkconfig httpd on- groupadd www
- [ sh, -c, "usermod -a -G www ec2-user" ] …
shell
script
예시
cloud-
init
예시
• Windows의 경우 EC2Config 서비스 (Windows Server 2016 부터 EC2Launch)
AMI 상품 – Product 사용성
- 초기 디폴트 사용자의 패스워드는 랜덤값으로 Brute-Force 공격으로부터
안전해야 함
• 주로 해당 instance-id 값을 많이 사용함
• instance meta-data 획득 방법
. 해당 인스턴스 내에서 http://169.254.169.254/latest/meta-data/ 호출
[ec2-user ~]$ curl http://169.254.169.254/latest/meta-data/instance-idi-1a2b3c4d5e6f7g8h9
- Free 또는 유료 상품인 경우 추가적인 라이센스를 요구해선 안됨
• 마켓플레이스를 통해 생성된 인스턴스의 AMI 복제 후 실행 시 추적 과금
별도 라이센스 필요 없음
AMI 상품 – 대상 AMI 기술 요건
- HVM / 64bit 유형의 EC2 패밀리를 선택
- 보안 취약점이나 malware 또는 바이러스를 담고 있지 않아야 함
- 대상 AMI는 N.Virginia(us-east-1)에 존재해야 함
- 셀러 포탈 내 AMI Self Service Scanning으로 사전 점검 (필수)
- 리눅스의 경우 root 로그인 및 고정패스워드/key 값으로 접근 비활성화
CAR 상품
토탈 솔루션 CloudFormation 템플릿
솔루션 클러스터
+네트워크 구조/설정
+AWS 리소스
(ex. LoadBalancing, RDS, S3, ..)
{ "AWSTemplateFormatVersion" : …"Parameters" : {
"DBUser": { …"InstanceType" : {
"Default" : "t2.small", …"Resources" : {
"WebServerInstance": { …"WebServerSecurityGroup" : { …
"Outputs" : {"WebsiteURL" : { …
}
CAR 상품 – 확인 사항
- 상품 AMI
- CloudFormation Template
- 상품 Software and AWS Infrastructure Pricing
- Topology Diagram과 Metadata
CAR – CloudFormation 템플릿
- 모든 리전에서 성공적으로 구성 가능해야 함
• AWS CloudFormation 콘솔에서 리전별 자체 테스트 수행 필요
• 리전별 AMI 생성/참조 맵핑구성 및 가용 EC2 패밀리 확인 필요
"Mappings": {
"AWSRegionToAMI": {
"us-east-1": {
"AMI": "ami-2525ba32”
},
"us-east-2": {
"AMI": "ami-c76d36a2”
},
"us-west-1": { …
"Parameters": {
"InstanceType": {
"Type": "String",
"Default": "m4.2xlarge",
"AllowedValues": [
"m4.large",
"m4.xlarge",
"m4.2xlarge",
…
CAR – CloudFormation 템플릿
- Nested stack 구조 형태로 구성된 템플릿은 안됨
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Resources" : {
"myStackWithParams" : {
"Type" : "AWS::CloudFormation::Stack",
"Properties" : {
"TemplateURL" : "https://aaa.com/Sample.tmpl",
"Parameters" : {
"InstanceType" : "t2.micro",
"KeyName" : "mykey”
}
…
}
CAR – CloudFormation 템플릿
- CloudFormation 템플릿의 입력정보로 AWS credentials 정보를 요구해선 안됨
- CloudFormation 템플릿의 입력정보로 개인정보를 요구해선 안됨
- 접근가능 IP, DB 사용자/패스워드 등을 default로 셋팅하면 안됨
• 패스워드 등은 입력가능한 정규표현식을 구성
"MasterUserPassword": {
"NoEcho": "true",
"Description": "The database master user password",
"Type": "String",
"MinLength": "8",
"MaxLength": "41",
"AllowedPattern": "[a-zA-Z0-9]*",
"ConstraintDescription": "Must contain from 8 to 41 characters.”
}
CAR 상품 – 확인 사항
- SSH(default port 22), RDP(default port 3389)를 anyopen(0.0.0.0) 안됨
- 제품을 위한 신규 VPC 구성을 추천 (적절한 NACL 및 Security Group 구성)
- 필요한 고객 환경의 권한은 IAM role을 AssumeRole 형태로 구성
https://docs.aws.amazon.com/ko_kr/AWSCloudFormation/latest/UserGuide/aws-resource-iam-managedpolicy.html
"CreateTestDBPolicy" : {"Type" : "AWS::IAM::ManagedPolicy","Properties" : {"Description" : "Policy for creating a test database","Path" : "/","PolicyDocument" : {
"Version":"2012-10-17","Statement" : [{"Effect" : "Allow","Action" : "rds:CreateDBInstance","Resource" : {"Fn::Join" : [ "", [ "arn:aws:rds:", { "Ref" : "AWS::Region" }, ":", { "Ref" : "AWS::AccountId" }, ":db:test*" ] ]},"Condition" : {"StringEquals" : { "rds:DatabaseEngine" : "mysql" }
}…}
CAR – Software & AWS Pricing
- Software Price
• 판매 SW 시간당 비용 : 구성 인스턴스 수 * 시간당 인스턴스 비용
• Annual 비용은 선택사항
- AWS Infrastructure Price
• AWS Calculator 를 활용 https://calculator.s3.amazonaws.com/index.html
• CF 템플릿의 디폴트 셋팅으로 N.Virginia 리전 기준으로 계산
CAR – Topology Diagram
- CloudForamtion으로 설치될 architecture diagram
• AWS 정식 아이콘 사용 : https://aws.amazon.com/architecture/icons/
• 1100 * 700 pixels
SaaS 상품 vs AMI/CAR 상품
AMI 유형상품
구매한 상품instance
CAR 유형상품
또는
사용자 (고객)
판매자
SaaS 유형상품
사용자 (고객)
고객의 AWS 내에상품 설치/구성
판매자의 AWS에서동작되는 상품을
사용
Metering vs Contract service
두 가지 SaaS 과금 모델 지원 : ’사용한 만큼’ , ‘예약한 만큼’ 과금 모델
‘사용한 만큼’ 과금 ‘예약한 만큼’ 과금
서비스 이름 Metering Contract
과금 형태 AWS 서비스와 유사. 사용한 만큼 과금전통적인 SaaS 과금과 유사. 사용자가 먼저 예약구매한 후 해당 범위 내에서 사용
일반적인 과금 단위 Data, host hours, bandwidth, request, .. User, Storage, ..
시간 단위 Hourly, daily Monthly, annually, multi-year
판매자 청구 방법판매자는 미터링 데이타를 전송 :“Customer X used Y”
AWS가 구매자의 구매정보를 저장하고 이를판매자에게 제공 :“Customer X is allowed to use Y”
과금 시점 AWS가 정기적(monthly)으로 과금하는 시점구매자가 예약 구매하는 시점 및 갱신 시점 (monthly, annually, biannually, etc.)
예시 Trend Micro의 스캔한 hosts 숫자 기반 과금 Tableau의 예약한 사용자 수 기반 과금
Metering 서비스 – 과금 모델 정의
• 과금 기준
- Users : SaaS에서 사용할 수 있는 내부 사용자 수
- Hosts : 인스턴스나 endpoint 수
- Data : 사용한 용량 단위 MB, GB, or TB
- Bandwidth : 제공가능한 또는 측정한 대역폭 Mbps or Gbps
- Requests : Query나 API 호출 수
- Tiers : 사용량을 임계값 기준으로 티어를 구분 과금 (standard or
professional)
Metering 서비스
• 신규 사용자 등록 절차 (subscribe)
1. ‘Agree to Terms and Register’ 선택
2. 구매자 빌링 요소 업데이트 및 각종
파라메터 생성
3. SaaS 등록 URL로 redirect
4. 구매자의 ‘Registration token’ 획득
(POST 내 ‘x-amzn-marketplace-token’ )
5. ResolveCustomer(Metering Service API 내) 호출
(4단계의 토큰이 input parameter)
AWS SaaSRegistration tokenvia
HTTPS POST
7. Product Code가 맞는지 확인
8. Customer identifier 를 세션 저장소에 저장
9. SaaS 내에 사용자 정보 생성
10. 8단계의 Customer identifier 사용자 정보 내 영구
저장 (이때 중복 확인)
11. SNS notification을 통해 ‘subscribe-success’ 수신
12. 이후 지속적인 사용량 미터링 후 전송(hourly)
SaaS
6. 가입 진행, Product Code / Customer
identifier 응답
AWS
ResolveCustomer(Registration token) 호출
ResolveCustomer응답
Product Code,Customer identifier
Metering 서비스
• 사용자 과금 요청 (BatchMeterUsage)
- AWS Marketplace Metering Service 중 BatchMeterUsage API 호출
http://docs.aws.amazon.com/marketplacemetering/latest/APIReference/API_BatchMeterUsage.html
- 모든 사용자에 대해 한시간 주기로 사용 내역을 전송해야 함
. 0원도 호출 필요
. 한시간 내 중복 호출 시 최초 호출 내역만 인정(합산 안됨)
{ "ProductCode": "string", "UsageRecords": [
{ "CustomerIdentifier": "string", "Dimension": "string", "Quantity": number, "Timestamp": number
} ]
}
Contract 서비스
• 사용할 양을 AWS Marketplace를 통해 가입
• SaaS 어플리케이션에서 ‘AWS Marketplace Entitlement
Service’(GetEntitlements API)를 통해, 해당 사용자가 구매한 자격
요건을 필요시/주기적으로 확인
• Automatic Renewal 옵션 및 Upgrade 구매 가능
Contract 서비스 – 과금 모델 정의
• 하나 또는 다수 Dimension 선택
• 각 Dimension별로 unit cost 정의
• Monthly, Yearly, Bi-yearly, Triple-yearly 가능
• 과금 모델 예제들
User-based application
Data storage application
Content distribution
Contract 서비스
• 신규 사용자 등록 절차 (subscribe)
1. ‘Purchase Users(Data or Hosts)’ 선택
2. 구매자 빌링 요소 업데이트 및 각종
파라메터 생성
3. SaaS 등록 URL로 redirect
4. 구매자의 ‘Registration token’ 획득
(POST 내 ‘x-amzn-marketplace-token’ )
5. ResolveCustomer(Metering Service API 내) 호출
(4단계의 토큰이 input parameter)
AWS SaaSRegistration tokenvia
HTTPS POST
7. Product Code가 맞는지 확인
8. Customer identifier 를 세션 저장소에 저장
9. SaaS 내에 사용자 정보 생성
10. 8단계의 Customer identifier 사용자 정보 내 영구
저장 (이때 중복 확인)
11. SNS notification을 통해 ‘subscribe-success’ 수신
12. 이후 필요한 시점에 자격 요건을 AWS 에 질의
SaaS
6. 가입 진행, Product Code / Customer
identifier 응답
AWS
ResolveCustomer(Registration token) 호출
ResolveCustomer응답
Product Code,Customer identifier
Contract 서비스
• 사용자 자격 요건 확인 (GetEntitlements)
- AWS Marketplace Entitlement Service 중 GetEntitlements API 호출
http://docs.aws.amazon.com/marketplaceentitlement/latest/APIReference/API_GetEntitlements.html
- 구매한 자격 요건이 실제 SaaS 어플리케이션이 제공하는 서비스에 맞는지 확인
{"ProductCode": "72m8mmj6t2dgb8dfscnpsbfmn", "Filter": {
"CUSTOMER_IDENTIFIER": "gY2P1GGigmq" }
}
{"Entitlements": [
{"ProductCode": "72m8mmj6t2dgb8dfscnpsbfmn", "Dimension": "AdminUsers","CustomerIdentifier": "gY2P1GGigmq","Value": { "IntegerValue": 5 }"ExpirationDate": 1485477404000
},{"ProductCode": "72m8mmj6t2dgb8dfscnpsbfmn", "Dimension": "ReadOnlyUsers", "CustomerIdentifier": "gY2P1GGigmq", …
}]
}
Request Sample Response Sample
초당 10회 이하로 GetEntitlements 호출은제한됨
• AWS Marketplace Seller Guidehttp://awsmp-loadforms.s3.amazonaws.com/AWS_Marketplace_-_Seller_Guide.pdf
• AMI-Based Product Delivery Using AWS CloudFormationhttps://s3.amazonaws.com/awsmp-loadforms/awsmp-ami-delivery-using-cloudformation.pdf
• SaaS Seller Integration Guidehttps://s3.amazonaws.com/awsmp-loadforms/SaaS%20Seller%20Integration%20Guide.pdf
• AWS Marketplace API Documenthttps://aws.amazon.com/ko/documentation/marketplace/
참조 내역