# 수업 준비

1. 해당 [문서](https://docs.aws.amazon.com/cloud9/latest/user-guide/create-environment-main.html)를 참고해서 Cloud9 환경 생성 -&#x20;
   1. 플랫폼: **Amazon Linux 2023**
   2. 인스턴스 타입: **m5.large**
2. Cloud9 인스턴스로 접속한 다음 Terraform이 설치되어 있는지 확인

   ```
   terraform --version
   ```
3. Terraform이 설치되어 있지 않을 경우 아래의 명령어를 실행해서 Terraform 설치

   ```
   {
       sudo yum install -y yum-utils
       sudo yum-config-manager --add-repo https://rpm.releases.hashicorp.com/AmazonLinux/hashicorp.repo
       sudo yum -y install terraform
   }
   ```
4. Terraform 설치 확인&#x20;

   ```
   terraform --version
   ```
5. Cloud9에 설정된 AWS 임시 자격증명 비활성화

   ```
   {
       export TOKEN=$(curl -sX PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600")
       export INSTANCE_ID=$(curl -sH "X-aws-ec2-metadata-token: $TOKEN" "http://169.254.169.254/latest/meta-data/instance-id")
       export CLOUD9_ENVIRONMENT_ID=$(aws ec2 describe-tags \
       --filters "Name=resource-id,Values=$INSTANCE_ID" \
       --query "Tags[?Key=='aws:cloud9:environment'].Value" \
       --output text)
       aws cloud9 update-environment --environment-id $CLOUD9_ENVIRONMENT_ID --managed-credentials-action DISABLE
   }
   ```
6. AWS API를 호출하는 AWS 자격증명 확인

   ```
   aws sts get-caller-identity
   ```
7. Default VPC가 없을 경우에는 실습이 동작하지 않으니 VPC 콘솔에서 Default VPC를 생성


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://terraform.youngwjung.com/undefined.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
