Skip to content

Commit

Permalink
resolve discussions
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuszjenek committed Feb 5, 2024
1 parent 6971f87 commit 0f81fc9
Show file tree
Hide file tree
Showing 20 changed files with 471 additions and 85 deletions.
42 changes: 42 additions & 0 deletions examples/route53/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<!-- BEGIN_TF_DOCS -->
## Requirements

| Name | Version |
|------|---------|
| terraform | >= 1.3.0 |
| humanitec | ~> 0 |

## Providers

| Name | Version |
|------|---------|
| humanitec | ~> 0 |

## Modules

| Name | Source | Version |
|------|--------|---------|
| route53 | ../../humanitec-resource-defs/route53/basic | n/a |

## Resources

| Name | Type |
|------|------|
| [humanitec_application.example](https://registry.terraform.io/providers/humanitec/humanitec/latest/docs/resources/application) | resource |
| [humanitec_resource_definition_criteria.redis](https://registry.terraform.io/providers/humanitec/humanitec/latest/docs/resources/resource_definition_criteria) | resource |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| access\_key | AWS Access Key | `string` | n/a | yes |
| hosted\_zone | The name of the hosted zone in which this record set will reside. | `string` | n/a | yes |
| region | AWS Region | `string` | n/a | yes |
| secret\_key | AWS Secret Key | `string` | n/a | yes |
| subdomain | The subdomain of the DNS name that the DNS record is for. | `string` | n/a | yes |
| ip\_address | The IPv4 address that the DNS name should resolve to. | `string` | `""` | no |
| ipv6\_address | The IPv6 address that the DNS name should resolve to. | `string` | `""` | no |
| name | A valid fully qualified domain name that the DNS name should resolve to. | `string` | `""` | no |
| resource\_packs\_aws\_rev | AWS Resource Pack git branch | `string` | `"refs/heads/main"` | no |
| resource\_packs\_aws\_url | AWS Resource Pack git url | `string` | `"https://github.com/humanitec-architecture/resource-packs-aws.git"` | no |
<!-- END_TF_DOCS -->
31 changes: 31 additions & 0 deletions examples/route53/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
locals {
res_def_prefix = "${var.name}-"
}

resource "humanitec_application" "example" {
id = var.name
name = var.name
}

module "route53" {
source = "../../humanitec-resource-defs/route53/basic"

access_key = var.access_key
secret_key = var.secret_key
resource_packs_aws_url = var.resource_packs_aws_url
resource_packs_aws_rev = var.resource_packs_aws_rev
region = var.region

prefix = local.res_def_prefix

hosted_zone = var.hosted_zone
subdomain = var.subdomain
ip_address = var.ip_address
ipv6_address = var.ipv6_address
name = var.domain_name
}

resource "humanitec_resource_definition_criteria" "redis" {
resource_definition_id = module.route53.id
app_id = humanitec_application.example.id
}
12 changes: 12 additions & 0 deletions examples/route53/providers.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
terraform {
required_providers {
humanitec = {
source = "humanitec/humanitec"
version = "~> 0"
}
}

required_version = ">= 1.3.0"
}

provider "humanitec" {}
30 changes: 30 additions & 0 deletions examples/route53/terraform.tfvars.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

# AWS Access Key
access_key = ""

# The name of the hosted zone in which this record set will reside.
hosted_zone = ""

# The IPv4 address that the DNS name should resolve to.
ip_address = ""

# The IPv6 address that the DNS name should resolve to.
ipv6_address = ""

# A valid fully qualified domain name that the DNS name should resolve to.
name = ""

# AWS Region
region = ""

# AWS Resource Pack git branch
resource_packs_aws_rev = "refs/heads/main"

# AWS Resource Pack git url
resource_packs_aws_url = "https://github.com/humanitec-architecture/resource-packs-aws.git"

# AWS Secret Key
secret_key = ""

# The subdomain of the DNS name that the DNS record is for.
subdomain = ""
60 changes: 60 additions & 0 deletions examples/route53/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
variable "access_key" {
description = "AWS Access Key"
type = string
}

variable "secret_key" {
description = "AWS Secret Key"
type = string
}

variable "region" {
description = "AWS Region"
type = string
}

variable "resource_packs_aws_url" {
description = "AWS Resource Pack git url"
type = string
default = "https://github.com/humanitec-architecture/resource-packs-aws.git"
}

variable "resource_packs_aws_rev" {
description = "AWS Resource Pack git branch"
type = string
default = "refs/heads/main"
}

variable "name" {
description = "Name of the example application"
type = string
default = "route53-test"
}

variable "hosted_zone" {
description = "The name of the hosted zone in which this record set will reside."
type = string
}

variable "subdomain" {
description = "The subdomain of the DNS name that the DNS record is for."
type = string
}

variable "ip_address" {
description = "The IPv4 address that the DNS name should resolve to."
type = string
default = ""
}

variable "ipv6_address" {
description = "The IPv6 address that the DNS name should resolve to."
type = string
default = ""
}

variable "domain_name" {
description = "A valid fully qualified domain name that the DNS name should resolve to."
type = string
default = ""
}
37 changes: 37 additions & 0 deletions humanitec-resource-defs/route53/basic/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<!-- BEGIN_TF_DOCS -->


## Providers

| Name | Version |
|------|---------|
| humanitec | n/a |

## Resources

| Name | Type |
|------|------|
| [humanitec_resource_definition.main](https://registry.terraform.io/providers/humanitec/humanitec/latest/docs/resources/resource_definition) | resource |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| access\_key | AWS Access Key | `string` | n/a | yes |
| hosted\_zone | The name of the hosted zone in which this record set will reside. | `string` | n/a | yes |
| prefix | Prefix for all resources | `string` | n/a | yes |
| region | AWS Region | `string` | n/a | yes |
| secret\_key | AWS Secret Key | `string` | n/a | yes |
| subdomain | The subdomain of the DNS name that the DNS record is for. | `string` | n/a | yes |
| ip\_address | The IPv4 address that the DNS name should resolve to. | `string` | `""` | no |
| ipv6\_address | The IPv6 address that the DNS name should resolve to. | `string` | `""` | no |
| name | A valid fully qualified domain name that the DNS name should resolve to. | `string` | `""` | no |
| resource\_packs\_aws\_rev | AWS Resource Pack git branch | `string` | `"refs/heads/main"` | no |
| resource\_packs\_aws\_url | AWS Resource Pack git url | `string` | `"https://github.com/humanitec-architecture/resource-packs-aws.git"` | no |

## Outputs

| Name | Description |
|------|-------------|
| id | n/a |
<!-- END_TF_DOCS -->
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,21 @@ resource "humanitec_resource_definition" "main" {

values_string = jsonencode({
source = {
path = "modules/route53"
path = "modules/route53/basic"
rev = var.resource_packs_aws_rev
url = "https://github.com/humanitec-architecture/resource-packs-aws.git"
url = var.resource_packs_aws_url
}

variables = {
region = var.region
res_id = "$${context.res.id}"
dns_zone = var.dns_zone
dns_name = var.dns_name
dns_type = var.dns_type
dns_ttl = var.dns_ttl
region = var.region
res_id = "$${context.res.id}"
app_id = "$${context.app.id}"
env_id = "$${context.env.id}"
hosted_zone = var.hosted_zone
subdomain = var.subdomain
ip_address = var.ip_address
ipv6_address = var.ipv6_address
name = var.name
}
})
}
Expand Down
File renamed without changes.
33 changes: 33 additions & 0 deletions humanitec-resource-defs/route53/basic/terraform.tfvars.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@

# AWS Access Key
access_key = ""

# The name of the hosted zone in which this record set will reside.
hosted_zone = ""

# The IPv4 address that the DNS name should resolve to.
ip_address = ""

# The IPv6 address that the DNS name should resolve to.
ipv6_address = ""

# A valid fully qualified domain name that the DNS name should resolve to.
name = ""

# Prefix for all resources
prefix = ""

# AWS Region
region = ""

# AWS Resource Pack git branch
resource_packs_aws_rev = "refs/heads/main"

# AWS Resource Pack git url
resource_packs_aws_url = "https://github.com/humanitec-architecture/resource-packs-aws.git"

# AWS Secret Key
secret_key = ""

# The subdomain of the DNS name that the DNS record is for.
subdomain = ""
59 changes: 59 additions & 0 deletions humanitec-resource-defs/route53/basic/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
variable "prefix" {
description = "Prefix for all resources"
type = string
}

variable "resource_packs_aws_url" {
description = "AWS Resource Pack git url"
type = string
default = "https://github.com/humanitec-architecture/resource-packs-aws.git"
}

variable "resource_packs_aws_rev" {
description = "AWS Resource Pack git branch"
type = string
default = "refs/heads/main"
}

variable "access_key" {
description = "AWS Access Key"
type = string
}

variable "secret_key" {
description = "AWS Secret Key"
type = string
}

variable "region" {
description = "AWS Region"
type = string
}

variable "hosted_zone" {
description = "The name of the hosted zone in which this record set will reside."
type = string
}

variable "subdomain" {
description = "The subdomain of the DNS name that the DNS record is for."
type = string
}

variable "ip_address" {
description = "The IPv4 address that the DNS name should resolve to."
type = string
default = ""
}

variable "ipv6_address" {
description = "The IPv6 address that the DNS name should resolve to."
type = string
default = ""
}

variable "name" {
description = "A valid fully qualified domain name that the DNS name should resolve to."
type = string
default = ""
}
35 changes: 0 additions & 35 deletions humanitec-resource-defs/route53/variables.tf

This file was deleted.

Loading

0 comments on commit 0f81fc9

Please sign in to comment.