-
Notifications
You must be signed in to change notification settings - Fork 0
Feat/dohrmy 139 dom #45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
pareddyakamai
wants to merge
5
commits into
integration
Choose a base branch
from
feat/DOHRMY-139-DOM
base: integration
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+191
−0
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
28cf7eb
feat(dom): add Domain Ownership Management module
pareddyakamai 7abc32f
feat(dom): add Domain Ownership Management module with README documen…
pareddyakamai 412904b
Merge remote-tracking branch 'origin/integration' into feat/DOHRMY-13…
pareddyakamai fa6fb25
docs: remove terraform-docs.yaml file from dom folder
pareddyakamai 91d6cbd
docs: updating readme.md file
pareddyakamai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| <!-- BEGIN_TF_DOCS --> | ||
|
|
||
|
|
||
|
|
||
| # Usage | ||
| Basic usage of this module is as follows: | ||
|
|
||
| ```hcl | ||
| module "example" { | ||
| source = "<module-location>" | ||
|
|
||
| # Required variables | ||
| domain_validation_entries = <list(object({ | ||
| domain_name = string | ||
| validation_scope = string | ||
| validation_method = string | ||
| }))> | ||
| edgerc_path = <string> | ||
| edgerc_section = <string> | ||
| enable_validation = <bool> | ||
|
|
||
| # Optional variables | ||
| domain_search_entries = <list(object({ | ||
| domain_name = string | ||
| validation_scope = string | ||
| }))> | default: [] | ||
| } | ||
| ``` | ||
|
|
||
| ## Requirements | ||
|
|
||
| | Name | Version | | ||
| |------|---------| | ||
| | <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.9.0 | | ||
| | <a name="requirement_akamai"></a> [akamai](#requirement\_akamai) | >= 9.2.0 | | ||
|
|
||
| ## Resources | ||
|
|
||
| | Name | Type | | ||
| |------|------| | ||
| | [akamai_property_domainownership_domains.domains](https://registry.terraform.io/providers/akamai/akamai/latest/docs/resources/property_domainownership_domains) | resource | | ||
| | [akamai_property_domainownership_validation.validation](https://registry.terraform.io/providers/akamai/akamai/latest/docs/resources/property_domainownership_validation) | resource | | ||
| | [akamai_property_domainownership_search_domains.search](https://registry.terraform.io/providers/akamai/akamai/latest/docs/data-sources/property_domainownership_search_domains) | data source | | ||
|
|
||
| ## Modules | ||
|
|
||
| No modules. | ||
|
|
||
| ## Inputs | ||
|
|
||
| | Name | Description | Type | Default | Required | | ||
| |------|-------------|------|---------|:--------:| | ||
| | <a name="input_domain_validation_entries"></a> [domain\_validation\_entries](#input\_domain\_validation\_entries) | A list of objects with hostnames, domains, or wildcards to DOM validate | <pre>list(object({<br/> domain_name = string<br/> validation_scope = string<br/> validation_method = string<br/> }))</pre> | n/a | yes | | ||
| | <a name="input_edgerc_path"></a> [edgerc\_path](#input\_edgerc\_path) | Path to the .edgerc file | `string` | n/a | yes | | ||
| | <a name="input_edgerc_section"></a> [edgerc\_section](#input\_edgerc\_section) | Section in the .edgerc file | `string` | n/a | yes | | ||
| | <a name="input_enable_validation"></a> [enable\_validation](#input\_enable\_validation) | Set to true to enable domain validation | `bool` | n/a | yes | | ||
| | <a name="input_domain_search_entries"></a> [domain\_search\_entries](#input\_domain\_search\_entries) | List of domains to search validation status for | <pre>list(object({<br/> domain_name = string<br/> validation_scope = string<br/> }))</pre> | `[]` | no | | ||
|
|
||
| ## Outputs | ||
|
|
||
| | Name | Description | | ||
| |------|-------------| | ||
| | <a name="output_cname_validation_challenges"></a> [cname\_validation\_challenges](#output\_cname\_validation\_challenges) | Map of CNAME records for domain validation challenges (key: domain\_name) | | ||
| | <a name="output_domain_search_results"></a> [domain\_search\_results](#output\_domain\_search\_results) | n/a | | ||
| | <a name="output_txt_validation_challenges"></a> [txt\_validation\_challenges](#output\_txt\_validation\_challenges) | Map of TXT records for domain validation challenges (key: domain\_name) | | ||
| <!-- END_TF_DOCS --> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
|
|
||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove this empty line for the terraform-docs to add the documentation in this main.tf to the README. |
||
| /** | ||
| * # Akamai Domain Ownership Management (DOM) | ||
| * | ||
| * This directory contains the resource for Domain entry creation and Validation | ||
| * | ||
| */ | ||
|
|
||
|
|
||
| resource "akamai_property_domainownership_domains" "domains" { | ||
| for_each = { for entry in var.domain_validation_entries : entry.domain_name => entry } | ||
|
rlopezso marked this conversation as resolved.
|
||
|
|
||
| domains = [ | ||
| { | ||
| domain_name = each.value.domain_name | ||
| validation_scope = each.value.validation_scope | ||
| } | ||
| ] | ||
| } | ||
|
|
||
| resource "akamai_property_domainownership_validation" "validation" { | ||
| for_each = var.enable_validation ? { for entry in var.domain_validation_entries : entry.domain_name => entry } : {} | ||
|
|
||
| domains = [ | ||
| { | ||
| domain_name = each.value.domain_name | ||
| validation_scope = each.value.validation_scope | ||
| validation_method = each.value.validation_method | ||
| } | ||
| ] | ||
| } | ||
|
|
||
| data "akamai_property_domainownership_search_domains" "search" { | ||
| # If the list is empty or null, count is 0 (resource is skipped) | ||
| # Otherwise, count is 1 (resource is executed) | ||
| count = length(var.domain_search_entries) > 0 ? 1 : 0 | ||
|
|
||
| domains = [ | ||
| for entry in var.domain_search_entries : { | ||
| domain_name = entry.domain_name | ||
| validation_scope = upper(entry.validation_scope) | ||
| } | ||
| ] | ||
| } | ||
|
rlopezso marked this conversation as resolved.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| output "txt_validation_challenges" { | ||
| description = "Map of TXT records for domain validation challenges (key: domain_name)" | ||
| value = { | ||
| for domain_resource in akamai_property_domainownership_domains.domains : | ||
| element(flatten([for domain in domain_resource.domains : domain.domain_name]), 0) => | ||
| element(flatten([for domain in domain_resource.domains : domain.validation_challenge.txt_record]), 0) | ||
| } | ||
| } | ||
|
|
||
| output "cname_validation_challenges" { | ||
| description = "Map of CNAME records for domain validation challenges (key: domain_name)" | ||
| value = { | ||
| for domain_resource in akamai_property_domainownership_domains.domains : | ||
| element(flatten([for domain in domain_resource.domains : domain.domain_name]), 0) => | ||
| element(flatten([for domain in domain_resource.domains : domain.validation_challenge.cname_record]), 0) | ||
| } | ||
| } | ||
|
|
||
| output "domain_search_results" { | ||
| # 'domains' is the actual attribute name for this Akamai data source | ||
| value = one(data.akamai_property_domainownership_search_domains.search[*].domains) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| variable "domain_validation_entries" { | ||
| description = "A list of objects with hostnames, domains, or wildcards to DOM validate" | ||
| type = list(object({ | ||
| domain_name = string | ||
| validation_scope = string | ||
| validation_method = string | ||
| })) | ||
| } | ||
|
|
||
| variable "enable_validation" { | ||
| description = "Set to true to enable domain validation" | ||
| type = bool | ||
| } | ||
|
|
||
| #tflint-ignore: terraform_unused_declarations | ||
| variable "edgerc_path" { | ||
| description = "Path to the .edgerc file" | ||
| type = string | ||
| } | ||
|
|
||
| #tflint-ignore: terraform_unused_declarations | ||
| variable "edgerc_section" { | ||
| description = "Section in the .edgerc file" | ||
| type = string | ||
| } | ||
|
|
||
| variable "domain_search_entries" { | ||
| description = "List of domains to search validation status for" | ||
| type = list(object({ | ||
| domain_name = string | ||
| validation_scope = string | ||
| })) | ||
| default = [] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| terraform { | ||
| required_providers { | ||
| akamai = { | ||
| source = "akamai/akamai" | ||
| version = ">= 9.2.0" | ||
| } | ||
| } | ||
| required_version = ">= 1.9.0" | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with Jaime that this should be eligible and not mandated. But would it make more sense to add this to the DOM module? And through the deploy script, validate whether the domains are validated or not, and then call the dom module to perform the late validation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pareddyakamai this is related to removing the post validation flow for now.