-
Notifications
You must be signed in to change notification settings - Fork 1
feat: Add provision to use cross-account route53 for acm dns validation #21
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
base: main
Are you sure you want to change the base?
Conversation
main.tf
Outdated
|
|
||
| # Cross-account provider for Route53 | ||
| provider "aws" { | ||
| alias = "dns" |
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.
as variable is not allowed here and as description mentions cross-account provider, would it make more sense to call it cross_account_provider?
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 have changed the alias from dns to cross_account_provider
|
@rahul-infra Possible to paste result of |
| allow_overwrite = var.record_allow_overwrite | ||
| } | ||
|
|
||
| resource "aws_route53_record" "cross_account" { |
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.
let's have the name as something more descriptive than same account and cross account.
also wouldn't changing name of existing resource require a destroy and create? We should avoid it in that case and only use a different name for the new aws_route53_record resource being added.
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 made this change from 'same_account' to 'this' such that it doesnt destroy and create resources If user wants to change only the version.
| aws = { | ||
| source = "hashicorp/aws" | ||
| version = "~> 5.0" | ||
| version = "~> 6.0" |
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.
why did we update from 5.0 to 6.0?
are there any breaking changes when moving from 5.0 to 6.0?
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.
This shouldn't be a breaking change @ashwinimanoj .
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.
There are many breaking changes according to release notes:
https://github.com/hashicorp/terraform-provider-aws/releases/tag/v6.0.0
Not sure how many of them apply here
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.
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 checked the release notes for AWS Provider Version 6,
I can see those upgrades doesn't have any breaking changes .
…same account or different account. fix : removed extra space. fix: removed unwanted region in my acm module. fix : updated aws support provider. fix : updated aws version. fix : formatted main file. fix: removed region from passing to my acm module. Made changes in pre-commit file excluded acm main.tf file.
… branch. terraform-docs: automated action feat: added route53 arn and region in examples. Removed extra space in my example variabes.tf
c5747c5 to
f28365f
Compare
modules/acm/main.tf
Outdated
| } | ||
| } | ||
|
|
||
| terraform { |
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.
move this terraform block to providers.tf
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.
Moved providers into providers.tf file.
….com/infraspecdev/terraform-aws-ecs-deployment into feature/route53-cross-account-access
Terraform plan for same account:
`Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
Terraform will perform the following actions:
module.acm["base_domain"].aws_acm_certificate.this will be created
arn = (known after apply)
domain_name = "kong.staging.gaussb.io"
domain_validation_options = [
},
]
id = (known after apply)
key_algorithm = "RSA_2048"
not_after = (known after apply)
not_before = (known after apply)
pending_renewal = (known after apply)
region = "ap-south-1"
renewal_eligibility = (known after apply)
renewal_summary = (known after apply)
status = (known after apply)
subject_alternative_names = [
]
tags = {
}
tags_all = {
}
type = (known after apply)
validation_emails = (known after apply)
validation_method = "DNS"
options (known after apply)
}
module.acm["base_domain"].aws_acm_certificate_validation.this will be created
}
module.acm["base_domain"].aws_route53_record.same_account[0] will be created
}
Plan: 3 to add, 0 to change, 0 to destroy.
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Note: You didn't use the -out option to save this plan, so Terraform can't guarantee to take exactly these actions if you run "terraform apply" now.`
Terraform plan for cross account:
`
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
Terraform will perform the following actions:
module.acm["base_domain"].aws_acm_certificate.this will be created
arn = (known after apply)
domain_name = "kong.staging.gaussb.io"
domain_validation_options = [
},
]
id = (known after apply)
key_algorithm = "RSA_2048"
not_after = (known after apply)
not_before = (known after apply)
pending_renewal = (known after apply)
region = "ap-south-1"
renewal_eligibility = (known after apply)
renewal_summary = (known after apply)
status = (known after apply)
subject_alternative_names = [
]
tags = {
}
tags_all = {
}
type = (known after apply)
validation_emails = (known after apply)
validation_method = "DNS"
options (known after apply)
}
module.acm["base_domain"].aws_acm_certificate_validation.this will be created
}
module.acm["base_domain"].aws_route53_record.cross_account[0] will be created
}
Plan: 3 to add, 0 to change, 0 to destroy.
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Note: You didn't use the -out option to save this plan, so Terraform can't guarantee to take exactly these actions if you run "terraform apply" now
`
This is the terraform plan when the resource is already created with older version and when user wants to change to newer version:
`terraform plan
module.ecs-deployment_acm["base_domain"].aws_acm_certificate.this: Refreshing state... [id=arn:aws:acm:ap-south-1:471112575944:certificate/51b7aab4-9b03-479a-a4c3-9d3aae34348e]
module.ecs-deployment_acm["base_domain"].aws_route53_record.this[0]: Refreshing state... [id=Z0105802SJKE46BQ70GU__73523f433659a8ecb8b3cbb19ed15127.kong.staging.gaussb.io._CNAME]
module.ecs-deployment_acm["base_domain"].aws_acm_certificate_validation.this: Refreshing state... [id=2025-11-21 05:24:03.256 +0000 UTC]
Terraform will perform the following actions:
module.ecs-deployment_acm["base_domain"].aws_route53_record.this has moved to module.ecs-deployment_acm["base_domain"].aws_route53_record.this[0]
Plan: 0 to add, 0 to change, 0 to destroy.
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Note: You didn't use the -out option to save this plan, so Terraform can't guarantee to take exactly these actions if you run "terraform apply" now.`