diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9ad0422 --- /dev/null +++ b/.gitignore @@ -0,0 +1,36 @@ +### Terraform +# Local .terraform directories +**/.terraform/* + + +# .tfstate files +*.tfstate +*.tfstate.* + +# Crash log files +crash.log +crash.*.log + +# Exclude all .tfvars files, which are likely to contain sensitive data, such as +# password, private keys, and other secrets. These should not be part of version +# control as they are data points which are potentially sensitive and subject +# to change depending on the environment. +*.tfvars +*.tfvars.json + +# Ignore override files as they are usually used to override resources locally and so +# are not checked in +override.tf +override.tf.json +*_override.tf +*_override.tf.json + +# Include override files you do wish to add to version control using negated pattern +# !example_override.tf + +# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan +# example: *tfplan* + +# Ignore CLI configuration files +.terraformrc +terraform.rc diff --git a/examples/forwarder/.gitignore b/examples/forwarder/.gitignore new file mode 100644 index 0000000..8bdfa91 --- /dev/null +++ b/examples/forwarder/.gitignore @@ -0,0 +1,2 @@ +.terraform.lock.hcl +.terraform diff --git a/examples/forwarder/main.tf b/examples/forwarder/main.tf new file mode 100644 index 0000000..59f9174 --- /dev/null +++ b/examples/forwarder/main.tf @@ -0,0 +1,29 @@ +resource "axiom_dataset" "lambda_forwarder" { + name = "cloudwatch-lambda" + description = "Test" +} + +module "forwarder" { + source = "../../modules/forwarder" + axiom_dataset = axiom_dataset.lambda_forwarder.name + axiom_token = "" + prefix = "axiom-cloudwatch-forwarder" +} + +module "subscriber" { + source = "../../modules/subscriber" + prefix = "axiom-cloudwatch-tf-test" + forwarder_lambda_arn = module.forwarder.lambda_arn + log_groups_prefix = "/aws/lambda/" +} + +module "listener" { + source = "../../modules/listener" + prefix = "axiom-cloudwatch-tf-test" + forwarder_lambda_arn = module.forwarder.lambda_arn + log_groups_prefix = "/aws/lambda/" +} + +output "log_group_names" { + value = module.subscriber.log_groups_prefix +} diff --git a/examples/forwarder/terraform.tf b/examples/forwarder/terraform.tf new file mode 100644 index 0000000..adfc72b --- /dev/null +++ b/examples/forwarder/terraform.tf @@ -0,0 +1,12 @@ +terraform { + required_providers { + axiom = { + source = "axiomhq/axiom" + version = "1.1.2" + } + } +} + +provider "axiom" { + api_token = "" +} diff --git a/examples/unsubscriber/.gitignore b/examples/unsubscriber/.gitignore new file mode 100644 index 0000000..8bdfa91 --- /dev/null +++ b/examples/unsubscriber/.gitignore @@ -0,0 +1,2 @@ +.terraform.lock.hcl +.terraform diff --git a/examples/unsubscriber/main.tf b/examples/unsubscriber/main.tf new file mode 100644 index 0000000..c839c11 --- /dev/null +++ b/examples/unsubscriber/main.tf @@ -0,0 +1,6 @@ +module "unsubscriber" { + source = "../../modules/unsubscriber" + prefix = "axiom-cloudwatch-forwarder" + forwarder_lambda_arn = "Forwarder lambda ARN" + log_groups_prefix = "/aws/lambda/" +} diff --git a/examples/unsubscriber/terraform.tf b/examples/unsubscriber/terraform.tf new file mode 100644 index 0000000..adfc72b --- /dev/null +++ b/examples/unsubscriber/terraform.tf @@ -0,0 +1,12 @@ +terraform { + required_providers { + axiom = { + source = "axiomhq/axiom" + version = "1.1.2" + } + } +} + +provider "axiom" { + api_token = "" +}