You are viewing documentation for version 2 of the AWS SDK for Ruby. Version 3 documentation can be found here.
Class: Aws::FMS::Client
- Inherits:
-
Seahorse::Client::Base
- Object
- Seahorse::Client::Base
- Aws::FMS::Client
- Defined in:
- (unknown)
Overview
An API client for Firewall Management Service. To construct a client, you need to configure a :region
and :credentials
.
fms = Aws::FMS::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::FMS::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::FMS::Client
constructor
Constructs an API client.
API Operations collapse
-
#associate_admin_account(options = {}) ⇒ Struct
Sets the AWS Firewall Manager administrator account.
-
#delete_apps_list(options = {}) ⇒ Struct
Permanently deletes an AWS Firewall Manager applications list.
.
-
#delete_notification_channel(options = {}) ⇒ Struct
Deletes an AWS Firewall Manager association with the IAM role and the Amazon Simple Notification Service (SNS) topic that is used to record AWS Firewall Manager SNS logs.
.
-
#delete_policy(options = {}) ⇒ Struct
Permanently deletes an AWS Firewall Manager policy.
-
#delete_protocols_list(options = {}) ⇒ Struct
Permanently deletes an AWS Firewall Manager protocols list.
.
-
#disassociate_admin_account(options = {}) ⇒ Struct
Disassociates the account that has been set as the AWS Firewall Manager administrator account.
-
#get_admin_account(options = {}) ⇒ Types::GetAdminAccountResponse
Returns the AWS Organizations master account that is associated with AWS Firewall Manager as the AWS Firewall Manager administrator.
.
-
#get_apps_list(options = {}) ⇒ Types::GetAppsListResponse
Returns information about the specified AWS Firewall Manager applications list.
.
-
#get_compliance_detail(options = {}) ⇒ Types::GetComplianceDetailResponse
Returns detailed compliance information about the specified member account.
-
#get_notification_channel(options = {}) ⇒ Types::GetNotificationChannelResponse
Information about the Amazon Simple Notification Service (SNS) topic that is used to record AWS Firewall Manager SNS logs.
.
-
#get_policy(options = {}) ⇒ Types::GetPolicyResponse
Returns information about the specified AWS Firewall Manager policy.
.
-
#get_protection_status(options = {}) ⇒ Types::GetProtectionStatusResponse
If you created a Shield Advanced policy, returns policy-level attack summary information in the event of a potential DDoS attack.
-
#get_protocols_list(options = {}) ⇒ Types::GetProtocolsListResponse
Returns information about the specified AWS Firewall Manager protocols list.
.
-
#get_violation_details(options = {}) ⇒ Types::GetViolationDetailsResponse
Retrieves violations for a resource based on the specified AWS Firewall Manager policy and AWS account.
.
-
#list_apps_lists(options = {}) ⇒ Types::ListAppsListsResponse
Returns an array of
AppsListDataSummary
objects..
-
#list_compliance_status(options = {}) ⇒ Types::ListComplianceStatusResponse
Returns an array of
PolicyComplianceStatus
objects. -
#list_member_accounts(options = {}) ⇒ Types::ListMemberAccountsResponse
Returns a
MemberAccounts
object that lists the member accounts in the administrator's AWS organization.The
.ListMemberAccounts
must be submitted by the account that is set as the AWS Firewall Manager administrator. -
#list_policies(options = {}) ⇒ Types::ListPoliciesResponse
Returns an array of
PolicySummary
objects..
-
#list_protocols_lists(options = {}) ⇒ Types::ListProtocolsListsResponse
Returns an array of
ProtocolsListDataSummary
objects..
-
#list_tags_for_resource(options = {}) ⇒ Types::ListTagsForResourceResponse
Retrieves the list of tags for the specified AWS resource.
-
#put_apps_list(options = {}) ⇒ Types::PutAppsListResponse
Creates an AWS Firewall Manager applications list.
.
-
#put_notification_channel(options = {}) ⇒ Struct
Designates the IAM role and Amazon Simple Notification Service (SNS) topic that AWS Firewall Manager uses to record SNS logs.
To perform this action outside of the console, you must configure the SNS topic to allow the Firewall Manager role
AWSServiceRoleForFMS
to publish SNS logs. -
#put_policy(options = {}) ⇒ Types::PutPolicyResponse
Creates an AWS Firewall Manager policy.
Firewall Manager provides the following types of policies:
-
An AWS WAF policy (type WAFV2), which defines rule groups to run first in the corresponding AWS WAF web ACL and rule groups to run last in the web ACL.
-
An AWS WAF Classic policy (type WAF), which defines a rule group.
-
-
#put_protocols_list(options = {}) ⇒ Types::PutProtocolsListResponse
Creates an AWS Firewall Manager protocols list.
.
-
#tag_resource(options = {}) ⇒ Struct
Adds one or more tags to an AWS resource.
.
-
#untag_resource(options = {}) ⇒ Struct
Removes one or more tags from an AWS resource.
.
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::FMS::Client
Constructs an API client.
Instance Method Details
#associate_admin_account(options = {}) ⇒ Struct
Sets the AWS Firewall Manager administrator account. AWS Firewall Manager must be associated with the master account of your AWS organization or associated with a member account that has the appropriate permissions. If the account ID that you submit is not an AWS Organizations master account, AWS Firewall Manager will set the appropriate permissions for the given member account.
The account that you associate with AWS Firewall Manager is called the AWS Firewall Manager administrator account.
#delete_apps_list(options = {}) ⇒ Struct
Permanently deletes an AWS Firewall Manager applications list.
#delete_notification_channel(options = {}) ⇒ Struct
Deletes an AWS Firewall Manager association with the IAM role and the Amazon Simple Notification Service (SNS) topic that is used to record AWS Firewall Manager SNS logs.
#delete_policy(options = {}) ⇒ Struct
Permanently deletes an AWS Firewall Manager policy.
#delete_protocols_list(options = {}) ⇒ Struct
Permanently deletes an AWS Firewall Manager protocols list.
#disassociate_admin_account(options = {}) ⇒ Struct
Disassociates the account that has been set as the AWS Firewall Manager administrator account. To set a different account as the administrator account, you must submit an AssociateAdminAccount
request.
#get_admin_account(options = {}) ⇒ Types::GetAdminAccountResponse
Returns the AWS Organizations master account that is associated with AWS Firewall Manager as the AWS Firewall Manager administrator.
#get_apps_list(options = {}) ⇒ Types::GetAppsListResponse
Returns information about the specified AWS Firewall Manager applications list.
#get_compliance_detail(options = {}) ⇒ Types::GetComplianceDetailResponse
Returns detailed compliance information about the specified member account. Details include resources that are in and out of compliance with the specified policy. Resources are considered noncompliant for AWS WAF and Shield Advanced policies if the specified policy has not been applied to them. Resources are considered noncompliant for security group policies if they are in scope of the policy, they violate one or more of the policy rules, and remediation is disabled or not possible. Resources are considered noncompliant for Network Firewall policies if a firewall is missing in the VPC, if the firewall endpoint isn't set up in an expected Availability Zone and subnet, if a subnet created by the Firewall Manager doesn't have the expected route table, and for modifications to a firewall policy that violate the Firewall Manager policy's rules.
#get_notification_channel(options = {}) ⇒ Types::GetNotificationChannelResponse
Information about the Amazon Simple Notification Service (SNS) topic that is used to record AWS Firewall Manager SNS logs.
#get_policy(options = {}) ⇒ Types::GetPolicyResponse
Returns information about the specified AWS Firewall Manager policy.
#get_protection_status(options = {}) ⇒ Types::GetProtectionStatusResponse
If you created a Shield Advanced policy, returns policy-level attack summary information in the event of a potential DDoS attack. Other policy types are currently unsupported.
#get_protocols_list(options = {}) ⇒ Types::GetProtocolsListResponse
Returns information about the specified AWS Firewall Manager protocols list.
#get_violation_details(options = {}) ⇒ Types::GetViolationDetailsResponse
Retrieves violations for a resource based on the specified AWS Firewall Manager policy and AWS account.
#list_apps_lists(options = {}) ⇒ Types::ListAppsListsResponse
Returns an array of AppsListDataSummary
objects.
#list_compliance_status(options = {}) ⇒ Types::ListComplianceStatusResponse
Returns an array of PolicyComplianceStatus
objects. Use PolicyComplianceStatus
to get a summary of which member accounts are protected by the specified policy.
#list_member_accounts(options = {}) ⇒ Types::ListMemberAccountsResponse
Returns a MemberAccounts
object that lists the member accounts in the administrator's AWS organization.
The ListMemberAccounts
must be submitted by the account that is set as the AWS Firewall Manager administrator.
#list_policies(options = {}) ⇒ Types::ListPoliciesResponse
Returns an array of PolicySummary
objects.
#list_protocols_lists(options = {}) ⇒ Types::ListProtocolsListsResponse
Returns an array of ProtocolsListDataSummary
objects.
#list_tags_for_resource(options = {}) ⇒ Types::ListTagsForResourceResponse
Retrieves the list of tags for the specified AWS resource.
#put_apps_list(options = {}) ⇒ Types::PutAppsListResponse
Creates an AWS Firewall Manager applications list.
#put_notification_channel(options = {}) ⇒ Struct
Designates the IAM role and Amazon Simple Notification Service (SNS) topic that AWS Firewall Manager uses to record SNS logs.
To perform this action outside of the console, you must configure the SNS topic to allow the Firewall Manager role AWSServiceRoleForFMS
to publish SNS logs. For more information, see Firewall Manager required permissions for API actions in the AWS Firewall Manager Developer Guide.
#put_policy(options = {}) ⇒ Types::PutPolicyResponse
Creates an AWS Firewall Manager policy.
Firewall Manager provides the following types of policies:
-
An AWS WAF policy (type WAFV2), which defines rule groups to run first in the corresponding AWS WAF web ACL and rule groups to run last in the web ACL.
-
An AWS WAF Classic policy (type WAF), which defines a rule group.
-
A Shield Advanced policy, which applies Shield Advanced protection to specified accounts and resources.
-
A security group policy, which manages VPC security groups across your AWS organization.
-
An AWS Network Firewall policy, which provides firewall rules to filter network traffic in specified Amazon VPCs.
Each policy is specific to one of the types. If you want to enforce more than one policy type across accounts, create multiple policies. You can create multiple policies for each type.
You must be subscribed to Shield Advanced to create a Shield Advanced policy. For more information about subscribing to Shield Advanced, see CreateSubscription.
#put_protocols_list(options = {}) ⇒ Types::PutProtocolsListResponse
Creates an AWS Firewall Manager protocols list.
#tag_resource(options = {}) ⇒ Struct
Adds one or more tags to an AWS resource.
#untag_resource(options = {}) ⇒ Struct
Removes one or more tags from an AWS resource.
#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: |
---|