Skip to content

Instantly share code, notes, and snippets.

@grimm26
grimm26 / README-document.md
Last active January 6, 2020 18:43
terraform-docs issue supporting docs

Required Inputs

The following input variables are required:

default_retention_days

Description: The number of days that you want to specify for the default retention period.

Type: number

This file has been truncated, but you can view the full file.
Error: Missing required argument
The argument "region" is required, but was not set.
2019/09/04 11:49:47 [INFO] Terraform version: 0.12.7
2019/09/04 11:49:47 [INFO] Go runtime version: go1.12.9
2019/09/04 11:49:47 [INFO] CLI args: []string{"/usr/local/Cellar/tfenv/1.0.1/versions/0.12.7/terraform", "--version"}
2019/09/04 11:49:47 [DEBUG] Attempting to open CLI config file: /Users/mkeisler/.terraformrc
2019/09/04 11:49:47 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2019/09/04 11:49:47 [INFO] CLI command args: []string{"version", "--version"}
@grimm26
grimm26 / main.tf
Created December 6, 2018 17:23
terraform VPC peering module
provider "aws" {
alias = "this"
version = ">= 1.23.0"
}
provider "aws" {
alias = "peer"
version = ">= 1.23.0"
}
@grimm26
grimm26 / attributes-default.rb
Last active August 20, 2018 18:31
nested attributes
default['my-apt']['nodejs_version'] = 6
default['my-apt']['nodejs_server'] = "#{node['my-apt']['server']}/nodejs-#{node['my-apt']['nodejs_version']}"
# Then in another cookbook's attributes/fdefault.rb
override['my-apt']['nodejs_version'] = 10 if %w[xenial bionic].include?(node['lsb']['codename'])
# node['enova-apt']['nodejs_version'] is set to 10 on xenial/bionic nodes like expected, but node['my-apt']['nodejs_server'] keeps the default '6' value.
@grimm26
grimm26 / variables.tf
Created June 5, 2018 18:41
handling complex data structure
[
{
id = "${aws_subnet.publicA.id}"
cidr = "${aws_subnet.publicA.cidr_block}"
az = "${aws_subnet.publicA.availability_zone}"
},
{
id = "${aws_subnet.publicB.id}"
cidr = "${aws_subnet.publicB.cidr_block}"
az = "${aws_subnet.publicB.availability_zone}"
@grimm26
grimm26 / count_vowels.pl
Last active May 15, 2018 14:39
count vowels
#!/usr/bin/env perl
#
use strict;
my %vowels = (
a => 0,
e => 0,
i => 0,
o => 0,
u => 0
@grimm26
grimm26 / apply.debug
Created March 5, 2018 20:53
lambda debug
2018/03/05 14:50:24 [INFO] Terraform version: 0.11.3
2018/03/05 14:50:24 [INFO] Go runtime version: go1.9.3
2018/03/05 14:50:24 [INFO] CLI args: []string{"/usr/local/Cellar/terraform/0.11.3/bin/terraform", "apply"}
2018/03/05 14:50:24 [DEBUG] Attempting to open CLI config file: /Users/mkeisler/.terraformrc
2018/03/05 14:50:24 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2018/03/05 14:50:24 [INFO] CLI command args: []string{"apply"}
2018/03/05 14:50:24 [INFO] command: empty terraform config, returning nil
2018/03/05 14:50:24 [DEBUG] command: no data state file found for backend config
2018/03/05 14:50:24 [DEBUG] New state was assigned lineage "9583f702-7c2c-4e7c-bb6f-896de0d05fdd"
2018/03/05 14:50:24 [INFO] command: backend initialized: <nil>
@grimm26
grimm26 / gist:db40de2d562f46dd05c49690f79b6a14
Created March 5, 2018 20:47
aws_lambda_function last_modified error
> $ terraform apply
data.archive_file.funk_zip: Refreshing state...
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
+ aws_lambda_function.funk
@grimm26
grimm26 / gist:d0e9097b4e8b097a6553655bdefb57cd
Created February 13, 2018 17:29
aws_sns_topic only rate
2018/02/13 11:26:22 [INFO] Terraform version: 0.11.3
2018/02/13 11:26:22 [INFO] Go runtime version: go1.9.3
2018/02/13 11:26:22 [INFO] CLI args: []string{"/usr/local/Cellar/terraform/0.11.3/bin/terraform", "apply"}
2018/02/13 11:26:22 [DEBUG] Attempting to open CLI config file: /Users/mkeisler/.terraformrc
2018/02/13 11:26:22 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2018/02/13 11:26:22 [INFO] CLI command args: []string{"apply"}
2018/02/13 11:26:22 [INFO] command: empty terraform config, returning nil
2018/02/13 11:26:22 [DEBUG] command: no data state file found for backend config
2018/02/13 11:26:22 [DEBUG] New state was assigned lineage "db85a477-8218-4603-a944-b9ac5aa6ddc0"
2018/02/13 11:26:22 [INFO] command: backend initialized: <nil>
@grimm26
grimm26 / sns_feedback_failure
Last active February 13, 2018 16:54
sns feedback
> $ cat main.tf
provider "aws" {}
resource "aws_sns_topic" "m" {
name = "mktest2"
lambda_success_feedback_role_arn = "arn:aws:iam::112233445566:role/SNSSuccessFeedback"
lambda_failure_feedback_role_arn = "arn:aws:iam::112233445566:role/SNSFailureFeedback"
lambda_success_feedback_sample_rate = "100"
}