SAW 런북을 사용하여 API Gateway의 사용자 지정 도메인 이름 문제를 해결하려면 어떻게 해야 하나요?

7분 분량
0

AWSSupport-TroubleshootAPIGatewayCustomDomainConfig AWS Support Automation Workflow(SAW) 런북을 사용하여 Amazon API Gateway의 사용자 지정 도메인 이름 구성 문제를 해결하고 싶습니다.

간략한 설명

AWSSupport-TroubleshootAPIGatewayCustomDomainConfig 런북은 API Gateway의 사용자 지정 도메인 이름 구성을 확인하기 위한 자동화된 솔루션입니다. 이 런북은 사용자 지정 도메인 이름이 DNS 레코드 및 API 매핑에 대한 올바른 구성으로 API Gateway에 설정되어 있는지 확인합니다.

SAW에 대한 자세한 내용은 AWS Support Automation Workflows(SAW)를 참조하세요.

해결 방법

AWSSupport-TroubleshootAPIGatewayCustomDomainConfig 런북은 다음 특성을 검증합니다.

  • 사용자 지정 도메인 이름이 API Gateway에 있는지 여부.
  • 사용자 지정 도메인 이름과 모든 API 간에 매핑이 있는지 여부.
  • 이전 매핑 목록에 사용자 지정 도메인 이름과 지정된 API 간의 매핑이 있는지 여부.
  • 사용자 지정 도메인 이름에 대한 기존 DNS 레코드가 있는지 여부.
  • DNS 레코드가 사용자 지정 도메인 이름 생성 중에 API Gateway가 생성한 올바른 타겟 값을 가리키는지 여부.

자동화를 실행하는 현재 사용자 또는 위임된 AWS Identity and Access Management(IAM) 서비스 역할에는 다음 권한이 있어야 합니다.

  • apigateway:GET
  • iam:ListRoles
  • iam:PassRole
  • route53:ListResourceRecordSets
  • ssm:DescribeAutomationExecutions
  • ssm:GetAutomationExecution
  • ssm:DescribeAutomationStepExecutions
  • ssm:StartAutomationExecution
  • ssm:DescribeDocument
  • ssm:GetDocument
  • ssm:ListDocuments

전제 조건

런북을 실행하기 전에, IAM 사용자 또는 역할에 올바른 권한이 있는지 확인하세요. 이러한 권한에는 특정 AWS Systems Manager 권한과 이 문서의 이전 섹션에서 다룬 추가 서비스별 권한이 포함됩니다.

AWSSupport-TroubleshootAPIGatewayCustomDomainConfig 자동화 실행

  1. AWSSupport-TroubleshootAPIGatewayCustomDomainConfig 런북을 엽니다.
    참고: 이 런북은 us-east-1 AWS 리전에 있습니다.

  2. 자동화 실행을 선택합니다.

    입력 파라미터에 다음을 입력합니다.

    • AutomationAssumeRole(선택 사항): Systems Manager의 기능인 자동화가 사용자 대신 작업을 수행할 수 있도록 허용하는 IAM 역할의 Amazon 리소스 이름(ARN). 역할이 지정되지 않은 경우 자동화는 런북을 시작한 사용자의 권한을 사용합니다.
    • DomainName(필수): API의 사용자 지정 도메인 이름.
    • ApiId(필수): API의 ID.
    • DNSServerIp(선택 사항): 사용자 지정 도메인 이름을 확인하기 위한 DNS 서버. 값을 지정하지 않으면 AWS DNS 서버가 사용됩니다.
    • HostedZoneId(선택 사항): 사용자 지정 도메인 이름에 대한 DNS 레코드가 포함된 공용 호스팅 영역의 ID. Route 53이 DNS에 사용되지 않는 경우에는 필요 없습니다.
  3. 실행을 선택합니다. 자동화가 시작됩니다.

  4. 자동화가 완료되면 출력 섹션을 검토하여 자세한 결과를 확인합니다.

    런북 검사가 실행되면 출력에 사용자 지정 도메인 이름의 구성 세부 정보가 표시됩니다.

    사용자 지정 도메인 이름 구성이 런북 내 검사 중 하나를 통과하지 못하면 해당 단계에서 런북이 실패합니다. 문제 해결 권장 사항은 런북의 출력에서 확인할 수 있습니다.

AWSSupport-TroubleshootAPIGatewayCustomDomainConfig 런북의 출력 예시

성공적인 구성 검사의 경우 출력 예시:

{
  "Result": "The custom domain name is configured correctly",
  "DomainDetails": {
    "DomainName": "<<CUSTOM DOMAIN NAME>>",
    "APIGatewayDomainName": "d-XXXXXXXX.execute-api.<<REGION>>.amazonaws.com",
    "Status": "XXXXXX",
    "EndpointType": "XXXXXX"
  },
  "MappingDetails": [
    {
      "API": "XXXXXX",
      "MappingId": "XXXXXX",
      "MappingKey": "XXXXXX",
      "Stage": "XXXXXX",
      "Status": "ApiHasMappings"
    }
  ],
  "DNSDetails": {
    "<<RECORD TYPE>>": [
      "XXX.XXX.XXX.XXX",
      "XXX.XXX.XXX.XXX",
      "XXX.XXX.XXX.XXX"
    ]
  }
}

사용자 지정 도메인 이름이 API Gateway에 없는 경우의 출력 예시:

" Check (1/5): Check custom domain name exists.
  Status: Failed.

  Troubleshooting Recommendations:
    - Custom domain name: <<CUSTOM DOMAIN NAME>> is not configured in API gateway.
    - Please see the link below for information on how to setup a custom domain for API Gateway:
      > https://aws.amazon.com/ko/premiumsupport/knowledge-center/custom-domain-name-amazon-api-gateway/

    - The remaining checks have not been run at this point hence there may be other errors in the current configuration.
    - After resolving the error above, please check that your custom domain name has:
      > A mapping to the API you are trying to reach
      > A DNS record pointing to the generated API Gateway domain name.

    - You can run this automation again to confirm the changes have been made correctly.
    - More details for this particular error can be found within the individual step details.

  Check (2/5): List mappings.
  Status: Skipped

  Check (3/5): Check mapping exists to API Id: <<API ID>>.
  Status: Skipped

  Check (4/5): Check DNS record exists for custom domain name.
  Status: Skipped

  Check (5/5): Validate DNS record.
  Status: Skipped "

사용자 지정 도메인 이름에 매핑이 전혀 없는 경우의 출력 예시:

" Check (1/5): Check custom domain name exists.
  Status: Complete

  Check (2/5): List mappings.
  Status: Failed

  Troubleshooting Recommendations:
    - <<CUSTOM DOMAIN NAME>> does not contain any mappings.
    - Please see the documentation to create one here:
      > https://docs.aws.amazon.com/apigateway/latest/developerguide/rest-api-mappings.html

    - The remaining checks have not been run at this point hence there may be other errors in the current configuration.
    - After resolving the error above, please check that your custom domain name has:
      > A mapping to the API you are trying to reach
      > A DNS record pointing to the generated API Gateway domain name.

    - You can run this automation again to confirm the changes have been made correctly.
    - More details for this particular error can be found within the individual step details.

  Check (3/5): Check mapping exists to API Id: <<API ID>>.
  Status: Skipped

  Check (4/5): Check DNS record exists for custom domain name.
  Status: Skipped

  Check (5/5): Validate DNS record.
  Status: Skipped "

사용자 지정 도메인 이름이 지정된 API ID에 매핑되지 않은 경우의 출력 예시:

" Check (1/5): Check custom domain name exists.
  Status: Complete

  Check (2/5): List mappings.
  Status: Complete

  Check (3/5): Check mapping exists to API Id: <<API ID>>.
  Status: Failed

    Troubleshooting Recommendations:
    - A base path mapping does not exist between API Id: <<API ID>> and custom domain name: <<CUSTOM DOMAIN NAME>>.
    - Please see the documentation to create one here:
      > https://docs.aws.amazon.com/apigateway/latest/developerguide/rest-api-mappings.html

    - The remaining checks have not been run at this point hence there may be other errors in the current configuration.
    - After resolving the error above, please check that your custom domain name has:
      > A mapping to the API you are trying to reach
      > A DNS record pointing to the generated API Gateway domain name.

    - You can run this automation again to confirm the changes have been made correctly.
    - More details for this particular error can be found within the individual step details.

  Check (4/5): Check DNS record exists for custom domain name.
  Status: Not Run

  Check (5/5): Validate DNS record.
  Status: Skipped "

사용자 지정 도메인 이름에 대한 DNS 레코드가 없는 경우의 출력 예시:

" Check (1/5): Check custom domain name exists.
  Status: Complete

  Check (2/5): List mappings.
  Status: Complete

  Check (3/5): Check mapping exists to API Id: <<API ID>>.
  Status: Complete

  Check (4/5): Check DNS record exists for custom domain name.
  Status: Failed

  Troubleshooting Recommendations:
    - There is no DNS record for the custom domain name: <<CUSTOM DOMAIN NAME>> or the domain could not be resolved.
    - Please check your DNS server for a record for this domain and ensure it can be resolved.

    - The remaining checks have not been run at this point hence there may be other errors in the current configuration.
    - After resolving the error above, please check that your custom domain name has:
      > A DNS record pointing to the generated API Gateway domain name.

    - You can run this automation again to confirm the changes have been made correctly.
    - More details for this particular error can be found within the individual step details.


  Check (5/5): Validate DNS record.
  Status: Skipped "

DNS 레코드가 올바른 타겟을 가리키지 않는 경우의 출력 예시:

" Check (1/5): Check custom domain name exists.
  Status: Complete

  Check (2/5): List mappings.
  Status: Complete

  Check (3/5): Check mapping exists to API Id: <<API ID>>.
  Status: Complete

  Check (4/5): Check DNS record exists for custom domain name.
  Status: Complete

  Check (5/5): Validate DNS record.
  Status: Failed

  Troubleshooting Recommendations:
    - The DNS record for the custom domain name: <<CUSTOM DOMAIN NAME>> may not be pointing to the correct target.
    - The API Gateway domain name generated for this custom domain name is: <<API GATEWAY DOMAIN NAME>> which should be the target of the DNS record created for the custom domain name.
    - Please check your DNS record for this domain and ensure it is pointing to the API Gateway domain name: <<API GATEWAY DOMAIN NAME>>.

    - After resolving the error above, you can run this automation again to confirm the changes have been made correctly.
    - More details for this particular error can be found within the individual step details."

참고: AWS 리소스의 문제 해결, 수정, 관리 및 비용 절감을 돕기 위해, AWS Support는 AWS에서 제공하는 사전 정의된 런북 중 일부를 유지 관리합니다. 런북 접두사는 AWSSupport- 및 **AWSPremiumSupport-**입니다.

관련 정보

자동화 실행

자동화 설정

댓글 없음

관련 콘텐츠