Skip to content

Commit

Permalink
Usage instructions (#82)
Browse files Browse the repository at this point in the history
* Add usage instructions

* Add usage instructions
  • Loading branch information
arianvp committed Feb 14, 2024
1 parent 6fbedf2 commit 4fad5e0
Showing 1 changed file with 41 additions and 1 deletion.
42 changes: 41 additions & 1 deletion site/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@
const ownerId = images["us-east-1"].Images[0].OwnerId
document.querySelector("#owner-id").textContent = ownerId

const terraform = document.querySelector("#terraform")
terraform.textContent = terraform.textContent.replace("_OWNER_ID_", ownerId)

const awscli2 = document.querySelector("#awscli2")
awscli2.textContent = awscli2.textContent.replace("_OWNER_ID_", ownerId)

/**
* @type {HTMLTemplateElement}
*/
Expand Down Expand Up @@ -202,9 +208,43 @@

<body>
<h1>Amazon Images / AMIs</h1>
<p>NixOS images are published under AWS Account ID <span id="owner-id"></span></p>

<h2>Terraform / OpenTofu</h2>
<p>You can use terraform to query for the latest image</p>
<pre id="terraform">
provider "aws" {
region = "eu-central-1"
}

data "aws_ami" "nixos_arm64" {
owners = ["_OWNER_ID_"]
most_recent = true

filter {
name = "name"
values = ["nixos/23.11*"]
}
filter {
name = "architecture"
values = ["arm64"]
}
}

resource "aws_instance" "nixos_arm64" {
ami = data.aws_ami.nixos_arm64.id
instance_type = "t4g.nano"
}
</pre>
<h2>AWS CLI</h2>
<pre id="awscli2">
aws ec2 describe-images --owners _OWNER_ID_ \
--filter 'Name=name,Values=nixos/23.11*' \
--filter 'Name=architecture,Values=arm64'
</pre>


<p>Here are the latest NixOS images available in the Amazon cloud.</p>
<p>NixOS images are published under AWS Account ID <span id="owner-id"></span> </p>
<table id="images-table">
<thead>
<tr>
Expand Down

0 comments on commit 4fad5e0

Please sign in to comment.