rusty_cdk_core/wrappers/mod.rs
1//! Type-safe wrapper types
2//!
3//! This module provides newtype wrappers that enforce type safety and validation
4//! for various configuration values used in AWS resources. These wrappers help
5//! prevent common mistakes like using invalid identifiers, zero values where
6//! positive numbers are required, or invalid memory/timeout configurations.
7//!
8//! # Creating Wrappers
9//!
10//! ** Recommended approach: ** Use the compile-time validated proc macros from the
11//! `rusty-cdk-macros` crate for type safety and validation at compile time.
12//!
13//! ** Direct creation: ** While these wrappers can be created directly by calling
14//! their constructors, this bypasses compile-time validation and should only be
15//! used as an override.
16//!
17//! # Example
18//! ```rust
19//! use rusty_cdk_core::wrappers::StringWithOnlyAlphaNumericsAndUnderscores;
20//! use rusty_cdk_macros::string_with_only_alphanumerics_and_underscores;
21//! use rusty_cdk_core::wrappers::{Memory};
22//!
23//! // Preferred: Use the macro for compile-time validation
24//! let function_name = string_with_only_alphanumerics_and_underscores!("my_lambda_function");
25//! ```
26
27/// A string wrapper that ensures the content contains only letters, numbers, and underscores.
28///
29/// # Validation Rules (when using the macro)
30/// - Only alphanumeric characters (a-z, A-Z, 0-9) and underscores (_) are allowed
31///
32/// # Recommended Usage
33/// Use the `string_with_only_alphanumerics_and_underscores!` macro from `rusty-cdk-macros`
34/// for compile-time validation:
35///
36/// ```rust
37/// use rusty_cdk_core::wrappers::StringWithOnlyAlphaNumericsAndUnderscores;
38/// use rusty_cdk_macros::string_with_only_alphanumerics_and_underscores;
39///
40/// let function_name = string_with_only_alphanumerics_and_underscores!("my_lambda_function");
41/// ```
42#[derive(Debug, Clone)]
43pub struct StringWithOnlyAlphaNumericsAndUnderscores(pub String);
44
45/// A string wrapper that ensures the content contains only letters, numbers, underscores, and hyphens.
46///
47/// # Validation Rules (when using the macro)
48/// - Only alphanumeric characters (a-z, A-Z, 0-9), underscores (_), and hyphens (-) are allowed
49///
50/// # Recommended Usage
51/// Use the `string_with_only_alphanumerics_underscores_and_hyphens!` macro from `rusty-cdk-macros`
52/// for compile-time validation:
53///
54/// ```rust
55/// use rusty_cdk_core::wrappers::StringWithOnlyAlphaNumericsUnderscoresAndHyphens;
56/// use rusty_cdk_macros::string_with_only_alphanumerics_underscores_and_hyphens;
57///
58/// let stack_name = string_with_only_alphanumerics_underscores_and_hyphens!("my-function-name");
59/// ```
60#[derive(Debug, Clone)]
61pub struct StringWithOnlyAlphaNumericsUnderscoresAndHyphens(pub String);
62
63/// A string wrapper that ensures the content contains only letters, numbers, and hyphens.
64///
65/// # Validation Rules (when using the macro)
66/// - Only alphanumeric characters (a-z, A-Z, 0-9), underscores (_), and hyphens (-) are allowed
67///
68/// # Recommended Usage
69/// Use the `string_with_only_alphanumerics_underscores_and_hyphens!` macro from `rusty-cdk-macros`
70/// for compile-time validation:
71///
72/// ```rust
73/// use rusty_cdk_core::wrappers::StringWithOnlyAlphaNumericsAndHyphens;
74/// use rusty_cdk_macros::string_with_only_alphanumerics_and_hyphens;
75///
76/// let stack_name = string_with_only_alphanumerics_and_hyphens!("my-stack-name");
77/// ```
78#[derive(Debug, Clone)]
79pub struct StringWithOnlyAlphaNumericsAndHyphens(pub String);
80
81/// A string wrapper for AWS Secrets Manager secret names.
82///
83/// # Validation Rules (when using the macro)
84/// - String must not be empty
85/// - Only alphanumeric characters and the following special characters are allowed: / _ + = . @ -
86/// - Maximum length of 512 characters (AWS Secrets Manager limit)
87///
88/// # Recommended Usage
89/// Use the `string_for_secret!` macro from `rusty-cdk-macros` for compile-time validation:
90///
91/// ```rust
92/// use rusty_cdk_core::wrappers::StringForSecret;
93/// use rusty_cdk_macros::string_for_secret;
94///
95/// let secret_name = string_for_secret!("myapp/database/password");
96/// ```
97#[derive(Debug, Clone)]
98pub struct StringForSecret(pub String);
99
100/// A wrapper for positive integers that must be greater than zero.
101///
102/// # Recommended Usage
103/// Use the `non_zero_number!` macro from `rusty-cdk-macros` for compile-time validation:
104///
105/// ```rust
106/// use rusty_cdk_core::wrappers::NonZeroNumber;
107/// use rusty_cdk_macros::non_zero_number;
108///
109/// let capacity = non_zero_number!(10);
110/// ```
111#[derive(Debug, Copy, Clone)]
112pub struct NonZeroNumber(pub u32);
113
114/// Memory allocation configuration for AWS Lambda functions, specified in megabytes.
115///
116/// # Validation Rules (when using the macro)
117/// - Minimum: 128 MB
118/// - Maximum: 10,240 MB (10 GB)
119///
120/// # Recommended Usage
121/// Use the `memory!` macro from `rusty-cdk-macros` for compile-time validation:
122///
123/// ```rust
124/// use rusty_cdk_core::wrappers::Memory;
125/// use rusty_cdk_macros::memory;
126///
127/// let mem = memory!(512);
128/// ```
129#[derive(Debug, Copy, Clone)]
130pub struct Memory(pub u16);
131
132/// Timeout configuration for AWS Lambda functions, specified in seconds.
133///
134/// # Validation Rules (when using the macro)
135/// - Minimum: 1 second
136/// - Maximum: 900 seconds (15 minutes)
137///
138/// # Recommended Usage
139/// Use the `timeout!` macro from `rusty-cdk-macros` for compile-time validation:
140///
141/// ```rust
142/// use rusty_cdk_core::wrappers::Timeout;
143/// use rusty_cdk_macros::timeout;
144///
145/// let timeout_val = timeout!(30);
146/// ```
147#[derive(Debug, Copy, Clone)]
148pub struct Timeout(pub u16);
149
150/// Environment variable key wrapper for AWS Lambda function configuration.
151///
152/// # Validation Rules (when using the macro)
153/// - Minimum length of 2
154/// - Should start with a letter of number
155/// - Should only contain letters, numbers and underscores
156///
157/// # Recommended Usage
158/// Use the `env_var_key!` macro from `rusty-cdk-macros` for compile-time validation:
159///
160/// ```rust
161/// use rusty_cdk_core::wrappers::EnvVarKey;
162/// use rusty_cdk_macros::env_var_key;
163///
164/// let db_url = env_var_key!("DATABASE_URL");
165/// ```
166#[derive(Debug, Clone)]
167pub struct EnvVarKey(pub String);
168
169/// File path wrapper for AWS Lambda deployment package ZIP files.
170///
171/// # Use Cases
172/// - Lambda function deployment packages
173/// - Any AWS resource requiring ZIP file uploads
174///
175/// # Validation Rules (when using the macro)
176/// - Should be a valid file path to a ZIP file
177/// - Can be relative or absolute paths
178/// - File should exist and be accessible at deployment time
179///
180/// # Recommended Usage
181/// Use the `zip_file!` macro from `rusty-cdk-macros` for compile-time validation:
182///
183/// ```rust,compile_fail
184/// use rusty_cdk_core::wrappers::ZipFile;
185/// use rusty_cdk_macros::zip_file;
186///
187/// let lambda_code = zip_file!("./target/lambda/function.zip");
188/// ```
189#[derive(Debug, Clone)]
190pub struct ZipFile(pub String);
191
192/// Delay seconds wrapper for AWS SQS queue configuration.
193///
194/// # Validation Rules (when using the macro)
195/// - Minimum: 0 seconds (no delay)
196/// - Maximum: 900 seconds (15 minutes)
197///
198/// # Recommended Usage
199/// Use the `delay_seconds!` macro from `rusty-cdk-macros` for compile-time validation:
200///
201/// ```rust
202/// use rusty_cdk_core::wrappers::DelaySeconds;
203/// use rusty_cdk_macros::delay_seconds;
204///
205/// let delay = delay_seconds!(300);
206/// ```
207#[derive(Debug, Copy, Clone)]
208pub struct DelaySeconds(pub u16);
209
210/// Maximum message size wrapper for AWS SQS queue configuration.
211///
212/// # Validation Rules (when using the macro)
213/// - Minimum: 1,024 bytes (1 KiB)
214/// - Maximum: 1,048,576 bytes (1 MiB)
215///
216/// # Recommended Usage
217/// Use the `maximum_message_size!` macro from `rusty-cdk-macros` for compile-time validation:
218///
219/// ```rust
220/// use rusty_cdk_core::wrappers::MaximumMessageSize;
221/// use rusty_cdk_macros::maximum_message_size;
222///
223/// let max_size = maximum_message_size!(262144); // 256 KiB
224/// ```
225#[derive(Debug, Copy, Clone)]
226pub struct MaximumMessageSize(pub u32);
227
228/// Message retention period wrapper for AWS SQS queue configuration.
229///
230/// # Validation Rules (when using the macro)
231/// - Minimum: 60 seconds (1 minute)
232/// - Maximum: 1,209,600 seconds (14 days)
233///
234/// # Recommended Usage
235/// Use the `message_retention_period!` macro from `rusty-cdk-macros` for compile-time validation:
236///
237/// ```rust
238/// use rusty_cdk_core::wrappers::MessageRetentionPeriod;
239/// use rusty_cdk_macros::message_retention_period;
240///
241/// let retention = message_retention_period!(345600); // 4 days
242/// ```
243#[derive(Debug, Copy, Clone)]
244pub struct MessageRetentionPeriod(pub u32);
245
246/// Visibility timeout wrapper for AWS SQS queue configuration.
247/// Determines how long messages remain invisible after being received by a consumer
248///
249/// # Validation Rules (when using the macro)
250/// - Minimum: 0 seconds
251/// - Maximum: 43,200 seconds (12 hours)
252///
253/// # Recommended Usage
254/// Use the `visibility_timeout!` macro from `rusty-cdk-macros` for compile-time validation:
255///
256/// ```rust
257/// use rusty_cdk_core::wrappers::VisibilityTimeout;
258/// use rusty_cdk_macros::visibility_timeout;
259///
260/// let timeout = visibility_timeout!(30);
261/// ```
262#[derive(Debug, Copy, Clone)]
263pub struct VisibilityTimeout(pub u32);
264
265/// Receive message wait time wrapper for AWS SQS queue configuration.
266///
267/// # Validation Rules (when using the macro)
268/// - Minimum: 0 seconds (short polling)
269/// - Maximum: 20 seconds (long polling)
270/// - Enables long polling when greater than 0
271///
272/// # Recommended Usage
273/// Use the `receive_message_wait_time!` macro from `rusty-cdk-macros` for compile-time validation:
274///
275/// ```rust
276/// use rusty_cdk_core::wrappers::ReceiveMessageWaitTime;
277/// use rusty_cdk_macros::receive_message_wait_time;
278///
279/// let wait_time = receive_message_wait_time!(10);
280/// ```
281#[derive(Debug, Copy, Clone)]
282pub struct ReceiveMessageWaitTime(pub u8);
283
284/// Maximum concurrency configuration for SQS event sources in AWS Lambda.
285///
286/// # Validation Rules (when using the macro)
287/// - Minimum: 2 concurrent invocations
288/// - Maximum: 1,000 concurrent invocations
289///
290/// # Recommended Usage
291/// Use the `sqs_event_source_max_concurrency!` macro from `rusty-cdk-macros` for compile-time validation:
292///
293/// ```rust
294/// use rusty_cdk_core::wrappers::SqsEventSourceMaxConcurrency;
295/// use rusty_cdk_macros::sqs_event_source_max_concurrency;
296///
297/// let max_concurrency = sqs_event_source_max_concurrency!(10);
298/// ```
299#[derive(Debug, Copy, Clone)]
300pub struct SqsEventSourceMaxConcurrency(pub u16);
301
302/// A wrapper for referencing existing AWS S3 buckets.
303///
304/// Use this when you need to reference a bucket that already exists, as opposed to creating a new one (use `BucketName` for new buckets).
305///
306/// # Validation Rules (when using the macro)
307/// - Value must not be an ARN (cannot start with "arn:")
308/// - Value must not include the "s3:" prefix
309/// - Bucket must exist in your AWS account
310///
311/// # Recommended Usage
312/// Use the `bucket!` macro from `rusty-cdk-macros` for compile-time validation
313///
314/// # Note
315/// The `bucket!` macro queries AWS at compile time to verify the bucket exists and caches the result for faster subsequent compilations.
316/// Set `RUSTY_CDK_NO_REMOTE=true` env var to skip remote checks.
317#[derive(Debug, Clone)]
318pub struct Bucket(pub String);
319
320/// Retention period configuration for AWS CloudWatch Logs log groups, specified in days.
321///
322/// # Validation Rules (when using the macro)
323/// - Must be one of the following values:
324/// 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1096, 1827, 2192, 2557, 2922, 3288, 3653
325///
326/// # Recommended Usage
327/// Use the `log_retention!` macro from `rusty-cdk-macros` for compile-time validation:
328///
329/// ```rust
330/// use rusty_cdk_core::wrappers::RetentionInDays;
331/// use rusty_cdk_macros::log_retention;
332///
333/// let retention = log_retention!(30);
334/// ```
335#[derive(Debug, Copy, Clone)]
336pub struct RetentionInDays(pub u16);
337
338/// A wrapper for AWS CloudWatch Logs log group names.
339///
340/// # Validation Rules (when using the macro)
341/// - String must not be empty
342/// - Maximum length of 512 characters
343/// - Only alphanumeric characters and the following special characters are allowed: . - _ # / \
344///
345/// # Recommended Usage
346/// Use the `log_group_name!` macro from `rusty-cdk-macros` for compile-time validation:
347///
348/// ```rust
349/// use rusty_cdk_core::wrappers::LogGroupName;
350/// use rusty_cdk_macros::log_group_name;
351///
352/// let log_group = log_group_name!("/aws/lambda/my-function");
353/// ```
354#[derive(Debug, Clone)]
355pub struct LogGroupName(pub String);
356
357/// A wrapper for creating new AWS S3 bucket names.
358///
359/// # Validation Rules (when using the macro)
360/// - Must contain only lowercase letters, numbers, periods (.), and hyphens (-)
361/// - No uppercase letters are allowed
362/// - Bucket name must be globally unique and available (verified at compile time by `bucket_name!`)
363/// - Must be between 3 and 63 characters long
364///
365/// # Recommended Usage
366/// Use the `bucket_name!` macro from `rusty-cdk-macros` for compile-time validation
367///
368/// # Note
369/// The `bucket_name!` macro queries AWS at compile time to verify the bucket name is globally
370/// available and caches the result for faster subsequent compilations.
371/// Set `RUSTY_CDK_NO_REMOTE=true` to skip remote checks.
372#[derive(Debug, Clone)]
373pub struct BucketName(pub String);
374
375/// A wrapper for AWS IAM action permissions.
376///
377/// This wrapper ensures type safety when defining IAM policy actions, helping prevent
378/// runtime IAM policy errors by validating permissions at compile time against AWS's
379/// official permission list.
380///
381/// # Validation Rules (when using the macro)
382/// - String must not be empty
383/// - Action must be a valid AWS IAM action (e.g., "s3:GetObject", "dynamodb:Query")
384/// - Wildcards are supported (e.g., "s3:*", "dynamodb:Get*")
385///
386/// # Recommended Usage
387/// Use the `iam_action!` macro from `rusty-cdk-macros` for compile-time validation:
388///
389/// ```rust
390/// use rusty_cdk_core::wrappers::IamAction;
391/// use rusty_cdk_macros::iam_action;
392///
393/// let action = iam_action!("s3:GetObject");
394/// let wildcard_action = iam_action!("s3:Put*");
395/// ```
396#[derive(Debug, Clone)]
397pub struct IamAction(pub String);
398
399/// Configuration for object size constraints in S3 lifecycle rules, specified in bytes.
400///
401/// This wrapper defines minimum and maximum object sizes for S3 lifecycle transitions.
402/// It allows you to apply lifecycle rules only to objects within a specific size range.
403///
404/// # Structure
405/// - First value: Minimum object size (optional)
406/// - Second value: Maximum object size (optional)
407/// - Both values are in bytes
408///
409/// # Validation Rules (when using the macro)
410/// - If both values are provided, the first must be smaller than the second
411/// - Values represent object sizes in bytes
412///
413/// # Recommended Usage
414/// Use the `lifecycle_object_sizes!` macro from `rusty-cdk-macros` for compile-time validation:
415///
416/// ```rust
417/// use rusty_cdk_core::wrappers::S3LifecycleObjectSizes;
418/// use rusty_cdk_macros::lifecycle_object_sizes;
419///
420/// let sizes = lifecycle_object_sizes!(1024,10485760);
421///
422/// let max_only = lifecycle_object_sizes!(5242880);
423/// ```
424#[derive(Debug, Clone)]
425pub struct S3LifecycleObjectSizes(pub Option<u32>, pub Option<u32>);
426
427/// A wrapper for TOML configuration file paths.
428///
429/// This wrapper ensures type safety when specifying paths to TOML configuration files used in infrastructure definitions.
430///
431/// # Recommended Usage
432/// Use the `toml_file!` macro from `rusty-cdk-macros` for compile-time validation:
433#[derive(Debug, Clone)]
434pub struct TomlFile(pub String);
435
436/// Number of connection attempts for CloudFront origin connections.
437///
438/// # Validation Rules (when using the macro)
439/// - Minimum: 1 attempt
440/// - Maximum: 3 attempts
441/// - Determines retry behavior for origin connection failures
442///
443/// # Recommended Usage
444/// Use the `connection_attempts!` macro from `rusty-cdk-macros` for compile-time validation:
445///
446/// ```rust
447/// use rusty_cdk_core::wrappers::ConnectionAttempts;
448/// use rusty_cdk_macros::connection_attempts;
449///
450/// let attempts = connection_attempts!(3);
451/// ```
452#[derive(Debug, Clone)]
453pub struct ConnectionAttempts(pub u8);
454
455/// Connection timeout configuration for CloudFront origins, specified in seconds.
456///
457/// # Structure
458/// - First value: Connection timeout in seconds (optional, 1-10 seconds)
459/// - Second value: Response completion timeout in seconds (optional, must be >= connection timeout)
460///
461/// # Recommended Usage
462/// Use the `cf_connection_timeout!` macro from `rusty-cdk-macros` for compile-time validation:
463///
464/// ```rust
465/// use rusty_cdk_core::wrappers::CfConnectionTimeout;
466/// use rusty_cdk_core::wrappers::S3LifecycleObjectSizes;
467/// use rusty_cdk_macros::cf_connection_timeout;
468///
469/// let timeouts = cf_connection_timeout!(5,30);
470///
471/// let conn_only = cf_connection_timeout!(3);
472/// ```
473#[derive(Debug, Clone)]
474pub struct CfConnectionTimeout(pub Option<u16>, pub Option<u16>);
475
476/// Path prefix for CloudFront origin requests.
477///
478/// # Recommended Usage
479/// Use the `origin_path!` macro from `rusty-cdk-macros` for compile-time validation:
480///
481/// ```rust
482/// use rusty_cdk_core::wrappers::OriginPath;
483/// use rusty_cdk_macros::origin_path;
484///
485/// let path = origin_path!("/images");
486/// ```
487#[derive(Debug, Clone)]
488pub struct OriginPath(pub String);
489
490/// Default root object for CloudFront distributions.
491///
492/// This wrapper specifies the object that CloudFront returns when a viewer requests
493/// the root URL of your distribution (e.g., http://example.com/ instead of http://example.com/index.html).
494///
495/// # Recommended Usage
496/// Use the `default_root_object!` macro from `rusty-cdk-macros` for compile-time validation:
497///
498/// ```rust
499/// use rusty_cdk_core::wrappers::DefaultRootObject;
500/// use rusty_cdk_macros::default_root_object;
501///
502/// let root_obj = default_root_object!("index.html");
503/// ```
504#[derive(Debug, Clone)]
505pub struct DefaultRootObject(pub String);
506
507/// Read timeout for S3 origin in CloudFront, specified in seconds.
508///
509/// # Validation Rules (when using the macro)
510/// - Minimum: 1 second
511/// - Maximum: 120 seconds
512/// - Determines maximum wait time for S3 to respond
513///
514/// # Recommended Usage
515/// Use the `s3_origin_read_timeout!` macro from `rusty-cdk-macros` for compile-time validation:
516///
517/// ```rust
518/// use rusty_cdk_core::wrappers::S3OriginReadTimeout;
519/// use rusty_cdk_macros::s3_origin_read_timeout;
520///
521/// let timeout = s3_origin_read_timeout!(60);
522/// ```
523#[derive(Debug, Clone)]
524pub struct S3OriginReadTimeout(pub u8);
525
526/// Action specification for AWS Lambda resource-based policy permissions.
527///
528/// # Recommended Usage
529/// Use the `lambda_permission_action!` macro from `rusty-cdk-macros` for compile-time validation:
530///
531/// ```rust
532/// use rusty_cdk_core::wrappers::LambdaPermissionAction;
533/// use rusty_cdk_macros::lambda_permission_action;
534///
535/// let action = lambda_permission_action!("lambda:InvokeFunction");
536/// ```
537#[derive(Debug, Clone)]
538pub struct LambdaPermissionAction(pub String);
539
540/// Name for AWS AppConfig applications, environments, or configuration profiles.
541///
542/// # Recommended Usage
543/// Use the `app_config_name!` macro from `rusty-cdk-macros` for compile-time validation:
544///
545/// ```rust
546/// use rusty_cdk_core::wrappers::AppConfigName;
547/// use rusty_cdk_macros::app_config_name;
548///
549/// let name = app_config_name!("my-app");
550/// ```
551#[derive(Debug, Clone)]
552pub struct AppConfigName(pub String);
553
554/// Deployment duration for AWS AppConfig deployments, specified in minutes.
555///
556/// # Recommended Usage
557/// Use the `deployment_duration_in_minutes!` macro from `rusty-cdk-macros` for compile-time validation:
558///
559/// ```rust
560/// use rusty_cdk_core::wrappers::DeploymentDurationInMinutes;
561/// use rusty_cdk_macros::deployment_duration_in_minutes;
562///
563/// let duration = deployment_duration_in_minutes!(15);
564/// ```
565///
566#[derive(Debug, Clone)]
567pub struct DeploymentDurationInMinutes(pub u16);
568
569/// Growth factor percentage for AWS AppConfig deployment strategies.
570///
571/// This wrapper configures the percentage of targets to receive the configuration
572/// during each deployment interval. AppConfig uses this to gradually roll out changes.
573///
574/// # Recommended Usage
575/// Use the `growth_factor!` macro from `rusty-cdk-macros` for compile-time validation:
576///
577/// ```rust
578/// use rusty_cdk_core::wrappers::GrowthFactor;
579/// use rusty_cdk_macros::growth_factor;
580///
581/// let factor = growth_factor!(10);
582/// ```
583///
584#[derive(Debug, Clone)]
585pub struct GrowthFactor(pub u8);
586
587/// Number of days before S3 objects transition to a different storage class.
588///
589/// # Recommended Usage
590/// Use the `lifecycle_transition_in_days!` macro from `rusty-cdk-macros` for compile-time validation:
591///
592/// ```rust
593/// use rusty_cdk_core::wrappers::LifecycleTransitionInDays;
594/// use rusty_cdk_macros::lifecycle_transition_in_days;
595///
596/// let transition = lifecycle_transition_in_days!(90,"Glacier");
597///
598/// let ia_transition = lifecycle_transition_in_days!(31,"StandardIA");
599/// ```
600#[derive(Debug, Clone)]
601pub struct LifecycleTransitionInDays(pub u16);
602
603/// LocationUri of AppConfig
604///
605/// # Recommended Usage
606/// Use the `location_uri!` macro from `rusty-cdk-macros` for compile-time validation:
607///
608/// ```rust
609/// use rusty_cdk_core::wrappers::LocationUri;
610/// use rusty_cdk_macros::location_uri;
611///
612/// // hosted does not require an additional argument
613/// let hosted = location_uri!("hosted");
614///
615/// // but s3 does
616/// let s3 = location_uri!("s3","s3://some-bucket/object");
617/// ```
618#[derive(Debug, Clone)]
619pub struct LocationUri(pub String);
620
621/// Name of an AppSync Api
622///
623/// # Recommended Usage
624/// Use the `app_sync_api_name!` macro from `rusty-cdk-macros` for compile-time validation:
625///
626/// ```rust
627/// use rusty_cdk_core::wrappers::AppSyncApiName;
628/// use rusty_cdk_macros::app_sync_api_name;
629///
630/// let name = app_sync_api_name!("my-api");
631/// ```
632#[derive(Debug, Clone)]
633pub struct AppSyncApiName(pub String);
634
635/// ChannelNamespace name for AppSync
636///
637/// # Recommended Usage
638/// Use the `channel_namespace_name!` macro from `rusty-cdk-macros` for compile-time validation:
639///
640/// ```rust
641/// use rusty_cdk_core::wrappers::ChannelNamespaceName;
642/// use rusty_cdk_macros::channel_namespace_name;
643///
644/// let namespace = channel_namespace_name!("my-namespace");
645/// ```
646#[derive(Debug, Clone)]
647pub struct ChannelNamespaceName(pub String);
648
649/// Specifies the access tier and the number of days until an object is moved to a specific S3 bucket tier.
650///
651/// # Recommended Usage
652/// Use the `bucket_tiering!` macro from `rusty-cdk-macros` for compile-time validation:
653///
654/// ```rust
655/// use rusty_cdk_core::wrappers::BucketTiering;
656/// use rusty_cdk_macros::bucket_tiering;
657///
658/// let tiering = bucket_tiering!("DEEP_ARCHIVE_ACCESS", 180);
659/// ```
660#[derive(Debug, Clone)]
661pub struct BucketTiering(pub String, pub u16);
662
663/// Specifies the number of days until an S3 table record expires.
664///
665/// # Recommended Usage
666/// Use the `record_expiration_days!` macro from `rusty-cdk-macros` for compile-time validation:
667///
668/// ```rust
669/// use rusty_cdk_core::wrappers::RecordExpirationDays;
670/// use rusty_cdk_macros::record_expiration_days;
671///
672/// let expiration = record_expiration_days!(365);
673/// ```
674#[derive(Debug, Clone)]
675pub struct RecordExpirationDays(pub u32);
676
677/// Maximum age of an event in seconds for a retry policy for an EventBridge schedule.
678///
679/// # Recommended Usage
680/// Use the `retry_policy_event_age!` macro from `rusty-cdk-macros` for compile-time validation:
681///
682/// ```rust
683/// use rusty_cdk_core::wrappers::RetryPolicyEventAge;
684/// use rusty_cdk_macros::retry_policy_event_age;
685///
686/// let age = retry_policy_event_age!(3600);
687/// ```
688#[derive(Debug, Clone)]
689pub struct RetryPolicyEventAge(pub u32);
690
691/// Number of retries for a retry policy for an EventBridge schedule.
692///
693/// # Recommended Usage
694/// Use the `retry_policy_retries!` macro from `rusty-cdk-macros` for compile-time validation:
695///
696/// ```rust
697/// use rusty_cdk_core::wrappers::RetryPolicyRetries;
698/// use rusty_cdk_macros::retry_policy_retries;
699///
700/// let retries = retry_policy_retries!(5);
701/// ```
702#[derive(Debug, Clone)]
703pub struct RetryPolicyRetries(pub u8);
704
705/// The maximum time window in minutes for a flexible time window for an EventBridge schedule.
706///
707/// # Recommended Usage
708/// Use the `max_flexible_time_window!` macro from `rusty-cdk-macros` for compile-time validation:
709///
710/// ```rust
711/// use rusty_cdk_core::wrappers::MaxFlexibleTimeWindow;
712/// use rusty_cdk_macros::max_flexible_time_window;
713///
714/// let window = max_flexible_time_window!(15);
715/// ```
716#[derive(Debug, Clone)]
717pub struct MaxFlexibleTimeWindow(pub u16);
718
719/// An `at` expression for an EventBridge schedule.
720///
721/// # Recommended Usage
722/// Use the `schedule_at_expression!` macro from `rusty-cdk-macros` for compile-time validation:
723///
724/// ```rust
725/// use rusty_cdk_core::wrappers::ScheduleAtExpression;
726/// use rusty_cdk_macros::schedule_at_expression;
727///
728/// let at = schedule_at_expression!("2027-01-01T00:00:00");
729/// ```
730#[derive(Debug, Clone)]
731pub struct ScheduleAtExpression(pub String);
732
733/// A `rate` expression for an EventBridge schedule.
734///
735/// # Recommended Usage
736/// Use the `schedule_rate_expression!` macro from `rusty-cdk-macros` for compile-time validation:
737///
738/// ```rust
739/// use rusty_cdk_core::wrappers::ScheduleRateExpression;
740/// use rusty_cdk_macros::schedule_rate_expression;
741///
742/// let rate = schedule_rate_expression!(5, "minutes");
743/// ```
744#[derive(Debug, Clone)]
745pub struct ScheduleRateExpression(pub u16, pub String);
746
747/// A `cron` expression for an EventBridge schedule.
748///
749/// # Recommended Usage
750/// Use the `schedule_cron_expression!` macro from `rusty-cdk-macros` for compile-time validation:
751///
752/// ```rust
753/// use rusty_cdk_core::wrappers::ScheduleCronExpression;
754/// use rusty_cdk_macros::schedule_cron_expression;
755///
756/// let cron = schedule_cron_expression!("0 12 * * ? *");
757/// ```
758#[derive(Debug, Clone)]
759pub struct ScheduleCronExpression(pub String);
760
761/// Name of an EventBridge schedule.
762///
763/// # Recommended Usage
764/// Use the `schedule_name!` macro from `rusty-cdk-macros` for compile-time validation:
765///
766/// ```rust
767/// use rusty_cdk_core::wrappers::ScheduleName;
768/// use rusty_cdk_macros::schedule_name;
769///
770/// let name = schedule_name!("my-schedule");
771/// ```
772#[derive(Debug, Clone)]
773pub struct ScheduleName(pub String);
774
775/// Name of an IAM policy.
776///
777/// # Recommended Usage
778/// Use the `policy_name!` macro from `rusty-cdk-macros` for compile-time validation:
779///
780/// ```rust
781/// use rusty_cdk_core::wrappers::PolicyName;
782/// use rusty_cdk_macros::policy_name;
783///
784/// let name = policy_name!("my-policy");
785/// ```
786#[derive(Debug, Clone)]
787pub struct PolicyName(pub String);
788
789/// DisplayName of an SNS topic
790///
791/// # Recommended Usage
792/// Use the `topic_display_name!` macro from `rusty-cdk-macros` for compile-time validation:
793///
794/// ```rust
795/// use rusty_cdk_core::wrappers::TopicDisplayName;
796/// use rusty_cdk_macros::topic_display_name;
797///
798/// let name = topic_display_name!("my-topic");
799/// ```
800#[derive(Debug, Clone)]
801pub struct TopicDisplayName(pub String);
802
803/// Archive policy of an SNS topic
804///
805/// # Recommended Usage
806/// Use the `archive_policy!` macro from `rusty-cdk-macros` for compile-time validation:
807///
808/// ```rust
809/// use rusty_cdk_core::wrappers::ArchivePolicy;
810/// use rusty_cdk_macros::archive_policy;
811///
812/// let policy = archive_policy!(30);
813/// ```
814#[derive(Debug, Clone)]
815pub struct ArchivePolicy(pub u16);
816
817/// KMS Key reuse period (in seconds) for an SQS queue
818///
819/// # Recommended Usage
820/// Use the `key_reuse_period!` macro from `rusty-cdk-macros` for compile-time validation:
821///
822/// ```rust
823/// use rusty_cdk_core::wrappers::KeyReusePeriod;
824/// use rusty_cdk_macros::key_reuse_period;
825///
826/// let period = key_reuse_period!(300);
827/// ```
828#[derive(Debug, Clone)]
829pub struct KeyReusePeriod(pub u32);
830
831/// Percentage of successful message deliveries to be logged in Amazon CloudWatch, for an SNS topic
832///
833/// # Recommended Usage
834/// Use the `success_feedback_sample_rate!` macro from `rusty-cdk-macros` for compile-time validation:
835///
836/// ```rust
837/// use rusty_cdk_core::wrappers::SuccessFeedbackSampleRate;
838/// use rusty_cdk_macros::success_feedback_sample_rate;
839///
840/// let rate = success_feedback_sample_rate!(100);
841/// ```
842#[derive(Debug, Clone)]
843pub struct SuccessFeedbackSampleRate(pub u8);