kcr_lambda_services_k8s_aws/v1alpha1/functionurlconfigs.rs
1// WARNING: generated by kopium - manual changes will be overwritten
2// kopium command: kopium --docs --derive=Default --derive=PartialEq --smart-derive-elision --filename crd-catalog/aws-controllers-k8s/lambda-controller/lambda.services.k8s.aws/v1alpha1/functionurlconfigs.yaml
3// kopium version: 0.21.2
4
5#[allow(unused_imports)]
6mod prelude {
7 pub use kube::CustomResource;
8 pub use serde::{Serialize, Deserialize};
9 pub use k8s_openapi::apimachinery::pkg::apis::meta::v1::Condition;
10}
11use self::prelude::*;
12
13/// FunctionUrlConfigSpec defines the desired state of FunctionUrlConfig.
14///
15/// Details about a Lambda function URL.
16#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
17#[kube(group = "lambda.services.k8s.aws", version = "v1alpha1", kind = "FunctionURLConfig", plural = "functionurlconfigs")]
18#[kube(namespaced)]
19#[kube(status = "FunctionURLConfigStatus")]
20#[kube(schema = "disabled")]
21#[kube(derive="Default")]
22#[kube(derive="PartialEq")]
23pub struct FunctionURLConfigSpec {
24 /// The type of authentication that your function URL uses. Set to AWS_IAM if
25 /// you want to restrict access to authenticated users only. Set to NONE if you
26 /// want to bypass IAM authentication to create a public endpoint. For more information,
27 /// see Security and auth model for Lambda function URLs (https://docs.aws.amazon.com/lambda/latest/dg/urls-auth.html).
28 #[serde(rename = "authType")]
29 pub auth_type: String,
30 /// The cross-origin resource sharing (CORS) (https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS)
31 /// settings for your function URL.
32 #[serde(default, skip_serializing_if = "Option::is_none")]
33 pub cors: Option<FunctionURLConfigCors>,
34 /// The name or ARN of the Lambda function.
35 ///
36 /// Name formats
37 ///
38 /// * Function name – my-function.
39 ///
40 /// * Function ARN – arn:aws:lambda:us-west-2:123456789012:function:my-function.
41 ///
42 /// * Partial ARN – 123456789012:function:my-function.
43 ///
44 /// The length constraint applies only to the full ARN. If you specify only the
45 /// function name, it is limited to 64 characters in length.
46 ///
47 /// Regex Pattern: `^(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?$`
48 #[serde(default, skip_serializing_if = "Option::is_none", rename = "functionName")]
49 pub function_name: Option<String>,
50 /// AWSResourceReferenceWrapper provides a wrapper around *AWSResourceReference
51 /// type to provide more user friendly syntax for references using 'from' field
52 /// Ex:
53 /// APIIDRef:
54 ///
55 /// from:
56 /// name: my-api
57 #[serde(default, skip_serializing_if = "Option::is_none", rename = "functionRef")]
58 pub function_ref: Option<FunctionURLConfigFunctionRef>,
59 /// The alias name.
60 ///
61 /// Regex Pattern: `^(^\$LATEST$)|((?!^[0-9]+$)([a-zA-Z0-9-_]+))$`
62 #[serde(default, skip_serializing_if = "Option::is_none")]
63 pub qualifier: Option<String>,
64}
65
66/// The cross-origin resource sharing (CORS) (https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS)
67/// settings for your function URL.
68#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
69pub struct FunctionURLConfigCors {
70 #[serde(default, skip_serializing_if = "Option::is_none", rename = "allowCredentials")]
71 pub allow_credentials: Option<bool>,
72 #[serde(default, skip_serializing_if = "Option::is_none", rename = "allowHeaders")]
73 pub allow_headers: Option<Vec<String>>,
74 #[serde(default, skip_serializing_if = "Option::is_none", rename = "allowMethods")]
75 pub allow_methods: Option<Vec<String>>,
76 #[serde(default, skip_serializing_if = "Option::is_none", rename = "allowOrigins")]
77 pub allow_origins: Option<Vec<String>>,
78 #[serde(default, skip_serializing_if = "Option::is_none", rename = "exposeHeaders")]
79 pub expose_headers: Option<Vec<String>>,
80 #[serde(default, skip_serializing_if = "Option::is_none", rename = "maxAge")]
81 pub max_age: Option<i64>,
82}
83
84/// AWSResourceReferenceWrapper provides a wrapper around *AWSResourceReference
85/// type to provide more user friendly syntax for references using 'from' field
86/// Ex:
87/// APIIDRef:
88///
89/// from:
90/// name: my-api
91#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
92pub struct FunctionURLConfigFunctionRef {
93 /// AWSResourceReference provides all the values necessary to reference another
94 /// k8s resource for finding the identifier(Id/ARN/Name)
95 #[serde(default, skip_serializing_if = "Option::is_none")]
96 pub from: Option<FunctionURLConfigFunctionRefFrom>,
97}
98
99/// AWSResourceReference provides all the values necessary to reference another
100/// k8s resource for finding the identifier(Id/ARN/Name)
101#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
102pub struct FunctionURLConfigFunctionRefFrom {
103 #[serde(default, skip_serializing_if = "Option::is_none")]
104 pub name: Option<String>,
105 #[serde(default, skip_serializing_if = "Option::is_none")]
106 pub namespace: Option<String>,
107}
108
109/// FunctionURLConfigStatus defines the observed state of FunctionURLConfig
110#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
111pub struct FunctionURLConfigStatus {
112 /// All CRs managed by ACK have a common `Status.ACKResourceMetadata` member
113 /// that is used to contain resource sync state, account ownership,
114 /// constructed ARN for the resource
115 #[serde(default, skip_serializing_if = "Option::is_none", rename = "ackResourceMetadata")]
116 pub ack_resource_metadata: Option<FunctionURLConfigStatusAckResourceMetadata>,
117 /// All CRs managed by ACK have a common `Status.Conditions` member that
118 /// contains a collection of `ackv1alpha1.Condition` objects that describe
119 /// the various terminal states of the CR and its backend AWS service API
120 /// resource
121 #[serde(default, skip_serializing_if = "Option::is_none")]
122 pub conditions: Option<Vec<Condition>>,
123 /// When the function URL was created, in ISO-8601 format (https://www.w3.org/TR/NOTE-datetime)
124 /// (YYYY-MM-DDThh:mm:ss.sTZD).
125 #[serde(default, skip_serializing_if = "Option::is_none", rename = "creationTime")]
126 pub creation_time: Option<String>,
127 /// The Amazon Resource Name (ARN) of your function.
128 ///
129 /// Regex Pattern: `^arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?$`
130 #[serde(default, skip_serializing_if = "Option::is_none", rename = "functionARN")]
131 pub function_arn: Option<String>,
132 /// The HTTP URL endpoint for your function.
133 #[serde(default, skip_serializing_if = "Option::is_none", rename = "functionURL")]
134 pub function_url: Option<String>,
135}
136
137/// All CRs managed by ACK have a common `Status.ACKResourceMetadata` member
138/// that is used to contain resource sync state, account ownership,
139/// constructed ARN for the resource
140#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
141pub struct FunctionURLConfigStatusAckResourceMetadata {
142 /// ARN is the Amazon Resource Name for the resource. This is a
143 /// globally-unique identifier and is set only by the ACK service controller
144 /// once the controller has orchestrated the creation of the resource OR
145 /// when it has verified that an "adopted" resource (a resource where the
146 /// ARN annotation was set by the Kubernetes user on the CR) exists and
147 /// matches the supplied CR's Spec field values.
148 /// https://github.com/aws/aws-controllers-k8s/issues/270
149 #[serde(default, skip_serializing_if = "Option::is_none")]
150 pub arn: Option<String>,
151 /// OwnerAccountID is the AWS Account ID of the account that owns the
152 /// backend AWS service API resource.
153 #[serde(rename = "ownerAccountID")]
154 pub owner_account_id: String,
155 /// Region is the AWS region in which the resource exists or will exist.
156 pub region: String,
157}
158