diff --git a/modules/meshstack/logo.png b/modules/meshstack/logo.png new file mode 100644 index 0000000..0833b67 Binary files /dev/null and b/modules/meshstack/logo.png differ diff --git a/modules/meshstack/logo.svg b/modules/meshstack/logo.svg new file mode 100644 index 0000000..f8f0619 --- /dev/null +++ b/modules/meshstack/logo.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/modules/meshstack/payment-method/buildingblock/APP_TEAM_README.md b/modules/meshstack/payment-method/buildingblock/APP_TEAM_README.md new file mode 100644 index 0000000..d1a677d --- /dev/null +++ b/modules/meshstack/payment-method/buildingblock/APP_TEAM_README.md @@ -0,0 +1,30 @@ +# meshStack Payment Method + +## Description +This building block provides a payment method for a specific workspace in meshStack. It allows teams to manage budgets and track spending across their cloud resources by assigning payment methods with defined amounts. + +## Usage Motivation +This building block is for application teams managing workloads across multiple cloud platforms who need centralized cost control. Configuring a payment method enables teams to allocate budgets per workspace and ensure financial accountability. + +## Usage Examples +- A development team creates a payment method with a budget of $10,000 for their workspace to control cloud spending. +- A team launching a new project sets up a payment method with an expiration date to align with their project timeline. +- An operations team assigns a payment method with custom tags to categorize and track spending by department or cost center. + +## Shared Responsibility + +| Responsibility | Platform Team | Application Team | +|------------------------|--------------|----------------| +| Creating and maintaining automation for payment methods | ✅ | ❌ | +| Provisioning payment methods for workspaces | ✅ | ❌ | +| Configuring the budget amount | ❌ | ✅ | +| Managing expiration dates | ❌ | ✅ | +| Applying tags for cost tracking | ❌ | ✅ | +| Monitoring spending against the payment method | ❌ | ✅ | + +## Recommendations for Setting the Right Budget +To define an effective payment method budget: +- **Baseline your spending**: Review historical costs across all platforms to determine a reasonable budget. +- **Add buffer**: Include a buffer (10-20%) for unexpected usage spikes. +- **Set expiration dates**: For temporary projects, set expiration dates to automatically clean up unused payment methods. +- **Use tags effectively**: Apply consistent tags to enable better cost tracking and reporting across your organization. diff --git a/modules/meshstack/payment-method/buildingblock/README.md b/modules/meshstack/payment-method/buildingblock/README.md new file mode 100644 index 0000000..c51963e --- /dev/null +++ b/modules/meshstack/payment-method/buildingblock/README.md @@ -0,0 +1,95 @@ +--- +name: meshStack Payment Method +supportedPlatforms: + - meshstack +description: | + Creates a new meshStack Payment Method for a Workspace +--- +# meshStack Payment Method Building Block + +This Terraform module creates a payment method for a specific workspace in meshStack. + +## Features +- Create payment methods with configurable budgets +- Optional expiration dates +- Flexible tagging support + +## Usage + +```hcl +module "payment_method" { + source = "./modules/meshstack/payment-method/buildingblock" + + payment_method_name = "dev-team-budget" + workspace_id = "workspace-abc123" + amount = 10000 + expiration_date = "2025-12-31T23:59:59Z" + + tags = { + team = ["development"] + environment = ["production"] + } +} +``` + +## Requirements + +| Name | Version | +|------|---------| +| terraform | >= 1.0 | +| meshstack | ~> 0.14.0 | + +## Inputs + +| Name | Description | Type | Default | Required | +|------|-------------|------|---------|----------| +| payment_method_name | Name of the payment method | string | "default-payment-method" | no | +| workspace_id | The ID of the workspace to which this payment method will be assigned | string | n/a | yes | +| amount | The budget amount for this payment method | number | n/a | yes | +| expiration_date | The expiration date in RFC3339 format (e.g., '2025-12-31T23:59:59Z') | string | null | no | +| tags | Additional tags to apply to the payment method | map(list(string)) | {} | no | + +## Outputs + +| Name | Description | +|------|-------------| +| payment_method_name | The name of the payment method | +| workspace_id | The workspace ID associated with this payment method | +| amount | The budget amount for this payment method | + + +## Requirements + +| Name | Version | +|------|---------| +| [terraform](#requirement\_terraform) | >= 1.0 | +| [meshstack](#requirement\_meshstack) | ~> 0.14.0 | + +## Modules + +No modules. + +## Resources + +| Name | Type | +|------|------| +| [meshstack_payment_method.payment_method](https://registry.terraform.io/providers/meshcloud/meshstack/latest/docs/resources/payment_method) | resource | + +## Inputs + +| Name | Description | Type | Default | Required | +|------|-------------|------|---------|:--------:| +| [amount](#input\_amount) | The budget amount for this payment method | `number` | n/a | yes | +| [expiration\_date](#input\_expiration\_date) | The expiration date of the payment method in RFC3339 format (e.g., '2025-12-31') | `string` | `null` | no | +| [payment\_method\_name](#input\_payment\_method\_name) | Name of the payment method | `string` | `"default-payment-method"` | no | +| [tags](#input\_tags) | Additional tags to apply to the payment method | `map(list(string))` | `{}` | no | +| [workspace\_id](#input\_workspace\_id) | The ID of the workspace to which this payment method will be assigned | `string` | n/a | yes | + +## Outputs + +| Name | Description | +|------|-------------| +| [amount](#output\_amount) | The budget amount for this payment method | +| [payment\_method\_name](#output\_payment\_method\_name) | The name of the payment method | +| [workspace\_id](#output\_workspace\_id) | The workspace ID associated with this payment method | + \ No newline at end of file diff --git a/modules/meshstack/payment-method/buildingblock/logo.png b/modules/meshstack/payment-method/buildingblock/logo.png new file mode 100644 index 0000000..eb98c45 Binary files /dev/null and b/modules/meshstack/payment-method/buildingblock/logo.png differ diff --git a/modules/meshstack/payment-method/buildingblock/logo.svg b/modules/meshstack/payment-method/buildingblock/logo.svg new file mode 100644 index 0000000..fe4e6cd --- /dev/null +++ b/modules/meshstack/payment-method/buildingblock/logo.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/modules/meshstack/payment-method/buildingblock/main.tf b/modules/meshstack/payment-method/buildingblock/main.tf new file mode 100644 index 0000000..a8d7cc6 --- /dev/null +++ b/modules/meshstack/payment-method/buildingblock/main.tf @@ -0,0 +1,12 @@ +resource "meshstack_payment_method" "payment_method" { + metadata = { + name = var.payment_method_name + owned_by_workspace = var.workspace_id + } + spec = { + display_name = var.payment_method_name + amount = var.amount + expiration_date = var.expiration_date + tags = var.tags + } +} diff --git a/modules/meshstack/payment-method/buildingblock/outputs.tf b/modules/meshstack/payment-method/buildingblock/outputs.tf new file mode 100644 index 0000000..4219507 --- /dev/null +++ b/modules/meshstack/payment-method/buildingblock/outputs.tf @@ -0,0 +1,14 @@ +output "payment_method_name" { + value = meshstack_payment_method.payment_method.metadata.name + description = "The name of the payment method" +} + +output "workspace_id" { + value = meshstack_payment_method.payment_method.metadata.owned_by_workspace + description = "The workspace ID associated with this payment method" +} + +output "amount" { + value = meshstack_payment_method.payment_method.spec.amount + description = "The budget amount for this payment method" +} diff --git a/modules/meshstack/payment-method/buildingblock/provider.tf b/modules/meshstack/payment-method/buildingblock/provider.tf new file mode 100644 index 0000000..5d05bbf --- /dev/null +++ b/modules/meshstack/payment-method/buildingblock/provider.tf @@ -0,0 +1,2 @@ +provider "meshstack" { +} diff --git a/modules/meshstack/payment-method/buildingblock/variables.tf b/modules/meshstack/payment-method/buildingblock/variables.tf new file mode 100644 index 0000000..085edc3 --- /dev/null +++ b/modules/meshstack/payment-method/buildingblock/variables.tf @@ -0,0 +1,27 @@ +variable "payment_method_name" { + type = string + description = "Name of the payment method" + default = "default-payment-method" +} + +variable "workspace_id" { + type = string + description = "The ID of the workspace to which this payment method will be assigned" +} + +variable "amount" { + type = number + description = "The budget amount for this payment method" +} + +variable "expiration_date" { + type = string + description = "The expiration date of the payment method in RFC3339 format (e.g., '2025-12-31')" + default = null +} + +variable "tags" { + type = map(list(string)) + description = "Additional tags to apply to the payment method" + default = {} +} diff --git a/modules/meshstack/payment-method/buildingblock/versions.tf b/modules/meshstack/payment-method/buildingblock/versions.tf new file mode 100644 index 0000000..1f35b08 --- /dev/null +++ b/modules/meshstack/payment-method/buildingblock/versions.tf @@ -0,0 +1,10 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + meshstack = { + source = "meshcloud/meshstack" + version = "~> 0.14.0" + } + } +}