github.com/pulumi/pulumi-kubernetes/sdk/v3@v3.30.2/go/kubernetes/extensions/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 // 30 // Deprecated: extensions/v1beta1/Ingress is deprecated by networking.k8s.io/v1beta1/Ingress and not supported by Kubernetes v1.20+ clusters. 31 type Ingress struct { 32 pulumi.CustomResourceState 33 34 // 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 35 ApiVersion pulumi.StringPtrOutput `pulumi:"apiVersion"` 36 // 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 37 Kind pulumi.StringPtrOutput `pulumi:"kind"` 38 // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 39 Metadata metav1.ObjectMetaPtrOutput `pulumi:"metadata"` 40 // 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 41 Spec IngressSpecPtrOutput `pulumi:"spec"` 42 // 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 43 Status IngressStatusPtrOutput `pulumi:"status"` 44 } 45 46 // NewIngress registers a new resource with the given unique name, arguments, and options. 47 func NewIngress(ctx *pulumi.Context, 48 name string, args *IngressArgs, opts ...pulumi.ResourceOption) (*Ingress, error) { 49 if args == nil { 50 args = &IngressArgs{} 51 } 52 53 args.ApiVersion = pulumi.StringPtr("extensions/v1beta1") 54 args.Kind = pulumi.StringPtr("Ingress") 55 aliases := pulumi.Aliases([]pulumi.Alias{ 56 { 57 Type: pulumi.String("kubernetes:networking.k8s.io/v1:Ingress"), 58 }, 59 { 60 Type: pulumi.String("kubernetes:networking.k8s.io/v1beta1:Ingress"), 61 }, 62 }) 63 opts = append(opts, aliases) 64 var resource Ingress 65 err := ctx.RegisterResource("kubernetes:extensions/v1beta1:Ingress", name, args, &resource, opts...) 66 if err != nil { 67 return nil, err 68 } 69 return &resource, nil 70 } 71 72 // GetIngress gets an existing Ingress resource's state with the given name, ID, and optional 73 // state properties that are used to uniquely qualify the lookup (nil if not required). 74 func GetIngress(ctx *pulumi.Context, 75 name string, id pulumi.IDInput, state *IngressState, opts ...pulumi.ResourceOption) (*Ingress, error) { 76 var resource Ingress 77 err := ctx.ReadResource("kubernetes:extensions/v1beta1:Ingress", name, id, state, &resource, opts...) 78 if err != nil { 79 return nil, err 80 } 81 return &resource, nil 82 } 83 84 // Input properties used for looking up and filtering Ingress resources. 85 type ingressState struct { 86 } 87 88 type IngressState struct { 89 } 90 91 func (IngressState) ElementType() reflect.Type { 92 return reflect.TypeOf((*ingressState)(nil)).Elem() 93 } 94 95 type ingressArgs struct { 96 // 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 97 ApiVersion *string `pulumi:"apiVersion"` 98 // 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 99 Kind *string `pulumi:"kind"` 100 // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 101 Metadata *metav1.ObjectMeta `pulumi:"metadata"` 102 // 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 103 Spec *IngressSpec `pulumi:"spec"` 104 } 105 106 // The set of arguments for constructing a Ingress resource. 107 type IngressArgs struct { 108 // 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 109 ApiVersion pulumi.StringPtrInput 110 // 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 111 Kind pulumi.StringPtrInput 112 // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 113 Metadata metav1.ObjectMetaPtrInput 114 // 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 115 Spec IngressSpecPtrInput 116 } 117 118 func (IngressArgs) ElementType() reflect.Type { 119 return reflect.TypeOf((*ingressArgs)(nil)).Elem() 120 } 121 122 type IngressInput interface { 123 pulumi.Input 124 125 ToIngressOutput() IngressOutput 126 ToIngressOutputWithContext(ctx context.Context) IngressOutput 127 } 128 129 func (*Ingress) ElementType() reflect.Type { 130 return reflect.TypeOf((**Ingress)(nil)).Elem() 131 } 132 133 func (i *Ingress) ToIngressOutput() IngressOutput { 134 return i.ToIngressOutputWithContext(context.Background()) 135 } 136 137 func (i *Ingress) ToIngressOutputWithContext(ctx context.Context) IngressOutput { 138 return pulumi.ToOutputWithContext(ctx, i).(IngressOutput) 139 } 140 141 // IngressArrayInput is an input type that accepts IngressArray and IngressArrayOutput values. 142 // You can construct a concrete instance of `IngressArrayInput` via: 143 // 144 // IngressArray{ IngressArgs{...} } 145 type IngressArrayInput interface { 146 pulumi.Input 147 148 ToIngressArrayOutput() IngressArrayOutput 149 ToIngressArrayOutputWithContext(context.Context) IngressArrayOutput 150 } 151 152 type IngressArray []IngressInput 153 154 func (IngressArray) ElementType() reflect.Type { 155 return reflect.TypeOf((*[]*Ingress)(nil)).Elem() 156 } 157 158 func (i IngressArray) ToIngressArrayOutput() IngressArrayOutput { 159 return i.ToIngressArrayOutputWithContext(context.Background()) 160 } 161 162 func (i IngressArray) ToIngressArrayOutputWithContext(ctx context.Context) IngressArrayOutput { 163 return pulumi.ToOutputWithContext(ctx, i).(IngressArrayOutput) 164 } 165 166 // IngressMapInput is an input type that accepts IngressMap and IngressMapOutput values. 167 // You can construct a concrete instance of `IngressMapInput` via: 168 // 169 // IngressMap{ "key": IngressArgs{...} } 170 type IngressMapInput interface { 171 pulumi.Input 172 173 ToIngressMapOutput() IngressMapOutput 174 ToIngressMapOutputWithContext(context.Context) IngressMapOutput 175 } 176 177 type IngressMap map[string]IngressInput 178 179 func (IngressMap) ElementType() reflect.Type { 180 return reflect.TypeOf((*map[string]*Ingress)(nil)).Elem() 181 } 182 183 func (i IngressMap) ToIngressMapOutput() IngressMapOutput { 184 return i.ToIngressMapOutputWithContext(context.Background()) 185 } 186 187 func (i IngressMap) ToIngressMapOutputWithContext(ctx context.Context) IngressMapOutput { 188 return pulumi.ToOutputWithContext(ctx, i).(IngressMapOutput) 189 } 190 191 type IngressOutput struct{ *pulumi.OutputState } 192 193 func (IngressOutput) ElementType() reflect.Type { 194 return reflect.TypeOf((**Ingress)(nil)).Elem() 195 } 196 197 func (o IngressOutput) ToIngressOutput() IngressOutput { 198 return o 199 } 200 201 func (o IngressOutput) ToIngressOutputWithContext(ctx context.Context) IngressOutput { 202 return o 203 } 204 205 // 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 206 func (o IngressOutput) ApiVersion() pulumi.StringPtrOutput { 207 return o.ApplyT(func(v *Ingress) pulumi.StringPtrOutput { return v.ApiVersion }).(pulumi.StringPtrOutput) 208 } 209 210 // 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 211 func (o IngressOutput) Kind() pulumi.StringPtrOutput { 212 return o.ApplyT(func(v *Ingress) pulumi.StringPtrOutput { return v.Kind }).(pulumi.StringPtrOutput) 213 } 214 215 // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 216 func (o IngressOutput) Metadata() metav1.ObjectMetaPtrOutput { 217 return o.ApplyT(func(v *Ingress) metav1.ObjectMetaPtrOutput { return v.Metadata }).(metav1.ObjectMetaPtrOutput) 218 } 219 220 // 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 221 func (o IngressOutput) Spec() IngressSpecPtrOutput { 222 return o.ApplyT(func(v *Ingress) IngressSpecPtrOutput { return v.Spec }).(IngressSpecPtrOutput) 223 } 224 225 // 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 226 func (o IngressOutput) Status() IngressStatusPtrOutput { 227 return o.ApplyT(func(v *Ingress) IngressStatusPtrOutput { return v.Status }).(IngressStatusPtrOutput) 228 } 229 230 type IngressArrayOutput struct{ *pulumi.OutputState } 231 232 func (IngressArrayOutput) ElementType() reflect.Type { 233 return reflect.TypeOf((*[]*Ingress)(nil)).Elem() 234 } 235 236 func (o IngressArrayOutput) ToIngressArrayOutput() IngressArrayOutput { 237 return o 238 } 239 240 func (o IngressArrayOutput) ToIngressArrayOutputWithContext(ctx context.Context) IngressArrayOutput { 241 return o 242 } 243 244 func (o IngressArrayOutput) Index(i pulumi.IntInput) IngressOutput { 245 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Ingress { 246 return vs[0].([]*Ingress)[vs[1].(int)] 247 }).(IngressOutput) 248 } 249 250 type IngressMapOutput struct{ *pulumi.OutputState } 251 252 func (IngressMapOutput) ElementType() reflect.Type { 253 return reflect.TypeOf((*map[string]*Ingress)(nil)).Elem() 254 } 255 256 func (o IngressMapOutput) ToIngressMapOutput() IngressMapOutput { 257 return o 258 } 259 260 func (o IngressMapOutput) ToIngressMapOutputWithContext(ctx context.Context) IngressMapOutput { 261 return o 262 } 263 264 func (o IngressMapOutput) MapIndex(k pulumi.StringInput) IngressOutput { 265 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Ingress { 266 return vs[0].(map[string]*Ingress)[vs[1].(string)] 267 }).(IngressOutput) 268 } 269 270 func init() { 271 pulumi.RegisterInputType(reflect.TypeOf((*IngressInput)(nil)).Elem(), &Ingress{}) 272 pulumi.RegisterInputType(reflect.TypeOf((*IngressArrayInput)(nil)).Elem(), IngressArray{}) 273 pulumi.RegisterInputType(reflect.TypeOf((*IngressMapInput)(nil)).Elem(), IngressMap{}) 274 pulumi.RegisterOutputType(IngressOutput{}) 275 pulumi.RegisterOutputType(IngressArrayOutput{}) 276 pulumi.RegisterOutputType(IngressMapOutput{}) 277 }