FirewallRuleGroup

class aws_cdk.aws_route53resolver_alpha.FirewallRuleGroup(scope, id, *, name=None, rules=None)

Bases: Resource

(experimental) A Firewall Rule Group.

Stability:

experimental

ExampleMetadata:

infused

Example:

# my_block_list: route53resolver.FirewallDomainList

route53resolver.FirewallRuleGroup(self, "RuleGroup",
    rules=[route53resolver.FirewallRule(
        priority=10,
        firewall_domain_list=my_block_list,
        # block and reply with NODATA
        action=route53resolver.FirewallRuleAction.block()
    )
    ]
)
Parameters:
  • scope (Construct) –

  • id (str) –

  • name (Optional[str]) – (experimental) The name of the rule group. Default: - a CloudFormation generated name

  • rules (Optional[Sequence[Union[FirewallRule, Dict[str, Any]]]]) – (experimental) A list of rules for this group. Default: - no rules

Stability:

experimental

Methods

add_rule(*, action, firewall_domain_list, priority)

(experimental) Adds a rule to this group.

Parameters:
  • action (FirewallRuleAction) – (experimental) The action for this rule.

  • firewall_domain_list (IFirewallDomainList) – (experimental) The domain list for this rule.

  • priority (Union[int, float]) – (experimental) The priority of the rule in the rule group. This value must be unique within the rule group.

Stability:

experimental

Return type:

FirewallRuleGroup

apply_removal_policy(policy)

Apply the given removal policy to this resource.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you’ve removed it from the CDK application or because you’ve made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).

Parameters:

policy (RemovalPolicy) –

Return type:

None

associate(id, *, priority, vpc, mutation_protection=None, name=None)

(experimental) Associates this Firewall Rule Group with a VPC.

Parameters:
  • id (str) –

  • priority (Union[int, float]) – (experimental) The setting that determines the processing order of the rule group among the rule groups that are associated with a single VPC. DNS Firewall filters VPC traffic starting from rule group with the lowest numeric priority setting. This value must be greater than 100 and less than 9,000

  • vpc (IVpc) – (experimental) The VPC that to associate with the rule group.

  • mutation_protection (Optional[bool]) – (experimental) If enabled, this setting disallows modification or removal of the association, to help prevent against accidentally altering DNS firewall protections. Default: true

  • name (Optional[str]) – (experimental) The name of the association. Default: - a CloudFormation generated name

Stability:

experimental

Return type:

FirewallRuleGroupAssociation

to_string()

Returns a string representation of this construct.

Return type:

str

Attributes

env

The environment this resource belongs to.

For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.

firewall_rule_group_arn

(experimental) The ARN (Amazon Resource Name) of the rule group.

Stability:

experimental

Attribute:

true

firewall_rule_group_creation_time

(experimental) The date and time that the rule group was created.

Stability:

experimental

Attribute:

true

firewall_rule_group_creator_request_id

(experimental) The creator request ID.

Stability:

experimental

Attribute:

true

firewall_rule_group_id

(experimental) The ID of the rule group.

Stability:

experimental

firewall_rule_group_modification_time

(experimental) The date and time that the rule group was last modified.

Stability:

experimental

Attribute:

true

firewall_rule_group_owner_id

(experimental) The AWS account ID for the account that created the rule group.

Stability:

experimental

Attribute:

true

firewall_rule_group_rule_count

(experimental) The number of rules in the rule group.

Stability:

experimental

Attribute:

true

firewall_rule_group_share_status

(experimental) Whether the rule group is shared with other AWS accounts, or was shared with the current account by another AWS account.

Stability:

experimental

Attribute:

true

firewall_rule_group_status

(experimental) The status of the rule group.

Stability:

experimental

Attribute:

true

firewall_rule_group_status_message

(experimental) Additional information about the status of the rule group.

Stability:

experimental

Attribute:

true

node

The tree node.

stack

The stack in which this resource is defined.

Static Methods

classmethod from_firewall_rule_group_id(scope, id, firewall_rule_group_id)

(experimental) Import an existing Firewall Rule Group.

Parameters:
  • scope (Construct) –

  • id (str) –

  • firewall_rule_group_id (str) –

Stability:

experimental

Return type:

IFirewallRuleGroup

classmethod is_construct(x)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

Parameters:

x (Any) – Any object.

Return type:

bool

Returns:

true if x is an object created from a class which extends Construct.

classmethod is_owned_resource(construct)

Returns true if the construct was created by CDK, and false otherwise.

Parameters:

construct (IConstruct) –

Return type:

bool

classmethod is_resource(construct)

Check whether the given construct is a Resource.

Parameters:

construct (IConstruct) –

Return type:

bool