-
Terraform State File:
- Store the Terraform state file in an S3 bucket.
- Bucket name:
byry-bucket
- Specify a unique key for the state file.
-
S3 Bucket:
- Create a general-purpose S3 bucket.
- Add a directory named
logs
in the bucket.
-
IAM Role:
- Create an IAM Role with full S3 access using an AWS-managed policy.
- Attach this role to the EC2 instance.
-
EC2 Instance:
- Launch an EC2 instance with the IAM Role attached.
-
Testing:
- SSH into the EC2 instance.
- Use AWS CLI to upload a file to the S3 bucket:
aws s3 cp <file_path> s3://<bucket_name>/logs/
Abrar-2510/workshop-devops-week4
Task: create an S3 bucket, an EC2 instance, and an IAM role with the necessary permissions. You will test the setup by uploading a file to the S3 bucket from the EC2 instance using the AWS CLI.
HCL