AWS announces preview of AWS Interconnect - multicloud
AWS announces AWS Interconnect – multicloud (preview), providing simple, resilient, high-speed private connections to other cloud service providers. AWS Interconnect - multicloud is easy to configure and provides high-speed, resilient connectivity with dedicated bandwidth, enabling customers to interconnect AWS networking services such as AWS Transit Gateway, AWS Cloud WAN, and Amazon VPC to other cloud service providers with ease.
CloudFormation 템플릿으로 생성한 Amazon EC2 인스턴스의 루트 볼륨 속성을 설정하려면 어떻게 해야 합니까?
AWS CloudFormation 템플릿을 사용하여 Amazon Elastic Compute Cloud(Amazon EC2) 인스턴스를 생성했습니다. 인스턴스의 루트 볼륨 속성을 설정하려고 합니다.
해결 방법
참고: 기본적으로 EC2 인스턴스는 Amazon Machine Image(AMI)의 블록 디바이스 매핑에 지정된 블록 디바이스를 사용합니다. AMI 블록 디바이스 매핑을 재정의하려면 인스턴스 블록 디바이스 매핑을 사용하십시오. 루트 볼륨의 경우 볼륨 크기, 볼륨 유형 및 DeleteOnTermination 설정만 재정의할 수 있습니다. 인스턴스가 실행된 후에는 연결된 Amazon Elastic Block Store(Amazon EBS) 볼륨의 DeleteOnTermination 설정만 수정할 수 있습니다.
AMI 루트 볼륨의 디바이스 이름 식별
디바이스 이름을 찾으려면 Amazon EC2 콘솔 또는 AWS Command Line Interface(AWS CLI)를 사용하십시오.
**참고:AWS CLI 명령을 실행할 때 오류가 발생하면, **AWS CLI 오류 문제 해결을 참조하세요. 또한 최신 AWS CLI 버전을 사용하고 있는지 확인하십시오.
Amazon EC2 콘솔
디바이스 이름을 식별하려면 다음 단계를 완료하십시오.
- Amazon EC2 콘솔을 엽니다.
- 탐색 표시줄에서 인스턴스를 시작하려는 AWS 리전을 선택합니다.
- 탐색 창에서 AMI를 선택합니다.
- 필터를 사용하여 AMI를 찾은 다음 선택합니다.
- 세부 정보 탭에서 루트 디바이스 이름 값을 복사합니다.
AWS CLI
디바이스 이름을 식별하려면 describe-images 명령을 실행합니다.
aws ec2 describe-images \ --region us-east-1 \ --image-ids ami-1234567890AWSEXAMPLE
참고: us-east-1을 자신의 리전으로 바꾸고 ami-1234567890AWSEXAMPLE를 자신의 AMI로 바꾸십시오.
명령의 출력이 디바이스 이름을 RootDeviceName의 값으로 반환합니다.
EC2 인스턴스의 루트 볼륨 속성 설정
AWS::EC2::Instance 리소스의 BlockDeviceMapping 속성을 사용하여 EC2 인스턴스의 루트 볼륨 속성을 설정합니다.
다음 JSON 및 YAML 예시에서 CloudFormation은 다음과 같은 구성으로 EC2 인스턴스를 생성합니다.
- 루트 볼륨의 크기는 30GB로 설정됩니다.
- 루트 볼륨의 DeleteOnTermination 속성이 true입니다.
- 지정된 AMI가 Amazon Linux 2 AMI이기 때문에 DeviceName은 /dev/xvda입니다.
- Encrypted 속성은 true입니다. 이 구성은 루트 볼륨의 기본 암호화를 허용합니다.
참고: 템플릿에서 /dev/xvda를 루트 디바이스 이름 값으로 바꾸십시오. 필요한 경우 템플릿에서 Ebs 속성을 수정합니다.
JSON 템플릿 예시:
{ "AWSTemplateFormatVersion": "2010-09-09", "Description": "AWS CloudFormation Sample Template that shows how to increase the size of the root volume. **WARNING** This template creates an Amazon EC2 instance. You will be billed for the AWS resource used if you create a stack from this template.", "Parameters": { "KeyName": { "Type": "AWS::EC2::KeyPair::KeyName", "Description": "Name of an existing EC2 KeyPair to enable SSH access to the EC2 instance." }, "InstanceType": { "Description": "EC2 instance type", "Type": "String", "Default": "t2.micro", "ConstraintDescription": "Please choose a valid instance type." }, "AMIID": { "Description": "The Latest Amazon Linux 2 AMI taken from the public AWS Systems Manager Parameter Store", "Type": "AWS::SSM::Parameter::Value<String>", "Default": "/aws/service/ami-amazon-linux-latest/amzn2-ami-hvm-x86_64-gp2" } }, "Resources": { "LinuxInstance": { "Type": "AWS::EC2::Instance", "Properties": { "ImageId": { "Ref": "AMIID" }, "InstanceType": { "Ref": "InstanceType" }, "KeyName": { "Ref": "KeyName" }, "BlockDeviceMappings": [ { "DeviceName": "/dev/xvda", "Ebs": { "VolumeType": "gp2", "VolumeSize": "30", "DeleteOnTermination":"false", "Encrypted": "true" } } ] } } } }
YAML 템플릿 예시:
AWSTemplateFormatVersion: 2010-09-09Description: >- AWS CloudFormation Sample Template that shows how to increase the size of the root volume. **WARNING** This template creates an Amazon EC2 instance. You will be billed for the AWS resource used if you create a stack from this template. Parameters: KeyName: Type: 'AWS::EC2::KeyPair::KeyName' Description: Name of an existing EC2 KeyPair to enable SSH access to the EC2 instance. InstanceType: Description: EC2 instance type Type: String Default: t2.micro ConstraintDescription: Please choose a valid instance type. AMIID: Description: >- The Latest Amazon Linux 2 AMI taken from the public Systems Manager Parameter Store Type: 'AWS::SSM::Parameter::Value<String>' Default: /aws/service/ami-amazon-linux-latest/amzn2-ami-hvm-x86_64-gp2 Resources: LinuxInstance: Type: 'AWS::EC2::Instance' Properties: ImageId: !Ref AMIID InstanceType: !Ref InstanceType KeyName: !Ref KeyName BlockDeviceMappings: - DeviceName: /dev/xvda Ebs: VolumeType: gp2 VolumeSize: '30' DeleteOnTermination: 'false' Encrypted: 'true'
- 언어
- 한국어

관련 콘텐츠
- 질문됨 8년 전