#[non_exhaustive]pub struct Target {Show 17 fields
pub id: String,
pub arn: String,
pub role_arn: Option<String>,
pub input: Option<String>,
pub input_path: Option<String>,
pub input_transformer: Option<InputTransformer>,
pub kinesis_parameters: Option<KinesisParameters>,
pub run_command_parameters: Option<RunCommandParameters>,
pub ecs_parameters: Option<EcsParameters>,
pub batch_parameters: Option<BatchParameters>,
pub sqs_parameters: Option<SqsParameters>,
pub http_parameters: Option<HttpParameters>,
pub redshift_data_parameters: Option<RedshiftDataParameters>,
pub sage_maker_pipeline_parameters: Option<SageMakerPipelineParameters>,
pub dead_letter_config: Option<DeadLetterConfig>,
pub retry_policy: Option<RetryPolicy>,
pub app_sync_parameters: Option<AppSyncParameters>,
}
Expand description
Targets are the resources to be invoked when a rule is triggered. For a complete list of services and resources that can be set as a target, see PutTargets.
If you are setting the event bus of another account as the target, and that account granted permission to your account through an organization instead of directly by the account ID, then you must specify a RoleArn
with proper permissions in the Target
structure. For more information, see Sending and Receiving Events Between Amazon Web Services Accounts in the Amazon EventBridge User Guide.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.id: String
The ID of the target within the specified rule. Use this ID to reference the target when updating the rule. We recommend using a memorable and unique string.
arn: String
The Amazon Resource Name (ARN) of the target.
role_arn: Option<String>
The Amazon Resource Name (ARN) of the IAM role to be used for this target when the rule is triggered. If one rule triggers multiple targets, you can use a different IAM role for each target.
input: Option<String>
Valid JSON text passed to the target. In this case, nothing from the event itself is passed to the target. For more information, see The JavaScript Object Notation (JSON) Data Interchange Format.
input_path: Option<String>
The value of the JSONPath that is used for extracting part of the matched event when passing it to the target. You may use JSON dot notation or bracket notation. For more information about JSON paths, see JSONPath.
input_transformer: Option<InputTransformer>
Settings to enable you to provide custom input to a target based on certain event data. You can extract one or more key-value pairs from the event and then use that data to send customized input to the target.
kinesis_parameters: Option<KinesisParameters>
The custom parameter you can use to control the shard assignment, when the target is a Kinesis data stream. If you do not include this parameter, the default is to use the eventId
as the partition key.
run_command_parameters: Option<RunCommandParameters>
Parameters used when you are using the rule to invoke Amazon EC2 Run Command.
ecs_parameters: Option<EcsParameters>
Contains the Amazon ECS task definition and task count to be used, if the event target is an Amazon ECS task. For more information about Amazon ECS tasks, see Task Definitions in the Amazon EC2 Container Service Developer Guide.
batch_parameters: Option<BatchParameters>
If the event target is an Batch job, this contains the job definition, job name, and other parameters. For more information, see Jobs in the Batch User Guide.
sqs_parameters: Option<SqsParameters>
Contains the message group ID to use when the target is a FIFO queue.
If you specify an SQS FIFO queue as a target, the queue must have content-based deduplication enabled.
http_parameters: Option<HttpParameters>
Contains the HTTP parameters to use when the target is a API Gateway endpoint or EventBridge ApiDestination.
If you specify an API Gateway API or EventBridge ApiDestination as a target, you can use this parameter to specify headers, path parameters, and query string keys/values as part of your target invoking request. If you're using ApiDestinations, the corresponding Connection can also have these values configured. In case of any conflicting keys, values from the Connection take precedence.
redshift_data_parameters: Option<RedshiftDataParameters>
Contains the Amazon Redshift Data API parameters to use when the target is a Amazon Redshift cluster.
If you specify a Amazon Redshift Cluster as a Target, you can use this to specify parameters to invoke the Amazon Redshift Data API ExecuteStatement based on EventBridge events.
sage_maker_pipeline_parameters: Option<SageMakerPipelineParameters>
Contains the SageMaker AI Model Building Pipeline parameters to start execution of a SageMaker AI Model Building Pipeline.
If you specify a SageMaker AI Model Building Pipeline as a target, you can use this to specify parameters to start a pipeline execution based on EventBridge events.
dead_letter_config: Option<DeadLetterConfig>
The DeadLetterConfig
that defines the target queue to send dead-letter queue events to.
retry_policy: Option<RetryPolicy>
The retry policy configuration to use for the dead-letter queue.
app_sync_parameters: Option<AppSyncParameters>
Contains the GraphQL operation to be parsed and executed, if the event target is an AppSync API.
Implementations§
Source§impl Target
impl Target
Sourcepub fn id(&self) -> &str
pub fn id(&self) -> &str
The ID of the target within the specified rule. Use this ID to reference the target when updating the rule. We recommend using a memorable and unique string.
Sourcepub fn role_arn(&self) -> Option<&str>
pub fn role_arn(&self) -> Option<&str>
The Amazon Resource Name (ARN) of the IAM role to be used for this target when the rule is triggered. If one rule triggers multiple targets, you can use a different IAM role for each target.
Sourcepub fn input(&self) -> Option<&str>
pub fn input(&self) -> Option<&str>
Valid JSON text passed to the target. In this case, nothing from the event itself is passed to the target. For more information, see The JavaScript Object Notation (JSON) Data Interchange Format.
Sourcepub fn input_path(&self) -> Option<&str>
pub fn input_path(&self) -> Option<&str>
The value of the JSONPath that is used for extracting part of the matched event when passing it to the target. You may use JSON dot notation or bracket notation. For more information about JSON paths, see JSONPath.
Sourcepub fn input_transformer(&self) -> Option<&InputTransformer>
pub fn input_transformer(&self) -> Option<&InputTransformer>
Settings to enable you to provide custom input to a target based on certain event data. You can extract one or more key-value pairs from the event and then use that data to send customized input to the target.
Sourcepub fn kinesis_parameters(&self) -> Option<&KinesisParameters>
pub fn kinesis_parameters(&self) -> Option<&KinesisParameters>
The custom parameter you can use to control the shard assignment, when the target is a Kinesis data stream. If you do not include this parameter, the default is to use the eventId
as the partition key.
Sourcepub fn run_command_parameters(&self) -> Option<&RunCommandParameters>
pub fn run_command_parameters(&self) -> Option<&RunCommandParameters>
Parameters used when you are using the rule to invoke Amazon EC2 Run Command.
Sourcepub fn ecs_parameters(&self) -> Option<&EcsParameters>
pub fn ecs_parameters(&self) -> Option<&EcsParameters>
Contains the Amazon ECS task definition and task count to be used, if the event target is an Amazon ECS task. For more information about Amazon ECS tasks, see Task Definitions in the Amazon EC2 Container Service Developer Guide.
Sourcepub fn batch_parameters(&self) -> Option<&BatchParameters>
pub fn batch_parameters(&self) -> Option<&BatchParameters>
If the event target is an Batch job, this contains the job definition, job name, and other parameters. For more information, see Jobs in the Batch User Guide.
Sourcepub fn sqs_parameters(&self) -> Option<&SqsParameters>
pub fn sqs_parameters(&self) -> Option<&SqsParameters>
Contains the message group ID to use when the target is a FIFO queue.
If you specify an SQS FIFO queue as a target, the queue must have content-based deduplication enabled.
Sourcepub fn http_parameters(&self) -> Option<&HttpParameters>
pub fn http_parameters(&self) -> Option<&HttpParameters>
Contains the HTTP parameters to use when the target is a API Gateway endpoint or EventBridge ApiDestination.
If you specify an API Gateway API or EventBridge ApiDestination as a target, you can use this parameter to specify headers, path parameters, and query string keys/values as part of your target invoking request. If you're using ApiDestinations, the corresponding Connection can also have these values configured. In case of any conflicting keys, values from the Connection take precedence.
Sourcepub fn redshift_data_parameters(&self) -> Option<&RedshiftDataParameters>
pub fn redshift_data_parameters(&self) -> Option<&RedshiftDataParameters>
Contains the Amazon Redshift Data API parameters to use when the target is a Amazon Redshift cluster.
If you specify a Amazon Redshift Cluster as a Target, you can use this to specify parameters to invoke the Amazon Redshift Data API ExecuteStatement based on EventBridge events.
Sourcepub fn sage_maker_pipeline_parameters(
&self,
) -> Option<&SageMakerPipelineParameters>
pub fn sage_maker_pipeline_parameters( &self, ) -> Option<&SageMakerPipelineParameters>
Contains the SageMaker AI Model Building Pipeline parameters to start execution of a SageMaker AI Model Building Pipeline.
If you specify a SageMaker AI Model Building Pipeline as a target, you can use this to specify parameters to start a pipeline execution based on EventBridge events.
Sourcepub fn dead_letter_config(&self) -> Option<&DeadLetterConfig>
pub fn dead_letter_config(&self) -> Option<&DeadLetterConfig>
The DeadLetterConfig
that defines the target queue to send dead-letter queue events to.
Sourcepub fn retry_policy(&self) -> Option<&RetryPolicy>
pub fn retry_policy(&self) -> Option<&RetryPolicy>
The retry policy configuration to use for the dead-letter queue.
Sourcepub fn app_sync_parameters(&self) -> Option<&AppSyncParameters>
pub fn app_sync_parameters(&self) -> Option<&AppSyncParameters>
Contains the GraphQL operation to be parsed and executed, if the event target is an AppSync API.
Trait Implementations§
impl StructuralPartialEq for Target
Auto Trait Implementations§
impl Freeze for Target
impl RefUnwindSafe for Target
impl Send for Target
impl Sync for Target
impl Unpin for Target
impl UnwindSafe for Target
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the foreground set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red()
and
green()
, which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg()
:
use yansi::{Paint, Color};
painted.fg(Color::White);
Set foreground color to white using white()
.
use yansi::Paint;
painted.white();
Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Source§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the background set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red()
and
on_green()
, which have the same functionality but
are pithier.
§Example
Set background color to red using fg()
:
use yansi::{Paint, Color};
painted.bg(Color::Red);
Set background color to red using on_red()
.
use yansi::Paint;
painted.on_red();
Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Source§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling Attribute
value
.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold()
and
underline()
, which have the same functionality
but are pithier.
§Example
Make text bold using attr()
:
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);
Make text bold using using bold()
.
use yansi::Paint;
painted.bold();
Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi
Quirk
value
.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask()
and
wrap()
, which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk()
:
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);
Enable wrapping using wrap()
.
use yansi::Paint;
painted.wrap();
Source§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.
fn clear(&self) -> Painted<&T>
resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.Source§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the Condition
value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted
only when both stdout
and stderr
are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);