github.com/pulumi/pulumi-kubernetes/sdk/v3@v3.30.2/go/kubernetes/core/v1/secretPatch.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 v1
     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  // Secret holds secret data of a certain type. The total bytes of the values in the Data field must be less than MaxSecretSize bytes.
    21  //
    22  // Note: While Pulumi automatically encrypts the 'data' and 'stringData'
    23  // fields, this encryption only applies to Pulumi's context, including the state file,
    24  // the Service, the CLI, etc. Kubernetes does not encrypt Secret resources by default,
    25  // and the contents are visible to users with access to the Secret in Kubernetes using
    26  // tools like 'kubectl'.
    27  //
    28  // For more information on securing Kubernetes Secrets, see the following links:
    29  // https://kubernetes.io/docs/concepts/configuration/secret/#security-properties
    30  // https://kubernetes.io/docs/concepts/configuration/secret/#risks
    31  type SecretPatch 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  	// Data contains the secret data. Each key must consist of alphanumeric characters, '-', '_' or '.'. The serialized form of the secret data is a base64 encoded string, representing the arbitrary (possibly non-string) data value here. Described in https://tools.ietf.org/html/rfc4648#section-4
    37  	Data pulumi.StringMapOutput `pulumi:"data"`
    38  	// Immutable, if set to true, ensures that data stored in the Secret cannot be updated (only object metadata can be modified). If not set to true, the field can be modified at any time. Defaulted to nil.
    39  	Immutable pulumi.BoolPtrOutput `pulumi:"immutable"`
    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  	// stringData allows specifying non-binary secret data in string form. It is provided as a write-only input field for convenience. All keys and values are merged into the data field on write, overwriting any existing values. The stringData field is never output when reading from the API.
    45  	StringData pulumi.StringMapOutput `pulumi:"stringData"`
    46  	// Used to facilitate programmatic handling of secret data. More info: https://kubernetes.io/docs/concepts/configuration/secret/#secret-types
    47  	Type pulumi.StringPtrOutput `pulumi:"type"`
    48  }
    49  
    50  // NewSecretPatch registers a new resource with the given unique name, arguments, and options.
    51  func NewSecretPatch(ctx *pulumi.Context,
    52  	name string, args *SecretPatchArgs, opts ...pulumi.ResourceOption) (*SecretPatch, error) {
    53  	if args == nil {
    54  		args = &SecretPatchArgs{}
    55  	}
    56  
    57  	args.ApiVersion = pulumi.StringPtr("v1")
    58  	args.Kind = pulumi.StringPtr("Secret")
    59  	var resource SecretPatch
    60  	err := ctx.RegisterResource("kubernetes:core/v1:SecretPatch", name, args, &resource, opts...)
    61  	if err != nil {
    62  		return nil, err
    63  	}
    64  	return &resource, nil
    65  }
    66  
    67  // GetSecretPatch gets an existing SecretPatch resource's state with the given name, ID, and optional
    68  // state properties that are used to uniquely qualify the lookup (nil if not required).
    69  func GetSecretPatch(ctx *pulumi.Context,
    70  	name string, id pulumi.IDInput, state *SecretPatchState, opts ...pulumi.ResourceOption) (*SecretPatch, error) {
    71  	var resource SecretPatch
    72  	err := ctx.ReadResource("kubernetes:core/v1:SecretPatch", name, id, state, &resource, opts...)
    73  	if err != nil {
    74  		return nil, err
    75  	}
    76  	return &resource, nil
    77  }
    78  
    79  // Input properties used for looking up and filtering SecretPatch resources.
    80  type secretPatchState struct {
    81  }
    82  
    83  type SecretPatchState struct {
    84  }
    85  
    86  func (SecretPatchState) ElementType() reflect.Type {
    87  	return reflect.TypeOf((*secretPatchState)(nil)).Elem()
    88  }
    89  
    90  type secretPatchArgs struct {
    91  	// 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
    92  	ApiVersion *string `pulumi:"apiVersion"`
    93  	// Data contains the secret data. Each key must consist of alphanumeric characters, '-', '_' or '.'. The serialized form of the secret data is a base64 encoded string, representing the arbitrary (possibly non-string) data value here. Described in https://tools.ietf.org/html/rfc4648#section-4
    94  	Data map[string]string `pulumi:"data"`
    95  	// Immutable, if set to true, ensures that data stored in the Secret cannot be updated (only object metadata can be modified). If not set to true, the field can be modified at any time. Defaulted to nil.
    96  	Immutable *bool `pulumi:"immutable"`
    97  	// 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
    98  	Kind *string `pulumi:"kind"`
    99  	// Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
   100  	Metadata *metav1.ObjectMetaPatch `pulumi:"metadata"`
   101  	// stringData allows specifying non-binary secret data in string form. It is provided as a write-only input field for convenience. All keys and values are merged into the data field on write, overwriting any existing values. The stringData field is never output when reading from the API.
   102  	StringData map[string]string `pulumi:"stringData"`
   103  	// Used to facilitate programmatic handling of secret data. More info: https://kubernetes.io/docs/concepts/configuration/secret/#secret-types
   104  	Type *string `pulumi:"type"`
   105  }
   106  
   107  // The set of arguments for constructing a SecretPatch resource.
   108  type SecretPatchArgs struct {
   109  	// 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
   110  	ApiVersion pulumi.StringPtrInput
   111  	// Data contains the secret data. Each key must consist of alphanumeric characters, '-', '_' or '.'. The serialized form of the secret data is a base64 encoded string, representing the arbitrary (possibly non-string) data value here. Described in https://tools.ietf.org/html/rfc4648#section-4
   112  	Data pulumi.StringMapInput
   113  	// Immutable, if set to true, ensures that data stored in the Secret cannot be updated (only object metadata can be modified). If not set to true, the field can be modified at any time. Defaulted to nil.
   114  	Immutable pulumi.BoolPtrInput
   115  	// 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
   116  	Kind pulumi.StringPtrInput
   117  	// Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
   118  	Metadata metav1.ObjectMetaPatchPtrInput
   119  	// stringData allows specifying non-binary secret data in string form. It is provided as a write-only input field for convenience. All keys and values are merged into the data field on write, overwriting any existing values. The stringData field is never output when reading from the API.
   120  	StringData pulumi.StringMapInput
   121  	// Used to facilitate programmatic handling of secret data. More info: https://kubernetes.io/docs/concepts/configuration/secret/#secret-types
   122  	Type pulumi.StringPtrInput
   123  }
   124  
   125  func (SecretPatchArgs) ElementType() reflect.Type {
   126  	return reflect.TypeOf((*secretPatchArgs)(nil)).Elem()
   127  }
   128  
   129  type SecretPatchInput interface {
   130  	pulumi.Input
   131  
   132  	ToSecretPatchOutput() SecretPatchOutput
   133  	ToSecretPatchOutputWithContext(ctx context.Context) SecretPatchOutput
   134  }
   135  
   136  func (*SecretPatch) ElementType() reflect.Type {
   137  	return reflect.TypeOf((**SecretPatch)(nil)).Elem()
   138  }
   139  
   140  func (i *SecretPatch) ToSecretPatchOutput() SecretPatchOutput {
   141  	return i.ToSecretPatchOutputWithContext(context.Background())
   142  }
   143  
   144  func (i *SecretPatch) ToSecretPatchOutputWithContext(ctx context.Context) SecretPatchOutput {
   145  	return pulumi.ToOutputWithContext(ctx, i).(SecretPatchOutput)
   146  }
   147  
   148  // SecretPatchArrayInput is an input type that accepts SecretPatchArray and SecretPatchArrayOutput values.
   149  // You can construct a concrete instance of `SecretPatchArrayInput` via:
   150  //
   151  //	SecretPatchArray{ SecretPatchArgs{...} }
   152  type SecretPatchArrayInput interface {
   153  	pulumi.Input
   154  
   155  	ToSecretPatchArrayOutput() SecretPatchArrayOutput
   156  	ToSecretPatchArrayOutputWithContext(context.Context) SecretPatchArrayOutput
   157  }
   158  
   159  type SecretPatchArray []SecretPatchInput
   160  
   161  func (SecretPatchArray) ElementType() reflect.Type {
   162  	return reflect.TypeOf((*[]*SecretPatch)(nil)).Elem()
   163  }
   164  
   165  func (i SecretPatchArray) ToSecretPatchArrayOutput() SecretPatchArrayOutput {
   166  	return i.ToSecretPatchArrayOutputWithContext(context.Background())
   167  }
   168  
   169  func (i SecretPatchArray) ToSecretPatchArrayOutputWithContext(ctx context.Context) SecretPatchArrayOutput {
   170  	return pulumi.ToOutputWithContext(ctx, i).(SecretPatchArrayOutput)
   171  }
   172  
   173  // SecretPatchMapInput is an input type that accepts SecretPatchMap and SecretPatchMapOutput values.
   174  // You can construct a concrete instance of `SecretPatchMapInput` via:
   175  //
   176  //	SecretPatchMap{ "key": SecretPatchArgs{...} }
   177  type SecretPatchMapInput interface {
   178  	pulumi.Input
   179  
   180  	ToSecretPatchMapOutput() SecretPatchMapOutput
   181  	ToSecretPatchMapOutputWithContext(context.Context) SecretPatchMapOutput
   182  }
   183  
   184  type SecretPatchMap map[string]SecretPatchInput
   185  
   186  func (SecretPatchMap) ElementType() reflect.Type {
   187  	return reflect.TypeOf((*map[string]*SecretPatch)(nil)).Elem()
   188  }
   189  
   190  func (i SecretPatchMap) ToSecretPatchMapOutput() SecretPatchMapOutput {
   191  	return i.ToSecretPatchMapOutputWithContext(context.Background())
   192  }
   193  
   194  func (i SecretPatchMap) ToSecretPatchMapOutputWithContext(ctx context.Context) SecretPatchMapOutput {
   195  	return pulumi.ToOutputWithContext(ctx, i).(SecretPatchMapOutput)
   196  }
   197  
   198  type SecretPatchOutput struct{ *pulumi.OutputState }
   199  
   200  func (SecretPatchOutput) ElementType() reflect.Type {
   201  	return reflect.TypeOf((**SecretPatch)(nil)).Elem()
   202  }
   203  
   204  func (o SecretPatchOutput) ToSecretPatchOutput() SecretPatchOutput {
   205  	return o
   206  }
   207  
   208  func (o SecretPatchOutput) ToSecretPatchOutputWithContext(ctx context.Context) SecretPatchOutput {
   209  	return o
   210  }
   211  
   212  // 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
   213  func (o SecretPatchOutput) ApiVersion() pulumi.StringPtrOutput {
   214  	return o.ApplyT(func(v *SecretPatch) pulumi.StringPtrOutput { return v.ApiVersion }).(pulumi.StringPtrOutput)
   215  }
   216  
   217  // Data contains the secret data. Each key must consist of alphanumeric characters, '-', '_' or '.'. The serialized form of the secret data is a base64 encoded string, representing the arbitrary (possibly non-string) data value here. Described in https://tools.ietf.org/html/rfc4648#section-4
   218  func (o SecretPatchOutput) Data() pulumi.StringMapOutput {
   219  	return o.ApplyT(func(v *SecretPatch) pulumi.StringMapOutput { return v.Data }).(pulumi.StringMapOutput)
   220  }
   221  
   222  // Immutable, if set to true, ensures that data stored in the Secret cannot be updated (only object metadata can be modified). If not set to true, the field can be modified at any time. Defaulted to nil.
   223  func (o SecretPatchOutput) Immutable() pulumi.BoolPtrOutput {
   224  	return o.ApplyT(func(v *SecretPatch) pulumi.BoolPtrOutput { return v.Immutable }).(pulumi.BoolPtrOutput)
   225  }
   226  
   227  // 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
   228  func (o SecretPatchOutput) Kind() pulumi.StringPtrOutput {
   229  	return o.ApplyT(func(v *SecretPatch) pulumi.StringPtrOutput { return v.Kind }).(pulumi.StringPtrOutput)
   230  }
   231  
   232  // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
   233  func (o SecretPatchOutput) Metadata() metav1.ObjectMetaPatchPtrOutput {
   234  	return o.ApplyT(func(v *SecretPatch) metav1.ObjectMetaPatchPtrOutput { return v.Metadata }).(metav1.ObjectMetaPatchPtrOutput)
   235  }
   236  
   237  // stringData allows specifying non-binary secret data in string form. It is provided as a write-only input field for convenience. All keys and values are merged into the data field on write, overwriting any existing values. The stringData field is never output when reading from the API.
   238  func (o SecretPatchOutput) StringData() pulumi.StringMapOutput {
   239  	return o.ApplyT(func(v *SecretPatch) pulumi.StringMapOutput { return v.StringData }).(pulumi.StringMapOutput)
   240  }
   241  
   242  // Used to facilitate programmatic handling of secret data. More info: https://kubernetes.io/docs/concepts/configuration/secret/#secret-types
   243  func (o SecretPatchOutput) Type() pulumi.StringPtrOutput {
   244  	return o.ApplyT(func(v *SecretPatch) pulumi.StringPtrOutput { return v.Type }).(pulumi.StringPtrOutput)
   245  }
   246  
   247  type SecretPatchArrayOutput struct{ *pulumi.OutputState }
   248  
   249  func (SecretPatchArrayOutput) ElementType() reflect.Type {
   250  	return reflect.TypeOf((*[]*SecretPatch)(nil)).Elem()
   251  }
   252  
   253  func (o SecretPatchArrayOutput) ToSecretPatchArrayOutput() SecretPatchArrayOutput {
   254  	return o
   255  }
   256  
   257  func (o SecretPatchArrayOutput) ToSecretPatchArrayOutputWithContext(ctx context.Context) SecretPatchArrayOutput {
   258  	return o
   259  }
   260  
   261  func (o SecretPatchArrayOutput) Index(i pulumi.IntInput) SecretPatchOutput {
   262  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *SecretPatch {
   263  		return vs[0].([]*SecretPatch)[vs[1].(int)]
   264  	}).(SecretPatchOutput)
   265  }
   266  
   267  type SecretPatchMapOutput struct{ *pulumi.OutputState }
   268  
   269  func (SecretPatchMapOutput) ElementType() reflect.Type {
   270  	return reflect.TypeOf((*map[string]*SecretPatch)(nil)).Elem()
   271  }
   272  
   273  func (o SecretPatchMapOutput) ToSecretPatchMapOutput() SecretPatchMapOutput {
   274  	return o
   275  }
   276  
   277  func (o SecretPatchMapOutput) ToSecretPatchMapOutputWithContext(ctx context.Context) SecretPatchMapOutput {
   278  	return o
   279  }
   280  
   281  func (o SecretPatchMapOutput) MapIndex(k pulumi.StringInput) SecretPatchOutput {
   282  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *SecretPatch {
   283  		return vs[0].(map[string]*SecretPatch)[vs[1].(string)]
   284  	}).(SecretPatchOutput)
   285  }
   286  
   287  func init() {
   288  	pulumi.RegisterInputType(reflect.TypeOf((*SecretPatchInput)(nil)).Elem(), &SecretPatch{})
   289  	pulumi.RegisterInputType(reflect.TypeOf((*SecretPatchArrayInput)(nil)).Elem(), SecretPatchArray{})
   290  	pulumi.RegisterInputType(reflect.TypeOf((*SecretPatchMapInput)(nil)).Elem(), SecretPatchMap{})
   291  	pulumi.RegisterOutputType(SecretPatchOutput{})
   292  	pulumi.RegisterOutputType(SecretPatchArrayOutput{})
   293  	pulumi.RegisterOutputType(SecretPatchMapOutput{})
   294  }