diff --git a/.bumpversion.cfg b/.bumpversion.cfg index fab32b7..4841ee5 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 1.0.0 +current_version = 1.1.0 commit = True message = Bumps version to {new_version} tag = False diff --git a/CHANGELOG.md b/CHANGELOG.md index 435f147..4027c38 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +### [1.1.0](https://github.com/plus3it/terraform-aws-tardigrade-ec2-account/releases/tag/1.1.0) + +**Released**: 2024.09.20 + +**Summary**: + +* Supports configuring the option to block public sharing of ebs snapshots + ### [1.0.0](https://github.com/plus3it/terraform-aws-tardigrade-ec2-account/releases/tag/1.0.0) **Released**: 2024.02.16 diff --git a/README.md b/README.md index c5a5aba..313c9d7 100644 --- a/README.md +++ b/README.md @@ -4,13 +4,15 @@ Module to manage EC2 account settings ## Requirements -No requirements. +| Name | Version | +|------|---------| +| [aws](#requirement\_aws) | >= 5.62.0 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | n/a | +| [aws](#provider\_aws) | >= 5.62.0 | ## Resources @@ -21,7 +23,7 @@ No requirements. | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| -| [ec2\_account](#input\_ec2\_account) | Object of inputs for ec2 account settings |
object({
ebs_encryption_by_default = optional(object({
enabled = optional(bool, true)
default_kms_key = optional(string)
}), {})
image_block_public_access = optional(object({
state = optional(string, "block-new-sharing")
}), {})
serial_console_access = optional(object({
enabled = optional(bool, false)
}))
})
| `{}` | no | +| [ec2\_account](#input\_ec2\_account) | Object of inputs for ec2 account settings |
object({
ebs_encryption_by_default = optional(object({
enabled = optional(bool, true)
default_kms_key = optional(string)
}), {})

ebs_snapshot_block_public_access = optional(object({
state = optional(string, "block-all-sharing")
}), {})

image_block_public_access = optional(object({
state = optional(string, "block-new-sharing")
}), {})

serial_console_access = optional(object({
enabled = optional(bool, false)
}))
})
| `{}` | no | ## Outputs diff --git a/main.tf b/main.tf index 177f37d..e479db0 100644 --- a/main.tf +++ b/main.tf @@ -7,6 +7,10 @@ resource "aws_ebs_default_kms_key" "this" { key_arn = var.ec2_account.ebs_encryption_by_default.default_kms_key } +resource "aws_ebs_snapshot_block_public_access" "this" { + state = var.ec2_account.ebs_snapshot_block_public_access.state +} + resource "aws_ec2_image_block_public_access" "this" { state = var.ec2_account.image_block_public_access.state } diff --git a/tests/all-inputs/main.tf b/tests/all-inputs/main.tf index b86a73b..ede83d7 100644 --- a/tests/all-inputs/main.tf +++ b/tests/all-inputs/main.tf @@ -7,6 +7,10 @@ module "ec2_account" { default_kms_key = null } + ebs_snapshot_block_public_access = { + state = "block-new-sharing" + } + image_block_public_access = { state = "block-new-sharing" } diff --git a/variables.tf b/variables.tf index 35901be..ca80a29 100644 --- a/variables.tf +++ b/variables.tf @@ -5,9 +5,15 @@ variable "ec2_account" { enabled = optional(bool, true) default_kms_key = optional(string) }), {}) + + ebs_snapshot_block_public_access = optional(object({ + state = optional(string, "block-all-sharing") + }), {}) + image_block_public_access = optional(object({ state = optional(string, "block-new-sharing") }), {}) + serial_console_access = optional(object({ enabled = optional(bool, false) })) diff --git a/versions.tf b/versions.tf new file mode 100644 index 0000000..f961040 --- /dev/null +++ b/versions.tf @@ -0,0 +1,8 @@ +terraform { + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 5.62.0" + } + } +}