Quantcast
Channel: Active questions tagged amazon-ec2 - Stack Overflow
Viewing all articles
Browse latest Browse all 29401

Terraform-setup EC2 instance without aws_instance

$
0
0

Using terraform, create the following resources in AWS EC2 instance S3 Bucket

By making use of userdata, echo some (ie ami-id, hostname etc) instance metadata to a file and copy that file to the s3 bucket.

The terraform command should look as follows

terraform apply –var 'aws_access_key_id='–var 'aws_secret_access_key=' -var 'bucket_name='

Constraints

  1. Do not use the aws_instance resource provided by terraform, rather, make use of autoscaling groups.
  2. Do not commit any aws credentials to source control of any kind.
  3. No aws access key id or secret access key information is to be present on the ec2 instance
  4. The whole project should be contained within a single file called site.tf
  5. Access to the S3 bucket from the EC2 instance should be done via Instance Roles

Viewing all articles
Browse latest Browse all 29401

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>