문의 주신 내용에 맞는 전문 컨설턴트 배정 후 연락드리겠습니다.
· Intro
· 서비스 간단 소개
· 리소스 등록 및 검색 확인
· 마무리
이미지 출처: AWS Cloud Map Overview
요금 관련 자세한 내용은 여기 참고 바랍니다.
선택 유형 | 조회 가능 방식 | Route 53 Hosted Zone 생성 여부 | Health check 옵션 |
---|---|---|---|
API calls | - API calls | N/A | - Route 53 health check - Custom health check |
API calls and DNS queries in VPCs | - API calls - Private DNS queries | - Private Hosted Zone 생성 | - Custom health check |
API calls and public DNS queries | - API calls - Public DNS queries | - Public Hosted Zone 생성 | - Route 53 health check - Custom health check |
[ec2-user@ip-172-31-30-148 ~]$ aws servicediscovery discover-instances
> --namespace-name gstest --service-name testservice
{
"Instances": [
{
"InstanceId": "webapp1",
"NamespaceName": "gstest",
"ServiceName": "testservice",
"HealthStatus": "HEALTHY",
"Attributes": {
"AWS_INSTANCE_IPV4": "172.31.43.81",
"ver": "1.0",
"env": "prod"
}
}
]
}
[ec2-user@ip-172-31-30-148 ~]$ aws servicediscovery register-instance
> --service-id srv-f6ablk2t5cgmgkxb --instance-id webapp2
> --attributes AWS_INSTANCE_IPV4=172.31.30.148,env=prod,ver=2.0
{
"OperationId": "533brlcjkneaj5rljl3cgsiky4vpbv7g-jpuk9x12"
}
[ec2-user@ip-172-31-30-148 ~]$ aws servicediscovery discover-instances
> --namespace-name gstest --service-name testservice
> --query-parameters env=prod
{
"Instances": [
{
"InstanceId": "webapp1",
"NamespaceName": "gstest",
"ServiceName": "testservice",
"HealthStatus": "HEALTHY",
"Attributes": {
"AWS_INSTANCE_IPV4": "172.31.43.81",
"ver": "1.0",
"env": "prod"
}
},
{
"InstanceId": "webapp2",
"NamespaceName": "gstest",
"ServiceName": "testservice",
"HealthStatus": "HEALTHY",
"Attributes": {
"AWS_INSTANCE_IPV4": "172.31.30.148",
"ver": "2.0",
"env": "prod"
}
}
]
}
[ec2-user@ip-172-31-30-148 ~]$ aws servicediscovery discover-instances
> --namespace-name gstest --service-name testservice
> --query-parameters ver=2.0
{
"Instances": [
{
"InstanceId": "webapp2",
"NamespaceName": "gstest",
"ServiceName": "testservice",
"HealthStatus": "HEALTHY",
"Attributes": {
"AWS_INSTANCE_IPV4": "172.31.30.148",
"ver": "2.0",
"env": "prod"
}
}
]
}
[ec2-user@ip-172-31-43-81 ~]$ dig +short testservice.gstest
172.31.43.81
[ec2-user@ip-172-31-43-81 ~]$ dig +short testservice.gstest
172.31.30.148
[ec2-user@ip-172-31-30-148 ~]$ aws servicediscovery create-http-namespace
> --name httpnamespace
{
"OperationId": "nysnwtlr7lpzyhi5undwvux73wuzaade-jpthhyb6"
}
[ec2-user@ip-172-31-30-148 ~]$ aws servicediscovery create-service
--name apicallservice --namespace-id ns-wqpirkiocccvc2jk
{
"Service": {
"Name": "testservice",
"DnsConfig": {},
"CreateDate": 1545121735.129,
"CreatorRequestId": "f86379db-394c-49e7-95e8-bb50aedd264b",
"Id": "srv-tpq6vlzdw4gm65at",
"NamespaceId": "ns-zd6szir6rd7hxnen",
"Arn": "arn:aws:servicediscovery:ap-northeast-1:00000000000:service/srv-tpq6vlzdw4gm65at"
}
}
[ec2-user@ip-172-31-30-148 ~]$ aws servicediscovery register-instance
> --service-id srv-tpq6vlzdw4gm65at --instance-id s3test
> --attributes ARN=arn:aws:s3:::gstest-cloudmap,env=prod,ver=2.0
{
"OperationId": "foomxra2ikqutisjb23xqyfbkvewew4c-jpukm31w"
}
[ec2-user@ip-172-31-30-148 ~]$ aws servicediscovery discover-instances
> --namespace-name httpnamespace --service-name testservice
{
"Instances": [
{
"InstanceId": "s3test",
"NamespaceName": "httpnamespace",
"ServiceName": "testservice",
"HealthStatus": "UNKNOWN",
"Attributes": {
"ver": "2.0",
"ARN": "arn:aws:s3:::gstest-cloudmap",
"env": "prod"
}
}
]
}