Skip to content

Commit

Permalink
first version
Browse files Browse the repository at this point in the history
  • Loading branch information
ssickles committed Mar 26, 2024
1 parent 65f733a commit 5d0ef79
Show file tree
Hide file tree
Showing 10 changed files with 200 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Nullstone
on:
push:
tags:
- 'v*'

env:
NULLSTONE_ORG: nullstone
NULLSTONE_API_KEY: ${{ secrets.NULLSTONE_API_KEY }}

jobs:
publish:
runs-on: ubuntu-latest

defaults:
run:
shell: bash

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Nullstone
uses: nullstone-io/setup-nullstone-action@v0

- name: Find version
id: version
run: echo "MODULE_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV

- id: publish
name: Publish
run: |
nullstone modules publish --version=${{ env.MODULE_VERSION }}
34 changes: 34 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# 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
15 changes: 15 additions & 0 deletions .nullstone/module.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
org_name: nullstone
name: aws-eventbus-scheduling
friendly_name: AWS EventBus Scheduling
description: Capability that injects the required env variables for an app to create schedules
category: capability
subcategory: datastores
provider_types:
- aws
platform: eventbus
subplatform: eventbridge
type: ""
appCategories:
- container
- serverless
is_public: true
50 changes: 50 additions & 0 deletions .terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
lock-providers:
terraform providers lock -platform=linux_amd64 -platform=linux_arm64 -platform=darwin_amd64 -platform=darwin_arm64 -platform=windows_amd64
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# aws-eventbus
Nullstone module to create an AWS EventBus
11 changes: 11 additions & 0 deletions eventbus.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
data "ns_connection" "eventbus" {
name = "eventbus"
contract = "datastore/aws/eventbus:eventbridge"
}

locals {
eventbus_arn = data.ns_connection.eventbus.outputs.eventbus_arn
eventbus_name = data.ns_connection.eventbus.outputs.eventbus_name
scheduler_group_name = data.ns_connection.eventbus.outputs.scheduler_group_name
scheduler_role_arn = data.ns_connection.eventbus.outputs.scheduler_role_arn
}
24 changes: 24 additions & 0 deletions nullstone.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
terraform {
required_providers {
ns = {
source = "nullstone-io/ns"
}
}
}

data "ns_workspace" "this" {}

// Generate a random suffix to ensure uniqueness of resources
resource "random_string" "resource_suffix" {
length = 5
lower = true
upper = false
numeric = false
special = false
}

locals {
tags = data.ns_workspace.this.tags
block_name = data.ns_workspace.this.block_name
resource_name = "${data.ns_workspace.this.block_ref}-${random_string.resource_suffix.result}"
}
20 changes: 20 additions & 0 deletions outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
output "env" {
value = [
{
name = "EVENTBUS_ARN"
value = local.eventbus_arn
},
{
name = "EVENTBUS_NAME"
value = local.eventbus_name
},
{
name = "SCHEDULER_GROUP_NAME"
value = local.scheduler_group_name
},
{
name = "SCHEDULER_ROLE_ARN"
value = local.scheduler_role_arn
},
]
}
9 changes: 9 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
variable "app_metadata" {
description = <<EOF
Nullstone automatically injects metadata from the app module into this module through this variable.
This variable is a reserved variable for capabilities.
EOF

type = map(string)
default = {}
}

0 comments on commit 5d0ef79

Please sign in to comment.