kcr_lambda_services_k8s_aws 3.20260602.223721

Kubernetes Custom Resource Bindings
Documentation
// WARNING: generated by kopium - manual changes will be overwritten
// kopium command: kopium --docs --derive=Default --derive=PartialEq --smart-derive-elision --filename crd-catalog/aws-controllers-k8s/lambda-controller/lambda.services.k8s.aws/v1alpha1/aliases.yaml
// kopium version: 0.23.0

#[allow(unused_imports)]
mod prelude {
    pub use kube::CustomResource;
    pub use serde::{Serialize, Deserialize};
    pub use std::collections::BTreeMap;
    pub use k8s_openapi::apimachinery::pkg::apis::meta::v1::Condition;
}

use self::prelude::*;

#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
#[kube(group = "lambda.services.k8s.aws", version = "v1alpha1", kind = "Alias", plural = "aliases")]
#[kube(namespaced)]
#[kube(status = "AliasStatus")]
#[kube(schema = "disabled")]
#[kube(derive="Default")]
#[kube(derive="PartialEq")]
pub struct AliasSpec {
    /// A description of the alias.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// Configures options for asynchronous invocation on an alias.
    /// 
    /// - DestinationConfig
    /// A destination for events after they have been sent to a function for processing.
    /// 
    /// Types of Destinations:
    /// Function - The Amazon Resource Name (ARN) of a Lambda function.
    /// Queue - The ARN of a standard SQS queue.
    /// Topic - The ARN of a standard SNS topic.
    /// Event Bus - The ARN of an Amazon EventBridge event bus.
    /// 
    /// - MaximumEventAgeInSeconds
    /// The maximum age of a request that Lambda sends to a function for processing.
    /// 
    /// - MaximumRetryAttempts
    /// The maximum number of times to retry when the function returns an error.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "functionEventInvokeConfig")]
    pub function_event_invoke_config: Option<AliasFunctionEventInvokeConfig>,
    /// The name or ARN of the Lambda function.
    /// 
    /// Name formats
    /// 
    ///    * Function name - MyFunction.
    /// 
    ///    * Function ARN - arn:aws:lambda:us-west-2:123456789012:function:MyFunction.
    /// 
    ///    * Partial ARN - 123456789012:function:MyFunction.
    /// 
    /// The length constraint applies only to the full ARN. If you specify only the
    /// function name, it is limited to 64 characters in length.
    /// 
    /// Regex Pattern: `^(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}((-gov)|(-iso([a-z]?)))?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?$`
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "functionName")]
    pub function_name: Option<String>,
    /// AWSResourceReferenceWrapper provides a wrapper around *AWSResourceReference
    /// type to provide more user friendly syntax for references using 'from' field
    /// Ex:
    /// APIIDRef:
    /// 
    /// 	from:
    /// 	  name: my-api
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "functionRef")]
    pub function_ref: Option<AliasFunctionRef>,
    /// The function version that the alias invokes.
    /// 
    /// Regex Pattern: `^(\$LATEST(\.PUBLISHED)?|[0-9]+)$`
    #[serde(rename = "functionVersion")]
    pub function_version: String,
    /// The name of the alias.
    /// 
    /// Regex Pattern: `^(?!^[0-9]+$)([a-zA-Z0-9-_]+)$`
    pub name: String,
    /// Permissions configures a set of Lambda permissions to grant to an alias.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub permissions: Option<Vec<AliasPermissions>>,
    /// Configures provisioned concurrency to a function's alias
    /// 
    /// - ProvisionedConcurrentExecutions
    /// The amount of provisioned concurrency to allocate for the version or alias.
    /// Minimum value of 1 is required
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "provisionedConcurrencyConfig")]
    pub provisioned_concurrency_config: Option<AliasProvisionedConcurrencyConfig>,
    /// The routing configuration (<https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html#configuring-alias-routing)>
    /// of the alias.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "routingConfig")]
    pub routing_config: Option<AliasRoutingConfig>,
}

/// Configures options for asynchronous invocation on an alias.
/// 
/// - DestinationConfig
/// A destination for events after they have been sent to a function for processing.
/// 
/// Types of Destinations:
/// Function - The Amazon Resource Name (ARN) of a Lambda function.
/// Queue - The ARN of a standard SQS queue.
/// Topic - The ARN of a standard SNS topic.
/// Event Bus - The ARN of an Amazon EventBridge event bus.
/// 
/// - MaximumEventAgeInSeconds
/// The maximum age of a request that Lambda sends to a function for processing.
/// 
/// - MaximumRetryAttempts
/// The maximum number of times to retry when the function returns an error.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct AliasFunctionEventInvokeConfig {
    /// A configuration object that specifies the destination of an event after Lambda
    /// processes it. For more information, see Adding a destination (<https://docs.aws.amazon.com/lambda/latest/dg/invocation-async-retain-records.html#invocation-async-destinations).>
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "destinationConfig")]
    pub destination_config: Option<AliasFunctionEventInvokeConfigDestinationConfig>,
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "functionName")]
    pub function_name: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "maximumEventAgeInSeconds")]
    pub maximum_event_age_in_seconds: Option<i64>,
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "maximumRetryAttempts")]
    pub maximum_retry_attempts: Option<i64>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub qualifier: Option<String>,
}

/// A configuration object that specifies the destination of an event after Lambda
/// processes it. For more information, see Adding a destination (<https://docs.aws.amazon.com/lambda/latest/dg/invocation-async-retain-records.html#invocation-async-destinations).>
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct AliasFunctionEventInvokeConfigDestinationConfig {
    /// A destination for events that failed processing. For more information, see
    /// Adding a destination (<https://docs.aws.amazon.com/lambda/latest/dg/invocation-async-retain-records.html#invocation-async-destinations).>
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "onFailure")]
    pub on_failure: Option<AliasFunctionEventInvokeConfigDestinationConfigOnFailure>,
    /// A destination for events that were processed successfully.
    /// 
    /// To retain records of successful asynchronous invocations (<https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#invocation-async-destinations),>
    /// you can configure an Amazon SNS topic, Amazon SQS queue, Lambda function,
    /// or Amazon EventBridge event bus as the destination.
    /// 
    /// OnSuccess is not supported in CreateEventSourceMapping or UpdateEventSourceMapping
    /// requests.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "onSuccess")]
    pub on_success: Option<AliasFunctionEventInvokeConfigDestinationConfigOnSuccess>,
}

/// A destination for events that failed processing. For more information, see
/// Adding a destination (<https://docs.aws.amazon.com/lambda/latest/dg/invocation-async-retain-records.html#invocation-async-destinations).>
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct AliasFunctionEventInvokeConfigDestinationConfigOnFailure {
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub destination: Option<String>,
}

/// A destination for events that were processed successfully.
/// 
/// To retain records of successful asynchronous invocations (<https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#invocation-async-destinations),>
/// you can configure an Amazon SNS topic, Amazon SQS queue, Lambda function,
/// or Amazon EventBridge event bus as the destination.
/// 
/// OnSuccess is not supported in CreateEventSourceMapping or UpdateEventSourceMapping
/// requests.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct AliasFunctionEventInvokeConfigDestinationConfigOnSuccess {
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub destination: Option<String>,
}

/// AWSResourceReferenceWrapper provides a wrapper around *AWSResourceReference
/// type to provide more user friendly syntax for references using 'from' field
/// Ex:
/// APIIDRef:
/// 
/// 	from:
/// 	  name: my-api
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct AliasFunctionRef {
    /// AWSResourceReference provides all the values necessary to reference another
    /// k8s resource for finding the identifier(Id/ARN/Name)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub from: Option<AliasFunctionRefFrom>,
}

/// AWSResourceReference provides all the values necessary to reference another
/// k8s resource for finding the identifier(Id/ARN/Name)
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct AliasFunctionRefFrom {
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub namespace: Option<String>,
}

#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct AliasPermissions {
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub action: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "eventSourceToken")]
    pub event_source_token: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "functionURLAuthType")]
    pub function_url_auth_type: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub principal: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "principalOrgID")]
    pub principal_org_id: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "revisionID")]
    pub revision_id: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "sourceARN")]
    pub source_arn: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "sourceAccount")]
    pub source_account: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "statementID")]
    pub statement_id: Option<String>,
}

/// Configures provisioned concurrency to a function's alias
/// 
/// - ProvisionedConcurrentExecutions
/// The amount of provisioned concurrency to allocate for the version or alias.
/// Minimum value of 1 is required
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct AliasProvisionedConcurrencyConfig {
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "functionName")]
    pub function_name: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "provisionedConcurrentExecutions")]
    pub provisioned_concurrent_executions: Option<i64>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub qualifier: Option<String>,
}

/// The routing configuration (<https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html#configuring-alias-routing)>
/// of the alias.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct AliasRoutingConfig {
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "additionalVersionWeights")]
    pub additional_version_weights: Option<BTreeMap<String, f64>>,
}

/// AliasStatus defines the observed state of Alias
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct AliasStatus {
    /// All CRs managed by ACK have a common `Status.ACKResourceMetadata` member
    /// that is used to contain resource sync state, account ownership,
    /// constructed ARN for the resource
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "ackResourceMetadata")]
    pub ack_resource_metadata: Option<AliasStatusAckResourceMetadata>,
    /// All CRs managed by ACK have a common `Status.Conditions` member that
    /// contains a collection of `ackv1alpha1.Condition` objects that describe
    /// the various terminal states of the CR and its backend AWS service API
    /// resource
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub conditions: Option<Vec<Condition>>,
    /// A unique identifier that changes when you update the alias.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "revisionID")]
    pub revision_id: Option<String>,
}

/// All CRs managed by ACK have a common `Status.ACKResourceMetadata` member
/// that is used to contain resource sync state, account ownership,
/// constructed ARN for the resource
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct AliasStatusAckResourceMetadata {
    /// ARN is the Amazon Resource Name for the resource. This is a
    /// globally-unique identifier and is set only by the ACK service controller
    /// once the controller has orchestrated the creation of the resource OR
    /// when it has verified that an "adopted" resource (a resource where the
    /// ARN annotation was set by the Kubernetes user on the CR) exists and
    /// matches the supplied CR's Spec field values.
    /// <https://github.com/aws/aws-controllers-k8s/issues/270>
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub arn: Option<String>,
    /// OwnerAccountID is the AWS Account ID of the account that owns the
    /// backend AWS service API resource.
    #[serde(rename = "ownerAccountID")]
    pub owner_account_id: String,
    /// Partition is the AWS partition in which the resource exists or will exist
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub partition: Option<String>,
    /// Region is the AWS region in which the resource exists or will exist.
    pub region: String,
}