AWS Route 53 Resolver Rule Association
This page shows how to write Terraform and CloudFormation for Route 53 Resolver Rule Association and write them securely.
aws_route53_resolver_rule_association (Terraform)
The Rule Association in Route 53 Resolver can be configured in Terraform with the resource name aws_route53_resolver_rule_association
. The following sections describe 4 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "aws_route53_resolver_rule_association" "eu_west1_cloudtuples_fwd" {
resolver_rule_id = aws_route53_resolver_rule.eu_west1_cloudtuples_fwd.id
vpc_id = aws_vpc.vpc1.id
}
# apple.cloudtuple rule
resource "aws_route53_resolver_rule_association" "example" {
resolver_rule_id = aws_route53_resolver_rule.sys.id
vpc_id = aws_vpc.foo.id
}
//dns route53 zone
resource "aws_route53_resolver_rule_association" "rule" {
for_each = toset(var.route53_resolver_rule_associations)
name = var.name
resolver_rule_id = each.key
vpc_id = aws_vpc.vpc.id
resource "aws_route53_resolver_rule_association" "fwdrule" {
count = length(var.associated_vpcs)
resolver_rule_id = aws_route53_resolver_rule.fwd.id
vpc_id = var.associated_vpcs[count.index]
}
Parameters
-
id
optional computed - string -
name
optional - string -
resolver_rule_id
required - string -
vpc_id
required - string -
timeouts
single block
Explanation in Terraform Registry
Provides a Route53 Resolver rule association.
AWS::Route53Resolver::ResolverRuleAssociation (CloudFormation)
The ResolverRuleAssociation in Route53Resolver can be configured in CloudFormation with the resource name AWS::Route53Resolver::ResolverRuleAssociation
. The following sections describe 10 examples of how to use the resource and its parameters.
Example Usage from GitHub
Type: AWS::Route53Resolver::ResolverRuleAssociation
Properties:
ResolverRuleId: !Ref OutboundRule
VPCId: !Ref AWSVPC
#---------------------- Transit Gateway - VPN ----------------------#
Type: AWS::Route53Resolver::ResolverRuleAssociation
Properties:
ResolverRuleId: !Ref OutboundRule
VPCId: !Ref AWSVPC
Type: AWS::Route53Resolver::ResolverRuleAssociation
Properties:
ResolverRuleId: !GetAtt OutboundResolverRule.ResolverRuleId
VPCId: !Ref Vpc
InstanceRole:
Type: AWS::IAM::Role
Type: AWS::Route53Resolver::ResolverRuleAssociation
Properties:
Name: !Sub ${pProjectName}-VPC
ResolverRuleId: !Ref pRuleId
VPCId: !Ref rVpc
############ Lambda Function get available CIDR ############
Type: "AWS::Route53Resolver::ResolverRuleAssociation"
Properties:
Name: stang-r53-resolver-rule-to-swa-association
ResolverRuleId: !Ref rResolverRule1
VPCId: !Ref VpcId
"AWS::Route53Resolver::ResolverRuleAssociation": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-route53resolver-resolverruleassociation.html",
"Attributes": {
"VPCId": {
"PrimitiveType": "String"
},
"AWS::Route53Resolver::ResolverRuleAssociation": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-route53resolver-resolverruleassociation.html",
"Attributes": {
"VPCId": {
"PrimitiveType": "String"
},
"AWS::Route53Resolver::ResolverRuleAssociation": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-route53resolver-resolverruleassociation.html",
"Attributes": {
"VPCId": {
"PrimitiveType": "String"
},
"AWS::Route53Resolver::ResolverRuleAssociation": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-route53resolver-resolverruleassociation.html",
"Attributes": {
"VPCId": {
"PrimitiveType": "String"
},
"AWS::Route53Resolver::ResolverRuleAssociation": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-route53resolver-resolverruleassociation.html",
"Attributes": {
"VPCId": {
"PrimitiveType": "String"
},
Parameters
-
VPCId
required - String -
ResolverRuleId
required - String -
Name
optional - String
Explanation in CloudFormation Registry
In the response to an AssociateResolverRule, DisassociateResolverRule, or ListResolverRuleAssociations request, provides information about an association between a resolver rule and a VPC. The association determines which DNS queries that originate in the VPC are forwarded to your network.
Frequently asked questions
What is AWS Route 53 Resolver Rule Association?
AWS Route 53 Resolver Rule Association is a resource for Route 53 Resolver of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.
Where can I find the example code for the AWS Route 53 Resolver Rule Association?
For Terraform, the kaysal/cloud-networking, GSA/grace-paas-dns and cbfield/terraform-aws-vpc source code examples are useful. See the Terraform Example section for further details.
For CloudFormation, the yuntreee/CloudFormation, yuntreee/CloudFormation and greenaussie/demo_vpc_endpoints_with_ec2 source code examples are useful. See the CloudFormation Example section for further details.