terraform-ec2-efs-s3

Through AWS console, provision an Elastic IP. EFS EC2 and S3 Bucket

TERRAFORM ASSIGNMENT

Through AWS console, provision an Elastic IP. Assign tag “Project” with value “NetSPI_EIP” to it. Write Terraform code to provision following resources:

  • S3 bucket with private access permissions
  • EFS volume
  • EC2 instance with SSH access
  • All required resources like VPC, Subnets, Security Groups etc. to provision above mentioned resources

These resources should meet following conditions:

  • An elastic IP provisioned in step 1 should be assigned to the provisioned EC2 instance for its public IP
  • EFS volume should be mounted on the EC2 instance at /data/test while it boots up One should be able to write data to mounted EFS volume One should be able to write data to the provisioned S3 bucket (No AWS credentials should be stored/set on the EC2 instance) Terraform should display S3 Bucket ID, EFS volume ID, EC2 instance ID, Security Group ID, Subnet ID as part of output generated by Terraform apply command Push the code to your own GitHub/GitLab repo and share the URL with NetSPI team.

Prerequisite

  • install aws cli
  • configure aws with acceskey and secretkey
  • Terraform v1.2.0

test :

  • clone the repository
  • make terraform init
  • terraform plan
  • terraform apply -auto-approve

after the test, dont forget to destroy all ressources using this command

  • terraform destroy -auto-approve