github.com/pulumi/pulumi-kubernetes/sdk/v3@v3.30.2/go/kubernetes/networking/v1beta1/ingress.go (about) 1 // Code generated by pulumigen DO NOT EDIT. 2 // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** 3 4 package v1beta1 5 6 import ( 7 "context" 8 "reflect" 9 10 metav1 "github.com/pulumi/pulumi-kubernetes/sdk/v3/go/kubernetes/meta/v1" 11 "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 12 ) 13 14 // Ingress is a collection of rules that allow inbound connections to reach the endpoints defined by a backend. An Ingress can be configured to give services externally-reachable urls, load balance traffic, terminate SSL, offer name based virtual hosting etc. 15 // 16 // This resource waits until its status is ready before registering success 17 // for create/update, and populating output properties from the current state of the resource. 18 // The following conditions are used to determine whether the resource creation has 19 // succeeded or failed: 20 // 21 // 1. Ingress object exists. 22 // 2. Endpoint objects exist with matching names for each Ingress path (except when Service 23 // type is ExternalName). 24 // 3. Ingress entry exists for '.status.loadBalancer.ingress'. 25 // 26 // If the Ingress has not reached a Ready state after 10 minutes, it will 27 // time out and mark the resource update as Failed. You can override the default timeout value 28 // by setting the 'customTimeouts' option on the resource. 29 type Ingress struct { 30 pulumi.CustomResourceState 31 32 // APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources 33 ApiVersion pulumi.StringPtrOutput `pulumi:"apiVersion"` 34 // Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds 35 Kind pulumi.StringPtrOutput `pulumi:"kind"` 36 // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 37 Metadata metav1.ObjectMetaPtrOutput `pulumi:"metadata"` 38 // Spec is the desired state of the Ingress. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status 39 Spec IngressSpecPtrOutput `pulumi:"spec"` 40 // Status is the current state of the Ingress. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status 41 Status IngressStatusPtrOutput `pulumi:"status"` 42 } 43 44 // NewIngress registers a new resource with the given unique name, arguments, and options. 45 func NewIngress(ctx *pulumi.Context, 46 name string, args *IngressArgs, opts ...pulumi.ResourceOption) (*Ingress, error) { 47 if args == nil { 48 args = &IngressArgs{} 49 } 50 51 args.ApiVersion = pulumi.StringPtr("networking.k8s.io/v1beta1") 52 args.Kind = pulumi.StringPtr("Ingress") 53 aliases := pulumi.Aliases([]pulumi.Alias{ 54 { 55 Type: pulumi.String("kubernetes:extensions/v1beta1:Ingress"), 56 }, 57 { 58 Type: pulumi.String("kubernetes:networking.k8s.io/v1:Ingress"), 59 }, 60 }) 61 opts = append(opts, aliases) 62 var resource Ingress 63 err := ctx.RegisterResource("kubernetes:networking.k8s.io/v1beta1:Ingress", name, args, &resource, opts...) 64 if err != nil { 65 return nil, err 66 } 67 return &resource, nil 68 } 69 70 // GetIngress gets an existing Ingress resource's state with the given name, ID, and optional 71 // state properties that are used to uniquely qualify the lookup (nil if not required). 72 func GetIngress(ctx *pulumi.Context, 73 name string, id pulumi.IDInput, state *IngressState, opts ...pulumi.ResourceOption) (*Ingress, error) { 74 var resource Ingress 75 err := ctx.ReadResource("kubernetes:networking.k8s.io/v1beta1:Ingress", name, id, state, &resource, opts...) 76 if err != nil { 77 return nil, err 78 } 79 return &resource, nil 80 } 81 82 // Input properties used for looking up and filtering Ingress resources. 83 type ingressState struct { 84 } 85 86 type IngressState struct { 87 } 88 89 func (IngressState) ElementType() reflect.Type { 90 return reflect.TypeOf((*ingressState)(nil)).Elem() 91 } 92 93 type ingressArgs struct { 94 // APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources 95 ApiVersion *string `pulumi:"apiVersion"` 96 // Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds 97 Kind *string `pulumi:"kind"` 98 // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 99 Metadata *metav1.ObjectMeta `pulumi:"metadata"` 100 // Spec is the desired state of the Ingress. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status 101 Spec *IngressSpec `pulumi:"spec"` 102 } 103 104 // The set of arguments for constructing a Ingress resource. 105 type IngressArgs struct { 106 // APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources 107 ApiVersion pulumi.StringPtrInput 108 // Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds 109 Kind pulumi.StringPtrInput 110 // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 111 Metadata metav1.ObjectMetaPtrInput 112 // Spec is the desired state of the Ingress. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status 113 Spec IngressSpecPtrInput 114 } 115 116 func (IngressArgs) ElementType() reflect.Type { 117 return reflect.TypeOf((*ingressArgs)(nil)).Elem() 118 } 119 120 type IngressInput interface { 121 pulumi.Input 122 123 ToIngressOutput() IngressOutput 124 ToIngressOutputWithContext(ctx context.Context) IngressOutput 125 } 126 127 func (*Ingress) ElementType() reflect.Type { 128 return reflect.TypeOf((**Ingress)(nil)).Elem() 129 } 130 131 func (i *Ingress) ToIngressOutput() IngressOutput { 132 return i.ToIngressOutputWithContext(context.Background()) 133 } 134 135 func (i *Ingress) ToIngressOutputWithContext(ctx context.Context) IngressOutput { 136 return pulumi.ToOutputWithContext(ctx, i).(IngressOutput) 137 } 138 139 // IngressArrayInput is an input type that accepts IngressArray and IngressArrayOutput values. 140 // You can construct a concrete instance of `IngressArrayInput` via: 141 // 142 // IngressArray{ IngressArgs{...} } 143 type IngressArrayInput interface { 144 pulumi.Input 145 146 ToIngressArrayOutput() IngressArrayOutput 147 ToIngressArrayOutputWithContext(context.Context) IngressArrayOutput 148 } 149 150 type IngressArray []IngressInput 151 152 func (IngressArray) ElementType() reflect.Type { 153 return reflect.TypeOf((*[]*Ingress)(nil)).Elem() 154 } 155 156 func (i IngressArray) ToIngressArrayOutput() IngressArrayOutput { 157 return i.ToIngressArrayOutputWithContext(context.Background()) 158 } 159 160 func (i IngressArray) ToIngressArrayOutputWithContext(ctx context.Context) IngressArrayOutput { 161 return pulumi.ToOutputWithContext(ctx, i).(IngressArrayOutput) 162 } 163 164 // IngressMapInput is an input type that accepts IngressMap and IngressMapOutput values. 165 // You can construct a concrete instance of `IngressMapInput` via: 166 // 167 // IngressMap{ "key": IngressArgs{...} } 168 type IngressMapInput interface { 169 pulumi.Input 170 171 ToIngressMapOutput() IngressMapOutput 172 ToIngressMapOutputWithContext(context.Context) IngressMapOutput 173 } 174 175 type IngressMap map[string]IngressInput 176 177 func (IngressMap) ElementType() reflect.Type { 178 return reflect.TypeOf((*map[string]*Ingress)(nil)).Elem() 179 } 180 181 func (i IngressMap) ToIngressMapOutput() IngressMapOutput { 182 return i.ToIngressMapOutputWithContext(context.Background()) 183 } 184 185 func (i IngressMap) ToIngressMapOutputWithContext(ctx context.Context) IngressMapOutput { 186 return pulumi.ToOutputWithContext(ctx, i).(IngressMapOutput) 187 } 188 189 type IngressOutput struct{ *pulumi.OutputState } 190 191 func (IngressOutput) ElementType() reflect.Type { 192 return reflect.TypeOf((**Ingress)(nil)).Elem() 193 } 194 195 func (o IngressOutput) ToIngressOutput() IngressOutput { 196 return o 197 } 198 199 func (o IngressOutput) ToIngressOutputWithContext(ctx context.Context) IngressOutput { 200 return o 201 } 202 203 // APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources 204 func (o IngressOutput) ApiVersion() pulumi.StringPtrOutput { 205 return o.ApplyT(func(v *Ingress) pulumi.StringPtrOutput { return v.ApiVersion }).(pulumi.StringPtrOutput) 206 } 207 208 // Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds 209 func (o IngressOutput) Kind() pulumi.StringPtrOutput { 210 return o.ApplyT(func(v *Ingress) pulumi.StringPtrOutput { return v.Kind }).(pulumi.StringPtrOutput) 211 } 212 213 // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 214 func (o IngressOutput) Metadata() metav1.ObjectMetaPtrOutput { 215 return o.ApplyT(func(v *Ingress) metav1.ObjectMetaPtrOutput { return v.Metadata }).(metav1.ObjectMetaPtrOutput) 216 } 217 218 // Spec is the desired state of the Ingress. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status 219 func (o IngressOutput) Spec() IngressSpecPtrOutput { 220 return o.ApplyT(func(v *Ingress) IngressSpecPtrOutput { return v.Spec }).(IngressSpecPtrOutput) 221 } 222 223 // Status is the current state of the Ingress. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status 224 func (o IngressOutput) Status() IngressStatusPtrOutput { 225 return o.ApplyT(func(v *Ingress) IngressStatusPtrOutput { return v.Status }).(IngressStatusPtrOutput) 226 } 227 228 type IngressArrayOutput struct{ *pulumi.OutputState } 229 230 func (IngressArrayOutput) ElementType() reflect.Type { 231 return reflect.TypeOf((*[]*Ingress)(nil)).Elem() 232 } 233 234 func (o IngressArrayOutput) ToIngressArrayOutput() IngressArrayOutput { 235 return o 236 } 237 238 func (o IngressArrayOutput) ToIngressArrayOutputWithContext(ctx context.Context) IngressArrayOutput { 239 return o 240 } 241 242 func (o IngressArrayOutput) Index(i pulumi.IntInput) IngressOutput { 243 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Ingress { 244 return vs[0].([]*Ingress)[vs[1].(int)] 245 }).(IngressOutput) 246 } 247 248 type IngressMapOutput struct{ *pulumi.OutputState } 249 250 func (IngressMapOutput) ElementType() reflect.Type { 251 return reflect.TypeOf((*map[string]*Ingress)(nil)).Elem() 252 } 253 254 func (o IngressMapOutput) ToIngressMapOutput() IngressMapOutput { 255 return o 256 } 257 258 func (o IngressMapOutput) ToIngressMapOutputWithContext(ctx context.Context) IngressMapOutput { 259 return o 260 } 261 262 func (o IngressMapOutput) MapIndex(k pulumi.StringInput) IngressOutput { 263 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Ingress { 264 return vs[0].(map[string]*Ingress)[vs[1].(string)] 265 }).(IngressOutput) 266 } 267 268 func init() { 269 pulumi.RegisterInputType(reflect.TypeOf((*IngressInput)(nil)).Elem(), &Ingress{}) 270 pulumi.RegisterInputType(reflect.TypeOf((*IngressArrayInput)(nil)).Elem(), IngressArray{}) 271 pulumi.RegisterInputType(reflect.TypeOf((*IngressMapInput)(nil)).Elem(), IngressMap{}) 272 pulumi.RegisterOutputType(IngressOutput{}) 273 pulumi.RegisterOutputType(IngressArrayOutput{}) 274 pulumi.RegisterOutputType(IngressMapOutput{}) 275 }