AddApplicationActionProps
- class aws_cdk.aws_elasticloadbalancingv2.AddApplicationActionProps(*, conditions=None, priority=None, action, remove_suffix=None)
Bases:
AddRuleProps
Properties for adding a new action to a listener.
- Parameters:
conditions (
Optional
[Sequence
[ListenerCondition
]]) – Rule applies if matches the conditions. Default: - No conditions.priority (
Union
[int
,float
,None
]) – Priority of this target group. The rule with the lowest priority will be used for every request. If priority is not given, these target groups will be added as defaults, and must not have conditions. Priorities must be unique. Default: Target groups are used as defaultsaction (
ListenerAction
) – Action to perform.remove_suffix (
Optional
[bool
]) –ListenerRule``s have a ``Rule
suffix on their logicalId by default. This allows you to remove that suffix. Legacy behavior of theaddTargetGroups()
convenience method did not include theRule
suffix on the logicalId of the generatedListenerRule
. At some point, increasing complexity of requirements can require users to switch from theaddTargetGroups()
method to theaddAction()
method. When migratingListenerRule``s deployed by a legacy version of ``addTargetGroups()
, you will need to enable this flag to avoid changing the logicalId of your resource. Otherwise Cfn will attempt to replace theListenerRule
and fail. Default: - use standard logicalId with theRule
suffix
- ExampleMetadata:
infused
Example:
# listener: elbv2.ApplicationListener listener.add_action("Fixed", priority=10, conditions=[ elbv2.ListenerCondition.path_patterns(["/ok"]) ], action=elbv2.ListenerAction.fixed_response(200, content_type="text/plain", message_body="OK" ) )
Attributes
- action
Action to perform.
- conditions
Rule applies if matches the conditions.
- priority
Priority of this target group.
The rule with the lowest priority will be used for every request. If priority is not given, these target groups will be added as defaults, and must not have conditions.
Priorities must be unique.
- Default:
Target groups are used as defaults
- remove_suffix
ListenerRule``s have a ``Rule
suffix on their logicalId by default. This allows you to remove that suffix.Legacy behavior of the
addTargetGroups()
convenience method did not include theRule
suffix on the logicalId of the generatedListenerRule
. At some point, increasing complexity of requirements can require users to switch from theaddTargetGroups()
method to theaddAction()
method. When migratingListenerRule``s deployed by a legacy version of ``addTargetGroups()
, you will need to enable this flag to avoid changing the logicalId of your resource. Otherwise Cfn will attempt to replace theListenerRule
and fail.- Default:
use standard logicalId with the
Rule
suffix