{"id":48441847,"url":"https://github.com/launchbynttdata/tf-aws-module_primitive-eks_addon","last_synced_at":"2026-04-06T16:00:58.221Z","repository":{"id":348057711,"uuid":"1089045724","full_name":"launchbynttdata/tf-aws-module_primitive-eks_addon","owner":"launchbynttdata","description":null,"archived":false,"fork":false,"pushed_at":"2026-03-30T15:37:51.000Z","size":112,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-30T17:36:10.743Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/launchbynttdata.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":"NOTICE","maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-03T20:09:40.000Z","updated_at":"2026-03-30T15:37:45.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/launchbynttdata/tf-aws-module_primitive-eks_addon","commit_stats":null,"previous_names":["launchbynttdata/tf-aws-module_primitive-eks_addon"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/launchbynttdata/tf-aws-module_primitive-eks_addon","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/launchbynttdata%2Ftf-aws-module_primitive-eks_addon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/launchbynttdata%2Ftf-aws-module_primitive-eks_addon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/launchbynttdata%2Ftf-aws-module_primitive-eks_addon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/launchbynttdata%2Ftf-aws-module_primitive-eks_addon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/launchbynttdata","download_url":"https://codeload.github.com/launchbynttdata/tf-aws-module_primitive-eks_addon/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/launchbynttdata%2Ftf-aws-module_primitive-eks_addon/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31479006,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-06T14:34:32.243Z","status":"ssl_error","status_checked_at":"2026-04-06T14:34:31.723Z","response_time":112,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-04-06T16:00:26.758Z","updated_at":"2026-04-06T16:00:58.174Z","avatar_url":"https://github.com/launchbynttdata.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tf-aws-module-template\n\n\u003e **🔧 This is a Template Repository**\n\u003e\n\u003e Use this template when creating new Terraform primitive modules for AWS resources. This template provides the standardized structure, testing framework, and tooling needed to build high-quality, maintainable primitive modules.\n\n---\n\n## What is a Primitive Module?\n\nA **primitive module** is a thin, focused Terraform wrapper around a single AWS resource type. Primitive modules:\n\n- Wrap a **single AWS resource** (e.g., `aws_eks_cluster`, `aws_kms_key`, `aws_s3_bucket`)\n- Provide sensible defaults while maintaining full configurability\n- Include comprehensive validation rules\n- Follow consistent patterns for inputs, outputs, and tagging\n- Include automated testing using Terratest\n- Serve as building blocks for higher-level composite modules\n\nFor examples of well-structured primitive modules, see:\n\n- [tf-aws-module_primitive-eks_cluster](https://github.com/launchbynttdata/tf-aws-module_primitive-eks_cluster)\n- [tf-aws-module_primitive-kms_key](https://github.com/launchbynttdata/tf-aws-module_primitive-kms_key)\n\n---\n\n## Getting Started with This Template\n\n### 1. Create Your New Module Repository\n\n1. Click the \"Use this template\" button on GitHub\n2. Name your repository following the naming convention: `tf-aws-module_primitive-\u003cresource_name\u003e`\n   - Examples: `tf-aws-module_primitive-s3_bucket`, `tf-aws-module_primitive-lambda_function`\n3. Clone your new repository locally\n\n### 2. Initialize and Clean Up Template References\n\nAfter cloning, run the cleanup target to update template references with your actual repository information:\n\n```bash\nmake init-module\n```\n\nThis command will:\n\n- Update the `go.mod` file with your repository's GitHub URL\n- Update test imports to reference your new module name\n- Remove template-specific placeholders\n\n### 3. Configure Your Environment\n\nInstall required development dependencies:\n\n```bash\nmake configure-dependencies\nmake configure-git-hooks\n```\n\nThis installs:\n\n- Terraform\n- Go\n- Pre-commit hooks\n- Other development tools specified in `.tool-versions`\n\n---\n\n## HOWTO: Developing a Primitive Module\n\n### Step 1: Define Your Resource\n\n1. **Identify the AWS resource** you're wrapping (e.g., `aws_eks_cluster`)\n2. **Review AWS documentation** for the resource to understand all available parameters\n3. **Study similar primitive modules** for patterns and best practices\n\n### Step 2: Create the Module Structure\n\nYour primitive module should include these core files:\n\n#### `main.tf`\n\n- Contains the primary resource declaration\n- Should be clean and focused on the single resource\n- Example:\n\n```hcl\nresource \"aws_eks_cluster\" \"this\" {\n  name     = var.name\n  role_arn = var.role_arn\n  version  = var.kubernetes_version\n\n  vpc_config {\n    subnet_ids              = var.vpc_config.subnet_ids\n    security_group_ids      = var.vpc_config.security_group_ids\n    endpoint_private_access = var.vpc_config.endpoint_private_access\n    endpoint_public_access  = var.vpc_config.endpoint_public_access\n    public_access_cidrs     = var.vpc_config.public_access_cidrs\n  }\n\n  tags = merge(\n    var.tags,\n    local.default_tags\n  )\n}\n```\n\n#### `variables.tf`\n\n- Define all configurable parameters\n- Include clear descriptions for each variable\n- Set sensible defaults where appropriate\n- Use validation rules to enforce constraints, but only when the validations can be made precise.\n- Alternatively, use [`check`](https://developer.hashicorp.com/terraform/language/block/check) blocks to create more complicated validations. (Requires terraform ~\u003e 1.12)\n- Example:\n\n```hcl\nvariable \"name\" {\n  description = \"Name of the EKS cluster\"\n  type        = string\n\n  validation {\n    condition     = length(var.name) \u003c= 100\n    error_message = \"Cluster name must be 100 characters or less\"\n  }\n}\n\nvariable \"kubernetes_version\" {\n  description = \"Kubernetes version to use for the EKS cluster\"\n  type        = string\n  default     = null\n\n  validation {\n    condition     = var.kubernetes_version == null || can(regex(\"^1\\\\.(2[89]|[3-9][0-9])$\", var.kubernetes_version))\n    error_message = \"Kubernetes version must be 1.28 or higher\"\n  }\n}\n```\n\n#### `outputs.tf`\n\n- Export all useful attributes of the resource\n- Include comprehensive outputs for downstream consumption\n- Document what each output provides\n- Example:\n\n```hcl\noutput \"id\" {\n  description = \"The ID of the EKS cluster\"\n  value       = aws_eks_cluster.this.id\n}\n\noutput \"arn\" {\n  description = \"The ARN of the EKS cluster\"\n  value       = aws_eks_cluster.this.arn\n}\n\noutput \"endpoint\" {\n  description = \"The endpoint for the EKS cluster API server\"\n  value       = aws_eks_cluster.this.endpoint\n}\n```\n\n#### `locals.tf`\n\n- Define local values and transformations\n- Include standard tags (e.g., `provisioner = \"Terraform\"`)\n- Example:\n\n```hcl\nlocals {\n  default_tags = {\n    provisioner = \"Terraform\"\n  }\n}\n```\n\n#### `versions.tf`\n\n- Specify required Terraform and provider versions\n- Example:\n\n```hcl\nterraform {\n  required_version = \"~\u003e 1.5\"\n\n  required_providers {\n    aws = {\n      source  = \"hashicorp/aws\"\n      version = \"~\u003e 5.100\"\n    }\n  }\n}\n```\n\n### Step 3: Create Examples\n\nCreate example configurations in the `examples/` directory:\n\n#### `examples/simple/`\n\n- Minimal, working configuration\n- Uses only required variables\n- Good for quick starts and basic testing\n\n#### `examples/complete/`\n\n- Comprehensive configuration showing all features\n- Demonstrates advanced options\n- Includes comments explaining choices\n\nEach example should include:\n\n- `main.tf` - The module invocation\n- `variables.tf` - Example variables\n- `outputs.tf` - Pass-through outputs\n- `test.tfvars` - Test values for automated testing\n- `README.md` - Documentation for the example\n\n### Step 4: Write Tests\n\nUpdate the test files in `tests/`:\n\n#### `tests/testimpl/test_impl.go`\n\nWrite functional tests that verify:\n\n- The resource is created successfully\n- Resource properties match expectations\n- Outputs are correct\n- Integration with AWS SDK to verify actual state\n\n#### `tests/testimpl/types.go`\n\nDefine the configuration structure for your tests:\n\n```go\ntype ThisTFModuleConfig struct {\n    Name              string `json:\"name\"`\n    KubernetesVersion string `json:\"kubernetes_version\"`\n    // ... other fields\n}\n```\n\n#### `tests/post_deploy_functional/main_test.go`\n\n- Update test names to match your module\n- Configure test flags (e.g., idempotency settings)\n- Adjust test context as needed\n\n### Step 5: Update Documentation\n\n1. **Update README.md** with:\n   - Overview of the module\n   - Feature list\n   - Usage examples\n   - Input/output documentation\n   - Validation rules\n\n2. **Document validation rules** clearly so users understand constraints.\n\n### Step 6: Test Your Module\n\n1. **Run local validation**:\n\n```bash\nmake check\n```\n\nThis runs:\n\n- Terraform fmt, validate, and plan\n- Go tests with Terratest\n- Pre-commit hooks\n- Security scans\n\n1. **Test with real infrastructure**:\n\n```bash\ncd examples/simple\nterraform init\nterraform plan -var-file=test.tfvars -out=the.tfplan\nterraform apply the.tfplan\n```\n\n1. **Verify outputs**:\n\n```bash\nterraform output\n```\n\n1. **Clean up**:\n\n```bash\nterraform destroy -var-file=test.tfvars\n```\n\n### Step 7: Document and Release\n\n1. **Write a comprehensive README** following the pattern in the example modules\n1. **Add files to commit** `git add .`\n1. **Run pre-commit hooks manually** `pre-commit run`\n1. **Resolve any pre-commit issues**\n1. **Push branch to github**\n\n---\n\n## Module Best Practices\n\n### Naming Conventions\n\n- Repository: `tf-aws-module_primitive-\u003cresource_name\u003e`\n- Resource identifier: Use `this` for the primary resource.\n- Variables: Use snake_case.\n- Match AWS resource parameter names where possible.\n\n### Input Variables\n\n- Provide sensible defaults when safe to do so.\n- Use `null` as default for optional complex objects.\n- Include validation rules with clear error messages.\n- Group related parameters using object types.\n- Document expected formats and constraints.\n\n### Outputs\n\n- Export all significant resource attributes.\n- Use clear, descriptive output names.\n- Include descriptions for all outputs.\n- Consider downstream module needs.\n\n### Tags\n\n- Always include a `tags` variable, unless the resource does not support tags.\n- Merge with `local.default_tags` including `provisioner = \"Terraform\"`.\n- Use provider default tags when appropriate.\n\n### Validation\n\n- Validate input constraints at the variable level.\n- Provide helpful error messages.\n- Check for common misconfigurations.\n- Validate relationships between variables.\n\n### Testing\n\n- Test the minimal example (required parameters only).\n- Test the complete example (all features).\n- Verify resource creation and properties.\n- Test idempotency where applicable.\n- Test validation rules by expecting failures.\n\n### Documentation\n\n- Clear overview of the module's purpose.\n- Feature list highlighting key capabilities.\n- Multiple usage examples (minimal and complete).\n- Comprehensive input/output tables.\n- Document validation rules and constraints.\n- Include links to relevant AWS documentation.\n\n---\n\n## File Structure\n\nAfter initialization, your module should have this structure:\n\n```\ntf-aws-module_primitive-\u003cresource_name\u003e/\n├── .github/\n│   └── workflows/          # CI/CD workflows\n├── examples/\n│   ├── simple/            # Minimal example\n│   │   ├── main.tf\n│   │   ├── variables.tf\n│   │   ├── outputs.tf\n│   │   ├── test.tfvars\n│   │   └── README.md\n│   └── complete/          # Comprehensive example\n│       ├── main.tf\n│       ├── variables.tf\n│       ├── outputs.tf\n│       ├── test.tfvars\n│       └── README.md\n├── tests/\n│   ├── post_deploy_functional/\n│   │   └── main_test.go\n│   ├── testimpl/\n│   │   ├── test_impl.go\n│   │   └── types.go\n├── .gitignore\n├── .pre-commit-config.yaml\n├── .tool-versions\n├── go.mod\n├── go.sum\n├── LICENSE\n├── locals.tf\n├── main.tf\n├── Makefile\n├── outputs.tf\n├── README.md\n├── variables.tf\n└── versions.tf\n```\n\n---\n\n## Common Makefile Targets\n\n| Target | Description |\n|--------|-------------|\n| `make init-module` | Initialize new module from template (run once after creating from template) |\n| `make configure-dependencies` | Install required development tools |\n| `make configure-git-hooks` | Set up pre-commit hooks |\n| `make check` | Run all validation and tests |\n| `make configure` | Full setup (dependencies + hooks + repo sync) |\n| `make clean` | Remove downloaded components |\n\n---\n\n## Getting Help\n\n- Review example modules: [EKS Cluster](https://github.com/launchbynttdata/tf-aws-module_primitive-eks_cluster), [KMS Key](https://github.com/launchbynttdata/tf-aws-module_primitive-kms_key)\n- Check the Launch Common Automation Framework documentation.\n- Reach out to the platform team for guidance.\n\n---\n\n## Contributing\n\nFollow the established patterns in existing primitive modules. All modules should:\n\n- Pass `make check` validation.\n- Include comprehensive tests.\n- Follow naming conventions.\n- Include clear documentation.\n- Use semantic versioning.\n\n\u003c!-- BEGIN_TF_DOCS --\u003e\n## Requirements\n\n| Name | Version |\n|------|---------|\n| \u003ca name=\"requirement_terraform\"\u003e\u003c/a\u003e [terraform](#requirement\\_terraform) | ~\u003e 1.5 |\n| \u003ca name=\"requirement_aws\"\u003e\u003c/a\u003e [aws](#requirement\\_aws) | ~\u003e 5.100 |\n\n## Modules\n\nNo modules.\n\n## Resources\n\n| Name | Type |\n|------|------|\n| [aws_eks_addon.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/eks_addon) | resource |\n\n## Inputs\n\n| Name | Description | Type | Default | Required |\n|------|-------------|------|---------|:--------:|\n| \u003ca name=\"input_cluster_name\"\u003e\u003c/a\u003e [cluster\\_name](#input\\_cluster\\_name) | The name of the EKS cluster to which the addon will be attached. | `string` | n/a | yes |\n| \u003ca name=\"input_addon_name\"\u003e\u003c/a\u003e [addon\\_name](#input\\_addon\\_name) | The name of the addon. | `string` | n/a | yes |\n| \u003ca name=\"input_addon_version\"\u003e\u003c/a\u003e [addon\\_version](#input\\_addon\\_version) | The version of the addon. | `string` | `null` | no |\n| \u003ca name=\"input_configuration_values\"\u003e\u003c/a\u003e [configuration\\_values](#input\\_configuration\\_values) | A JSON string that contains the configuration values for the addon. | `string` | `null` | no |\n| \u003ca name=\"input_resolve_conflicts_on_create\"\u003e\u003c/a\u003e [resolve\\_conflicts\\_on\\_create](#input\\_resolve\\_conflicts\\_on\\_create) | How to resolve parameter value conflicts on addon creation. | `string` | `null` | no |\n| \u003ca name=\"input_resolve_conflicts_on_update\"\u003e\u003c/a\u003e [resolve\\_conflicts\\_on\\_update](#input\\_resolve\\_conflicts\\_on\\_update) | How to resolve parameter value conflicts on addon update. | `string` | `null` | no |\n| \u003ca name=\"input_pod_identity_association\"\u003e\u003c/a\u003e [pod\\_identity\\_association](#input\\_pod\\_identity\\_association) | Whether to associate the addon with a pod identity. | \u003cpre\u003eobject({\u003cbr/\u003e    role_arn        = string\u003cbr/\u003e    service_account = string\u003cbr/\u003e  })\u003c/pre\u003e | `null` | no |\n| \u003ca name=\"input_preserve\"\u003e\u003c/a\u003e [preserve](#input\\_preserve) | Whether to preserve the addon when the cluster is deleted. | `bool` | `false` | no |\n| \u003ca name=\"input_service_account_role_arn\"\u003e\u003c/a\u003e [service\\_account\\_role\\_arn](#input\\_service\\_account\\_role\\_arn) | The ARN of the IAM role to bind to the addons service account. | `string` | `null` | no |\n| \u003ca name=\"input_tags\"\u003e\u003c/a\u003e [tags](#input\\_tags) | A map of tags to assign to the resource. | `map(string)` | `{}` | no |\n\n## Outputs\n\n| Name | Description |\n|------|-------------|\n| \u003ca name=\"output_arn\"\u003e\u003c/a\u003e [arn](#output\\_arn) | The Amazon Resource Name (ARN) of the EKS addon. |\n| \u003ca name=\"output_id\"\u003e\u003c/a\u003e [id](#output\\_id) | The ID of the EKS addon. |\n| \u003ca name=\"output_created_at\"\u003e\u003c/a\u003e [created\\_at](#output\\_created\\_at) | The creation timestamp of the EKS addon. |\n| \u003ca name=\"output_modified_at\"\u003e\u003c/a\u003e [modified\\_at](#output\\_modified\\_at) | The last modified timestamp of the EKS addon. |\n| \u003ca name=\"output_tags_all\"\u003e\u003c/a\u003e [tags\\_all](#output\\_tags\\_all) | A map of all tags assigned to the EKS addon. |\n| \u003ca name=\"output_addon_version\"\u003e\u003c/a\u003e [addon\\_version](#output\\_addon\\_version) | The version of the EKS addon. |\n\u003c!-- END_TF_DOCS --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flaunchbynttdata%2Ftf-aws-module_primitive-eks_addon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flaunchbynttdata%2Ftf-aws-module_primitive-eks_addon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flaunchbynttdata%2Ftf-aws-module_primitive-eks_addon/lists"}