CloudFormation으로 EC2 생성 시 발생하는 The requested configuration is currently not supported. Please check the documentation for supported configurations 에러 해결

CloudFormation으로 EC2 생성 시 발생하는 The requested configuration is currently not supported. Please check the documentation for supported configurations 에러를 해결하는 방법에 대해서 정리해 봤습니다.
2023.02.19

この記事は公開されてから1年以上経過しています。情報が古い可能性がありますので、ご注意ください。

안녕하세요 클래스메소드 김재욱(Kim Jaewook) 입니다. 이번에는 CloudFormation으로 EC2 생성 시 발생하는 The requested configuration is currently not supported. Please check the documentation for supported configurations 에러를 해결하는 방법에 대해서 정리해 봤습니다.

에러 발생

The requested configuration is currently not supported. Please check the documentation for supported.

CloudFormation으로 EC2 인스턴스를 생성 했더니 다음과 같은 에러가 발생했습니다.

에러 해결

먼저 에러가 발생하는 이유로는 일부 옵션이 인스턴스 유형과 호환되지 않거나, 요청된 AWS 리전 또는 가용 영역 내에서 인스턴스 설정이 지원되지 않을 수 있습니다.

먼저 인스턴스 타입이 해당 가용 영역에서 사용할 수 없는지 확인해 보도록 하겠습니다.

확인 하는 방법으로는 EC2 콘솔 화면에서「인스턴스 유형」을 클릭합니다.

그리고 원하는 EC2 인스턴스 타입을 검색하고「가용 영역」을 확인합니다.

가용 영역을 확인함으로써, 해당 인스턴스 타입이 현재 가용 영역에서 사용할 수 있는지 확인할 수 있습니다.

그 외 생각할 수 있는 에러는 일부 옵션이 인스턴스 유형과 호환되지 않는 부분입니다.

# ------------------------------------------------------------#
# Input Parameters
# ------------------------------------------------------------# 
Parameters:
  testEC2KeyPair: 
    Description: Amazon EC2 Key Pair
    Type: "AWS::EC2::KeyPair::KeyName"
  testSubnetIDs: 
    Description: Subnet IDs
    Type: "AWS::EC2::Subnet::Id"
  testSecurityGroupIDs:
    Description: List of Security Groups to add to EC2 instance
    Type: List<AWS::EC2::SecurityGroup::Id>
  testInstanceType:
    Description: test EC2 instance type
    Type: String
    Default: t2.small
Resources:
# ------------------------------------------------------------#
#  Create EC2 Instance
# ------------------------------------------------------------#
  Testec2:
    Type: AWS::EC2::Instance
    Properties:
      ImageId: ami-0cd7ad8676931d727
      InstanceType: !Ref testInstanceType
      KeyName: !Ref testEC2KeyPair
      DisableApiTermination: true
      EbsOptimized: true
      BlockDeviceMappings:
        - DeviceName: /dev/sda1
          Ebs:
            VolumeSize: 20
            VolumeType: gp2
      SecurityGroupIds: !Ref testSecurityGroupIDs
      SubnetId: !Ref testSubnetIDs

현재 CloudFormation 템플릿을 확인해 보면, 인스턴스 타입 t2.small에 EbsOptimized를 true로 설정하고 있습니다.

여기서 에러 원인을 확인할 수 있는데, 현재 t2 계열은 EBS 최적화 옵션인 EbsOptimized를 지원하지 않기 때문에 에러가 발생한 것 입니다.

EbsOptimized는 default값이 false이기 때문에 EbsOptimized를 지우거나 false로 변경 후 다시 스택을 생성합니다.

스택을 생성해 보면 문제 없이 EC2 인스턴스가 생성 된 것을 확인할 수 있습니다.

본 블로그 게시글을 보시고 문의 사항이 있으신 분들은 클래스메소드코리아 (info@classmethod.kr)로 연락 주시면 빠른 시일 내 담당자가 회신 드릴 수 있도록 하겠습니다 !