Skip to content

Instantly share code, notes, and snippets.

View marcandjulien's full-sized avatar

Marc-André Julien marcandjulien

View GitHub Profile
@atheiman
atheiman / EbsEncryptionByDefault.yml
Last active June 4, 2025 17:17
Enable EBS default encryption using a CloudFormation custom resource.
# aws cloudformation deploy \
# --stack-name EbsEncryptionByDefault \
# --capabilities 'CAPABILITY_IAM' \
# --template-file ./EbsEncryptionByDefault.yml
Description: >-
Enables default EBS encryption settings. See EBS Encryption docs for more info:
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html
Resources:
function Add-EnvPath {
param(
[Parameter(Mandatory=$true)]
[string] $Path,
[ValidateSet('Machine', 'User', 'Session')]
[string] $Container = 'Session'
)
if ($Container -ne 'Session') {