AWS SDK 예제 GitHub 리포지토리에 더 많은 AWS문서 SDK 예제
CLI로 ResetImageAttribute 사용
다음 코드 예시는 ResetImageAttribute의 사용 방법을 보여 줍니다.
- CLI
-
- AWS CLI
-
launchPermission 속성 재설정
이 예시에서는 지정된 AMI의
launchPermission속성을 기본값으로 재설정합니다. 기본적으로 AMI는 프라이빗으로 설정됩니다. 이 명령이 성공하면 출력이 반환되지 않습니다.명령:
aws ec2 reset-image-attribute --image-idami-5731123e--attributelaunchPermission-
API 세부 정보는 AWS CLI 명령 참조의 ResetImageAttribute
섹션을 참조하세요.
-
- PowerShell
-
- Tools for PowerShell V4
-
예제 1: 이 예제에서는 'launchPermission' 속성을 기본값으로 재설정합니다. 기본적으로 AMI는 프라이빗으로 설정됩니다.
Reset-EC2ImageAttribute -ImageId ami-12345678 -Attribute launchPermission-
API 세부 정보는 AWS Tools for PowerShell Cmdlet 참조(V4)의 ResetImageAttribute를 참조하세요.
-
- Tools for PowerShell V5
-
예제 1: 이 예제에서는 'launchPermission' 속성을 기본값으로 재설정합니다. 기본적으로 AMI는 프라이빗으로 설정됩니다.
Reset-EC2ImageAttribute -ImageId ami-12345678 -Attribute launchPermission-
API 세부 정보는 AWS Tools for PowerShell Cmdlet 참조(V5)의 ResetImageAttribute를 참조하세요.
-
RequestSpotInstances
ResetInstanceAttribute