You are viewing documentation for version 2 of the AWS SDK for Ruby. Version 3 documentation can be found here.
Class: Aws::Route53Resolver::Client
- Inherits:
-
Seahorse::Client::Base
- Object
- Seahorse::Client::Base
- Aws::Route53Resolver::Client
- Defined in:
- (unknown)
Overview
An API client for Amazon Route 53 Resolver. To construct a client, you need to configure a :region
and :credentials
.
route53resolver = Aws::Route53Resolver::Client.new(
region: region_name,
credentials: credentials,
# ...
)
See #initialize for a full list of supported configuration options.
Region
You can configure a default region in the following locations:
ENV['AWS_REGION']
Aws.config[:region]
Go here for a list of supported regions.
Credentials
Default credentials are loaded automatically from the following locations:
ENV['AWS_ACCESS_KEY_ID']
andENV['AWS_SECRET_ACCESS_KEY']
Aws.config[:credentials]
- The shared credentials ini file at
~/.aws/credentials
(more information) - From an instance profile when running on EC2
You can also construct a credentials object from one of the following classes:
Alternatively, you configure credentials with :access_key_id
and
:secret_access_key
:
# load credentials from disk
creds = YAML.load(File.read('/path/to/secrets'))
Aws::Route53Resolver::Client.new(
access_key_id: creds['access_key_id'],
secret_access_key: creds['secret_access_key']
)
Always load your credentials from outside your application. Avoid configuring credentials statically and never commit them to source control.
Instance Attribute Summary
Attributes inherited from Seahorse::Client::Base
Constructor collapse
-
#initialize(options = {}) ⇒ Aws::Route53Resolver::Client
constructor
Constructs an API client.
API Operations collapse
-
#associate_resolver_endpoint_ip_address(options = {}) ⇒ Types::AssociateResolverEndpointIpAddressResponse
Adds IP addresses to an inbound or an outbound Resolver endpoint.
-
#associate_resolver_query_log_config(options = {}) ⇒ Types::AssociateResolverQueryLogConfigResponse
Associates an Amazon VPC with a specified query logging configuration.
-
#associate_resolver_rule(options = {}) ⇒ Types::AssociateResolverRuleResponse
Associates a Resolver rule with a VPC.
-
#create_resolver_endpoint(options = {}) ⇒ Types::CreateResolverEndpointResponse
Creates a Resolver endpoint.
-
#create_resolver_query_log_config(options = {}) ⇒ Types::CreateResolverQueryLogConfigResponse
Creates a Resolver query logging configuration, which defines where you want Resolver to save DNS query logs that originate in your VPCs.
-
#create_resolver_rule(options = {}) ⇒ Types::CreateResolverRuleResponse
For DNS queries that originate in your VPCs, specifies which Resolver endpoint the queries pass through, one domain name that you want to forward to your network, and the IP addresses of the DNS resolvers in your network.
.
-
#delete_resolver_endpoint(options = {}) ⇒ Types::DeleteResolverEndpointResponse
Deletes a Resolver endpoint.
-
#delete_resolver_query_log_config(options = {}) ⇒ Types::DeleteResolverQueryLogConfigResponse
Deletes a query logging configuration.
-
#delete_resolver_rule(options = {}) ⇒ Types::DeleteResolverRuleResponse
Deletes a Resolver rule.
-
#disassociate_resolver_endpoint_ip_address(options = {}) ⇒ Types::DisassociateResolverEndpointIpAddressResponse
Removes IP addresses from an inbound or an outbound Resolver endpoint.
-
#disassociate_resolver_query_log_config(options = {}) ⇒ Types::DisassociateResolverQueryLogConfigResponse
Disassociates a VPC from a query logging configuration.
Before you can delete a query logging configuration, you must first disassociate all VPCs from the configuration.
-
#disassociate_resolver_rule(options = {}) ⇒ Types::DisassociateResolverRuleResponse
Removes the association between a specified Resolver rule and a specified VPC.
If you disassociate a Resolver rule from a VPC, Resolver stops forwarding DNS queries for the domain name that you specified in the Resolver rule.
-
#get_resolver_endpoint(options = {}) ⇒ Types::GetResolverEndpointResponse
Gets information about a specified Resolver endpoint, such as whether it's an inbound or an outbound Resolver endpoint, and the current status of the endpoint.
.
-
#get_resolver_query_log_config(options = {}) ⇒ Types::GetResolverQueryLogConfigResponse
Gets information about a specified Resolver query logging configuration, such as the number of VPCs that the configuration is logging queries for and the location that logs are sent to.
-
#get_resolver_query_log_config_association(options = {}) ⇒ Types::GetResolverQueryLogConfigAssociationResponse
Gets information about a specified association between a Resolver query logging configuration and an Amazon VPC.
-
#get_resolver_query_log_config_policy(options = {}) ⇒ Types::GetResolverQueryLogConfigPolicyResponse
Gets information about a query logging policy.
-
#get_resolver_rule(options = {}) ⇒ Types::GetResolverRuleResponse
Gets information about a specified Resolver rule, such as the domain name that the rule forwards DNS queries for and the ID of the outbound Resolver endpoint that the rule is associated with.
.
-
#get_resolver_rule_association(options = {}) ⇒ Types::GetResolverRuleAssociationResponse
Gets information about an association between a specified Resolver rule and a VPC.
-
#get_resolver_rule_policy(options = {}) ⇒ Types::GetResolverRulePolicyResponse
Gets information about a Resolver rule policy.
-
#list_resolver_endpoint_ip_addresses(options = {}) ⇒ Types::ListResolverEndpointIpAddressesResponse
Gets the IP addresses for a specified Resolver endpoint.
.
-
#list_resolver_endpoints(options = {}) ⇒ Types::ListResolverEndpointsResponse
Lists all the Resolver endpoints that were created using the current AWS account.
.
-
#list_resolver_query_log_config_associations(options = {}) ⇒ Types::ListResolverQueryLogConfigAssociationsResponse
Lists information about associations between Amazon VPCs and query logging configurations.
.
-
#list_resolver_query_log_configs(options = {}) ⇒ Types::ListResolverQueryLogConfigsResponse
Lists information about the specified query logging configurations.
-
#list_resolver_rule_associations(options = {}) ⇒ Types::ListResolverRuleAssociationsResponse
Lists the associations that were created between Resolver rules and VPCs using the current AWS account.
.
-
#list_resolver_rules(options = {}) ⇒ Types::ListResolverRulesResponse
Lists the Resolver rules that were created using the current AWS account.
.
-
#list_tags_for_resource(options = {}) ⇒ Types::ListTagsForResourceResponse
Lists the tags that you associated with the specified resource.
.
-
#put_resolver_query_log_config_policy(options = {}) ⇒ Types::PutResolverQueryLogConfigPolicyResponse
Specifies an AWS account that you want to share a query logging configuration with, the query logging configuration that you want to share, and the operations that you want the account to be able to perform on the configuration.
.
-
#put_resolver_rule_policy(options = {}) ⇒ Types::PutResolverRulePolicyResponse
Specifies an AWS account that you want to share rules with, the Resolver rules that you want to share, and the operations that you want the account to be able to perform on those rules.
.
-
#tag_resource(options = {}) ⇒ Struct
Adds one or more tags to a specified resource.
.
-
#untag_resource(options = {}) ⇒ Struct
Removes one or more tags from a specified resource.
.
-
#update_resolver_endpoint(options = {}) ⇒ Types::UpdateResolverEndpointResponse
Updates the name of an inbound or an outbound Resolver endpoint.
-
#update_resolver_rule(options = {}) ⇒ Types::UpdateResolverRuleResponse
Updates settings for a specified Resolver rule.
Instance Method Summary collapse
-
#wait_until(waiter_name, params = {}) {|waiter| ... } ⇒ Boolean
Waiters polls an API operation until a resource enters a desired state.
-
#waiter_names ⇒ Array<Symbol>
Returns the list of supported waiters.
Methods inherited from Seahorse::Client::Base
add_plugin, api, #build_request, clear_plugins, define, new, #operation, #operation_names, plugins, remove_plugin, set_api, set_plugins
Methods included from Seahorse::Client::HandlerBuilder
#handle, #handle_request, #handle_response
Constructor Details
#initialize(options = {}) ⇒ Aws::Route53Resolver::Client
Constructs an API client.
Instance Method Details
#associate_resolver_endpoint_ip_address(options = {}) ⇒ Types::AssociateResolverEndpointIpAddressResponse
Adds IP addresses to an inbound or an outbound Resolver endpoint. If you want to add more than one IP address, submit one AssociateResolverEndpointIpAddress
request for each IP address.
To remove an IP address from an endpoint, see DisassociateResolverEndpointIpAddress.
#associate_resolver_query_log_config(options = {}) ⇒ Types::AssociateResolverQueryLogConfigResponse
Associates an Amazon VPC with a specified query logging configuration. Route 53 Resolver logs DNS queries that originate in all of the Amazon VPCs that are associated with a specified query logging configuration. To associate more than one VPC with a configuration, submit one AssociateResolverQueryLogConfig
request for each VPC.
The VPCs that you associate with a query logging configuration must be in the same Region as the configuration.
To remove a VPC from a query logging configuration, see DisassociateResolverQueryLogConfig.
#associate_resolver_rule(options = {}) ⇒ Types::AssociateResolverRuleResponse
Associates a Resolver rule with a VPC. When you associate a rule with a VPC, Resolver forwards all DNS queries for the domain name that is specified in the rule and that originate in the VPC. The queries are forwarded to the IP addresses for the DNS resolvers that are specified in the rule. For more information about rules, see CreateResolverRule.
#create_resolver_endpoint(options = {}) ⇒ Types::CreateResolverEndpointResponse
Creates a Resolver endpoint. There are two types of Resolver endpoints, inbound and outbound:
-
An inbound Resolver endpoint forwards DNS queries to the DNS service for a VPC from your network.
-
An outbound Resolver endpoint forwards DNS queries from the DNS service for a VPC to your network.
#create_resolver_query_log_config(options = {}) ⇒ Types::CreateResolverQueryLogConfigResponse
Creates a Resolver query logging configuration, which defines where you want Resolver to save DNS query logs that originate in your VPCs. Resolver can log queries only for VPCs that are in the same Region as the query logging configuration.
To specify which VPCs you want to log queries for, you use AssociateResolverQueryLogConfig
. For more information, see AssociateResolverQueryLogConfig.
You can optionally use AWS Resource Access Manager (AWS RAM) to share a query logging configuration with other AWS accounts. The other accounts can then associate VPCs with the configuration. The query logs that Resolver creates for a configuration include all DNS queries that originate in all VPCs that are associated with the configuration.
#create_resolver_rule(options = {}) ⇒ Types::CreateResolverRuleResponse
For DNS queries that originate in your VPCs, specifies which Resolver endpoint the queries pass through, one domain name that you want to forward to your network, and the IP addresses of the DNS resolvers in your network.
#delete_resolver_endpoint(options = {}) ⇒ Types::DeleteResolverEndpointResponse
Deletes a Resolver endpoint. The effect of deleting a Resolver endpoint depends on whether it's an inbound or an outbound Resolver endpoint:
-
Inbound: DNS queries from your network are no longer routed to the DNS service for the specified VPC.
-
Outbound: DNS queries from a VPC are no longer routed to your network.
#delete_resolver_query_log_config(options = {}) ⇒ Types::DeleteResolverQueryLogConfigResponse
Deletes a query logging configuration. When you delete a configuration, Resolver stops logging DNS queries for all of the Amazon VPCs that are associated with the configuration. This also applies if the query logging configuration is shared with other AWS accounts, and the other accounts have associated VPCs with the shared configuration.
Before you can delete a query logging configuration, you must first disassociate all VPCs from the configuration. See DisassociateResolverQueryLogConfig.
If you used Resource Access Manager (RAM) to share a query logging configuration with other accounts, you must stop sharing the configuration before you can delete a configuration. The accounts that you shared the configuration with can first disassociate VPCs that they associated with the configuration, but that's not necessary. If you stop sharing the configuration, those VPCs are automatically disassociated from the configuration.
#delete_resolver_rule(options = {}) ⇒ Types::DeleteResolverRuleResponse
Deletes a Resolver rule. Before you can delete a Resolver rule, you must disassociate it from all the VPCs that you associated the Resolver rule with. For more information, see DisassociateResolverRule.
#disassociate_resolver_endpoint_ip_address(options = {}) ⇒ Types::DisassociateResolverEndpointIpAddressResponse
Removes IP addresses from an inbound or an outbound Resolver endpoint. If you want to remove more than one IP address, submit one DisassociateResolverEndpointIpAddress
request for each IP address.
To add an IP address to an endpoint, see AssociateResolverEndpointIpAddress.
#disassociate_resolver_query_log_config(options = {}) ⇒ Types::DisassociateResolverQueryLogConfigResponse
Disassociates a VPC from a query logging configuration.
Before you can delete a query logging configuration, you must first disassociate all VPCs from the configuration. If you used Resource Access Manager (RAM) to share a query logging configuration with other accounts, VPCs can be disassociated from the configuration in the following ways: The accounts that you shared the configuration with can disassociate VPCs from the configuration. You can stop sharing the configuration.
#disassociate_resolver_rule(options = {}) ⇒ Types::DisassociateResolverRuleResponse
Removes the association between a specified Resolver rule and a specified VPC.
If you disassociate a Resolver rule from a VPC, Resolver stops forwarding DNS queries for the domain name that you specified in the Resolver rule.
#get_resolver_endpoint(options = {}) ⇒ Types::GetResolverEndpointResponse
Gets information about a specified Resolver endpoint, such as whether it's an inbound or an outbound Resolver endpoint, and the current status of the endpoint.
#get_resolver_query_log_config(options = {}) ⇒ Types::GetResolverQueryLogConfigResponse
Gets information about a specified Resolver query logging configuration, such as the number of VPCs that the configuration is logging queries for and the location that logs are sent to.
#get_resolver_query_log_config_association(options = {}) ⇒ Types::GetResolverQueryLogConfigAssociationResponse
Gets information about a specified association between a Resolver query logging configuration and an Amazon VPC. When you associate a VPC with a query logging configuration, Resolver logs DNS queries that originate in that VPC.
#get_resolver_query_log_config_policy(options = {}) ⇒ Types::GetResolverQueryLogConfigPolicyResponse
Gets information about a query logging policy. A query logging policy specifies the Resolver query logging operations and resources that you want to allow another AWS account to be able to use.
#get_resolver_rule(options = {}) ⇒ Types::GetResolverRuleResponse
Gets information about a specified Resolver rule, such as the domain name that the rule forwards DNS queries for and the ID of the outbound Resolver endpoint that the rule is associated with.
#get_resolver_rule_association(options = {}) ⇒ Types::GetResolverRuleAssociationResponse
Gets information about an association between a specified Resolver rule and a VPC. You associate a Resolver rule and a VPC using AssociateResolverRule.
#get_resolver_rule_policy(options = {}) ⇒ Types::GetResolverRulePolicyResponse
Gets information about a Resolver rule policy. A Resolver rule policy specifies the Resolver operations and resources that you want to allow another AWS account to be able to use.
#list_resolver_endpoint_ip_addresses(options = {}) ⇒ Types::ListResolverEndpointIpAddressesResponse
Gets the IP addresses for a specified Resolver endpoint.
#list_resolver_endpoints(options = {}) ⇒ Types::ListResolverEndpointsResponse
Lists all the Resolver endpoints that were created using the current AWS account.
#list_resolver_query_log_config_associations(options = {}) ⇒ Types::ListResolverQueryLogConfigAssociationsResponse
Lists information about associations between Amazon VPCs and query logging configurations.
#list_resolver_query_log_configs(options = {}) ⇒ Types::ListResolverQueryLogConfigsResponse
Lists information about the specified query logging configurations. Each configuration defines where you want Resolver to save DNS query logs and specifies the VPCs that you want to log queries for.
#list_resolver_rule_associations(options = {}) ⇒ Types::ListResolverRuleAssociationsResponse
Lists the associations that were created between Resolver rules and VPCs using the current AWS account.
#list_resolver_rules(options = {}) ⇒ Types::ListResolverRulesResponse
Lists the Resolver rules that were created using the current AWS account.
#list_tags_for_resource(options = {}) ⇒ Types::ListTagsForResourceResponse
Lists the tags that you associated with the specified resource.
#put_resolver_query_log_config_policy(options = {}) ⇒ Types::PutResolverQueryLogConfigPolicyResponse
Specifies an AWS account that you want to share a query logging configuration with, the query logging configuration that you want to share, and the operations that you want the account to be able to perform on the configuration.
#put_resolver_rule_policy(options = {}) ⇒ Types::PutResolverRulePolicyResponse
Specifies an AWS account that you want to share rules with, the Resolver rules that you want to share, and the operations that you want the account to be able to perform on those rules.
#tag_resource(options = {}) ⇒ Struct
Adds one or more tags to a specified resource.
#untag_resource(options = {}) ⇒ Struct
Removes one or more tags from a specified resource.
#update_resolver_endpoint(options = {}) ⇒ Types::UpdateResolverEndpointResponse
Updates the name of an inbound or an outbound Resolver endpoint.
#update_resolver_rule(options = {}) ⇒ Types::UpdateResolverRuleResponse
Updates settings for a specified Resolver rule. ResolverRuleId
is required, and all other parameters are optional. If you don't specify a parameter, it retains its current value.
#wait_until(waiter_name, params = {}) {|waiter| ... } ⇒ Boolean
Waiters polls an API operation until a resource enters a desired state.
Basic Usage
Waiters will poll until they are succesful, they fail by entering a terminal state, or until a maximum number of attempts are made.
# polls in a loop, sleeping between attempts client.waiter_until(waiter_name, params)
Configuration
You can configure the maximum number of polling attempts, and the delay (in seconds) between each polling attempt. You configure waiters by passing a block to #wait_until:
# poll for ~25 seconds
client.wait_until(...) do |w|
w.max_attempts = 5
w.delay = 5
end
Callbacks
You can be notified before each polling attempt and before each
delay. If you throw :success
or :failure
from these callbacks,
it will terminate the waiter.
started_at = Time.now
client.wait_until(...) do |w|
# disable max attempts
w.max_attempts = nil
# poll for 1 hour, instead of a number of attempts
w.before_wait do |attempts, response|
throw :failure if Time.now - started_at > 3600
end
end
Handling Errors
When a waiter is successful, it returns true
. When a waiter
fails, it raises an error. All errors raised extend from
Waiters::Errors::WaiterFailed.
begin
client.wait_until(...)
rescue Aws::Waiters::Errors::WaiterFailed
# resource did not enter the desired state in time
end
#waiter_names ⇒ Array<Symbol>
Returns the list of supported waiters. The following table lists the supported waiters and the client method they call:
Waiter Name | Client Method | Default Delay: | Default Max Attempts: |
---|