Skip to content

Commit

Permalink
Explicitly specify http_endpoint in launch_template terraform
Browse files Browse the repository at this point in the history
http_endpoint has to be explicitly specified in the metadata_options block
of the launch template terraform according to issue
hashicorp/terraform-provider-aws#12564
  • Loading branch information
bharath-123 committed Dec 9, 2020
1 parent e042ceb commit dc3a709
Show file tree
Hide file tree
Showing 31 changed files with 97 additions and 0 deletions.
11 changes: 11 additions & 0 deletions docs/instance_groups.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,17 @@ spec:
instanceProtection: true
```

## instanceMetadata

Instance metadata service v1 can be disabled and only instance metadata v2 can be enabled for instances within an instance group.

```YAML
spec:
instanceMetadata:
httpPutResponseHopLimit: 1
httpTokens: required
```

## externalLoadBalancers

Instance groups can be linked to up to 10 load balancers. When attached, any instance launched will
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,7 @@ resource "aws_launch_template" "bastion-bastionuserdata-example-com" {
create_before_destroy = true
}
metadata_options {
http_endpoint = "enabled"
http_put_response_hop_limit = 1
http_tokens = "optional"
}
Expand Down Expand Up @@ -500,6 +501,7 @@ resource "aws_launch_template" "master-us-test-1a-masters-bastionuserdata-exampl
create_before_destroy = true
}
metadata_options {
http_endpoint = "enabled"
http_put_response_hop_limit = 1
http_tokens = "optional"
}
Expand Down Expand Up @@ -565,6 +567,7 @@ resource "aws_launch_template" "nodes-bastionuserdata-example-com" {
create_before_destroy = true
}
metadata_options {
http_endpoint = "enabled"
http_put_response_hop_limit = 1
http_tokens = "optional"
}
Expand Down
2 changes: 2 additions & 0 deletions tests/integration/update_cluster/complex/kubernetes.tf
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ resource "aws_launch_template" "master-us-test-1a-masters-complex-example-com" {
create_before_destroy = true
}
metadata_options {
http_endpoint = "enabled"
http_put_response_hop_limit = 1
http_tokens = "required"
}
Expand Down Expand Up @@ -379,6 +380,7 @@ resource "aws_launch_template" "nodes-complex-example-com" {
create_before_destroy = true
}
metadata_options {
http_endpoint = "enabled"
http_put_response_hop_limit = 1
http_tokens = "optional"
}
Expand Down
2 changes: 2 additions & 0 deletions tests/integration/update_cluster/compress/kubernetes.tf
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ resource "aws_launch_template" "master-us-test-1a-masters-compress-example-com"
create_before_destroy = true
}
metadata_options {
http_endpoint = "enabled"
http_put_response_hop_limit = 1
http_tokens = "optional"
}
Expand Down Expand Up @@ -332,6 +333,7 @@ resource "aws_launch_template" "nodes-compress-example-com" {
create_before_destroy = true
}
metadata_options {
http_endpoint = "enabled"
http_put_response_hop_limit = 1
http_tokens = "optional"
}
Expand Down
4 changes: 4 additions & 0 deletions tests/integration/update_cluster/existing_iam/kubernetes.tf
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,7 @@ resource "aws_launch_template" "master-us-test-1a-masters-existing-iam-example-c
create_before_destroy = true
}
metadata_options {
http_endpoint = "enabled"
http_put_response_hop_limit = 1
http_tokens = "optional"
}
Expand Down Expand Up @@ -458,6 +459,7 @@ resource "aws_launch_template" "master-us-test-1b-masters-existing-iam-example-c
create_before_destroy = true
}
metadata_options {
http_endpoint = "enabled"
http_put_response_hop_limit = 1
http_tokens = "optional"
}
Expand Down Expand Up @@ -527,6 +529,7 @@ resource "aws_launch_template" "master-us-test-1c-masters-existing-iam-example-c
create_before_destroy = true
}
metadata_options {
http_endpoint = "enabled"
http_put_response_hop_limit = 1
http_tokens = "optional"
}
Expand Down Expand Up @@ -592,6 +595,7 @@ resource "aws_launch_template" "nodes-existing-iam-example-com" {
create_before_destroy = true
}
metadata_options {
http_endpoint = "enabled"
http_put_response_hop_limit = 1
http_tokens = "optional"
}
Expand Down
4 changes: 4 additions & 0 deletions tests/integration/update_cluster/existing_sg/kubernetes.tf
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,7 @@ resource "aws_launch_template" "master-us-test-1a-masters-existingsg-example-com
create_before_destroy = true
}
metadata_options {
http_endpoint = "enabled"
http_put_response_hop_limit = 1
http_tokens = "optional"
}
Expand Down Expand Up @@ -539,6 +540,7 @@ resource "aws_launch_template" "master-us-test-1b-masters-existingsg-example-com
create_before_destroy = true
}
metadata_options {
http_endpoint = "enabled"
http_put_response_hop_limit = 1
http_tokens = "optional"
}
Expand Down Expand Up @@ -608,6 +610,7 @@ resource "aws_launch_template" "master-us-test-1c-masters-existingsg-example-com
create_before_destroy = true
}
metadata_options {
http_endpoint = "enabled"
http_put_response_hop_limit = 1
http_tokens = "optional"
}
Expand Down Expand Up @@ -673,6 +676,7 @@ resource "aws_launch_template" "nodes-existingsg-example-com" {
create_before_destroy = true
}
metadata_options {
http_endpoint = "enabled"
http_put_response_hop_limit = 1
http_tokens = "optional"
}
Expand Down
2 changes: 2 additions & 0 deletions tests/integration/update_cluster/externallb/kubernetes.tf
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ resource "aws_launch_template" "master-us-test-1a-masters-externallb-example-com
create_before_destroy = true
}
metadata_options {
http_endpoint = "enabled"
http_put_response_hop_limit = 1
http_tokens = "optional"
}
Expand Down Expand Up @@ -348,6 +349,7 @@ resource "aws_launch_template" "nodes-externallb-example-com" {
create_before_destroy = true
}
metadata_options {
http_endpoint = "enabled"
http_put_response_hop_limit = 1
http_tokens = "optional"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ resource "aws_launch_template" "master-us-test-1a-masters-externalpolicies-examp
create_before_destroy = true
}
metadata_options {
http_endpoint = "enabled"
http_put_response_hop_limit = 1
http_tokens = "optional"
}
Expand Down Expand Up @@ -418,6 +419,7 @@ resource "aws_launch_template" "nodes-externalpolicies-example-com" {
create_before_destroy = true
}
metadata_options {
http_endpoint = "enabled"
http_put_response_hop_limit = 1
http_tokens = "optional"
}
Expand Down
4 changes: 4 additions & 0 deletions tests/integration/update_cluster/ha/kubernetes.tf
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,7 @@ resource "aws_launch_template" "master-us-test-1a-masters-ha-example-com" {
create_before_destroy = true
}
metadata_options {
http_endpoint = "enabled"
http_put_response_hop_limit = 1
http_tokens = "optional"
}
Expand Down Expand Up @@ -510,6 +511,7 @@ resource "aws_launch_template" "master-us-test-1b-masters-ha-example-com" {
create_before_destroy = true
}
metadata_options {
http_endpoint = "enabled"
http_put_response_hop_limit = 1
http_tokens = "optional"
}
Expand Down Expand Up @@ -579,6 +581,7 @@ resource "aws_launch_template" "master-us-test-1c-masters-ha-example-com" {
create_before_destroy = true
}
metadata_options {
http_endpoint = "enabled"
http_put_response_hop_limit = 1
http_tokens = "optional"
}
Expand Down Expand Up @@ -644,6 +647,7 @@ resource "aws_launch_template" "nodes-ha-example-com" {
create_before_destroy = true
}
metadata_options {
http_endpoint = "enabled"
http_put_response_hop_limit = 1
http_tokens = "optional"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@
"instance_type": "m3.medium",
"key_name": "${aws_key_pair.kubernetes-minimal-json-example-com-c4a6ed9aa889b9e2c39cd663eb9c7157.id}",
"metadata_options": {
"http_endpoint": "enabled",
"http_put_response_hop_limit": 1,
"http_tokens": "optional"
},
Expand Down Expand Up @@ -400,6 +401,7 @@
"instance_type": "t2.medium",
"key_name": "${aws_key_pair.kubernetes-minimal-json-example-com-c4a6ed9aa889b9e2c39cd663eb9c7157.id}",
"metadata_options": {
"http_endpoint": "enabled",
"http_put_response_hop_limit": 1,
"http_tokens": "optional"
},
Expand Down
2 changes: 2 additions & 0 deletions tests/integration/update_cluster/minimal/kubernetes.tf
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ resource "aws_launch_template" "master-us-test-1a-masters-minimal-example-com" {
create_before_destroy = true
}
metadata_options {
http_endpoint = "enabled"
http_put_response_hop_limit = 1
http_tokens = "optional"
}
Expand Down Expand Up @@ -344,6 +345,7 @@ resource "aws_launch_template" "nodes-minimal-example-com" {
create_before_destroy = true
}
metadata_options {
http_endpoint = "enabled"
http_put_response_hop_limit = 1
http_tokens = "optional"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,7 @@ resource "aws_launch_template" "master-us-test-1a-masters-mixedinstances-example
create_before_destroy = true
}
metadata_options {
http_endpoint = "enabled"
http_put_response_hop_limit = 1
http_tokens = "optional"
}
Expand Down Expand Up @@ -528,6 +529,7 @@ resource "aws_launch_template" "master-us-test-1b-masters-mixedinstances-example
create_before_destroy = true
}
metadata_options {
http_endpoint = "enabled"
http_put_response_hop_limit = 1
http_tokens = "optional"
}
Expand Down Expand Up @@ -597,6 +599,7 @@ resource "aws_launch_template" "master-us-test-1c-masters-mixedinstances-example
create_before_destroy = true
}
metadata_options {
http_endpoint = "enabled"
http_put_response_hop_limit = 1
http_tokens = "optional"
}
Expand Down Expand Up @@ -662,6 +665,7 @@ resource "aws_launch_template" "nodes-mixedinstances-example-com" {
create_before_destroy = true
}
metadata_options {
http_endpoint = "enabled"
http_put_response_hop_limit = 1
http_tokens = "optional"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,7 @@ resource "aws_launch_template" "master-us-test-1a-masters-mixedinstances-example
create_before_destroy = true
}
metadata_options {
http_endpoint = "enabled"
http_put_response_hop_limit = 1
http_tokens = "optional"
}
Expand Down Expand Up @@ -528,6 +529,7 @@ resource "aws_launch_template" "master-us-test-1b-masters-mixedinstances-example
create_before_destroy = true
}
metadata_options {
http_endpoint = "enabled"
http_put_response_hop_limit = 1
http_tokens = "optional"
}
Expand Down Expand Up @@ -597,6 +599,7 @@ resource "aws_launch_template" "master-us-test-1c-masters-mixedinstances-example
create_before_destroy = true
}
metadata_options {
http_endpoint = "enabled"
http_put_response_hop_limit = 1
http_tokens = "optional"
}
Expand Down Expand Up @@ -662,6 +665,7 @@ resource "aws_launch_template" "nodes-mixedinstances-example-com" {
create_before_destroy = true
}
metadata_options {
http_endpoint = "enabled"
http_put_response_hop_limit = 1
http_tokens = "optional"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,7 @@ resource "aws_launch_template" "bastion-private-shared-ip-example-com" {
create_before_destroy = true
}
metadata_options {
http_endpoint = "enabled"
http_put_response_hop_limit = 1
http_tokens = "optional"
}
Expand Down Expand Up @@ -476,6 +477,7 @@ resource "aws_launch_template" "master-us-test-1a-masters-private-shared-ip-exam
create_before_destroy = true
}
metadata_options {
http_endpoint = "enabled"
http_put_response_hop_limit = 1
http_tokens = "optional"
}
Expand Down Expand Up @@ -541,6 +543,7 @@ resource "aws_launch_template" "nodes-private-shared-ip-example-com" {
create_before_destroy = true
}
metadata_options {
http_endpoint = "enabled"
http_put_response_hop_limit = 1
http_tokens = "optional"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,7 @@ resource "aws_launch_template" "bastion-private-shared-subnet-example-com" {
create_before_destroy = true
}
metadata_options {
http_endpoint = "enabled"
http_put_response_hop_limit = 1
http_tokens = "optional"
}
Expand Down Expand Up @@ -471,6 +472,7 @@ resource "aws_launch_template" "master-us-test-1a-masters-private-shared-subnet-
create_before_destroy = true
}
metadata_options {
http_endpoint = "enabled"
http_put_response_hop_limit = 1
http_tokens = "optional"
}
Expand Down Expand Up @@ -536,6 +538,7 @@ resource "aws_launch_template" "nodes-private-shared-subnet-example-com" {
create_before_destroy = true
}
metadata_options {
http_endpoint = "enabled"
http_put_response_hop_limit = 1
http_tokens = "optional"
}
Expand Down
3 changes: 3 additions & 0 deletions tests/integration/update_cluster/privatecalico/kubernetes.tf
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,7 @@ resource "aws_launch_template" "bastion-privatecalico-example-com" {
create_before_destroy = true
}
metadata_options {
http_endpoint = "enabled"
http_put_response_hop_limit = 1
http_tokens = "optional"
}
Expand Down Expand Up @@ -499,6 +500,7 @@ resource "aws_launch_template" "master-us-test-1a-masters-privatecalico-example-
create_before_destroy = true
}
metadata_options {
http_endpoint = "enabled"
http_put_response_hop_limit = 1
http_tokens = "optional"
}
Expand Down Expand Up @@ -564,6 +566,7 @@ resource "aws_launch_template" "nodes-privatecalico-example-com" {
create_before_destroy = true
}
metadata_options {
http_endpoint = "enabled"
http_put_response_hop_limit = 1
http_tokens = "optional"
}
Expand Down
3 changes: 3 additions & 0 deletions tests/integration/update_cluster/privatecanal/kubernetes.tf
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,7 @@ resource "aws_launch_template" "bastion-privatecanal-example-com" {
create_before_destroy = true
}
metadata_options {
http_endpoint = "enabled"
http_put_response_hop_limit = 1
http_tokens = "optional"
}
Expand Down Expand Up @@ -499,6 +500,7 @@ resource "aws_launch_template" "master-us-test-1a-masters-privatecanal-example-c
create_before_destroy = true
}
metadata_options {
http_endpoint = "enabled"
http_put_response_hop_limit = 1
http_tokens = "optional"
}
Expand Down Expand Up @@ -564,6 +566,7 @@ resource "aws_launch_template" "nodes-privatecanal-example-com" {
create_before_destroy = true
}
metadata_options {
http_endpoint = "enabled"
http_put_response_hop_limit = 1
http_tokens = "optional"
}
Expand Down
Loading

0 comments on commit dc3a709

Please sign in to comment.