-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Code improvement, bug fixes and adding the dynamic provisioning based…
… on the settings.
- Loading branch information
fvilarin
committed
May 21, 2024
1 parent
94f0755
commit 0d73aa9
Showing
48 changed files
with
1,307 additions
and
1,311 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
/.idea/ | ||
/iac/.terraform* | ||
/iac/.credentials | ||
/iac/.terraform* | ||
/iac/terraform.tfstate* | ||
/iac/*/settings.json |
This file contains 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 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 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 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 |
---|---|---|
@@ -1,11 +1,9 @@ | ||
[linode] | ||
token = <token> | ||
|
||
[edgegrid] | ||
account_key = <account-key> | ||
client_secret = <client-secret> | ||
host = <host> | ||
access_token = <access-token> | ||
client_token = <client-token> | ||
|
||
[linode] | ||
token = <token> | ||
aws_access_key_id = <linode-object-storage-access-key> | ||
aws_secret_access_key = <linode-object-storage-secret-key> | ||
client_secret = <client-secret> |
This file contains 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 was deleted.
Oops, something went wrong.
This file contains 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 |
---|---|---|
@@ -1,20 +1,40 @@ | ||
# Definition of the Edge DNS TLS certificate validation entries. | ||
data "akamai_property_hostnames" "default" { | ||
for_each = { for property in local.propertySettings.hostnames : property.name => property } | ||
contract_id = local.generalSettings.contract | ||
group_id = local.generalSettings.group | ||
property_id = akamai_property.default[each.key].id | ||
version = akamai_property.default[each.key].latest_version | ||
depends_on = [ akamai_property.default ] | ||
} | ||
|
||
resource "akamai_dns_record" "certificateValidation" { | ||
for_each = { for property in local.propertySettings.hostnames : property.name => property } | ||
name = data.akamai_property_hostnames.default[each.key].hostnames[0].cert_status[0].hostname | ||
recordtype = "CNAME" | ||
ttl = 30 | ||
zone = local.dnsSettings.zone | ||
target = [data.akamai_property_hostnames.default[each.key].hostnames[0].cert_status[0].target] | ||
depends_on = [data.akamai_property_hostnames.default] | ||
} | ||
|
||
# Definition of the Edge DNS general entries. | ||
resource "akamai_dns_record" "records" { | ||
for_each = { for record in local.dnsSettings.records: record.id => record } | ||
zone = local.dnsSettings.id | ||
name = "${each.value.id}.${local.dnsSettings.id}" | ||
for_each = { for record in local.dnsSettings.records: record.name => record } | ||
zone = local.dnsSettings.zone | ||
name = "${each.key}.${local.dnsSettings.zone}" | ||
recordtype = each.value.type | ||
ttl = each.value.ttl | ||
target = [ each.value.value ] | ||
} | ||
|
||
# Definition of the Edge DNS entries that point to the Edge Hostname. | ||
resource "akamai_dns_record" "default" { | ||
for_each = toset(local.propertySettings.hostnames) | ||
zone = local.dnsSettings.id | ||
name = each.value | ||
for_each = { for property in local.propertySettings.hostnames : property.name => property } | ||
zone = local.dnsSettings.zone | ||
name = "${each.key}.${local.dnsSettings.zone}" | ||
recordtype = "CNAME" | ||
ttl = local.dnsSettings.defaultTtl | ||
target = [ akamai_edge_hostname.default.edge_hostname ] | ||
target = [ akamai_edge_hostname.default[each.key].edge_hostname ] | ||
depends_on = [ akamai_edge_hostname.default ] | ||
} |
This file contains 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 |
---|---|---|
@@ -1,11 +1,10 @@ | ||
# Definition of the Edge Hostname. This is the hostname that must be used in the Edge DNS entries | ||
# of all hostnames that will pass through the CDN. | ||
resource "akamai_edge_hostname" "default" { | ||
for_each = { for property in local.propertySettings.hostnames : property.name => property } | ||
contract_id = local.generalSettings.contract | ||
group_id = local.generalSettings.group | ||
product_id = local.propertySettings.product | ||
edge_hostname = "${local.propertySettings.id}.edgekey.net" | ||
edge_hostname = "${local.propertySettings.name}-${each.value.origin.name}.edgesuite.net" | ||
ip_behavior = local.propertySettings.ipVersion | ||
certificate = akamai_cps_dv_enrollment.default.id | ||
depends_on = [ akamai_cps_dv_enrollment.default ] | ||
} |
Oops, something went wrong.