carlos / opentofu Public

Clone
git clone https://amadan.net/carlos/opentofu

Plain git — no account needed to clone.

Download

Download this file

1mock_provider "aws" {
2 mock_data "aws_ec2_instance_type_offerings" { defaults = { locations = ["eu-west-1a", "eu-west-1b"] } }
3 mock_data "aws_region" { defaults = { region = "eu-west-1" } }
4 mock_data "aws_availability_zones" { defaults = { names = ["eu-west-1a", "eu-west-1b"] } }
5 mock_data "aws_ami" { defaults = { id = "ami-0123456789abcdef0" } }
6 mock_resource "aws_s3_bucket" { defaults = { arn = "arn:aws:s3:::mock-test-bucket", id = "mock-test-bucket" } }
7 mock_resource "aws_iam_role" { defaults = { arn = "arn:aws:iam::123456789012:role/test" } }
8}
9variables {
10 aws_account_id = "123456789012"
11 name = "test-carlos"
12 apps_domain = "apps.example.com"
13 release_public_key = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="
14}
15run "topology" {
16 command = plan
17 assert {
18 condition = module.region.host_count == 1
19 error_message = "Unexpected host count."
20 }
21}
22run "reject_invalid_public_key" {
23 command = plan
24 variables { release_public_key = "not-a-public-key" }
25 expect_failures = [var.release_public_key]
26}
27run "reject_shell_in_domain" {
28 command = plan
29 variables { apps_domain = "apps.example.com\nENVEOF\necho bad" }
30 expect_failures = [var.apps_domain]
31}
32