aws_sdk_synthetics/client/update_canary.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2impl super::Client {
3 /// Constructs a fluent builder for the [`UpdateCanary`](crate::operation::update_canary::builders::UpdateCanaryFluentBuilder) operation.
4 ///
5 /// - The fluent builder is configurable:
6 /// - [`name(impl Into<String>)`](crate::operation::update_canary::builders::UpdateCanaryFluentBuilder::name) / [`set_name(Option<String>)`](crate::operation::update_canary::builders::UpdateCanaryFluentBuilder::set_name):<br>required: **true**<br><p>The name of the canary that you want to update. To find the names of your canaries, use <a href="https://docs.aws.amazon.com/AmazonSynthetics/latest/APIReference/API_DescribeCanaries.html">DescribeCanaries</a>.</p> <p>You cannot change the name of a canary that has already been created.</p><br>
7 /// - [`code(CanaryCodeInput)`](crate::operation::update_canary::builders::UpdateCanaryFluentBuilder::code) / [`set_code(Option<CanaryCodeInput>)`](crate::operation::update_canary::builders::UpdateCanaryFluentBuilder::set_code):<br>required: **false**<br><p>A structure that includes the entry point from which the canary should start running your script. If the script is stored in an Amazon S3 bucket, the bucket name, key, and version are also included.</p><br>
8 /// - [`execution_role_arn(impl Into<String>)`](crate::operation::update_canary::builders::UpdateCanaryFluentBuilder::execution_role_arn) / [`set_execution_role_arn(Option<String>)`](crate::operation::update_canary::builders::UpdateCanaryFluentBuilder::set_execution_role_arn):<br>required: **false**<br><p>The ARN of the IAM role to be used to run the canary. This role must already exist, and must include <code>lambda.amazonaws.com</code> as a principal in the trust policy. The role must also have the following permissions:</p> <ul> <li> <p><code>s3:PutObject</code></p></li> <li> <p><code>s3:GetBucketLocation</code></p></li> <li> <p><code>s3:ListAllMyBuckets</code></p></li> <li> <p><code>cloudwatch:PutMetricData</code></p></li> <li> <p><code>logs:CreateLogGroup</code></p></li> <li> <p><code>logs:CreateLogStream</code></p></li> <li> <p><code>logs:CreateLogStream</code></p></li> </ul><br>
9 /// - [`runtime_version(impl Into<String>)`](crate::operation::update_canary::builders::UpdateCanaryFluentBuilder::runtime_version) / [`set_runtime_version(Option<String>)`](crate::operation::update_canary::builders::UpdateCanaryFluentBuilder::set_runtime_version):<br>required: **false**<br><p>Specifies the runtime version to use for the canary. For a list of valid runtime versions and for more information about runtime versions, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_Library.html"> Canary Runtime Versions</a>.</p><br>
10 /// - [`schedule(CanaryScheduleInput)`](crate::operation::update_canary::builders::UpdateCanaryFluentBuilder::schedule) / [`set_schedule(Option<CanaryScheduleInput>)`](crate::operation::update_canary::builders::UpdateCanaryFluentBuilder::set_schedule):<br>required: **false**<br><p>A structure that contains information about how often the canary is to run, and when these runs are to stop.</p><br>
11 /// - [`run_config(CanaryRunConfigInput)`](crate::operation::update_canary::builders::UpdateCanaryFluentBuilder::run_config) / [`set_run_config(Option<CanaryRunConfigInput>)`](crate::operation::update_canary::builders::UpdateCanaryFluentBuilder::set_run_config):<br>required: **false**<br><p>A structure that contains the timeout value that is used for each individual run of the canary.</p><important> <p>Environment variable keys and values are encrypted at rest using Amazon Web Services owned KMS keys. However, the environment variables are not encrypted on the client side. Do not store sensitive information in them.</p> </important><br>
12 /// - [`success_retention_period_in_days(i32)`](crate::operation::update_canary::builders::UpdateCanaryFluentBuilder::success_retention_period_in_days) / [`set_success_retention_period_in_days(Option<i32>)`](crate::operation::update_canary::builders::UpdateCanaryFluentBuilder::set_success_retention_period_in_days):<br>required: **false**<br><p>The number of days to retain data about successful runs of this canary.</p> <p>This setting affects the range of information returned by <a href="https://docs.aws.amazon.com/AmazonSynthetics/latest/APIReference/API_GetCanaryRuns.html">GetCanaryRuns</a>, as well as the range of information displayed in the Synthetics console.</p><br>
13 /// - [`failure_retention_period_in_days(i32)`](crate::operation::update_canary::builders::UpdateCanaryFluentBuilder::failure_retention_period_in_days) / [`set_failure_retention_period_in_days(Option<i32>)`](crate::operation::update_canary::builders::UpdateCanaryFluentBuilder::set_failure_retention_period_in_days):<br>required: **false**<br><p>The number of days to retain data about failed runs of this canary.</p> <p>This setting affects the range of information returned by <a href="https://docs.aws.amazon.com/AmazonSynthetics/latest/APIReference/API_GetCanaryRuns.html">GetCanaryRuns</a>, as well as the range of information displayed in the Synthetics console.</p><br>
14 /// - [`vpc_config(VpcConfigInput)`](crate::operation::update_canary::builders::UpdateCanaryFluentBuilder::vpc_config) / [`set_vpc_config(Option<VpcConfigInput>)`](crate::operation::update_canary::builders::UpdateCanaryFluentBuilder::set_vpc_config):<br>required: **false**<br><p>If this canary is to test an endpoint in a VPC, this structure contains information about the subnet and security groups of the VPC endpoint. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_VPC.html"> Running a Canary in a VPC</a>.</p><br>
15 /// - [`visual_reference(VisualReferenceInput)`](crate::operation::update_canary::builders::UpdateCanaryFluentBuilder::visual_reference) / [`set_visual_reference(Option<VisualReferenceInput>)`](crate::operation::update_canary::builders::UpdateCanaryFluentBuilder::set_visual_reference):<br>required: **false**<br><p>Defines the screenshots to use as the baseline for comparisons during visual monitoring comparisons during future runs of this canary. If you omit this parameter, no changes are made to any baseline screenshots that the canary might be using already.</p> <p>Visual monitoring is supported only on canaries running the <b>syn-puppeteer-node-3.2</b> runtime or later. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Library_SyntheticsLogger_VisualTesting.html"> Visual monitoring</a> and <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_Blueprints_VisualTesting.html"> Visual monitoring blueprint</a></p><br>
16 /// - [`artifact_s3_location(impl Into<String>)`](crate::operation::update_canary::builders::UpdateCanaryFluentBuilder::artifact_s3_location) / [`set_artifact_s3_location(Option<String>)`](crate::operation::update_canary::builders::UpdateCanaryFluentBuilder::set_artifact_s3_location):<br>required: **false**<br><p>The location in Amazon S3 where Synthetics stores artifacts from the test runs of this canary. Artifacts include the log file, screenshots, and HAR files. The name of the Amazon S3 bucket can't include a period (.).</p><br>
17 /// - [`artifact_config(ArtifactConfigInput)`](crate::operation::update_canary::builders::UpdateCanaryFluentBuilder::artifact_config) / [`set_artifact_config(Option<ArtifactConfigInput>)`](crate::operation::update_canary::builders::UpdateCanaryFluentBuilder::set_artifact_config):<br>required: **false**<br><p>A structure that contains the configuration for canary artifacts, including the encryption-at-rest settings for artifacts that the canary uploads to Amazon S3.</p><br>
18 /// - [`provisioned_resource_cleanup(ProvisionedResourceCleanupSetting)`](crate::operation::update_canary::builders::UpdateCanaryFluentBuilder::provisioned_resource_cleanup) / [`set_provisioned_resource_cleanup(Option<ProvisionedResourceCleanupSetting>)`](crate::operation::update_canary::builders::UpdateCanaryFluentBuilder::set_provisioned_resource_cleanup):<br>required: **false**<br><p>Specifies whether to also delete the Lambda functions and layers used by this canary when the canary is deleted.</p> <p>If the value of this parameter is <code>OFF</code>, then the value of the <code>DeleteLambda</code> parameter of the <a href="https://docs.aws.amazon.com/AmazonSynthetics/latest/APIReference/API_DeleteCanary.html">DeleteCanary</a> operation determines whether the Lambda functions and layers will be deleted.</p><br>
19 /// - [`dry_run_id(impl Into<String>)`](crate::operation::update_canary::builders::UpdateCanaryFluentBuilder::dry_run_id) / [`set_dry_run_id(Option<String>)`](crate::operation::update_canary::builders::UpdateCanaryFluentBuilder::set_dry_run_id):<br>required: **false**<br><p>Update the existing canary using the updated configurations from the DryRun associated with the DryRunId.</p><note> <p>When you use the <code>dryRunId</code> field when updating a canary, the only other field you can provide is the <code>Schedule</code>. Adding any other field will thrown an exception.</p> </note><br>
20 /// - [`visual_references(VisualReferenceInput)`](crate::operation::update_canary::builders::UpdateCanaryFluentBuilder::visual_references) / [`set_visual_references(Option<Vec::<VisualReferenceInput>>)`](crate::operation::update_canary::builders::UpdateCanaryFluentBuilder::set_visual_references):<br>required: **false**<br><p>A list of visual reference configurations for the canary, one for each browser type that the canary is configured to run on. Visual references are used for visual monitoring comparisons.</p> <p><code>syn-nodejs-puppeteer-11.0</code> and above, and <code>syn-nodejs-playwright-3.0</code> and above, only supports <code>visualReferences</code>. <code>visualReference</code> field is not supported.</p> <p>Versions older than <code>syn-nodejs-puppeteer-11.0</code> supports both <code>visualReference</code> and <code>visualReferences</code> for backward compatibility. It is recommended to use <code>visualReferences</code> for consistency and future compatibility.</p> <p>For multibrowser visual monitoring, you can update the baseline for all configured browsers in a single update call by specifying a list of VisualReference objects, one per browser. Each VisualReference object maps to a specific browser configuration, allowing you to manage visual baselines for multiple browsers simultaneously.</p> <p>For single configuration canaries using Chrome browser (default browser), use visualReferences for <code>syn-nodejs-puppeteer-11.0</code> and above, and <code>syn-nodejs-playwright-3.0</code> and above canaries. The browserType in the visualReference object is not mandatory.</p><br>
21 /// - [`browser_configs(BrowserConfig)`](crate::operation::update_canary::builders::UpdateCanaryFluentBuilder::browser_configs) / [`set_browser_configs(Option<Vec::<BrowserConfig>>)`](crate::operation::update_canary::builders::UpdateCanaryFluentBuilder::set_browser_configs):<br>required: **false**<br><p>A structure that specifies the browser type to use for a canary run. CloudWatch Synthetics supports running canaries on both <code>CHROME</code> and <code>FIREFOX</code> browsers.</p><note> <p>If not specified, <code>browserConfigs</code> defaults to Chrome.</p> </note><br>
22 /// - On success, responds with [`UpdateCanaryOutput`](crate::operation::update_canary::UpdateCanaryOutput)
23 /// - On failure, responds with [`SdkError<UpdateCanaryError>`](crate::operation::update_canary::UpdateCanaryError)
24 pub fn update_canary(&self) -> crate::operation::update_canary::builders::UpdateCanaryFluentBuilder {
25 crate::operation::update_canary::builders::UpdateCanaryFluentBuilder::new(self.handle.clone())
26 }
27}