{"id":51410883,"url":"https://github.com/launchbynttdata/tf-aws-module_primitive-acmpca_certificate_authority_certificate","last_synced_at":"2026-07-04T14:32:34.930Z","repository":{"id":348720130,"uuid":"1114030051","full_name":"launchbynttdata/tf-aws-module_primitive-acmpca_certificate_authority_certificate","owner":"launchbynttdata","description":null,"archived":false,"fork":false,"pushed_at":"2026-04-02T18:52:59.000Z","size":44,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-03T02:35:29.928Z","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":"CHANGELOG.md","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-12-10T19:54:34.000Z","updated_at":"2026-04-02T18:52:57.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/launchbynttdata/tf-aws-module_primitive-acmpca_certificate_authority_certificate","commit_stats":null,"previous_names":["launchbynttdata/tf-aws-module_primitive-acmpca_certificate_authority_certificate"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/launchbynttdata/tf-aws-module_primitive-acmpca_certificate_authority_certificate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/launchbynttdata%2Ftf-aws-module_primitive-acmpca_certificate_authority_certificate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/launchbynttdata%2Ftf-aws-module_primitive-acmpca_certificate_authority_certificate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/launchbynttdata%2Ftf-aws-module_primitive-acmpca_certificate_authority_certificate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/launchbynttdata%2Ftf-aws-module_primitive-acmpca_certificate_authority_certificate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/launchbynttdata","download_url":"https://codeload.github.com/launchbynttdata/tf-aws-module_primitive-acmpca_certificate_authority_certificate/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/launchbynttdata%2Ftf-aws-module_primitive-acmpca_certificate_authority_certificate/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35125718,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-04T02:00:05.987Z","response_time":113,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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-07-04T14:32:33.572Z","updated_at":"2026-07-04T14:32:34.918Z","avatar_url":"https://github.com/launchbynttdata.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tf-aws-module_primitive-acmpca_certificate_authority_certificate\n\n[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n[![Terraform](https://img.shields.io/badge/terraform-1.5.x-623CE4.svg)](https://www.terraform.io)\n\n## Overview\n\nThis Terraform module provides a primitive wrapper around the `aws_acmpca_certificate_authority_certificate` resource, which installs a certificate on an AWS Certificate Manager Private Certificate Authority (ACM PCA).\n\nThis resource is used to associate a CA certificate with a Private Certificate Authority. This is typically used after issuing a certificate for the CA using the `aws_acmpca_certificate` resource.\n\n## Features\n\n- **Simple Installation**: Install CA certificates on ACM Private Certificate Authorities\n- **Root and Subordinate CA Support**: Works with both root and subordinate Certificate Authorities\n- **Certificate Chain Management**: Optional certificate chain for subordinate CAs\n- **Full Resource Access**: All resource attributes exposed as outputs\n- **Comprehensive Testing**: Validates actual AWS resource state using AWS SDK\n\n## Usage\n\n### Basic Example\n\n```hcl\nmodule \"certificate_authority_certificate\" {\n  source = \"launchbynttdata/module_primitive-acmpca_certificate_authority_certificate/aws\"\n\n  certificate_authority_arn = aws_acmpca_certificate_authority.example.arn\n  certificate               = aws_acmpca_certificate.example.certificate\n  certificate_chain         = aws_acmpca_certificate.example.certificate_chain # Optional, for subordinate CAs\n}\n```\n\n### Complete Example with Root CA\n\nSee [examples/simple](examples/simple/) for a complete working example that creates a test Certificate Authority and installs a certificate on it.\n\n## When to Use This Module\n\nUse this module when you need to:\n\n- Install a CA certificate on an ACM Private Certificate Authority\n- Complete the setup of a new Certificate Authority after issuing its certificate\n- Manage CA certificates separately from CA creation for better modularity\n\n## Prerequisites\n\n- An existing AWS Certificate Manager Private Certificate Authority\n- A certificate issued for that Certificate Authority (using `aws_acmpca_certificate`)\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** (in this case, `aws_acmpca_certificate_authority_certificate`)\n- Provide sensible defaults while maintaining full configurability\n- Follow consistent patterns for inputs, outputs, and validation\n- Include automated testing using Terratest\n- Serve as building blocks for higher-level composite modules\n\n---\n\n## Getting Started with Development\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```text\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_acmpca_certificate_authority_certificate.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/acmpca_certificate_authority_certificate) | resource |\n\n## Inputs\n\n| Name | Description | Type | Default | Required |\n|------|-------------|------|---------|:--------:|\n| \u003ca name=\"input_certificate\"\u003e\u003c/a\u003e [certificate](#input\\_certificate) | (Required) PEM-encoded certificate for the Certificate Authority. See https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/acmpca_certificate_authority_certificate#certificate | `string` | n/a | yes |\n| \u003ca name=\"input_certificate_authority_arn\"\u003e\u003c/a\u003e [certificate\\_authority\\_arn](#input\\_certificate\\_authority\\_arn) | (Required) ARN of the Certificate Authority. See https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/acmpca_certificate_authority_certificate#certificate_authority_arn | `string` | n/a | yes |\n| \u003ca name=\"input_certificate_chain\"\u003e\u003c/a\u003e [certificate\\_chain](#input\\_certificate\\_chain) | (Optional) PEM-encoded certificate chain that includes any intermediate certificates and chains up to root CA. Required for subordinate Certificate Authorities. See https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/acmpca_certificate_authority_certificate#certificate_chain | `string` | `null` | no |\n\n## Outputs\n\n| Name | Description |\n|------|-------------|\n| \u003ca name=\"output_certificate\"\u003e\u003c/a\u003e [certificate](#output\\_certificate) | PEM-encoded certificate for the Certificate Authority |\n| \u003ca name=\"output_certificate_authority_arn\"\u003e\u003c/a\u003e [certificate\\_authority\\_arn](#output\\_certificate\\_authority\\_arn) | ARN of the Certificate Authority |\n| \u003ca name=\"output_certificate_chain\"\u003e\u003c/a\u003e [certificate\\_chain](#output\\_certificate\\_chain) | PEM-encoded certificate chain |\n| \u003ca name=\"output_id\"\u003e\u003c/a\u003e [id](#output\\_id) | Certificate Authority ARN (same as certificate\\_authority\\_arn) |\n\u003c!-- END_TF_DOCS --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flaunchbynttdata%2Ftf-aws-module_primitive-acmpca_certificate_authority_certificate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flaunchbynttdata%2Ftf-aws-module_primitive-acmpca_certificate_authority_certificate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flaunchbynttdata%2Ftf-aws-module_primitive-acmpca_certificate_authority_certificate/lists"}