Skip to content

Commit 9fcea61

Browse files
author
Tony Nyurkin
committed
Add ignore changes of key_name
1 parent 2a69744 commit 9fcea61

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,11 @@ data "aws_ami" "ubuntu-xenial" {
9898
|------|-------------|:----:|:-----:|:-----:|
9999
| ami | ID of AMI to use for the instance | string | n/a | yes |
100100
| associate\_public\_ip\_address | If true, the EC2 instance will have associated public IP address | bool | `"null"` | no |
101-
| cpu\_credits | The credit option for CPU usage (unlimited or standard) | string | `"standard"` | no |
101+
| cpu\_credits | The credit option for CPU usage \(unlimited or standard\) | string | `"standard"` | no |
102102
| disable\_api\_termination | If true, enables EC2 Instance Termination Protection | bool | `"false"` | no |
103103
| ebs\_block\_device | Additional EBS block devices to attach to the instance | list(map(string)) | `[]` | no |
104104
| ebs\_optimized | If true, the launched EC2 instance will be EBS-optimized | bool | `"false"` | no |
105-
| ephemeral\_block\_device | Customize Ephemeral (also known as Instance Store) volumes on the instance | list(map(string)) | `[]` | no |
105+
| ephemeral\_block\_device | Customize Ephemeral \(also known as Instance Store\) volumes on the instance | list(map(string)) | `[]` | no |
106106
| get\_password\_data | If true, wait for password data to become available and retrieve it. | bool | `"false"` | no |
107107
| iam\_instance\_profile | The IAM Instance Profile to launch the instance with. Specified as the name of the Instance Profile. | string | `""` | no |
108108
| instance\_count | Number of instances to launch | number | `"1"` | no |
@@ -122,10 +122,10 @@ data "aws_ami" "ubuntu-xenial" {
122122
| subnet\_id | The VPC Subnet ID to launch in | string | `""` | no |
123123
| subnet\_ids | A list of VPC Subnet IDs to launch in | list(string) | `[]` | no |
124124
| tags | A mapping of tags to assign to the resource | map(string) | `{}` | no |
125-
| tenancy | The tenancy of the instance (if the instance is running in a VPC). Available values: default, dedicated, host. | string | `"default"` | no |
126-
| use\_num\_suffix | Always append numerical suffix to instance name, even if instance_count is 1 | bool | `"false"` | no |
127-
| user\_data | The user data to provide when launching the instance. Do not pass gzip-compressed data via this argument; see user_data_base64 instead. | string | `"null"` | no |
128-
| user\_data\_base64 | Can be used instead of user_data to pass base64-encoded binary data directly. Use this instead of user_data whenever the value is not a valid UTF-8 string. For example, gzip-encoded user data must be base64-encoded and passed via this argument to avoid corruption. | string | `"null"` | no |
125+
| tenancy | The tenancy of the instance \(if the instance is running in a VPC\). Available values: default, dedicated, host. | string | `"default"` | no |
126+
| use\_num\_suffix | Always append numerical suffix to instance name, even if instance\_count is 1 | bool | `"false"` | no |
127+
| user\_data | The user data to provide when launching the instance. Do not pass gzip-compressed data via this argument; see user\_data\_base64 instead. | string | `"null"` | no |
128+
| user\_data\_base64 | Can be used instead of user\_data to pass base64-encoded binary data directly. Use this instead of user\_data whenever the value is not a valid UTF-8 string. For example, gzip-encoded user data must be base64-encoded and passed via this argument to avoid corruption. | string | `"null"` | no |
129129
| volume\_tags | A mapping of tags to assign to the devices created by the instance at launch time | map(string) | `{}` | no |
130130
| vpc\_security\_group\_ids | A list of security group IDs to associate with | list(string) | `"null"` | no |
131131

main.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,4 +93,10 @@ resource "aws_instance" "this" {
9393
credit_specification {
9494
cpu_credits = local.is_t_instance_type ? var.cpu_credits : null
9595
}
96+
97+
lifecycle {
98+
ignore_changes = [
99+
key_name
100+
]
101+
}
96102
}

0 commit comments

Comments
 (0)