github.com/pulumi/pulumi-kubernetes/sdk/v3@v3.30.2/go/kubernetes/extensions/v1beta1/podSecurityPolicy.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 // PodSecurityPolicy governs the ability to make requests that affect the Security Context that will be applied to a pod and container. Deprecated: use PodSecurityPolicy from policy API Group instead. 15 type PodSecurityPolicy struct { 16 pulumi.CustomResourceState 17 18 // 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 19 ApiVersion pulumi.StringPtrOutput `pulumi:"apiVersion"` 20 // 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 21 Kind pulumi.StringPtrOutput `pulumi:"kind"` 22 // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 23 Metadata metav1.ObjectMetaPtrOutput `pulumi:"metadata"` 24 // spec defines the policy enforced. 25 Spec PodSecurityPolicySpecPtrOutput `pulumi:"spec"` 26 } 27 28 // NewPodSecurityPolicy registers a new resource with the given unique name, arguments, and options. 29 func NewPodSecurityPolicy(ctx *pulumi.Context, 30 name string, args *PodSecurityPolicyArgs, opts ...pulumi.ResourceOption) (*PodSecurityPolicy, error) { 31 if args == nil { 32 args = &PodSecurityPolicyArgs{} 33 } 34 35 args.ApiVersion = pulumi.StringPtr("extensions/v1beta1") 36 args.Kind = pulumi.StringPtr("PodSecurityPolicy") 37 aliases := pulumi.Aliases([]pulumi.Alias{ 38 { 39 Type: pulumi.String("kubernetes:policy/v1beta1:PodSecurityPolicy"), 40 }, 41 }) 42 opts = append(opts, aliases) 43 var resource PodSecurityPolicy 44 err := ctx.RegisterResource("kubernetes:extensions/v1beta1:PodSecurityPolicy", name, args, &resource, opts...) 45 if err != nil { 46 return nil, err 47 } 48 return &resource, nil 49 } 50 51 // GetPodSecurityPolicy gets an existing PodSecurityPolicy resource's state with the given name, ID, and optional 52 // state properties that are used to uniquely qualify the lookup (nil if not required). 53 func GetPodSecurityPolicy(ctx *pulumi.Context, 54 name string, id pulumi.IDInput, state *PodSecurityPolicyState, opts ...pulumi.ResourceOption) (*PodSecurityPolicy, error) { 55 var resource PodSecurityPolicy 56 err := ctx.ReadResource("kubernetes:extensions/v1beta1:PodSecurityPolicy", name, id, state, &resource, opts...) 57 if err != nil { 58 return nil, err 59 } 60 return &resource, nil 61 } 62 63 // Input properties used for looking up and filtering PodSecurityPolicy resources. 64 type podSecurityPolicyState struct { 65 } 66 67 type PodSecurityPolicyState struct { 68 } 69 70 func (PodSecurityPolicyState) ElementType() reflect.Type { 71 return reflect.TypeOf((*podSecurityPolicyState)(nil)).Elem() 72 } 73 74 type podSecurityPolicyArgs struct { 75 // 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 76 ApiVersion *string `pulumi:"apiVersion"` 77 // 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 78 Kind *string `pulumi:"kind"` 79 // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 80 Metadata *metav1.ObjectMeta `pulumi:"metadata"` 81 // spec defines the policy enforced. 82 Spec *PodSecurityPolicySpec `pulumi:"spec"` 83 } 84 85 // The set of arguments for constructing a PodSecurityPolicy resource. 86 type PodSecurityPolicyArgs struct { 87 // 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 88 ApiVersion pulumi.StringPtrInput 89 // 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 90 Kind pulumi.StringPtrInput 91 // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 92 Metadata metav1.ObjectMetaPtrInput 93 // spec defines the policy enforced. 94 Spec PodSecurityPolicySpecPtrInput 95 } 96 97 func (PodSecurityPolicyArgs) ElementType() reflect.Type { 98 return reflect.TypeOf((*podSecurityPolicyArgs)(nil)).Elem() 99 } 100 101 type PodSecurityPolicyInput interface { 102 pulumi.Input 103 104 ToPodSecurityPolicyOutput() PodSecurityPolicyOutput 105 ToPodSecurityPolicyOutputWithContext(ctx context.Context) PodSecurityPolicyOutput 106 } 107 108 func (*PodSecurityPolicy) ElementType() reflect.Type { 109 return reflect.TypeOf((**PodSecurityPolicy)(nil)).Elem() 110 } 111 112 func (i *PodSecurityPolicy) ToPodSecurityPolicyOutput() PodSecurityPolicyOutput { 113 return i.ToPodSecurityPolicyOutputWithContext(context.Background()) 114 } 115 116 func (i *PodSecurityPolicy) ToPodSecurityPolicyOutputWithContext(ctx context.Context) PodSecurityPolicyOutput { 117 return pulumi.ToOutputWithContext(ctx, i).(PodSecurityPolicyOutput) 118 } 119 120 // PodSecurityPolicyArrayInput is an input type that accepts PodSecurityPolicyArray and PodSecurityPolicyArrayOutput values. 121 // You can construct a concrete instance of `PodSecurityPolicyArrayInput` via: 122 // 123 // PodSecurityPolicyArray{ PodSecurityPolicyArgs{...} } 124 type PodSecurityPolicyArrayInput interface { 125 pulumi.Input 126 127 ToPodSecurityPolicyArrayOutput() PodSecurityPolicyArrayOutput 128 ToPodSecurityPolicyArrayOutputWithContext(context.Context) PodSecurityPolicyArrayOutput 129 } 130 131 type PodSecurityPolicyArray []PodSecurityPolicyInput 132 133 func (PodSecurityPolicyArray) ElementType() reflect.Type { 134 return reflect.TypeOf((*[]*PodSecurityPolicy)(nil)).Elem() 135 } 136 137 func (i PodSecurityPolicyArray) ToPodSecurityPolicyArrayOutput() PodSecurityPolicyArrayOutput { 138 return i.ToPodSecurityPolicyArrayOutputWithContext(context.Background()) 139 } 140 141 func (i PodSecurityPolicyArray) ToPodSecurityPolicyArrayOutputWithContext(ctx context.Context) PodSecurityPolicyArrayOutput { 142 return pulumi.ToOutputWithContext(ctx, i).(PodSecurityPolicyArrayOutput) 143 } 144 145 // PodSecurityPolicyMapInput is an input type that accepts PodSecurityPolicyMap and PodSecurityPolicyMapOutput values. 146 // You can construct a concrete instance of `PodSecurityPolicyMapInput` via: 147 // 148 // PodSecurityPolicyMap{ "key": PodSecurityPolicyArgs{...} } 149 type PodSecurityPolicyMapInput interface { 150 pulumi.Input 151 152 ToPodSecurityPolicyMapOutput() PodSecurityPolicyMapOutput 153 ToPodSecurityPolicyMapOutputWithContext(context.Context) PodSecurityPolicyMapOutput 154 } 155 156 type PodSecurityPolicyMap map[string]PodSecurityPolicyInput 157 158 func (PodSecurityPolicyMap) ElementType() reflect.Type { 159 return reflect.TypeOf((*map[string]*PodSecurityPolicy)(nil)).Elem() 160 } 161 162 func (i PodSecurityPolicyMap) ToPodSecurityPolicyMapOutput() PodSecurityPolicyMapOutput { 163 return i.ToPodSecurityPolicyMapOutputWithContext(context.Background()) 164 } 165 166 func (i PodSecurityPolicyMap) ToPodSecurityPolicyMapOutputWithContext(ctx context.Context) PodSecurityPolicyMapOutput { 167 return pulumi.ToOutputWithContext(ctx, i).(PodSecurityPolicyMapOutput) 168 } 169 170 type PodSecurityPolicyOutput struct{ *pulumi.OutputState } 171 172 func (PodSecurityPolicyOutput) ElementType() reflect.Type { 173 return reflect.TypeOf((**PodSecurityPolicy)(nil)).Elem() 174 } 175 176 func (o PodSecurityPolicyOutput) ToPodSecurityPolicyOutput() PodSecurityPolicyOutput { 177 return o 178 } 179 180 func (o PodSecurityPolicyOutput) ToPodSecurityPolicyOutputWithContext(ctx context.Context) PodSecurityPolicyOutput { 181 return o 182 } 183 184 // 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 185 func (o PodSecurityPolicyOutput) ApiVersion() pulumi.StringPtrOutput { 186 return o.ApplyT(func(v *PodSecurityPolicy) pulumi.StringPtrOutput { return v.ApiVersion }).(pulumi.StringPtrOutput) 187 } 188 189 // 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 190 func (o PodSecurityPolicyOutput) Kind() pulumi.StringPtrOutput { 191 return o.ApplyT(func(v *PodSecurityPolicy) pulumi.StringPtrOutput { return v.Kind }).(pulumi.StringPtrOutput) 192 } 193 194 // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 195 func (o PodSecurityPolicyOutput) Metadata() metav1.ObjectMetaPtrOutput { 196 return o.ApplyT(func(v *PodSecurityPolicy) metav1.ObjectMetaPtrOutput { return v.Metadata }).(metav1.ObjectMetaPtrOutput) 197 } 198 199 // spec defines the policy enforced. 200 func (o PodSecurityPolicyOutput) Spec() PodSecurityPolicySpecPtrOutput { 201 return o.ApplyT(func(v *PodSecurityPolicy) PodSecurityPolicySpecPtrOutput { return v.Spec }).(PodSecurityPolicySpecPtrOutput) 202 } 203 204 type PodSecurityPolicyArrayOutput struct{ *pulumi.OutputState } 205 206 func (PodSecurityPolicyArrayOutput) ElementType() reflect.Type { 207 return reflect.TypeOf((*[]*PodSecurityPolicy)(nil)).Elem() 208 } 209 210 func (o PodSecurityPolicyArrayOutput) ToPodSecurityPolicyArrayOutput() PodSecurityPolicyArrayOutput { 211 return o 212 } 213 214 func (o PodSecurityPolicyArrayOutput) ToPodSecurityPolicyArrayOutputWithContext(ctx context.Context) PodSecurityPolicyArrayOutput { 215 return o 216 } 217 218 func (o PodSecurityPolicyArrayOutput) Index(i pulumi.IntInput) PodSecurityPolicyOutput { 219 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *PodSecurityPolicy { 220 return vs[0].([]*PodSecurityPolicy)[vs[1].(int)] 221 }).(PodSecurityPolicyOutput) 222 } 223 224 type PodSecurityPolicyMapOutput struct{ *pulumi.OutputState } 225 226 func (PodSecurityPolicyMapOutput) ElementType() reflect.Type { 227 return reflect.TypeOf((*map[string]*PodSecurityPolicy)(nil)).Elem() 228 } 229 230 func (o PodSecurityPolicyMapOutput) ToPodSecurityPolicyMapOutput() PodSecurityPolicyMapOutput { 231 return o 232 } 233 234 func (o PodSecurityPolicyMapOutput) ToPodSecurityPolicyMapOutputWithContext(ctx context.Context) PodSecurityPolicyMapOutput { 235 return o 236 } 237 238 func (o PodSecurityPolicyMapOutput) MapIndex(k pulumi.StringInput) PodSecurityPolicyOutput { 239 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *PodSecurityPolicy { 240 return vs[0].(map[string]*PodSecurityPolicy)[vs[1].(string)] 241 }).(PodSecurityPolicyOutput) 242 } 243 244 func init() { 245 pulumi.RegisterInputType(reflect.TypeOf((*PodSecurityPolicyInput)(nil)).Elem(), &PodSecurityPolicy{}) 246 pulumi.RegisterInputType(reflect.TypeOf((*PodSecurityPolicyArrayInput)(nil)).Elem(), PodSecurityPolicyArray{}) 247 pulumi.RegisterInputType(reflect.TypeOf((*PodSecurityPolicyMapInput)(nil)).Elem(), PodSecurityPolicyMap{}) 248 pulumi.RegisterOutputType(PodSecurityPolicyOutput{}) 249 pulumi.RegisterOutputType(PodSecurityPolicyArrayOutput{}) 250 pulumi.RegisterOutputType(PodSecurityPolicyMapOutput{}) 251 }