vpc_id=$(aws ec2 describe-vpcs --filters "Name=tag:Name,Values=wsi-vpc" --query "Vpcs[].VpcId[]" --region ap-northeast-2 --output text)
Shell
복사
NAMESPACE_ID=$(aws servicediscovery create-private-dns-namespace \
--name 'wsi.local' \
--vpc $vpc_id \
--region ap-northeast-2 \
--output text
)
Shell
복사
aws servicediscovery get-operation --operation-id $NAMESPACE_ID
Shell
복사
NAMESPACE_ID=$(aws servicediscovery list-namespaces \
--filters Name=NAME,Values=wsi.local,Condition=EQ \
--query 'Namespaces[0].Id' \
--output text)
Shell
복사
SERVICE_ID=$(aws servicediscovery create-service \
--name "stress" \
--namespace-id $NAMESPACE_ID \
--description "Namespace for new application" \
--dns-config "NamespaceId=$NAMESPACE_ID,DnsRecords=[{Type=SRV,TTL=15}]" \
--health-check-custom-config "FailureThreshold=1" \
--query 'Service.Id' \
--output text)
Shell
복사
