Skip to content

Commit

Permalink
docs updated
Browse files Browse the repository at this point in the history
  • Loading branch information
shamimice03 committed Aug 24, 2023
1 parent da25b69 commit bb467c2
Show file tree
Hide file tree
Showing 14 changed files with 236 additions and 36 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Release

on:
workflow_dispatch:
push:
branches:
- main

jobs:
release:
name: Release
runs-on: ubuntu-latest
# Skip running release workflow on forks
if: github.repository_owner == 'shamimice03'
steps:
- name: Checkout
uses: actions/checkout@v3 # https://github.com/actions/checkout
with:
persist-credentials: false
fetch-depth: 0

- name: Release
uses: cycjimmy/semantic-release-action@v3
with:
semantic_version: 18.0.0 # https://semantic-release.gitbook.io/semantic-release/v/beta/extending/plugins-list
extra_plugins: |
@semantic-release/[email protected]
@semantic-release/[email protected]
[email protected]
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} # Personal Access Token
33 changes: 30 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
.terraform*
*tfstate*
*tfvars
# Local .terraform directories
**/.terraform/*

# Terraform lockfile
.terraform.lock.hcl

# .tfstate files
*.tfstate
*.tfstate.*
*.tfplan

# Crash log files
crash.log

# Exclude all .tfvars files, which are likely to contain sentitive 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

# 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

# Ignore CLI configuration files
.terraformrc
terraform.rc
31 changes: 31 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
repos:
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.81.0
hooks:
- id: terraform_fmt
- id: terraform_validate
- id: terraform_docs
args:
- --hook-config=--path-to-file=README.md # Valid UNIX path. I.e. ../TFDOC.md or docs/README.md etc.
- --hook-config=--add-to-existing-file=true # Boolean. true or false
- --hook-config=--create-file-if-not-exist=true # Boolean. true or false
- id: terraform_tflint
args:
- '--args=--only=terraform_deprecated_interpolation'
- '--args=--only=terraform_deprecated_index'
- '--args=--only=terraform_unused_declarations'
- '--args=--only=terraform_comment_syntax'
- '--args=--only=terraform_documented_outputs'
- '--args=--only=terraform_documented_variables'
- '--args=--only=terraform_typed_variables'
- '--args=--only=terraform_module_pinned_source'
- '--args=--only=terraform_naming_convention'
- '--args=--only=terraform_required_version'
- '--args=--only=terraform_required_providers'
- '--args=--only=terraform_standard_module_structure'
- '--args=--only=terraform_workspace_remote'
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-merge-conflict
#- id: end-of-file-fixer
45 changes: 45 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"branches": [
"main",
"master"
],
"ci": false,
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"preset": "conventionalcommits"
}
],
[
"@semantic-release/release-notes-generator",
{
"preset": "conventionalcommits"
}
],
[
"@semantic-release/github",
{
"successComment": "This ${issue.pull_request ? 'PR is included' : 'issue has been resolved'} in version ${nextRelease.version} :tada:",
"labels": false,
"releasedLabels": false
}
],
[
"@semantic-release/changelog",
{
"changelogFile": "CHANGELOG.md",
"changelogTitle": "# Changelog\n\nAll notable changes to this project will be documented in this file."
}
],
[
"@semantic-release/git",
{
"assets": [
"CHANGELOG.md"
],
"message": "chore(release): version ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
]
]
}
45 changes: 45 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,48 @@ module "acm-route53" {
```


<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
## Requirements

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.0.0 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | 5.13.1 |

## Modules

No modules.

## Resources

| Name | Type |
|------|------|
| [aws_acm_certificate.cert](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/acm_certificate) | resource |
| [aws_acm_certificate_validation.valid_cert](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/acm_certificate_validation) | resource |
| [aws_route53_record.validation](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route53_record) | resource |
| [aws_route53_zone.public_zone](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/route53_zone) | data source |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_allow_record_overwrite"></a> [allow\_record\_overwrite](#input\_allow\_record\_overwrite) | Determine Record Overwite | `bool` | `true` | no |
| <a name="input_domain_name"></a> [domain\_name](#input\_domain\_name) | Define Domain name | `string` | `""` | no |
| <a name="input_hosted_zone_name"></a> [hosted\_zone\_name](#input\_hosted\_zone\_name) | Define Hosted Zone Name | `string` | `""` | no |
| <a name="input_private_zone"></a> [private\_zone](#input\_private\_zone) | Determine Zone Type. `false` leads to `public zone` and `true` for `private zone` | `bool` | `false` | no |
| <a name="input_tags"></a> [tags](#input\_tags) | Define Tags | `map(any)` | <pre>{<br> "Name": "ssl-cert"<br>}</pre> | no |
| <a name="input_ttl"></a> [ttl](#input\_ttl) | Define ttl | `number` | `60` | no |
| <a name="input_validation_method"></a> [validation\_method](#input\_validation\_method) | Define Validation Method. `DNS` or `EMAIL` | `string` | `"DNS"` | no |

## Outputs

| Name | Description |
|------|-------------|
| <a name="output_certificate_arn"></a> [certificate\_arn](#output\_certificate\_arn) | certificate arn |
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
30 changes: 30 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# examples

<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
## Requirements

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | 5.0.0 |

## Providers

No providers.

## Modules

No modules.

## Resources

No resources.

## Inputs

No inputs.

## Outputs

No outputs.
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
25 changes: 12 additions & 13 deletions examples/main.tf
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
module "acm-route53" {

source = "shamimice03/acm-route53/aws"
# module "acm_route53" {

domain_name = "webapp.example.com"
validation_method = "DNS"
hosted_zone_name = "example.com"
private_zone = false
allow_record_overwrite = true
ttl = 60
tags = {
"Name" = "ssl-cert"
}
# source = "shamimice03/acm-route53/aws"

}
# domain_name = "webapp.example.com"
# validation_method = "DNS"
# hosted_zone_name = "example.com"
# private_zone = false
# allow_record_overwrite = true
# ttl = 60
# tags = {
# "Name" = "ssl-cert"
# }
# }
Empty file added examples/outputs.tf
Empty file.
Empty file added examples/variables.tf
Empty file.
8 changes: 4 additions & 4 deletions examples/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "4.51.0"
version = "5.0.0"
}
}
}

provider "aws" {
profile = "terraform-user"
}
# provider "aws" {
# profile = "terraform-user"
# }
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ resource "aws_route53_record" "validation" {
}
}

allow_overwrite = var.allow_record_overwrite
allow_overwrite = var.allow_record_overwrite
name = each.value.name
records = [each.value.record]
ttl = var.ttl
Expand Down
2 changes: 1 addition & 1 deletion outputs.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
output "certificate_arn" {
description = "certificate arn"
value = aws_acm_certificate_validation.valid_cert.certificate_arn
value = aws_acm_certificate_validation.valid_cert.certificate_arn
}
18 changes: 5 additions & 13 deletions variables.tf
Original file line number Diff line number Diff line change
@@ -1,33 +1,25 @@
variable "domain_name" {
description = "Define Domain name"
type = string
default = "webapp.kubecloud.com"
default = ""
}

variable "validation_method" {
description = "Define Validation Method"
description = "Define Validation Method. `DNS` or `EMAIL`"
type = string
default = "DNS" ## DNS or EMAIL
}

variable "hosted_zone_name" {
description = "Define Hosted Zone Name"
type = string
default = "kubecloud.com"
default = ""
}

variable "private_zone" {
description = "Determine Zone Type"
description = "Determine Zone Type. `false` leads to `public zone` and `true` for `private zone`"
type = bool
default = false
# false = public zone
# true = private zone
}

variable "allow_create_before_destroy_policy" {
description = "Define Create Before Destroy Lifecycle Policy"
type = bool
default = true
default = false
}

variable "tags" {
Expand Down
2 changes: 1 addition & 1 deletion versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "4.51.0"
version = ">= 5.0.0"
}
}
}
Expand Down

0 comments on commit bb467c2

Please sign in to comment.