New answers tagged amazon-ec2
0
here is a complete example:
resource "aws_key_pair" "my_key" {
key_name = "my_key"
public_key = file(pathexpand("~/.ssh/id_rsa.pub"))
}
resource "aws_instance" "example" {
ami = my_ami
instance_type = "t2.micro"
key_name = aws_key_pair.my_key.key_name
ebs_block_device {
...
0
Terraform Provisioners are a last resort, so I'd encourage you to think about other options first.
In this case, your example suggests that you're already using cloud-init and so if at all possible I'd suggest modifying that cloud-init configuration to include a request to install the package you want to install. If you are using the cloud-config YAML format ...
Top 50 recent answers are included
Related Tags
amazon-ec2 × 135amazon-web-services × 70
ansible × 16
terraform × 16
aws-cli × 12
amazon-ecs × 9
docker × 7
autoscaling × 7
linux × 6
jenkins × 5
kubernetes × 4
continuous-deployment × 4
automation × 4
python × 4
load-balance × 4
amazon-cloudwatch × 4
ansible-inventory × 4
amazon-ami × 4
amazon-ebs × 4
deployment × 3
configuration-management × 3
cloud × 3
amazon-s3 × 3
aws-iam × 3
aws-vpc × 3