Skip to content

Commit

Permalink
examples: add examples directory
Browse files Browse the repository at this point in the history
  • Loading branch information
dasfmi committed Oct 9, 2024
1 parent 7e970f4 commit 554653d
Show file tree
Hide file tree
Showing 7 changed files with 99 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions examples/forwarder/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.terraform.lock.hcl
.terraform
29 changes: 29 additions & 0 deletions examples/forwarder/main.tf
Original file line number Diff line number Diff line change
@@ -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
}
12 changes: 12 additions & 0 deletions examples/forwarder/terraform.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
terraform {
required_providers {
axiom = {
source = "axiomhq/axiom"
version = "1.1.2"
}
}
}

provider "axiom" {
api_token = ""
}
2 changes: 2 additions & 0 deletions examples/unsubscriber/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.terraform.lock.hcl
.terraform
6 changes: 6 additions & 0 deletions examples/unsubscriber/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module "unsubscriber" {
source = "../../modules/unsubscriber"
prefix = "axiom-cloudwatch-forwarder"
forwarder_lambda_arn = "Forwarder lambda ARN"
log_groups_prefix = "/aws/lambda/"
}
12 changes: 12 additions & 0 deletions examples/unsubscriber/terraform.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
terraform {
required_providers {
axiom = {
source = "axiomhq/axiom"
version = "1.1.2"
}
}
}

provider "axiom" {
api_token = ""
}

0 comments on commit 554653d

Please sign in to comment.