Skip to content
v2.273.0

FirewallRuleGroup L2 construct ​

A Firewall Rule Group.

Example ​

ts
declare const myBlockList: route53resolver.FirewallDomainList;
new route53resolver.FirewallRuleGroup(this, 'RuleGroup', {
  rules: [
    {
      priority: 10,
      firewallDomainList: myBlockList,
      // block and reply with NODATA
      action: route53resolver.FirewallRuleAction.block(),
    },
  ],
});
python
# 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()
    )
    ]
)
java
FirewallDomainList myBlockList;

FirewallRuleGroup.Builder.create(this, "RuleGroup")
        .rules(List.of(FirewallRule.builder()
                .priority(10)
                .firewallDomainList(myBlockList)
                // block and reply with NODATA
                .action(FirewallRuleAction.block())
                .build()))
        .build();
csharp
// Install: dotnet add package Amazon.CDK.AWS.Route53Resolver.Alpha
FirewallDomainList myBlockList;

new FirewallRuleGroup(this, "RuleGroup", new FirewallRuleGroupProps {
    Rules = new [] { new FirewallRule {
        Priority = 10,
        FirewallDomainList = myBlockList,
        // block and reply with NODATA
        Action = FirewallRuleAction.Block()
    } }
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdkroute53resolveralpha/v2
var myBlockList FirewallDomainList

route53resolver.NewFirewallRuleGroup(this, jsii.String("RuleGroup"), &FirewallRuleGroupProps{
	Rules: []FirewallRule{
		&FirewallRule{
			Priority: jsii.Number(10),
			FirewallDomainList: myBlockList,
			// block and reply with NODATA
			Action: route53resolver.FirewallRuleAction_Block(),
		},
	},
})

Initializer ​

ts
new FirewallRuleGroup(scope: Construct, id: string, props?: FirewallRuleGroupProps)
python
FirewallRuleGroup(scope: Construct, id: str, props: typing.Optional[FirewallRuleGroupProps] = None)
java
new FirewallRuleGroup(Construct scope, String id, FirewallRuleGroupProps props)
csharp
new FirewallRuleGroup(Construct scope, string id, FirewallRuleGroupProps? props = null)
go
NewFirewallRuleGroup(Scope Construct, Id *string, Props FirewallRuleGroupProps)

Construct Props ​

namestringnamestrnameStringNamestringName*string= a CloudFormation generated name#
The name of the rule group.
rulesFirewallRule[]rulestyping.List[FirewallRule]rulesList<FirewallRule>RulesFirewallRule[]Rules*[]FirewallRule= no rules#
A list of rules for this group.

Properties ​

The environment this resource belongs to.
notes

For resources that are created and managed in a Stack (those created by creating new class instances like new Role(), new Bucket(), etc.), this is always the same as the environment of the stack they belong to.

For referenced resources (those obtained from referencing methods like Role.fromRoleArn(), Bucket.fromBucketName(), etc.), they might be different than the stack they were imported into.

firewallRuleGroupArnstringfirewall_rule_group_arnstrfirewallRuleGroupArnStringFirewallRuleGroupArnstringFirewallRuleGroupArn*stringrequired#
The ARN (Amazon Resource Name) of the rule group.
firewallRuleGroupCreationTimestringfirewall_rule_group_creation_timestrfirewallRuleGroupCreationTimeStringFirewallRuleGroupCreationTimestringFirewallRuleGroupCreationTime*stringrequired#
The date and time that the rule group was created.
firewallRuleGroupCreatorRequestIdstringfirewall_rule_group_creator_request_idstrfirewallRuleGroupCreatorRequestIdStringFirewallRuleGroupCreatorRequestIdstringFirewallRuleGroupCreatorRequestId*stringrequired#
The creator request ID.
firewallRuleGroupIdstringfirewall_rule_group_idstrfirewallRuleGroupIdStringFirewallRuleGroupIdstringFirewallRuleGroupId*stringrequired#
The ID of the rule group.
firewallRuleGroupModificationTimestringfirewall_rule_group_modification_timestrfirewallRuleGroupModificationTimeStringFirewallRuleGroupModificationTimestringFirewallRuleGroupModificationTime*stringrequired#
The date and time that the rule group was last modified.
firewallRuleGroupOwnerIdstringfirewall_rule_group_owner_idstrfirewallRuleGroupOwnerIdStringFirewallRuleGroupOwnerIdstringFirewallRuleGroupOwnerId*stringrequired#
The AWS account ID for the account that created the rule group.
firewallRuleGroupRuleCountnumberfirewall_rule_group_rule_countint | floatfirewallRuleGroupRuleCountNumberFirewallRuleGroupRuleCountdoubleFirewallRuleGroupRuleCount*float64required#
The number of rules in the rule group.
firewallRuleGroupShareStatusstringfirewall_rule_group_share_statusstrfirewallRuleGroupShareStatusStringFirewallRuleGroupShareStatusstringFirewallRuleGroupShareStatus*stringrequired#
Whether the rule group is shared with other AWS accounts, or was shared with the current account by another AWS account.
firewallRuleGroupStatusstringfirewall_rule_group_statusstrfirewallRuleGroupStatusStringFirewallRuleGroupStatusstringFirewallRuleGroupStatus*stringrequired#
The status of the rule group.
firewallRuleGroupStatusMessagestringfirewall_rule_group_status_messagestrfirewallRuleGroupStatusMessageStringFirewallRuleGroupStatusMessagestringFirewallRuleGroupStatusMessage*stringrequired#
Additional information about the status of the rule group.
nodeNodenodeNodenodeNodeNodeNodeNodeNoderequired#
The tree node.
PROPERTY_INJECTION_IDstringproperty_injection_idstrPROPERTY_INJECTION_IDStringPROPERTY_INJECTION_IDstringPROPERTY_INJECTION_ID*stringrequiredstatic#
Uniquely identifies this class.
stackStackstackStackstackStackStackStackStackStackrequired#
The stack in which this resource is defined.

Methods ​

addRule(rule: FirewallRule): FirewallRuleGroup // chainabledef add_rule(self, rule: FirewallRule) -> FirewallRuleGrouppublic FirewallRuleGroup addRule(FirewallRule rule)public FirewallRuleGroup AddRule(FirewallRule rule)func AddRule(Rule FirewallRule) FirewallRuleGroup#
Adds a rule to this group.
applyCrossStackReferenceStrength(strength: ReferenceStrength): voiddef apply_cross_stack_reference_strength(self, strength: ReferenceStrength) -> Nonepublic void applyCrossStackReferenceStrength(ReferenceStrength strength)public void ApplyCrossStackReferenceStrength(ReferenceStrength strength)func ApplyCrossStackReferenceStrength(Strength ReferenceStrength)#
Override the cross-stack reference strength for this resource.
notes · 1 parameter

When set, any cross-stack reference to this resource will use the specified mechanism instead of the global default determined by the @aws-cdk/core:defaultCrossStackReferences context key. This is useful for selectively weakening specific references to avoid the "deadly embrace" problem without changing the app-wide default.

Parameters

  • strengthstrengthstrengthstrengthStrength — - The reference strength to use for this resource.
applyRemovalPolicy(policy: RemovalPolicy): voiddef apply_removal_policy(self, policy: RemovalPolicy) -> Nonepublic void applyRemovalPolicy(RemovalPolicy policy)public void ApplyRemovalPolicy(RemovalPolicy policy)func ApplyRemovalPolicy(Policy RemovalPolicy)#
Apply the given removal policy to this resource.
notes

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).

associate(id: string, props: FirewallRuleGroupAssociationOptions): FirewallRuleGroupAssociationdef associate(self, id: str, props: FirewallRuleGroupAssociationOptions) -> FirewallRuleGroupAssociationpublic FirewallRuleGroupAssociation associate(String id, FirewallRuleGroupAssociationOptions props)public FirewallRuleGroupAssociation Associate(string id, FirewallRuleGroupAssociationOptions props)func Associate(Id *string, Props FirewallRuleGroupAssociationOptions) FirewallRuleGroupAssociation#
Associates this Firewall Rule Group with a VPC.
fromFirewallRuleGroupId(scope: Construct, id: string, firewallRuleGroupId: string): IFirewallRuleGroup@staticmethod def from_firewall_rule_group_id(scope: Construct, id: str, firewall_rule_group_id: str) -> IFirewallRuleGrouppublic static IFirewallRuleGroup fromFirewallRuleGroupId(Construct scope, String id, String firewallRuleGroupId)public static IFirewallRuleGroup FromFirewallRuleGroupId(Construct scope, string id, string firewallRuleGroupId)func FromFirewallRuleGroupId(Scope Construct, Id *string, FirewallRuleGroupId *string) IFirewallRuleGroupstatic#
Import an existing Firewall Rule Group.
isConstruct(x: any): boolean@staticmethod def is_construct(x: Any) -> boolpublic static Boolean isConstruct(Object x)public static bool IsConstruct(object x)func IsConstruct(X interface{}) *boolstatic#
Checks if `x` is a construct.
notes · 1 parameter · returns

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

  • xxxxX — Any object.

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

isOwnedResource(construct: IConstruct): boolean@staticmethod def is_owned_resource(construct: IConstruct) -> boolpublic static Boolean isOwnedResource(IConstruct construct)public static bool IsOwnedResource(IConstruct construct)func IsOwnedResource(Construct IConstruct) *boolstatic#
Returns true if the construct was created by CDK, and false otherwise.
isResource(construct: IConstruct): boolean@staticmethod def is_resource(construct: IConstruct) -> boolpublic static Boolean isResource(IConstruct construct)public static bool IsResource(IConstruct construct)func IsResource(Construct IConstruct) *boolstatic#
Check whether the given construct is a Resource.
toString(): stringdef to_string(self, ) -> strpublic String toString()public string ToString()func ToString() *string#
Returns a string representation of this construct.
with(...mixins: IMixin[]): IConstructdef with(self, mixins: IMixin) -> IConstructpublic IConstruct with(IMixin mixins)public IConstruct With(IMixin mixins)func With(Mixins IMixin) IConstruct#
Applies one or more mixins to this construct.

Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited. Use multiple with() calls if subsequent mixins should apply to added constructs.