github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/cognito/userPoolUICustomization.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 cognito 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 Cognito User Pool UI Customization resource. 16 // 17 // > **Note:** To use this resource, the user pool must have a domain associated with it. For more information, see the Amazon Cognito Developer Guide on [Customizing the Built-in Sign-In and Sign-up Webpages](https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-app-ui-customization.html). 18 // 19 // ## Example Usage 20 // 21 // ### UI customization settings for a single client 22 // 23 // <!--Start PulumiCodeChooser --> 24 // ```go 25 // package main 26 // 27 // import ( 28 // 29 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/cognito" 30 // "github.com/pulumi/pulumi-std/sdk/go/std" 31 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 32 // 33 // ) 34 // 35 // func main() { 36 // pulumi.Run(func(ctx *pulumi.Context) error { 37 // example, err := cognito.NewUserPool(ctx, "example", &cognito.UserPoolArgs{ 38 // Name: pulumi.String("example"), 39 // }) 40 // if err != nil { 41 // return err 42 // } 43 // exampleUserPoolDomain, err := cognito.NewUserPoolDomain(ctx, "example", &cognito.UserPoolDomainArgs{ 44 // Domain: pulumi.String("example"), 45 // UserPoolId: example.ID(), 46 // }) 47 // if err != nil { 48 // return err 49 // } 50 // exampleUserPoolClient, err := cognito.NewUserPoolClient(ctx, "example", &cognito.UserPoolClientArgs{ 51 // Name: pulumi.String("example"), 52 // UserPoolId: example.ID(), 53 // }) 54 // if err != nil { 55 // return err 56 // } 57 // invokeFilebase64, err := std.Filebase64(ctx, &std.Filebase64Args{ 58 // Input: "logo.png", 59 // }, nil) 60 // if err != nil { 61 // return err 62 // } 63 // _, err = cognito.NewUserPoolUICustomization(ctx, "example", &cognito.UserPoolUICustomizationArgs{ 64 // ClientId: exampleUserPoolClient.ID(), 65 // Css: pulumi.String(".label-customizable {font-weight: 400;}"), 66 // ImageFile: invokeFilebase64.Result, 67 // UserPoolId: exampleUserPoolDomain.UserPoolId, 68 // }) 69 // if err != nil { 70 // return err 71 // } 72 // return nil 73 // }) 74 // } 75 // 76 // ``` 77 // <!--End PulumiCodeChooser --> 78 // 79 // ### UI customization settings for all clients 80 // 81 // <!--Start PulumiCodeChooser --> 82 // ```go 83 // package main 84 // 85 // import ( 86 // 87 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/cognito" 88 // "github.com/pulumi/pulumi-std/sdk/go/std" 89 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 90 // 91 // ) 92 // 93 // func main() { 94 // pulumi.Run(func(ctx *pulumi.Context) error { 95 // example, err := cognito.NewUserPool(ctx, "example", &cognito.UserPoolArgs{ 96 // Name: pulumi.String("example"), 97 // }) 98 // if err != nil { 99 // return err 100 // } 101 // exampleUserPoolDomain, err := cognito.NewUserPoolDomain(ctx, "example", &cognito.UserPoolDomainArgs{ 102 // Domain: pulumi.String("example"), 103 // UserPoolId: example.ID(), 104 // }) 105 // if err != nil { 106 // return err 107 // } 108 // invokeFilebase64, err := std.Filebase64(ctx, &std.Filebase64Args{ 109 // Input: "logo.png", 110 // }, nil) 111 // if err != nil { 112 // return err 113 // } 114 // _, err = cognito.NewUserPoolUICustomization(ctx, "example", &cognito.UserPoolUICustomizationArgs{ 115 // Css: pulumi.String(".label-customizable {font-weight: 400;}"), 116 // ImageFile: invokeFilebase64.Result, 117 // UserPoolId: exampleUserPoolDomain.UserPoolId, 118 // }) 119 // if err != nil { 120 // return err 121 // } 122 // return nil 123 // }) 124 // } 125 // 126 // ``` 127 // <!--End PulumiCodeChooser --> 128 // 129 // ## Import 130 // 131 // Using `pulumi import`, import Cognito User Pool UI Customizations using the `user_pool_id` and `client_id` separated by `,`. For example: 132 // 133 // ```sh 134 // $ pulumi import aws:cognito/userPoolUICustomization:UserPoolUICustomization example us-west-2_ZCTarbt5C,12bu4fuk3mlgqa2rtrujgp6egq 135 // ``` 136 type UserPoolUICustomization struct { 137 pulumi.CustomResourceState 138 139 // The client ID for the client app. Defaults to `ALL`. If `ALL` is specified, the `css` and/or `imageFile` settings will be used for every client that has no UI customization set previously. 140 ClientId pulumi.StringPtrOutput `pulumi:"clientId"` 141 // The creation date in [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8) for the UI customization. 142 CreationDate pulumi.StringOutput `pulumi:"creationDate"` 143 // The CSS values in the UI customization, provided as a String. At least one of `css` or `imageFile` is required. 144 Css pulumi.StringPtrOutput `pulumi:"css"` 145 // The CSS version number. 146 CssVersion pulumi.StringOutput `pulumi:"cssVersion"` 147 // The uploaded logo image for the UI customization, provided as a base64-encoded String. Drift detection is not possible for this argument. At least one of `css` or `imageFile` is required. 148 ImageFile pulumi.StringPtrOutput `pulumi:"imageFile"` 149 // The logo image URL for the UI customization. 150 ImageUrl pulumi.StringOutput `pulumi:"imageUrl"` 151 // The last-modified date in [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8) for the UI customization. 152 LastModifiedDate pulumi.StringOutput `pulumi:"lastModifiedDate"` 153 // The user pool ID for the user pool. 154 UserPoolId pulumi.StringOutput `pulumi:"userPoolId"` 155 } 156 157 // NewUserPoolUICustomization registers a new resource with the given unique name, arguments, and options. 158 func NewUserPoolUICustomization(ctx *pulumi.Context, 159 name string, args *UserPoolUICustomizationArgs, opts ...pulumi.ResourceOption) (*UserPoolUICustomization, error) { 160 if args == nil { 161 return nil, errors.New("missing one or more required arguments") 162 } 163 164 if args.UserPoolId == nil { 165 return nil, errors.New("invalid value for required argument 'UserPoolId'") 166 } 167 opts = internal.PkgResourceDefaultOpts(opts) 168 var resource UserPoolUICustomization 169 err := ctx.RegisterResource("aws:cognito/userPoolUICustomization:UserPoolUICustomization", name, args, &resource, opts...) 170 if err != nil { 171 return nil, err 172 } 173 return &resource, nil 174 } 175 176 // GetUserPoolUICustomization gets an existing UserPoolUICustomization resource's state with the given name, ID, and optional 177 // state properties that are used to uniquely qualify the lookup (nil if not required). 178 func GetUserPoolUICustomization(ctx *pulumi.Context, 179 name string, id pulumi.IDInput, state *UserPoolUICustomizationState, opts ...pulumi.ResourceOption) (*UserPoolUICustomization, error) { 180 var resource UserPoolUICustomization 181 err := ctx.ReadResource("aws:cognito/userPoolUICustomization:UserPoolUICustomization", name, id, state, &resource, opts...) 182 if err != nil { 183 return nil, err 184 } 185 return &resource, nil 186 } 187 188 // Input properties used for looking up and filtering UserPoolUICustomization resources. 189 type userPoolUICustomizationState struct { 190 // The client ID for the client app. Defaults to `ALL`. If `ALL` is specified, the `css` and/or `imageFile` settings will be used for every client that has no UI customization set previously. 191 ClientId *string `pulumi:"clientId"` 192 // The creation date in [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8) for the UI customization. 193 CreationDate *string `pulumi:"creationDate"` 194 // The CSS values in the UI customization, provided as a String. At least one of `css` or `imageFile` is required. 195 Css *string `pulumi:"css"` 196 // The CSS version number. 197 CssVersion *string `pulumi:"cssVersion"` 198 // The uploaded logo image for the UI customization, provided as a base64-encoded String. Drift detection is not possible for this argument. At least one of `css` or `imageFile` is required. 199 ImageFile *string `pulumi:"imageFile"` 200 // The logo image URL for the UI customization. 201 ImageUrl *string `pulumi:"imageUrl"` 202 // The last-modified date in [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8) for the UI customization. 203 LastModifiedDate *string `pulumi:"lastModifiedDate"` 204 // The user pool ID for the user pool. 205 UserPoolId *string `pulumi:"userPoolId"` 206 } 207 208 type UserPoolUICustomizationState struct { 209 // The client ID for the client app. Defaults to `ALL`. If `ALL` is specified, the `css` and/or `imageFile` settings will be used for every client that has no UI customization set previously. 210 ClientId pulumi.StringPtrInput 211 // The creation date in [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8) for the UI customization. 212 CreationDate pulumi.StringPtrInput 213 // The CSS values in the UI customization, provided as a String. At least one of `css` or `imageFile` is required. 214 Css pulumi.StringPtrInput 215 // The CSS version number. 216 CssVersion pulumi.StringPtrInput 217 // The uploaded logo image for the UI customization, provided as a base64-encoded String. Drift detection is not possible for this argument. At least one of `css` or `imageFile` is required. 218 ImageFile pulumi.StringPtrInput 219 // The logo image URL for the UI customization. 220 ImageUrl pulumi.StringPtrInput 221 // The last-modified date in [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8) for the UI customization. 222 LastModifiedDate pulumi.StringPtrInput 223 // The user pool ID for the user pool. 224 UserPoolId pulumi.StringPtrInput 225 } 226 227 func (UserPoolUICustomizationState) ElementType() reflect.Type { 228 return reflect.TypeOf((*userPoolUICustomizationState)(nil)).Elem() 229 } 230 231 type userPoolUICustomizationArgs struct { 232 // The client ID for the client app. Defaults to `ALL`. If `ALL` is specified, the `css` and/or `imageFile` settings will be used for every client that has no UI customization set previously. 233 ClientId *string `pulumi:"clientId"` 234 // The CSS values in the UI customization, provided as a String. At least one of `css` or `imageFile` is required. 235 Css *string `pulumi:"css"` 236 // The uploaded logo image for the UI customization, provided as a base64-encoded String. Drift detection is not possible for this argument. At least one of `css` or `imageFile` is required. 237 ImageFile *string `pulumi:"imageFile"` 238 // The user pool ID for the user pool. 239 UserPoolId string `pulumi:"userPoolId"` 240 } 241 242 // The set of arguments for constructing a UserPoolUICustomization resource. 243 type UserPoolUICustomizationArgs struct { 244 // The client ID for the client app. Defaults to `ALL`. If `ALL` is specified, the `css` and/or `imageFile` settings will be used for every client that has no UI customization set previously. 245 ClientId pulumi.StringPtrInput 246 // The CSS values in the UI customization, provided as a String. At least one of `css` or `imageFile` is required. 247 Css pulumi.StringPtrInput 248 // The uploaded logo image for the UI customization, provided as a base64-encoded String. Drift detection is not possible for this argument. At least one of `css` or `imageFile` is required. 249 ImageFile pulumi.StringPtrInput 250 // The user pool ID for the user pool. 251 UserPoolId pulumi.StringInput 252 } 253 254 func (UserPoolUICustomizationArgs) ElementType() reflect.Type { 255 return reflect.TypeOf((*userPoolUICustomizationArgs)(nil)).Elem() 256 } 257 258 type UserPoolUICustomizationInput interface { 259 pulumi.Input 260 261 ToUserPoolUICustomizationOutput() UserPoolUICustomizationOutput 262 ToUserPoolUICustomizationOutputWithContext(ctx context.Context) UserPoolUICustomizationOutput 263 } 264 265 func (*UserPoolUICustomization) ElementType() reflect.Type { 266 return reflect.TypeOf((**UserPoolUICustomization)(nil)).Elem() 267 } 268 269 func (i *UserPoolUICustomization) ToUserPoolUICustomizationOutput() UserPoolUICustomizationOutput { 270 return i.ToUserPoolUICustomizationOutputWithContext(context.Background()) 271 } 272 273 func (i *UserPoolUICustomization) ToUserPoolUICustomizationOutputWithContext(ctx context.Context) UserPoolUICustomizationOutput { 274 return pulumi.ToOutputWithContext(ctx, i).(UserPoolUICustomizationOutput) 275 } 276 277 // UserPoolUICustomizationArrayInput is an input type that accepts UserPoolUICustomizationArray and UserPoolUICustomizationArrayOutput values. 278 // You can construct a concrete instance of `UserPoolUICustomizationArrayInput` via: 279 // 280 // UserPoolUICustomizationArray{ UserPoolUICustomizationArgs{...} } 281 type UserPoolUICustomizationArrayInput interface { 282 pulumi.Input 283 284 ToUserPoolUICustomizationArrayOutput() UserPoolUICustomizationArrayOutput 285 ToUserPoolUICustomizationArrayOutputWithContext(context.Context) UserPoolUICustomizationArrayOutput 286 } 287 288 type UserPoolUICustomizationArray []UserPoolUICustomizationInput 289 290 func (UserPoolUICustomizationArray) ElementType() reflect.Type { 291 return reflect.TypeOf((*[]*UserPoolUICustomization)(nil)).Elem() 292 } 293 294 func (i UserPoolUICustomizationArray) ToUserPoolUICustomizationArrayOutput() UserPoolUICustomizationArrayOutput { 295 return i.ToUserPoolUICustomizationArrayOutputWithContext(context.Background()) 296 } 297 298 func (i UserPoolUICustomizationArray) ToUserPoolUICustomizationArrayOutputWithContext(ctx context.Context) UserPoolUICustomizationArrayOutput { 299 return pulumi.ToOutputWithContext(ctx, i).(UserPoolUICustomizationArrayOutput) 300 } 301 302 // UserPoolUICustomizationMapInput is an input type that accepts UserPoolUICustomizationMap and UserPoolUICustomizationMapOutput values. 303 // You can construct a concrete instance of `UserPoolUICustomizationMapInput` via: 304 // 305 // UserPoolUICustomizationMap{ "key": UserPoolUICustomizationArgs{...} } 306 type UserPoolUICustomizationMapInput interface { 307 pulumi.Input 308 309 ToUserPoolUICustomizationMapOutput() UserPoolUICustomizationMapOutput 310 ToUserPoolUICustomizationMapOutputWithContext(context.Context) UserPoolUICustomizationMapOutput 311 } 312 313 type UserPoolUICustomizationMap map[string]UserPoolUICustomizationInput 314 315 func (UserPoolUICustomizationMap) ElementType() reflect.Type { 316 return reflect.TypeOf((*map[string]*UserPoolUICustomization)(nil)).Elem() 317 } 318 319 func (i UserPoolUICustomizationMap) ToUserPoolUICustomizationMapOutput() UserPoolUICustomizationMapOutput { 320 return i.ToUserPoolUICustomizationMapOutputWithContext(context.Background()) 321 } 322 323 func (i UserPoolUICustomizationMap) ToUserPoolUICustomizationMapOutputWithContext(ctx context.Context) UserPoolUICustomizationMapOutput { 324 return pulumi.ToOutputWithContext(ctx, i).(UserPoolUICustomizationMapOutput) 325 } 326 327 type UserPoolUICustomizationOutput struct{ *pulumi.OutputState } 328 329 func (UserPoolUICustomizationOutput) ElementType() reflect.Type { 330 return reflect.TypeOf((**UserPoolUICustomization)(nil)).Elem() 331 } 332 333 func (o UserPoolUICustomizationOutput) ToUserPoolUICustomizationOutput() UserPoolUICustomizationOutput { 334 return o 335 } 336 337 func (o UserPoolUICustomizationOutput) ToUserPoolUICustomizationOutputWithContext(ctx context.Context) UserPoolUICustomizationOutput { 338 return o 339 } 340 341 // The client ID for the client app. Defaults to `ALL`. If `ALL` is specified, the `css` and/or `imageFile` settings will be used for every client that has no UI customization set previously. 342 func (o UserPoolUICustomizationOutput) ClientId() pulumi.StringPtrOutput { 343 return o.ApplyT(func(v *UserPoolUICustomization) pulumi.StringPtrOutput { return v.ClientId }).(pulumi.StringPtrOutput) 344 } 345 346 // The creation date in [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8) for the UI customization. 347 func (o UserPoolUICustomizationOutput) CreationDate() pulumi.StringOutput { 348 return o.ApplyT(func(v *UserPoolUICustomization) pulumi.StringOutput { return v.CreationDate }).(pulumi.StringOutput) 349 } 350 351 // The CSS values in the UI customization, provided as a String. At least one of `css` or `imageFile` is required. 352 func (o UserPoolUICustomizationOutput) Css() pulumi.StringPtrOutput { 353 return o.ApplyT(func(v *UserPoolUICustomization) pulumi.StringPtrOutput { return v.Css }).(pulumi.StringPtrOutput) 354 } 355 356 // The CSS version number. 357 func (o UserPoolUICustomizationOutput) CssVersion() pulumi.StringOutput { 358 return o.ApplyT(func(v *UserPoolUICustomization) pulumi.StringOutput { return v.CssVersion }).(pulumi.StringOutput) 359 } 360 361 // The uploaded logo image for the UI customization, provided as a base64-encoded String. Drift detection is not possible for this argument. At least one of `css` or `imageFile` is required. 362 func (o UserPoolUICustomizationOutput) ImageFile() pulumi.StringPtrOutput { 363 return o.ApplyT(func(v *UserPoolUICustomization) pulumi.StringPtrOutput { return v.ImageFile }).(pulumi.StringPtrOutput) 364 } 365 366 // The logo image URL for the UI customization. 367 func (o UserPoolUICustomizationOutput) ImageUrl() pulumi.StringOutput { 368 return o.ApplyT(func(v *UserPoolUICustomization) pulumi.StringOutput { return v.ImageUrl }).(pulumi.StringOutput) 369 } 370 371 // The last-modified date in [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8) for the UI customization. 372 func (o UserPoolUICustomizationOutput) LastModifiedDate() pulumi.StringOutput { 373 return o.ApplyT(func(v *UserPoolUICustomization) pulumi.StringOutput { return v.LastModifiedDate }).(pulumi.StringOutput) 374 } 375 376 // The user pool ID for the user pool. 377 func (o UserPoolUICustomizationOutput) UserPoolId() pulumi.StringOutput { 378 return o.ApplyT(func(v *UserPoolUICustomization) pulumi.StringOutput { return v.UserPoolId }).(pulumi.StringOutput) 379 } 380 381 type UserPoolUICustomizationArrayOutput struct{ *pulumi.OutputState } 382 383 func (UserPoolUICustomizationArrayOutput) ElementType() reflect.Type { 384 return reflect.TypeOf((*[]*UserPoolUICustomization)(nil)).Elem() 385 } 386 387 func (o UserPoolUICustomizationArrayOutput) ToUserPoolUICustomizationArrayOutput() UserPoolUICustomizationArrayOutput { 388 return o 389 } 390 391 func (o UserPoolUICustomizationArrayOutput) ToUserPoolUICustomizationArrayOutputWithContext(ctx context.Context) UserPoolUICustomizationArrayOutput { 392 return o 393 } 394 395 func (o UserPoolUICustomizationArrayOutput) Index(i pulumi.IntInput) UserPoolUICustomizationOutput { 396 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *UserPoolUICustomization { 397 return vs[0].([]*UserPoolUICustomization)[vs[1].(int)] 398 }).(UserPoolUICustomizationOutput) 399 } 400 401 type UserPoolUICustomizationMapOutput struct{ *pulumi.OutputState } 402 403 func (UserPoolUICustomizationMapOutput) ElementType() reflect.Type { 404 return reflect.TypeOf((*map[string]*UserPoolUICustomization)(nil)).Elem() 405 } 406 407 func (o UserPoolUICustomizationMapOutput) ToUserPoolUICustomizationMapOutput() UserPoolUICustomizationMapOutput { 408 return o 409 } 410 411 func (o UserPoolUICustomizationMapOutput) ToUserPoolUICustomizationMapOutputWithContext(ctx context.Context) UserPoolUICustomizationMapOutput { 412 return o 413 } 414 415 func (o UserPoolUICustomizationMapOutput) MapIndex(k pulumi.StringInput) UserPoolUICustomizationOutput { 416 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *UserPoolUICustomization { 417 return vs[0].(map[string]*UserPoolUICustomization)[vs[1].(string)] 418 }).(UserPoolUICustomizationOutput) 419 } 420 421 func init() { 422 pulumi.RegisterInputType(reflect.TypeOf((*UserPoolUICustomizationInput)(nil)).Elem(), &UserPoolUICustomization{}) 423 pulumi.RegisterInputType(reflect.TypeOf((*UserPoolUICustomizationArrayInput)(nil)).Elem(), UserPoolUICustomizationArray{}) 424 pulumi.RegisterInputType(reflect.TypeOf((*UserPoolUICustomizationMapInput)(nil)).Elem(), UserPoolUICustomizationMap{}) 425 pulumi.RegisterOutputType(UserPoolUICustomizationOutput{}) 426 pulumi.RegisterOutputType(UserPoolUICustomizationArrayOutput{}) 427 pulumi.RegisterOutputType(UserPoolUICustomizationMapOutput{}) 428 }