You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Users of this Terraform module can create multiple similar resources by using [`for_each` meta-argument within `module` block](https://www.terraform.io/language/meta-arguments/for_each) which became available in Terraform 0.13.
81
-
82
-
Users of Terragrunt can achieve similar results by using modules provided in the [wrappers](https://github.com/terraform-aws-modules/terraform-aws-ec2-instance/tree/master/wrappers) directory, if they prefer to reduce amount of configuration files.
description = "An encrypted root ami based off ${data.aws_ami.ubuntu.id}"
119
-
source_ami_id = data.aws_ami.ubuntu.id
120
-
source_ami_region = "eu-west-2"
121
-
encrypted = true
122
-
123
-
tags = { Name = "ubuntu-encrypted-ami" }
124
-
}
125
-
126
-
data "aws_ami" "encrypted-ami" {
127
-
most_recent = true
128
-
129
-
filter {
130
-
name = "name"
131
-
values = [aws_ami_copy.ubuntu_encrypted_ami.id]
132
-
}
133
-
134
-
owners = ["self"]
135
-
}
136
-
```
137
-
138
-
## Conditional creation
139
-
140
-
The following combinations are supported to conditionally create resources:
141
-
142
-
- Disable resource creation (no resources created):
143
-
144
-
```hcl
145
-
create = false
146
-
```
147
-
148
-
- Create spot instance:
149
-
150
-
```hcl
151
-
create_spot_instance = true
152
-
```
153
-
154
-
## Notes
155
-
156
-
-`network_interface` can't be specified together with `vpc_security_group_ids`, `associate_public_ip_address`, `subnet_id`. See [complete example](https://github.com/terraform-aws-modules/terraform-aws-ec2-instance/tree/master/examples/complete) for details.
157
-
- Changes in `ebs_block_device` argument will be ignored. Use [aws_volume_attachment](https://www.terraform.io/docs/providers/aws/r/volume_attachment.html) resource to attach and detach volumes from AWS EC2 instances. See [this example](https://github.com/terraform-aws-modules/terraform-aws-ec2-instance/tree/master/examples/volume-attachment).
158
-
- In regards to spot instances, you must grant the `AWSServiceRoleForEC2Spot` service-linked role access to any custom KMS keys, otherwise your spot request and instances will fail with `bad parameters`. You can see more details about why the request failed by using the awscli and `aws ec2 describe-spot-instance-requests`
159
-
160
-
<!-- BEGIN_TF_DOCS -->
161
1
## Requirements
162
2
163
3
| Name | Version |
@@ -175,7 +15,7 @@ The following combinations are supported to conditionally create resources:
@@ -304,18 +144,3 @@ The following combinations are supported to conditionally create resources:
304
144
| <aname="output_spot_instance_id"></a> [spot\_instance\_id](#output\_spot\_instance\_id)| The Instance ID (if any) that is currently fulfilling the Spot Instance request |
305
145
| <aname="output_spot_request_state"></a> [spot\_request\_state](#output\_spot\_request\_state)| The current request state of the Spot Instance Request |
306
146
| <aname="output_tags_all"></a> [tags\_all](#output\_tags\_all)| A map of tags assigned to the resource, including those inherited from the provider default\_tags configuration block |
307
-
<!-- END_TF_DOCS -->
308
-
309
-
## Authors
310
-
311
-
Module is maintained by [Anton Babenko](https://github.com/antonbabenko) with help from [these awesome contributors](https://github.com/terraform-aws-modules/terraform-aws-ec2-instance/graphs/contributors).
312
-
313
-
## License
314
-
315
-
Apache 2 Licensed. See [LICENSE](https://github.com/terraform-aws-modules/terraform-aws-ec2-instance/tree/master/LICENSE) for full details.
316
-
317
-
## Additional information for users from Russia and Belarus
318
-
319
-
* Russia has [illegally annexed Crimea in 2014](https://en.wikipedia.org/wiki/Annexation_of_Crimea_by_the_Russian_Federation) and [brought the war in Donbas](https://en.wikipedia.org/wiki/War_in_Donbas) followed by [full-scale invasion of Ukraine in 2022](https://en.wikipedia.org/wiki/2022_Russian_invasion_of_Ukraine).
320
-
* Russia has brought sorrow and devastations to millions of Ukrainians, killed hundreds of innocent people, damaged thousands of buildings, and forced several million people to flee.
0 commit comments