2013-01-22 5 views
1

기본적으로 app_name.elasticbeanstalk.com 도메인 이름이있는 Beanstalk App이 있습니다.Elastic Beanstalk App에 대해 사용자 지정된 DNS 이름을 설정하는 방법

bowser가 액세스 할 수있는 www.app_name.com과 같은 도메인 이름을 원하고 다음 단계를 수행하십시오.

  1. 는 ELB의 공용 DNS의 CNAME으로 도메인 이름 app_name.com
  2. 설정 www.app_name.com을 등록합니다.

이렇게하면 브라우저에서 www.app_name.com에 액세스 할 수 있습니다. 하지만 일단 브라우저가로드되면 URL은 갑자기 app_name.elasticbeanstalk.com으로 변경됩니다.

app_name.elasticbeanstalk.com을 다른 사용자에게 표시하고 싶지 않습니다. www.app_name.com을 사용할 수 있습니까? 방법?

도와주세요.

+0

그냥 분명히 : www.app_name.com의 CNAME은 app_name.elasticbeanstalk.com입니까? –

답변

5

Route53CloudFormation을 사용하여이 작업을 수행 할 수 있습니다. 이렇게하려면 CloudFormation 템플릿의 Elastic Beanstalk 리소스를 사용하여 Elastic Beanstalk 스택을 만듭니다. Route53 리소스를 사용하여 원하는 도메인 이름을 만들 수도 있습니다. 그런 다음 Route53 리소스 내에서 Elastic Beanstalk 엔드 포인트에 매핑되는 별칭을 만듭니다.

이 같은 것을 볼 수 있습니다 CloudFormation 자원 사용에 대한

"Resources" : { 
    "DNS" : { 
    "Type" : "AWS::Route53::RecordSetGroup", 
    "Properties" : { 
     "HostedZoneName" : "example.com", 
     "Comment" : "CNAME alias targeted to Elastic Beanstalk endpoint.", 
     "RecordSets" : [ 
     { 
      "Name" : "example.example.com", 
      "Type" : "CNAME", 
      "TTL" : "900", 
      "ResourceRecords" : [{ "Fn::GetAtt" : ["sampleEnvironment","EndpointURL"] }] 
     }] 
    } 
    }, 

    "sampleApplication" : { 
    "Type" : "AWS::ElasticBeanstalk::Application", 
    "Properties" : { 
     "Description" : "AWS Elastic Beanstalk Ruby Sample Application", 
     "ApplicationVersions" : [{ 
     "VersionLabel" : "Initial Version", 
     "Description" : "Version 1.0", 
     "SourceBundle" : { 
      "S3Bucket" : { "Fn::Join" : ["-", ["elasticbeanstalk-samples", { "Ref" : "AWS::Region" }]]}, 
      "S3Key" : "ruby-sample.zip" 
     } 
     }], 
     "ConfigurationTemplates" : [{ 
     "TemplateName" : "DefaultConfiguration", 
     "Description" : "Default Configuration Version 1.0 - with SSH access", 
     "SolutionStackName" : "64bit Amazon Linux running Ruby 1.9.3", 
     "OptionSettings" : [{ 
      "Namespace" : "aws:autoscaling:launchconfiguration", 
      "OptionName" : "EC2KeyName", 
      "Value" : { "Ref" : "KeyName" } 
     }] 
     }] 
    } 
    }, 
    "sampleEnvironment" : { 
    "Type" : "AWS::ElasticBeanstalk::Environment", 
    "Properties" : { 
     "ApplicationName" : { "Ref" : "sampleApplication" }, 
     "Description" : "AWS Elastic Beanstalk Environment running Ruby Sample Application", 
     "TemplateName" : "DefaultConfiguration", 
     "VersionLabel" : "Initial Version" 
    } 
    } 
}, 

상세 정보 here를 찾을 수 있으며 샘플 템플릿을 here

CloudFormation 동적으로 매우 쉽게 청소 자원과 상호 작용을 가능하게 찾을 수 있습니다을 .. 아니 완전히 언급 된 스크립트를 언급 :