Skip to content

Commit

Permalink
feat: lookup for AMI that doesn't contain ECS/EKS agent and packages …
Browse files Browse the repository at this point in the history
…+ enable setting volume size (#30)

* feat: trunk init

* feat: look up the Amazon Linux 2023 Minimal AMI + enable setting volume size
  • Loading branch information
gberenice authored Jan 3, 2025
1 parent 295c4f7 commit 27f1d8a
Show file tree
Hide file tree
Showing 11 changed files with 180 additions and 93 deletions.
2 changes: 1 addition & 1 deletion .github/trunk-upgrade.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
uses: actions/checkout@v4

- name: Trunk Upgrade
uses: trunk-io/trunk-action/upgrade@2eaee169140ec559bd556208f9f99cdfdf468da8 # v1.1.18
uses: trunk-io/trunk-action/upgrade@4d5ecc89b2691705fd08c747c78652d2fc806a94 # v1.1.19
with:
base: main
reviewers: "@masterpointio/masterpoint-internal"
Expand Down
9 changes: 9 additions & 0 deletions .trunk/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
*out
*logs
*actions
*notifications
*tools
plugins
user_trunk.yaml
user.yaml
tmp
2 changes: 2 additions & 0 deletions .trunk/configs/.checkov.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
skip-check:
- CKV_TF_1 # Ensure module references are pinned to a commit SHA.
14 changes: 14 additions & 0 deletions .trunk/configs/.markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Autoformatter friendly markdownlint config (all formatting rules disabled)
default: true
blank_lines: false
bullet: false
html: false
indentation: false
line_length: false
spaces: false
url: false
whitespace: false

# Ignore MD041/first-line-heading/first-line-h1
# Error: First line in a file should be a top-level heading
MD041: false
4 changes: 4 additions & 0 deletions .trunk/configs/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# `release-please` doesn't generate prettier compliant output, see relevant issues:
# https://github.com/googleapis/release-please/issues/1902
# https://github.com/googleapis/release-please/issues/1802
CHANGELOG.md
10 changes: 10 additions & 0 deletions .trunk/configs/.yamllint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
rules:
quoted-strings:
required: only-when-needed
extra-allowed: ["{|}"]
empty-values:
forbid-in-block-mappings: true
forbid-in-flow-mappings: true
key-duplicates: {}
octal-values:
forbid-implicit-octal: true
34 changes: 34 additions & 0 deletions .trunk/trunk.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# This file controls the behavior of Trunk: https://docs.trunk.io/cli
# To learn more about the format of this file, see https://docs.trunk.io/reference/trunk-yaml
version: 0.1
cli:
version: 1.22.8
# Trunk provides extensibility via plugins. (https://docs.trunk.io/plugins)
plugins:
sources:
- id: trunk
ref: v1.6.6
uri: https://github.com/trunk-io/plugins
# Many linters and tools depend on runtimes - configure them here. (https://docs.trunk.io/runtimes)
runtimes:
enabled:
- [email protected]
- [email protected]
# This is the section where you manage your linters. (https://docs.trunk.io/check/configuration)
lint:
enabled:
- [email protected]
- [email protected]
- [email protected]
- git-diff-check
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
actions:
enabled:
- trunk-announce
- trunk-check-pre-push
- trunk-fmt-pre-commit
- trunk-upgrade-available
187 changes: 97 additions & 90 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion data.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ data "aws_ami" "amazon_linux_2023" {

filter {
name = "name"
values = ["al2023-ami*"]
values = ["al2023-ami-2023*"]
}

filter {
Expand Down
3 changes: 2 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,8 @@ resource "aws_launch_template" "default" {
block_device_mappings {
device_name = "/dev/xvda"
ebs {
encrypted = true
encrypted = true
volume_size = var.volume_size
}
}

Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ variable "metadata_http_protocol_ipv6_enabled" {
default = false
}

variable "volume_size" {
description = "The size of the volume in gigabytes."
type = number
default = null
}

######################
## SESSION LOGGING ##
####################
Expand Down

0 comments on commit 27f1d8a

Please sign in to comment.