Skip to content

Commit 5780d5f

Browse files
authored
Merge pull request #10 from lorengordon/feat/ec2-imds
2 parents eea3dd1 + e56212b commit 5780d5f

File tree

6 files changed

+31
-2
lines changed

6 files changed

+31
-2
lines changed

.bumpversion.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 1.1.0
2+
current_version = 1.2.0
33
commit = True
44
message = Bumps version to {new_version}
55
tag = False

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).
66

7+
### [1.2.0](https://github.com/plus3it/terraform-aws-tardigrade-ec2-account/releases/tag/1.2.0)
8+
9+
**Released**: 2024.12.30
10+
11+
**Summary**:
12+
13+
* Supports configurating instance metadata defaults
14+
715
### [1.1.0](https://github.com/plus3it/terraform-aws-tardigrade-ec2-account/releases/tag/1.1.0)
816

917
**Released**: 2024.09.20

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Module to manage EC2 account settings
2323

2424
| Name | Description | Type | Default | Required |
2525
|------|-------------|------|---------|:--------:|
26-
| <a name="input_ec2_account"></a> [ec2\_account](#input\_ec2\_account) | Object of inputs for ec2 account settings | <pre>object({<br> ebs_encryption_by_default = optional(object({<br> enabled = optional(bool, true)<br> default_kms_key = optional(string)<br> }), {})<br><br> ebs_snapshot_block_public_access = optional(object({<br> state = optional(string, "block-all-sharing")<br> }), {})<br><br> image_block_public_access = optional(object({<br> state = optional(string, "block-new-sharing")<br> }), {})<br><br> serial_console_access = optional(object({<br> enabled = optional(bool, false)<br> }))<br> })</pre> | `{}` | no |
26+
| <a name="input_ec2_account"></a> [ec2\_account](#input\_ec2\_account) | Object of inputs for ec2 account settings | <pre>object({<br> ebs_encryption_by_default = optional(object({<br> enabled = optional(bool, true)<br> default_kms_key = optional(string)<br> }), {})<br><br> ebs_snapshot_block_public_access = optional(object({<br> state = optional(string, "block-all-sharing")<br> }), {})<br><br> image_block_public_access = optional(object({<br> state = optional(string, "block-new-sharing")<br> }), {})<br><br> instance_metadata_defaults = optional(object({<br> http_endpoint = optional(string, "enabled")<br> http_tokens = optional(string, "required")<br> http_put_response_hop_limit = optional(number, 2)<br> instance_metadata_tags = optional(string, "enabled")<br> }), {})<br><br> serial_console_access = optional(object({<br> enabled = optional(bool, false)<br> }))<br> })</pre> | `{}` | no |
2727

2828
## Outputs
2929

main.tf

+7
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,10 @@ resource "aws_ec2_serial_console_access" "this" {
2020

2121
enabled = var.ec2_account.serial_console_access.enabled
2222
}
23+
24+
resource "aws_ec2_instance_metadata_defaults" "this" {
25+
http_endpoint = var.ec2_account.instance_metadata_defaults.http_endpoint
26+
http_tokens = var.ec2_account.instance_metadata_defaults.http_tokens
27+
http_put_response_hop_limit = var.ec2_account.instance_metadata_defaults.http_put_response_hop_limit
28+
instance_metadata_tags = var.ec2_account.instance_metadata_defaults.instance_metadata_tags
29+
}

tests/all-inputs/main.tf

+7
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@ module "ec2_account" {
1515
state = "block-new-sharing"
1616
}
1717

18+
instance_metadata_defaults = {
19+
http_endpoint = "enabled"
20+
http_tokens = "required"
21+
http_put_response_hop_limit = 2
22+
instance_metadata_tags = "enabled"
23+
}
24+
1825
serial_console_access = {
1926
enabled = true
2027
}

variables.tf

+7
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@ variable "ec2_account" {
1414
state = optional(string, "block-new-sharing")
1515
}), {})
1616

17+
instance_metadata_defaults = optional(object({
18+
http_endpoint = optional(string, "enabled")
19+
http_tokens = optional(string, "required")
20+
http_put_response_hop_limit = optional(number, 2)
21+
instance_metadata_tags = optional(string, "enabled")
22+
}), {})
23+
1724
serial_console_access = optional(object({
1825
enabled = optional(bool, false)
1926
}))

0 commit comments

Comments
 (0)