[go: up one dir, main page]

Today I Learned

tags


2022/03/17

About the terraform count meta-argument:


2022/04/04

to run terraform output $output_name to print a named output


2022/05/03

aws policy documents can change the order of items within permissions arrays, but that’s safe to ignore:

Also, that & types take 8 bytes = 64 bits on 64-bit systems

use std::mem;

pub struct Foo {
    bar: String, // 24
    baz: usize, // 8
}

pub struct Quux<'a> {
    foo: &'a Foo,
    bar: usize,
}

fn main() {
    println!("Foo: {}", mem::size_of::<Foo>()); // 32
    println!("&Foo: {}", mem::size_of::<&Foo>()); // 8 -- a pointer?
    println!("Quux: {}", mem::size_of::<Quux>()); // 16 -- a pointer + a usize!
    println!("&Quux: {}", mem::size_of::<&Quux>()); // 8 -- another pointer
}

2022/11/08

That the aws_ec2_tag resource can be used to add tags to AWS RAM-shared VPCs and subnets:

This resource should only be used in cases where EC2 resources are created outside Terraform (e.g., AMIs), being shared via Resource Access Manager (RAM), or implicitly created by other means (e.g., Transit Gateway VPN Attachments).


Also, that

When the source of a module is a version control repository or archive file (generically, a “package”), the module itself may be in a sub-directory relative to the root of the package. A special double-slash syntax is interpreted by Terraform to indicate that the remaining path after that point is a sub-directory within the package. For example: git::https://example.com/network.git//modules/vpc?ref=v1.2.0

https://developer.hashicorp.com/terraform/language/modules/sources#modules-in-package-sub-directories


2022/11/30

that you can option+click to change your cursor’s location in iterm2 and mac’s terminal.app! H/t Vlad Grenkov for this one :)


As of Terraform 1.3, you can write

type = optional(real_type, default_value)

See https://www.hashicorp.com/blog/terraform-1-3-improves-extensibility-and-maintainability-of-terraform-modules


2025/11/11

Apparently terraform test got stabilized somewhere around 1.7 and I never noticed: https://developer.hashicorp.com/terraform/tutorials/configuration-language/test Also, opentofu supports it too: https://opentofu.org/docs/cli/commands/test/