github.com/pulumi/pulumi-kubernetes/sdk/v3@v3.30.2/go/kubernetes/networking/v1beta1/ingressPatch.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  // Patch resources are used to modify existing Kubernetes resources by using
    15  // Server-Side Apply updates. The name of the resource must be specified, but all other properties are optional. More than
    16  // one patch may be applied to the same resource, and a random FieldManager name will be used for each Patch resource.
    17  // Conflicts will result in an error by default, but can be forced using the "pulumi.com/patchForce" annotation. See the
    18  // [Server-Side Apply Docs](https://www.pulumi.com/registry/packages/kubernetes/how-to-guides/managing-resources-with-server-side-apply/) for
    19  // additional information about using Server-Side Apply to manage Kubernetes resources with Pulumi.
    20  // 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.
    21  //
    22  // This resource waits until its status is ready before registering success
    23  // for create/update, and populating output properties from the current state of the resource.
    24  // The following conditions are used to determine whether the resource creation has
    25  // succeeded or failed:
    26  //
    27  //  1. Ingress object exists.
    28  //  2. Endpoint objects exist with matching names for each Ingress path (except when Service
    29  //     type is ExternalName).
    30  //  3. Ingress entry exists for '.status.loadBalancer.ingress'.
    31  //
    32  // If the Ingress has not reached a Ready state after 10 minutes, it will
    33  // time out and mark the resource update as Failed. You can override the default timeout value
    34  // by setting the 'customTimeouts' option on the resource.
    35  type IngressPatch struct {
    36  	pulumi.CustomResourceState
    37  
    38  	// 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
    39  	ApiVersion pulumi.StringPtrOutput `pulumi:"apiVersion"`
    40  	// 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
    41  	Kind pulumi.StringPtrOutput `pulumi:"kind"`
    42  	// Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
    43  	Metadata metav1.ObjectMetaPatchPtrOutput `pulumi:"metadata"`
    44  	// 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
    45  	Spec IngressSpecPatchPtrOutput `pulumi:"spec"`
    46  	// 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
    47  	Status IngressStatusPatchPtrOutput `pulumi:"status"`
    48  }
    49  
    50  // NewIngressPatch registers a new resource with the given unique name, arguments, and options.
    51  func NewIngressPatch(ctx *pulumi.Context,
    52  	name string, args *IngressPatchArgs, opts ...pulumi.ResourceOption) (*IngressPatch, error) {
    53  	if args == nil {
    54  		args = &IngressPatchArgs{}
    55  	}
    56  
    57  	args.ApiVersion = pulumi.StringPtr("networking.k8s.io/v1beta1")
    58  	args.Kind = pulumi.StringPtr("Ingress")
    59  	aliases := pulumi.Aliases([]pulumi.Alias{
    60  		{
    61  			Type: pulumi.String("kubernetes:extensions/v1beta1:IngressPatch"),
    62  		},
    63  		{
    64  			Type: pulumi.String("kubernetes:networking.k8s.io/v1:IngressPatch"),
    65  		},
    66  	})
    67  	opts = append(opts, aliases)
    68  	var resource IngressPatch
    69  	err := ctx.RegisterResource("kubernetes:networking.k8s.io/v1beta1:IngressPatch", name, args, &resource, opts...)
    70  	if err != nil {
    71  		return nil, err
    72  	}
    73  	return &resource, nil
    74  }
    75  
    76  // GetIngressPatch gets an existing IngressPatch resource's state with the given name, ID, and optional
    77  // state properties that are used to uniquely qualify the lookup (nil if not required).
    78  func GetIngressPatch(ctx *pulumi.Context,
    79  	name string, id pulumi.IDInput, state *IngressPatchState, opts ...pulumi.ResourceOption) (*IngressPatch, error) {
    80  	var resource IngressPatch
    81  	err := ctx.ReadResource("kubernetes:networking.k8s.io/v1beta1:IngressPatch", name, id, state, &resource, opts...)
    82  	if err != nil {
    83  		return nil, err
    84  	}
    85  	return &resource, nil
    86  }
    87  
    88  // Input properties used for looking up and filtering IngressPatch resources.
    89  type ingressPatchState struct {
    90  }
    91  
    92  type IngressPatchState struct {
    93  }
    94  
    95  func (IngressPatchState) ElementType() reflect.Type {
    96  	return reflect.TypeOf((*ingressPatchState)(nil)).Elem()
    97  }
    98  
    99  type ingressPatchArgs struct {
   100  	// 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
   101  	ApiVersion *string `pulumi:"apiVersion"`
   102  	// 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
   103  	Kind *string `pulumi:"kind"`
   104  	// Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
   105  	Metadata *metav1.ObjectMetaPatch `pulumi:"metadata"`
   106  	// 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
   107  	Spec *IngressSpecPatch `pulumi:"spec"`
   108  }
   109  
   110  // The set of arguments for constructing a IngressPatch resource.
   111  type IngressPatchArgs struct {
   112  	// 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
   113  	ApiVersion pulumi.StringPtrInput
   114  	// 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
   115  	Kind pulumi.StringPtrInput
   116  	// Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
   117  	Metadata metav1.ObjectMetaPatchPtrInput
   118  	// 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
   119  	Spec IngressSpecPatchPtrInput
   120  }
   121  
   122  func (IngressPatchArgs) ElementType() reflect.Type {
   123  	return reflect.TypeOf((*ingressPatchArgs)(nil)).Elem()
   124  }
   125  
   126  type IngressPatchInput interface {
   127  	pulumi.Input
   128  
   129  	ToIngressPatchOutput() IngressPatchOutput
   130  	ToIngressPatchOutputWithContext(ctx context.Context) IngressPatchOutput
   131  }
   132  
   133  func (*IngressPatch) ElementType() reflect.Type {
   134  	return reflect.TypeOf((**IngressPatch)(nil)).Elem()
   135  }
   136  
   137  func (i *IngressPatch) ToIngressPatchOutput() IngressPatchOutput {
   138  	return i.ToIngressPatchOutputWithContext(context.Background())
   139  }
   140  
   141  func (i *IngressPatch) ToIngressPatchOutputWithContext(ctx context.Context) IngressPatchOutput {
   142  	return pulumi.ToOutputWithContext(ctx, i).(IngressPatchOutput)
   143  }
   144  
   145  // IngressPatchArrayInput is an input type that accepts IngressPatchArray and IngressPatchArrayOutput values.
   146  // You can construct a concrete instance of `IngressPatchArrayInput` via:
   147  //
   148  //	IngressPatchArray{ IngressPatchArgs{...} }
   149  type IngressPatchArrayInput interface {
   150  	pulumi.Input
   151  
   152  	ToIngressPatchArrayOutput() IngressPatchArrayOutput
   153  	ToIngressPatchArrayOutputWithContext(context.Context) IngressPatchArrayOutput
   154  }
   155  
   156  type IngressPatchArray []IngressPatchInput
   157  
   158  func (IngressPatchArray) ElementType() reflect.Type {
   159  	return reflect.TypeOf((*[]*IngressPatch)(nil)).Elem()
   160  }
   161  
   162  func (i IngressPatchArray) ToIngressPatchArrayOutput() IngressPatchArrayOutput {
   163  	return i.ToIngressPatchArrayOutputWithContext(context.Background())
   164  }
   165  
   166  func (i IngressPatchArray) ToIngressPatchArrayOutputWithContext(ctx context.Context) IngressPatchArrayOutput {
   167  	return pulumi.ToOutputWithContext(ctx, i).(IngressPatchArrayOutput)
   168  }
   169  
   170  // IngressPatchMapInput is an input type that accepts IngressPatchMap and IngressPatchMapOutput values.
   171  // You can construct a concrete instance of `IngressPatchMapInput` via:
   172  //
   173  //	IngressPatchMap{ "key": IngressPatchArgs{...} }
   174  type IngressPatchMapInput interface {
   175  	pulumi.Input
   176  
   177  	ToIngressPatchMapOutput() IngressPatchMapOutput
   178  	ToIngressPatchMapOutputWithContext(context.Context) IngressPatchMapOutput
   179  }
   180  
   181  type IngressPatchMap map[string]IngressPatchInput
   182  
   183  func (IngressPatchMap) ElementType() reflect.Type {
   184  	return reflect.TypeOf((*map[string]*IngressPatch)(nil)).Elem()
   185  }
   186  
   187  func (i IngressPatchMap) ToIngressPatchMapOutput() IngressPatchMapOutput {
   188  	return i.ToIngressPatchMapOutputWithContext(context.Background())
   189  }
   190  
   191  func (i IngressPatchMap) ToIngressPatchMapOutputWithContext(ctx context.Context) IngressPatchMapOutput {
   192  	return pulumi.ToOutputWithContext(ctx, i).(IngressPatchMapOutput)
   193  }
   194  
   195  type IngressPatchOutput struct{ *pulumi.OutputState }
   196  
   197  func (IngressPatchOutput) ElementType() reflect.Type {
   198  	return reflect.TypeOf((**IngressPatch)(nil)).Elem()
   199  }
   200  
   201  func (o IngressPatchOutput) ToIngressPatchOutput() IngressPatchOutput {
   202  	return o
   203  }
   204  
   205  func (o IngressPatchOutput) ToIngressPatchOutputWithContext(ctx context.Context) IngressPatchOutput {
   206  	return o
   207  }
   208  
   209  // 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
   210  func (o IngressPatchOutput) ApiVersion() pulumi.StringPtrOutput {
   211  	return o.ApplyT(func(v *IngressPatch) pulumi.StringPtrOutput { return v.ApiVersion }).(pulumi.StringPtrOutput)
   212  }
   213  
   214  // 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
   215  func (o IngressPatchOutput) Kind() pulumi.StringPtrOutput {
   216  	return o.ApplyT(func(v *IngressPatch) pulumi.StringPtrOutput { return v.Kind }).(pulumi.StringPtrOutput)
   217  }
   218  
   219  // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
   220  func (o IngressPatchOutput) Metadata() metav1.ObjectMetaPatchPtrOutput {
   221  	return o.ApplyT(func(v *IngressPatch) metav1.ObjectMetaPatchPtrOutput { return v.Metadata }).(metav1.ObjectMetaPatchPtrOutput)
   222  }
   223  
   224  // 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
   225  func (o IngressPatchOutput) Spec() IngressSpecPatchPtrOutput {
   226  	return o.ApplyT(func(v *IngressPatch) IngressSpecPatchPtrOutput { return v.Spec }).(IngressSpecPatchPtrOutput)
   227  }
   228  
   229  // 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
   230  func (o IngressPatchOutput) Status() IngressStatusPatchPtrOutput {
   231  	return o.ApplyT(func(v *IngressPatch) IngressStatusPatchPtrOutput { return v.Status }).(IngressStatusPatchPtrOutput)
   232  }
   233  
   234  type IngressPatchArrayOutput struct{ *pulumi.OutputState }
   235  
   236  func (IngressPatchArrayOutput) ElementType() reflect.Type {
   237  	return reflect.TypeOf((*[]*IngressPatch)(nil)).Elem()
   238  }
   239  
   240  func (o IngressPatchArrayOutput) ToIngressPatchArrayOutput() IngressPatchArrayOutput {
   241  	return o
   242  }
   243  
   244  func (o IngressPatchArrayOutput) ToIngressPatchArrayOutputWithContext(ctx context.Context) IngressPatchArrayOutput {
   245  	return o
   246  }
   247  
   248  func (o IngressPatchArrayOutput) Index(i pulumi.IntInput) IngressPatchOutput {
   249  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *IngressPatch {
   250  		return vs[0].([]*IngressPatch)[vs[1].(int)]
   251  	}).(IngressPatchOutput)
   252  }
   253  
   254  type IngressPatchMapOutput struct{ *pulumi.OutputState }
   255  
   256  func (IngressPatchMapOutput) ElementType() reflect.Type {
   257  	return reflect.TypeOf((*map[string]*IngressPatch)(nil)).Elem()
   258  }
   259  
   260  func (o IngressPatchMapOutput) ToIngressPatchMapOutput() IngressPatchMapOutput {
   261  	return o
   262  }
   263  
   264  func (o IngressPatchMapOutput) ToIngressPatchMapOutputWithContext(ctx context.Context) IngressPatchMapOutput {
   265  	return o
   266  }
   267  
   268  func (o IngressPatchMapOutput) MapIndex(k pulumi.StringInput) IngressPatchOutput {
   269  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *IngressPatch {
   270  		return vs[0].(map[string]*IngressPatch)[vs[1].(string)]
   271  	}).(IngressPatchOutput)
   272  }
   273  
   274  func init() {
   275  	pulumi.RegisterInputType(reflect.TypeOf((*IngressPatchInput)(nil)).Elem(), &IngressPatch{})
   276  	pulumi.RegisterInputType(reflect.TypeOf((*IngressPatchArrayInput)(nil)).Elem(), IngressPatchArray{})
   277  	pulumi.RegisterInputType(reflect.TypeOf((*IngressPatchMapInput)(nil)).Elem(), IngressPatchMap{})
   278  	pulumi.RegisterOutputType(IngressPatchOutput{})
   279  	pulumi.RegisterOutputType(IngressPatchArrayOutput{})
   280  	pulumi.RegisterOutputType(IngressPatchMapOutput{})
   281  }