github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/cloudfront/fieldLevelEncryptionConfig.go (about) 1 // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. 2 // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** 3 4 package cloudfront 5 6 import ( 7 "context" 8 "reflect" 9 10 "errors" 11 "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" 12 "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 13 ) 14 15 // Provides a CloudFront Field-level Encryption Config resource. 16 // 17 // ## Example Usage 18 // 19 // <!--Start PulumiCodeChooser --> 20 // ```go 21 // package main 22 // 23 // import ( 24 // 25 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/cloudfront" 26 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 27 // 28 // ) 29 // 30 // func main() { 31 // pulumi.Run(func(ctx *pulumi.Context) error { 32 // _, err := cloudfront.NewFieldLevelEncryptionConfig(ctx, "test", &cloudfront.FieldLevelEncryptionConfigArgs{ 33 // Comment: pulumi.String("test comment"), 34 // ContentTypeProfileConfig: &cloudfront.FieldLevelEncryptionConfigContentTypeProfileConfigArgs{ 35 // ForwardWhenContentTypeIsUnknown: pulumi.Bool(true), 36 // ContentTypeProfiles: &cloudfront.FieldLevelEncryptionConfigContentTypeProfileConfigContentTypeProfilesArgs{ 37 // Items: cloudfront.FieldLevelEncryptionConfigContentTypeProfileConfigContentTypeProfilesItemArray{ 38 // &cloudfront.FieldLevelEncryptionConfigContentTypeProfileConfigContentTypeProfilesItemArgs{ 39 // ContentType: pulumi.String("application/x-www-form-urlencoded"), 40 // Format: pulumi.String("URLEncoded"), 41 // }, 42 // }, 43 // }, 44 // }, 45 // QueryArgProfileConfig: &cloudfront.FieldLevelEncryptionConfigQueryArgProfileConfigArgs{ 46 // ForwardWhenQueryArgProfileIsUnknown: pulumi.Bool(true), 47 // QueryArgProfiles: &cloudfront.FieldLevelEncryptionConfigQueryArgProfileConfigQueryArgProfilesArgs{ 48 // Items: cloudfront.FieldLevelEncryptionConfigQueryArgProfileConfigQueryArgProfilesItemArray{ 49 // &cloudfront.FieldLevelEncryptionConfigQueryArgProfileConfigQueryArgProfilesItemArgs{ 50 // ProfileId: pulumi.Any(testAwsCloudfrontFieldLevelEncryptionProfile.Id), 51 // QueryArg: pulumi.String("Arg1"), 52 // }, 53 // }, 54 // }, 55 // }, 56 // }) 57 // if err != nil { 58 // return err 59 // } 60 // return nil 61 // }) 62 // } 63 // 64 // ``` 65 // <!--End PulumiCodeChooser --> 66 // 67 // ## Import 68 // 69 // Using `pulumi import`, import Cloudfront Field Level Encryption Config using the `id`. For example: 70 // 71 // ```sh 72 // $ pulumi import aws:cloudfront/fieldLevelEncryptionConfig:FieldLevelEncryptionConfig config E74FTE3AEXAMPLE 73 // ``` 74 type FieldLevelEncryptionConfig struct { 75 pulumi.CustomResourceState 76 77 // Internal value used by CloudFront to allow future updates to the Field Level Encryption Config. 78 CallerReference pulumi.StringOutput `pulumi:"callerReference"` 79 // An optional comment about the Field Level Encryption Config. 80 Comment pulumi.StringPtrOutput `pulumi:"comment"` 81 // Content Type Profile Config specifies when to forward content if a content type isn't recognized and profiles to use as by default in a request if a query argument doesn't specify a profile to use. 82 ContentTypeProfileConfig FieldLevelEncryptionConfigContentTypeProfileConfigOutput `pulumi:"contentTypeProfileConfig"` 83 // The current version of the Field Level Encryption Config. For example: `E2QWRUHAPOMQZL`. 84 Etag pulumi.StringOutput `pulumi:"etag"` 85 // Query Arg Profile Config that specifies when to forward content if a profile isn't found and the profile that can be provided as a query argument in a request. 86 QueryArgProfileConfig FieldLevelEncryptionConfigQueryArgProfileConfigOutput `pulumi:"queryArgProfileConfig"` 87 } 88 89 // NewFieldLevelEncryptionConfig registers a new resource with the given unique name, arguments, and options. 90 func NewFieldLevelEncryptionConfig(ctx *pulumi.Context, 91 name string, args *FieldLevelEncryptionConfigArgs, opts ...pulumi.ResourceOption) (*FieldLevelEncryptionConfig, error) { 92 if args == nil { 93 return nil, errors.New("missing one or more required arguments") 94 } 95 96 if args.ContentTypeProfileConfig == nil { 97 return nil, errors.New("invalid value for required argument 'ContentTypeProfileConfig'") 98 } 99 if args.QueryArgProfileConfig == nil { 100 return nil, errors.New("invalid value for required argument 'QueryArgProfileConfig'") 101 } 102 opts = internal.PkgResourceDefaultOpts(opts) 103 var resource FieldLevelEncryptionConfig 104 err := ctx.RegisterResource("aws:cloudfront/fieldLevelEncryptionConfig:FieldLevelEncryptionConfig", name, args, &resource, opts...) 105 if err != nil { 106 return nil, err 107 } 108 return &resource, nil 109 } 110 111 // GetFieldLevelEncryptionConfig gets an existing FieldLevelEncryptionConfig resource's state with the given name, ID, and optional 112 // state properties that are used to uniquely qualify the lookup (nil if not required). 113 func GetFieldLevelEncryptionConfig(ctx *pulumi.Context, 114 name string, id pulumi.IDInput, state *FieldLevelEncryptionConfigState, opts ...pulumi.ResourceOption) (*FieldLevelEncryptionConfig, error) { 115 var resource FieldLevelEncryptionConfig 116 err := ctx.ReadResource("aws:cloudfront/fieldLevelEncryptionConfig:FieldLevelEncryptionConfig", name, id, state, &resource, opts...) 117 if err != nil { 118 return nil, err 119 } 120 return &resource, nil 121 } 122 123 // Input properties used for looking up and filtering FieldLevelEncryptionConfig resources. 124 type fieldLevelEncryptionConfigState struct { 125 // Internal value used by CloudFront to allow future updates to the Field Level Encryption Config. 126 CallerReference *string `pulumi:"callerReference"` 127 // An optional comment about the Field Level Encryption Config. 128 Comment *string `pulumi:"comment"` 129 // Content Type Profile Config specifies when to forward content if a content type isn't recognized and profiles to use as by default in a request if a query argument doesn't specify a profile to use. 130 ContentTypeProfileConfig *FieldLevelEncryptionConfigContentTypeProfileConfig `pulumi:"contentTypeProfileConfig"` 131 // The current version of the Field Level Encryption Config. For example: `E2QWRUHAPOMQZL`. 132 Etag *string `pulumi:"etag"` 133 // Query Arg Profile Config that specifies when to forward content if a profile isn't found and the profile that can be provided as a query argument in a request. 134 QueryArgProfileConfig *FieldLevelEncryptionConfigQueryArgProfileConfig `pulumi:"queryArgProfileConfig"` 135 } 136 137 type FieldLevelEncryptionConfigState struct { 138 // Internal value used by CloudFront to allow future updates to the Field Level Encryption Config. 139 CallerReference pulumi.StringPtrInput 140 // An optional comment about the Field Level Encryption Config. 141 Comment pulumi.StringPtrInput 142 // Content Type Profile Config specifies when to forward content if a content type isn't recognized and profiles to use as by default in a request if a query argument doesn't specify a profile to use. 143 ContentTypeProfileConfig FieldLevelEncryptionConfigContentTypeProfileConfigPtrInput 144 // The current version of the Field Level Encryption Config. For example: `E2QWRUHAPOMQZL`. 145 Etag pulumi.StringPtrInput 146 // Query Arg Profile Config that specifies when to forward content if a profile isn't found and the profile that can be provided as a query argument in a request. 147 QueryArgProfileConfig FieldLevelEncryptionConfigQueryArgProfileConfigPtrInput 148 } 149 150 func (FieldLevelEncryptionConfigState) ElementType() reflect.Type { 151 return reflect.TypeOf((*fieldLevelEncryptionConfigState)(nil)).Elem() 152 } 153 154 type fieldLevelEncryptionConfigArgs struct { 155 // An optional comment about the Field Level Encryption Config. 156 Comment *string `pulumi:"comment"` 157 // Content Type Profile Config specifies when to forward content if a content type isn't recognized and profiles to use as by default in a request if a query argument doesn't specify a profile to use. 158 ContentTypeProfileConfig FieldLevelEncryptionConfigContentTypeProfileConfig `pulumi:"contentTypeProfileConfig"` 159 // Query Arg Profile Config that specifies when to forward content if a profile isn't found and the profile that can be provided as a query argument in a request. 160 QueryArgProfileConfig FieldLevelEncryptionConfigQueryArgProfileConfig `pulumi:"queryArgProfileConfig"` 161 } 162 163 // The set of arguments for constructing a FieldLevelEncryptionConfig resource. 164 type FieldLevelEncryptionConfigArgs struct { 165 // An optional comment about the Field Level Encryption Config. 166 Comment pulumi.StringPtrInput 167 // Content Type Profile Config specifies when to forward content if a content type isn't recognized and profiles to use as by default in a request if a query argument doesn't specify a profile to use. 168 ContentTypeProfileConfig FieldLevelEncryptionConfigContentTypeProfileConfigInput 169 // Query Arg Profile Config that specifies when to forward content if a profile isn't found and the profile that can be provided as a query argument in a request. 170 QueryArgProfileConfig FieldLevelEncryptionConfigQueryArgProfileConfigInput 171 } 172 173 func (FieldLevelEncryptionConfigArgs) ElementType() reflect.Type { 174 return reflect.TypeOf((*fieldLevelEncryptionConfigArgs)(nil)).Elem() 175 } 176 177 type FieldLevelEncryptionConfigInput interface { 178 pulumi.Input 179 180 ToFieldLevelEncryptionConfigOutput() FieldLevelEncryptionConfigOutput 181 ToFieldLevelEncryptionConfigOutputWithContext(ctx context.Context) FieldLevelEncryptionConfigOutput 182 } 183 184 func (*FieldLevelEncryptionConfig) ElementType() reflect.Type { 185 return reflect.TypeOf((**FieldLevelEncryptionConfig)(nil)).Elem() 186 } 187 188 func (i *FieldLevelEncryptionConfig) ToFieldLevelEncryptionConfigOutput() FieldLevelEncryptionConfigOutput { 189 return i.ToFieldLevelEncryptionConfigOutputWithContext(context.Background()) 190 } 191 192 func (i *FieldLevelEncryptionConfig) ToFieldLevelEncryptionConfigOutputWithContext(ctx context.Context) FieldLevelEncryptionConfigOutput { 193 return pulumi.ToOutputWithContext(ctx, i).(FieldLevelEncryptionConfigOutput) 194 } 195 196 // FieldLevelEncryptionConfigArrayInput is an input type that accepts FieldLevelEncryptionConfigArray and FieldLevelEncryptionConfigArrayOutput values. 197 // You can construct a concrete instance of `FieldLevelEncryptionConfigArrayInput` via: 198 // 199 // FieldLevelEncryptionConfigArray{ FieldLevelEncryptionConfigArgs{...} } 200 type FieldLevelEncryptionConfigArrayInput interface { 201 pulumi.Input 202 203 ToFieldLevelEncryptionConfigArrayOutput() FieldLevelEncryptionConfigArrayOutput 204 ToFieldLevelEncryptionConfigArrayOutputWithContext(context.Context) FieldLevelEncryptionConfigArrayOutput 205 } 206 207 type FieldLevelEncryptionConfigArray []FieldLevelEncryptionConfigInput 208 209 func (FieldLevelEncryptionConfigArray) ElementType() reflect.Type { 210 return reflect.TypeOf((*[]*FieldLevelEncryptionConfig)(nil)).Elem() 211 } 212 213 func (i FieldLevelEncryptionConfigArray) ToFieldLevelEncryptionConfigArrayOutput() FieldLevelEncryptionConfigArrayOutput { 214 return i.ToFieldLevelEncryptionConfigArrayOutputWithContext(context.Background()) 215 } 216 217 func (i FieldLevelEncryptionConfigArray) ToFieldLevelEncryptionConfigArrayOutputWithContext(ctx context.Context) FieldLevelEncryptionConfigArrayOutput { 218 return pulumi.ToOutputWithContext(ctx, i).(FieldLevelEncryptionConfigArrayOutput) 219 } 220 221 // FieldLevelEncryptionConfigMapInput is an input type that accepts FieldLevelEncryptionConfigMap and FieldLevelEncryptionConfigMapOutput values. 222 // You can construct a concrete instance of `FieldLevelEncryptionConfigMapInput` via: 223 // 224 // FieldLevelEncryptionConfigMap{ "key": FieldLevelEncryptionConfigArgs{...} } 225 type FieldLevelEncryptionConfigMapInput interface { 226 pulumi.Input 227 228 ToFieldLevelEncryptionConfigMapOutput() FieldLevelEncryptionConfigMapOutput 229 ToFieldLevelEncryptionConfigMapOutputWithContext(context.Context) FieldLevelEncryptionConfigMapOutput 230 } 231 232 type FieldLevelEncryptionConfigMap map[string]FieldLevelEncryptionConfigInput 233 234 func (FieldLevelEncryptionConfigMap) ElementType() reflect.Type { 235 return reflect.TypeOf((*map[string]*FieldLevelEncryptionConfig)(nil)).Elem() 236 } 237 238 func (i FieldLevelEncryptionConfigMap) ToFieldLevelEncryptionConfigMapOutput() FieldLevelEncryptionConfigMapOutput { 239 return i.ToFieldLevelEncryptionConfigMapOutputWithContext(context.Background()) 240 } 241 242 func (i FieldLevelEncryptionConfigMap) ToFieldLevelEncryptionConfigMapOutputWithContext(ctx context.Context) FieldLevelEncryptionConfigMapOutput { 243 return pulumi.ToOutputWithContext(ctx, i).(FieldLevelEncryptionConfigMapOutput) 244 } 245 246 type FieldLevelEncryptionConfigOutput struct{ *pulumi.OutputState } 247 248 func (FieldLevelEncryptionConfigOutput) ElementType() reflect.Type { 249 return reflect.TypeOf((**FieldLevelEncryptionConfig)(nil)).Elem() 250 } 251 252 func (o FieldLevelEncryptionConfigOutput) ToFieldLevelEncryptionConfigOutput() FieldLevelEncryptionConfigOutput { 253 return o 254 } 255 256 func (o FieldLevelEncryptionConfigOutput) ToFieldLevelEncryptionConfigOutputWithContext(ctx context.Context) FieldLevelEncryptionConfigOutput { 257 return o 258 } 259 260 // Internal value used by CloudFront to allow future updates to the Field Level Encryption Config. 261 func (o FieldLevelEncryptionConfigOutput) CallerReference() pulumi.StringOutput { 262 return o.ApplyT(func(v *FieldLevelEncryptionConfig) pulumi.StringOutput { return v.CallerReference }).(pulumi.StringOutput) 263 } 264 265 // An optional comment about the Field Level Encryption Config. 266 func (o FieldLevelEncryptionConfigOutput) Comment() pulumi.StringPtrOutput { 267 return o.ApplyT(func(v *FieldLevelEncryptionConfig) pulumi.StringPtrOutput { return v.Comment }).(pulumi.StringPtrOutput) 268 } 269 270 // Content Type Profile Config specifies when to forward content if a content type isn't recognized and profiles to use as by default in a request if a query argument doesn't specify a profile to use. 271 func (o FieldLevelEncryptionConfigOutput) ContentTypeProfileConfig() FieldLevelEncryptionConfigContentTypeProfileConfigOutput { 272 return o.ApplyT(func(v *FieldLevelEncryptionConfig) FieldLevelEncryptionConfigContentTypeProfileConfigOutput { 273 return v.ContentTypeProfileConfig 274 }).(FieldLevelEncryptionConfigContentTypeProfileConfigOutput) 275 } 276 277 // The current version of the Field Level Encryption Config. For example: `E2QWRUHAPOMQZL`. 278 func (o FieldLevelEncryptionConfigOutput) Etag() pulumi.StringOutput { 279 return o.ApplyT(func(v *FieldLevelEncryptionConfig) pulumi.StringOutput { return v.Etag }).(pulumi.StringOutput) 280 } 281 282 // Query Arg Profile Config that specifies when to forward content if a profile isn't found and the profile that can be provided as a query argument in a request. 283 func (o FieldLevelEncryptionConfigOutput) QueryArgProfileConfig() FieldLevelEncryptionConfigQueryArgProfileConfigOutput { 284 return o.ApplyT(func(v *FieldLevelEncryptionConfig) FieldLevelEncryptionConfigQueryArgProfileConfigOutput { 285 return v.QueryArgProfileConfig 286 }).(FieldLevelEncryptionConfigQueryArgProfileConfigOutput) 287 } 288 289 type FieldLevelEncryptionConfigArrayOutput struct{ *pulumi.OutputState } 290 291 func (FieldLevelEncryptionConfigArrayOutput) ElementType() reflect.Type { 292 return reflect.TypeOf((*[]*FieldLevelEncryptionConfig)(nil)).Elem() 293 } 294 295 func (o FieldLevelEncryptionConfigArrayOutput) ToFieldLevelEncryptionConfigArrayOutput() FieldLevelEncryptionConfigArrayOutput { 296 return o 297 } 298 299 func (o FieldLevelEncryptionConfigArrayOutput) ToFieldLevelEncryptionConfigArrayOutputWithContext(ctx context.Context) FieldLevelEncryptionConfigArrayOutput { 300 return o 301 } 302 303 func (o FieldLevelEncryptionConfigArrayOutput) Index(i pulumi.IntInput) FieldLevelEncryptionConfigOutput { 304 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *FieldLevelEncryptionConfig { 305 return vs[0].([]*FieldLevelEncryptionConfig)[vs[1].(int)] 306 }).(FieldLevelEncryptionConfigOutput) 307 } 308 309 type FieldLevelEncryptionConfigMapOutput struct{ *pulumi.OutputState } 310 311 func (FieldLevelEncryptionConfigMapOutput) ElementType() reflect.Type { 312 return reflect.TypeOf((*map[string]*FieldLevelEncryptionConfig)(nil)).Elem() 313 } 314 315 func (o FieldLevelEncryptionConfigMapOutput) ToFieldLevelEncryptionConfigMapOutput() FieldLevelEncryptionConfigMapOutput { 316 return o 317 } 318 319 func (o FieldLevelEncryptionConfigMapOutput) ToFieldLevelEncryptionConfigMapOutputWithContext(ctx context.Context) FieldLevelEncryptionConfigMapOutput { 320 return o 321 } 322 323 func (o FieldLevelEncryptionConfigMapOutput) MapIndex(k pulumi.StringInput) FieldLevelEncryptionConfigOutput { 324 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *FieldLevelEncryptionConfig { 325 return vs[0].(map[string]*FieldLevelEncryptionConfig)[vs[1].(string)] 326 }).(FieldLevelEncryptionConfigOutput) 327 } 328 329 func init() { 330 pulumi.RegisterInputType(reflect.TypeOf((*FieldLevelEncryptionConfigInput)(nil)).Elem(), &FieldLevelEncryptionConfig{}) 331 pulumi.RegisterInputType(reflect.TypeOf((*FieldLevelEncryptionConfigArrayInput)(nil)).Elem(), FieldLevelEncryptionConfigArray{}) 332 pulumi.RegisterInputType(reflect.TypeOf((*FieldLevelEncryptionConfigMapInput)(nil)).Elem(), FieldLevelEncryptionConfigMap{}) 333 pulumi.RegisterOutputType(FieldLevelEncryptionConfigOutput{}) 334 pulumi.RegisterOutputType(FieldLevelEncryptionConfigArrayOutput{}) 335 pulumi.RegisterOutputType(FieldLevelEncryptionConfigMapOutput{}) 336 }