Skip to content

Commit 6381c71

Browse files
committed
Initial commit
0 parents  commit 6381c71

17 files changed

+707
-0
lines changed

.docs/header.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
![nventive](https://nventive-public-assets.s3.amazonaws.com/nventive_logo_github.svg?v=2)
2+
3+
# terraform-aws-acm-certificate-import
4+
5+
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg?style=flat-square)](LICENSE) [![Latest Release](https://img.shields.io/github/release/nventive/terraform-aws-acm-certificate-import.svg?style=flat-square)](https://github.com/nventive/terraform-aws-acm-certificate-import/releases/latest)
6+
7+
Terraform module to import an existing certificate into ACM.
8+
9+
---
10+
11+
## Examples
12+
13+
**IMPORTANT:** We do not pin modules to versions in our examples because of the difficulty of keeping the versions in
14+
the documentation in sync with the latest released versions. We highly recommend that in your code you pin the version
15+
to the exact version you are using so that your infrastructure remains stable, and update versions in a systematic way
16+
so that they do not catch you by surprise.
17+
18+
```hcl
19+
module "cert" {
20+
source = "nventive/acm-certificate-import/aws"
21+
# We recommend pinning every module to a specific version
22+
# version = "x.x.x"
23+
24+
namespace = "eg"
25+
stage = "test"
26+
name = "app"
27+
28+
private_key_base64 = filebase64("${path.module}/key.pem")
29+
certificate_body_base64 = filebase64("${path.module}/cert.pem")
30+
certificate_chain_base64 = filebase64("${path.module}/chain.pem")
31+
}
32+
```

.docs/terraform-docs.yaml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
formatter: "markdown table"
2+
3+
header-from: .docs/header.md
4+
footer-from: .docs/footer.md
5+
6+
recursive:
7+
enabled: false
8+
path: modules
9+
10+
sections:
11+
hide: []
12+
show: []
13+
14+
content: |-
15+
{{ .Header }}
16+
{{ .Requirements }}
17+
{{ .Providers }}
18+
{{ .Modules }}
19+
{{ .Resources }}
20+
{{ .Inputs }}
21+
{{ .Outputs }}
22+
{{ .Footer }}
23+
24+
output:
25+
file: "README.md"
26+
mode: replace
27+
template: |-
28+
<!-- BEGIN_TF_DOCS -->
29+
{{ .Content }}
30+
<!-- END_TF_DOCS -->
31+
32+
output-values:
33+
enabled: false
34+
from: ""
35+
36+
sort:
37+
enabled: true
38+
by: name
39+
40+
settings:
41+
anchor: true
42+
color: true
43+
default: true
44+
description: false
45+
escape: true
46+
hide-empty: false
47+
html: true
48+
indent: 2
49+
lockfile: true
50+
read-comments: true
51+
required: true
52+
sensitive: true
53+
type: true

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[*]
2+
charset = utf-8
3+
end_of_line = lf
4+
indent_size = 2
5+
indent_style = space
6+
insert_final_newline = true
7+
max_line_length = 120
8+
tab_width = 2
9+
10+
[Makefile]
11+
indent_style = tab
12+
tab_width = 4

.gitattributes

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Define text file attributes.
2+
# - Treat them as text.
3+
# - Ensure no CRLF line-endings, neither on checkout nor on checkin.
4+
# - Detect whitespace errors.
5+
# - Exposed by default in `git diff --color` on the CLI.
6+
# - Validate with `git diff --check`.
7+
# - Deny applying with `git apply --whitespace=error-all`.
8+
# - Fix automatically with `git apply --whitespace=fix`.
9+
*.md text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
10+
*.tf text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
11+
*.yml text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
12+
*.yaml text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
13+
Makefile text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
14+
.githooks/* text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
15+
16+
# Define binary file attributes.
17+
# - Do not treat them as text.
18+
# - Include binary diff in patches instead of "binary files differ."
19+
*.gif -text diff
20+
*.jpeg -text diff
21+
*.jpg -text diff
22+
*.png -text diff
23+
*.svgz -text diff

.githooks/pre-commit

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
#
3+
# This hook will block a commit if Terraform isn't formatted properly or if README isn't up to date.
4+
#
5+
6+
[[ -f "$(which terraform)" ]] || (echo 1>&2 'Git Hooks (pre-commit): Terraform not in $PATH, can''t reformat.' && exit 1)
7+
terraform fmt -check 2>/dev/null || (echo 1>&2 'Git Hooks (pre-commit): Please run `terraform fmt` before committing.' && exit 1)
8+
9+
[[ -f "$(which terraform-docs)" ]] || (echo 1>&2 'Git Hooks (pre-commit): Terraform-docs not in $PATH, can''t update README file.' && exit 1)
10+
curl -sLo .docs/footer.md https://gist.githubusercontent.com/nventive-devops/7892a2ac9a2cc2ea219dd81796b6ce8b/raw/readme-footer.md
11+
terraform-docs markdown --config .docs/terraform-docs.yaml --output-check . 1>/dev/null 2>/dev/null || (
12+
echo 1>&2 'Git Hooks (pre-commit): Terraform-docs README file is out of date.'
13+
echo 1>&2 'Please run `make docs` before committing '
14+
exit 1
15+
)

.github/ISSUE_TEMPLATE.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
## Expected Behavior
2+
3+
4+
## Actual Behavior
5+
6+
7+
## Steps to Reproduce the Problem
8+
9+
1.
10+
2.
11+
3.
12+
13+
## Specifications
14+
15+
- OS [e.g. Linux, OSX, WSL, etc]:
16+
- Version [e.g. 11.5]:
17+
- Module version:
18+
- Terraform version:

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
GitHub Issue: #
2+
<!-- Link to relevant GitHub issue if applicable.
3+
All PRs should be associated with an issue -->
4+
5+
## Proposed Changes
6+
<!-- Please check one or more that apply to this PR. -->
7+
8+
- [ ] Bug fix
9+
- [ ] Feature
10+
- [ ] Code style update (formatting)
11+
- [ ] Refactoring (no functional changes, no api changes)
12+
- [ ] Build or CI related changes
13+
- [ ] Documentation content changes
14+
- [ ] Other, please describe:
15+
16+
17+
## What is the current behavior?
18+
<!-- Please describe the current behavior that you are modifying,
19+
or link to a relevant issue. -->
20+
21+
22+
## What is the new behavior?
23+
<!-- Please describe the new behavior after your modifications. -->
24+
25+
26+
## Checklist
27+
28+
Please check that your PR fulfills the following requirements:
29+
30+
- [ ] Documentation has been added/updated.
31+
- [ ] Automated tests for the changes have been added/updated.
32+
- [ ] Commits have been squashed (if applicable).
33+
- [ ] Updated [BREAKING_CHANGES.md](../BREAKING_CHANGES.md) (if you introduced a breaking change).
34+
35+
<!-- If this PR contains a breaking change, please describe the impact
36+
and migration path for existing applications below. -->
37+
38+
## Other information
39+
<!-- Please provide any additional information if necessary -->
40+
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Conventional Commits
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- synchronize
8+
9+
#env:
10+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
11+
12+
jobs:
13+
validate-commits:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Check out code into the Go module directory
18+
uses: actions/checkout@v1
19+
20+
- name: Commitsar check
21+
uses: docker://aevea/commitsar
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Terraform actions
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- synchronize
8+
9+
jobs:
10+
terraform-format-check:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v3
15+
with:
16+
ref: ${{ github.event.pull_request.head.ref }}
17+
18+
- name: Set up Terraform
19+
uses: hashicorp/setup-terraform@v1
20+
21+
- name: Check Terraform Code Formatting
22+
run: terraform fmt -check
23+
24+
- name: Download footer.md
25+
run: curl -sLo .docs/footer.md https://gist.githubusercontent.com/nventive-devops/7892a2ac9a2cc2ea219dd81796b6ce8b/raw/readme-footer.md
26+
27+
- name: Render terraform docs and push changes back to PR
28+
uses: terraform-docs/gh-actions@main
29+
with:
30+
working-dir: .
31+
git-commit-message: "docs: Update README.md (automated action)"
32+
config-file: .docs/terraform-docs.yaml
33+
output-file: README.md
34+
output-method: replace
35+
git-push: "true"

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# IDE
2+
.idea
3+
.vscode
4+
5+
# Terraform specific
6+
.terraform.lock.hcl
7+
.terraform/
8+
9+
# Temporary files
10+
.docs/footer.md

Makefile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
SHELL:=/bin/sh
2+
.SILENT:
3+
4+
.PHONY: docs hooks
5+
docs:
6+
curl -sLo .docs/footer.md https://gist.githubusercontent.com/nventive-devops/7892a2ac9a2cc2ea219dd81796b6ce8b/raw/readme-footer.md
7+
terraform-docs markdown --config .docs/terraform-docs.yaml .
8+
9+
hooks:
10+
cp .githooks/pre-commit .git/hooks/pre-commit
11+
chmod +x .git/hooks/pre-commit

README.md

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
<!-- BEGIN_TF_DOCS -->
2+
![nventive](https://nventive-public-assets.s3.amazonaws.com/nventive_logo_github.svg?v=2)
3+
4+
# terraform-aws-acm-certificate-import
5+
6+
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg?style=flat-square)](LICENSE) [![Latest Release](https://img.shields.io/github/release/nventive/terraform-aws-acm-certificate-import.svg?style=flat-square)](https://github.com/nventive/terraform-aws-acm-certificate-import/releases/latest)
7+
8+
Terraform module to import an existing certificate into ACM.
9+
10+
---
11+
12+
## Examples
13+
14+
**IMPORTANT:** We do not pin modules to versions in our examples because of the difficulty of keeping the versions in
15+
the documentation in sync with the latest released versions. We highly recommend that in your code you pin the version
16+
to the exact version you are using so that your infrastructure remains stable, and update versions in a systematic way
17+
so that they do not catch you by surprise.
18+
19+
```hcl
20+
module "cert" {
21+
source = "nventive/acm-certificate-import/aws"
22+
# We recommend pinning every module to a specific version
23+
# version = "x.x.x"
24+
25+
namespace = "eg"
26+
stage = "test"
27+
name = "app"
28+
29+
private_key_base64 = filebase64("${path.module}/key.pem")
30+
certificate_body_base64 = filebase64("${path.module}/cert.pem")
31+
certificate_chain_base64 = filebase64("${path.module}/chain.pem")
32+
}
33+
```
34+
## Requirements
35+
36+
| Name | Version |
37+
|------|---------|
38+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.0 |
39+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 2.0 |
40+
| <a name="requirement_null"></a> [null](#requirement\_null) | >= 2.0 |
41+
## Providers
42+
43+
| Name | Version |
44+
|------|---------|
45+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 2.0 |
46+
## Modules
47+
48+
| Name | Source | Version |
49+
|------|--------|---------|
50+
| <a name="module_this"></a> [this](#module\_this) | cloudposse/label/null | 0.25.0 |
51+
## Resources
52+
53+
| Name | Type |
54+
|------|------|
55+
| [aws_acm_certificate.default](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/acm_certificate) | resource |
56+
## Inputs
57+
58+
| Name | Description | Type | Default | Required |
59+
|------|-------------|------|---------|:--------:|
60+
| <a name="input_additional_tag_map"></a> [additional\_tag\_map](#input\_additional\_tag\_map) | Additional key-value pairs to add to each map in `tags_as_list_of_maps`. Not added to `tags` or `id`.<br>This is for some rare cases where resources want additional configuration of tags<br>and therefore take a list of maps with tag key, value, and additional configuration. | `map(string)` | `{}` | no |
61+
| <a name="input_attributes"></a> [attributes](#input\_attributes) | ID element. Additional attributes (e.g. `workers` or `cluster`) to add to `id`,<br>in the order they appear in the list. New attributes are appended to the<br>end of the list. The elements of the list are joined by the `delimiter`<br>and treated as a single ID element. | `list(string)` | `[]` | no |
62+
| <a name="input_certificate_body_base64"></a> [certificate\_body\_base64](#input\_certificate\_body\_base64) | The certificate's PEM-formatted public key base64-encoded. | `string` | n/a | yes |
63+
| <a name="input_certificate_chain_base64"></a> [certificate\_chain\_base64](#input\_certificate\_chain\_base64) | The certificate's PEM-formatted chain base64-encoded. | `string` | `""` | no |
64+
| <a name="input_context"></a> [context](#input\_context) | Single object for setting entire context at once.<br>See description of individual variables for details.<br>Leave string and numeric variables as `null` to use default value.<br>Individual variable settings (non-null) override settings in context object,<br>except for attributes, tags, and additional\_tag\_map, which are merged. | `any` | <pre>{<br> "additional_tag_map": {},<br> "attributes": [],<br> "delimiter": null,<br> "descriptor_formats": {},<br> "enabled": true,<br> "environment": null,<br> "id_length_limit": null,<br> "label_key_case": null,<br> "label_order": [],<br> "label_value_case": null,<br> "labels_as_tags": [<br> "unset"<br> ],<br> "name": null,<br> "namespace": null,<br> "regex_replace_chars": null,<br> "stage": null,<br> "tags": {},<br> "tenant": null<br>}</pre> | no |
65+
| <a name="input_delimiter"></a> [delimiter](#input\_delimiter) | Delimiter to be used between ID elements.<br>Defaults to `-` (hyphen). Set to `""` to use no delimiter at all. | `string` | `null` | no |
66+
| <a name="input_descriptor_formats"></a> [descriptor\_formats](#input\_descriptor\_formats) | Describe additional descriptors to be output in the `descriptors` output map.<br>Map of maps. Keys are names of descriptors. Values are maps of the form<br>`{<br> format = string<br> labels = list(string)<br>}`<br>(Type is `any` so the map values can later be enhanced to provide additional options.)<br>`format` is a Terraform format string to be passed to the `format()` function.<br>`labels` is a list of labels, in order, to pass to `format()` function.<br>Label values will be normalized before being passed to `format()` so they will be<br>identical to how they appear in `id`.<br>Default is `{}` (`descriptors` output will be empty). | `any` | `{}` | no |
67+
| <a name="input_enabled"></a> [enabled](#input\_enabled) | Set to false to prevent the module from creating any resources | `bool` | `null` | no |
68+
| <a name="input_environment"></a> [environment](#input\_environment) | ID element. Usually used for region e.g. 'uw2', 'us-west-2', OR role 'prod', 'staging', 'dev', 'UAT' | `string` | `null` | no |
69+
| <a name="input_id_length_limit"></a> [id\_length\_limit](#input\_id\_length\_limit) | Limit `id` to this many characters (minimum 6).<br>Set to `0` for unlimited length.<br>Set to `null` for keep the existing setting, which defaults to `0`.<br>Does not affect `id_full`. | `number` | `null` | no |
70+
| <a name="input_label_key_case"></a> [label\_key\_case](#input\_label\_key\_case) | Controls the letter case of the `tags` keys (label names) for tags generated by this module.<br>Does not affect keys of tags passed in via the `tags` input.<br>Possible values: `lower`, `title`, `upper`.<br>Default value: `title`. | `string` | `null` | no |
71+
| <a name="input_label_order"></a> [label\_order](#input\_label\_order) | The order in which the labels (ID elements) appear in the `id`.<br>Defaults to ["namespace", "environment", "stage", "name", "attributes"].<br>You can omit any of the 6 labels ("tenant" is the 6th), but at least one must be present. | `list(string)` | `null` | no |
72+
| <a name="input_label_value_case"></a> [label\_value\_case](#input\_label\_value\_case) | Controls the letter case of ID elements (labels) as included in `id`,<br>set as tag values, and output by this module individually.<br>Does not affect values of tags passed in via the `tags` input.<br>Possible values: `lower`, `title`, `upper` and `none` (no transformation).<br>Set this to `title` and set `delimiter` to `""` to yield Pascal Case IDs.<br>Default value: `lower`. | `string` | `null` | no |
73+
| <a name="input_labels_as_tags"></a> [labels\_as\_tags](#input\_labels\_as\_tags) | Set of labels (ID elements) to include as tags in the `tags` output.<br>Default is to include all labels.<br>Tags with empty values will not be included in the `tags` output.<br>Set to `[]` to suppress all generated tags.<br>**Notes:**<br> The value of the `name` tag, if included, will be the `id`, not the `name`.<br> Unlike other `null-label` inputs, the initial setting of `labels_as_tags` cannot be<br> changed in later chained modules. Attempts to change it will be silently ignored. | `set(string)` | <pre>[<br> "default"<br>]</pre> | no |
74+
| <a name="input_name"></a> [name](#input\_name) | ID element. Usually the component or solution name, e.g. 'app' or 'jenkins'.<br>This is the only ID element not also included as a `tag`.<br>The "name" tag is set to the full `id` string. There is no tag with the value of the `name` input. | `string` | `null` | no |
75+
| <a name="input_namespace"></a> [namespace](#input\_namespace) | ID element. Usually an abbreviation of your organization name, e.g. 'eg' or 'cp', to help ensure generated IDs are globally unique | `string` | `null` | no |
76+
| <a name="input_private_key_base64"></a> [private\_key\_base64](#input\_private\_key\_base64) | The certificate's PEM-formatted private key base64-encoded. | `string` | n/a | yes |
77+
| <a name="input_regex_replace_chars"></a> [regex\_replace\_chars](#input\_regex\_replace\_chars) | Terraform regular expression (regex) string.<br>Characters matching the regex will be removed from the ID elements.<br>If not set, `"/[^a-zA-Z0-9-]/"` is used to remove all characters other than hyphens, letters and digits. | `string` | `null` | no |
78+
| <a name="input_stage"></a> [stage](#input\_stage) | ID element. Usually used to indicate role, e.g. 'prod', 'staging', 'source', 'build', 'test', 'deploy', 'release' | `string` | `null` | no |
79+
| <a name="input_tags"></a> [tags](#input\_tags) | Additional tags (e.g. `{'BusinessUnit': 'XYZ'}`).<br>Neither the tag keys nor the tag values will be modified by this module. | `map(string)` | `{}` | no |
80+
| <a name="input_tenant"></a> [tenant](#input\_tenant) | ID element \_(Rarely used, not included by default)\_. A customer identifier, indicating who this instance of a resource is for | `string` | `null` | no |
81+
## Outputs
82+
83+
| Name | Description |
84+
|------|-------------|
85+
| <a name="output_arn"></a> [arn](#output\_arn) | The ARN of the certificate. |
86+
| <a name="output_id"></a> [id](#output\_id) | The ARN of the certificate. |
87+
## Breaking Changes
88+
89+
Please consult [BREAKING\_CHANGES.md](BREAKING\_CHANGES.md) for more information about version
90+
history and compatibility.
91+
92+
## Contributing
93+
94+
Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on the process for
95+
contributing to this project.
96+
97+
Be mindful of our [Code of Conduct](CODE\_OF\_CONDUCT.md).
98+
99+
## We're hiring
100+
101+
Look for current openings on BambooHR https://nventive.bamboohr.com/careers/
102+
103+
## Stay in touch
104+
105+
[nventive.com](https://nventive.com/) | [Linkedin](https://www.linkedin.com/company/nventive/) | [Instagram](https://www.instagram.com/hellonventive/) | [YouTube](https://www.youtube.com/channel/UCFQyvGEKMO10hEyvCqprp5w) | [Spotify](https://open.spotify.com/show/0lsxfIb6Ttm76jB4wgutob)
106+
<!-- END_TF_DOCS -->

0 commit comments

Comments
 (0)